Skip to content
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

Merged
merged 40 commits into from
Aug 25, 2023

Conversation

guru-aot
Copy link
Collaborator

@guru-aot guru-aot commented Aug 17, 2023

  • Only allow plain text files to be uploaded.
image
  • Validate header record type.
image
  • Validate withdrawal record type.
image
  • Validate footer record type.
image
  • Validate the application number to be numeric with 10 digits.
image
  • Validate SIN to be numeric and with 9 digits.
image
  • Validate the withdrawal to be a valid date in the format YYYYMMDD.
image
  • Validate if the total number of records in the file matches the footer information.
image
  • Succesfully validated
image

@guru-aot guru-aot changed the title #2111 UI format validation bulk withdrawal upload #2111-UI format validation bulk withdrawal upload Aug 17, 2023
@guru-aot guru-aot marked this pull request as ready for review August 22, 2023 17:45
@guru-aot guru-aot self-assigned this Aug 22, 2023
@guru-aot guru-aot added Institution Institution Features Web Portal SIMS-Api SIMS-Api labels Aug 22, 2023
@dheepak-aot
Copy link
Collaborator

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,
Copy link
Collaborator

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?

Copy link
Collaborator Author

@guru-aot guru-aot Aug 25, 2023

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[] },
Copy link
Collaborator

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.
Copy link
Collaborator

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?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its an inline comment

Copy link
Contributor

@ann-aot ann-aot left a 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 👍

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 4 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@github-actions
Copy link

Backend Unit Tests Coverage Report

Totals Coverage
Statements: 17.91% ( 2160 / 12063 )
Methods: 8.21% ( 126 / 1534 )
Lines: 20.75% ( 1896 / 9138 )
Branches: 9.92% ( 138 / 1391 )

@github-actions
Copy link

E2E Queue Consumers Coverage Report

Totals Coverage
Statements: 72.5% ( 406 / 560 )
Methods: 63.38% ( 45 / 71 )
Lines: 74.53% ( 357 / 479 )
Branches: 40% ( 4 / 10 )

@github-actions
Copy link

E2E Workflow Workers Coverage Report

Totals Coverage
Statements: 49.81% ( 267 / 536 )
Methods: 41.56% ( 32 / 77 )
Lines: 55.33% ( 218 / 394 )
Branches: 26.15% ( 17 / 65 )

Copy link
Collaborator

@dheepak-aot dheepak-aot left a 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.

@github-actions
Copy link

E2E SIMS API Coverage Report

Totals Coverage
Statements: 53.44% ( 3900 / 7298 )
Methods: 49.89% ( 470 / 942 )
Lines: 58.41% ( 3181 / 5446 )
Branches: 27.36% ( 249 / 910 )

@guru-aot guru-aot merged commit 4047a0b into main Aug 25, 2023
@guru-aot guru-aot deleted the #2111-UI-Format-Validation-Bulk-Withdrawal-Upload branch August 25, 2023 21:16
@guru-aot guru-aot temporarily deployed to DEV August 25, 2023 21:35 — with GitHub Actions Inactive
@guru-aot guru-aot temporarily deployed to DEV August 25, 2023 21:36 — with GitHub Actions Inactive
@guru-aot guru-aot temporarily deployed to DEV August 25, 2023 21:36 — with GitHub Actions Inactive
@guru-aot guru-aot temporarily deployed to DEV August 25, 2023 21:36 — with GitHub Actions Inactive
@guru-aot guru-aot temporarily deployed to DEV August 25, 2023 21:36 — with GitHub Actions Inactive
@guru-aot guru-aot temporarily deployed to DEV August 25, 2023 21:44 — with GitHub Actions Inactive
@guru-aot guru-aot temporarily deployed to DEV August 25, 2023 21:44 — with GitHub Actions Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Institution Institution Features SIMS-Api SIMS-Api
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants