-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#2111-UI format validation bulk withdrawal upload #2209
#2111-UI format validation bulk withdrawal upload #2209
Conversation
guru-aot
commented
Aug 17, 2023
•
edited
Loading
edited
- Only allow plain text files to be uploaded.
- Validate header record type.
- Validate withdrawal record type.
- Validate footer record type.
- Validate the application number to be numeric with 10 digits.
- Validate SIN to be numeric and with 9 digits.
- Validate the withdrawal to be a valid date in the format YYYYMMDD.
- Validate if the total number of records in the file matches the footer information.
- Succesfully validated
...rollers/student-scholastic-standings/student-scholastic-standings.institutions.controller.ts
Outdated
Show resolved
Hide resolved
...rollers/student-scholastic-standings/student-scholastic-standings.institutions.controller.ts
Show resolved
Hide resolved
...apps/api/src/services/application-bulk-withdrawal/application-bulk-withdrawal-text.models.ts
Outdated
Show resolved
Hide resolved
...rollers/student-scholastic-standings/student-scholastic-standings.institutions.controller.ts
Show resolved
Hide resolved
Thanks for doing the changes @guru-aot . Just a few minor comments. |
async bulkWithdrawal( | ||
@UploadedFile() file: Express.Multer.File, | ||
@Query("validation-only", new DefaultValuePipe(false), ParseBoolPipe) | ||
validationOnly: boolean, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For my info, can we have a scenario when we process a file without doing the validations?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont think, even with business validations it will not do the existing validations.
@@ -64,9 +64,14 @@ const fileFilter = ( | |||
file: MulterFile, | |||
allowedFileExtensions: string[], | |||
callback: (error: Error | null, acceptFile: boolean) => void, | |||
options?: { allowedMimeType?: string[] }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we adjust the comment to include allowedFileExtensions
and options
// Read the first line to check if the header code is the expected one. | ||
const header = ApplicationBulkWithdrawalHeader.createFromLine( | ||
fileLines.shift(), | ||
); // Read and remove header. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we move the comment above the execution line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its an inline comment
sources/packages/web/src/views/institution/WithdrawalUpload.vue
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work @guru-aot . Thanks for doing the changes 👍
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes @guru-aot . Great start!
I would say to review the error message content with @JasonCTang once.