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

#2112 - Business validations: Application Bulk Withdrawal #2465

Merged

Conversation

sh16011993
Copy link
Collaborator

@sh16011993 sh16011993 commented Nov 1, 2023

As a part of this PR, the following tasks were completed:

  • Checked to ensure that the affected Student Application belongs to the institution uploading the file.
  • In case one or multiple validations failed, the validation errors are returned. Below are the validation criteria:
  • If the application number is not found, assuming it is an SFAS application, it is just skipped and the rest of the file is processed. A warning is generated to the user: "Application is not present in SIMS and is a part of the SFAS system."
  • Validated if the combination of the SIN, Application number and institution matched with a record on SIMS. If not, returned the following line as a warning message "The record was not found and will be skipped."
  • If the file contains a line for an application that already has a withdrawal recorded, returned the line as a warning message: "This application is already withdrawn with the date: [withdrawal date]."
  • Verified that the application is in "Completed" status and not archived to execute the withdrawal, if not, returned an error with the message "The application is not in the completed status." or "The application is already archived and cannot be withdrawn."
  • For every single file line that has an error or warning, a summary is displayed:
  • Line number: record number including the header in the count.
  • Application Number (even if invalid): displayed to show which "Application Number" was interrupted.
  • Withdrawal Date (even if invalid): displayed to show the "Withdrawal Date" of the interrupted "Application Number".
  • Validations: displayed to show a user-friendly message about why the record is not considered valid.
  • Centralized the error validation code to the validation-utils file.

Screenshots [validation errors and warnings]:

image
image
image
image
image
image

@sh16011993 sh16011993 self-assigned this Nov 1, 2023
Copy link
Collaborator

@guru-aot guru-aot left a comment

Choose a reason for hiding this comment

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

Please work on the other dev comments, I do not have anything new.

Copy link
Collaborator

@guru-aot guru-aot left a comment

Choose a reason for hiding this comment

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

LGTM, nice work @sh16011993

validationModel.applicationFound = true;
validationModel.studentSINMatch =
textValidation.textModel.sin === applicationData.sin;
validationModel.hasCorrectInstitutionCode =
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are we suppose to do further validation, when originator is incorrect?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I just updated this part of the code.

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 making the changes @sh16011993
LGTM considering the need to wrap up the PR 👍

private async getApplicationValidationData(
applicationNumbers: string[],
institutionId: number,
originator: string,
Copy link
Contributor

@ann-aot ann-aot Nov 8, 2023

Choose a reason for hiding this comment

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

minor, if we need this institution code, then maybe instead of originator, we can name it as institutionCode in the service, same for line 145

Copy link
Collaborator

@andrewsignori-aot andrewsignori-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 making the changes, adjusting the ticket, and making it happen. Looks good 👍

Comment on lines 224 to 228
studentScholasticStandings: {
changeType:
StudentScholasticStandingChangeType.StudentWithdrewFromProgram,
},
},
Copy link
Contributor

Choose a reason for hiding this comment

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

I am having a hard time understanding the logic, this method is to retrieve the info of the application that are requested for scholastic standing right? then why this logic? so, the ideal scenario is the application won't have any previous scholastic standing, so with this where condition, those application info won't be retrieving right? Let me know if I am missing anything

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes. Thanks @ann-aot . Corrected it.

sin: record.student.sinValidation.sin,
locationId: record.location.id,
locationCode: record.location.institutionCode,
hasPreviouslyBeenWithdrawn: !!record.studentScholasticStandings?.filter(
Copy link
Contributor

@ann-aot ann-aot Nov 8, 2023

Choose a reason for hiding this comment

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

maybe u can use .some() and it will directly return a boolean

Copy link
Collaborator

@andrepestana-aot andrepestana-aot left a comment

Choose a reason for hiding this comment

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

Looks good!

Copy link

sonarqubecloud bot commented Nov 8, 2023

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 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link

github-actions bot commented Nov 8, 2023

Backend Unit Tests Coverage Report

Totals Coverage
Statements: 19.99% ( 2612 / 13064 )
Methods: 10.43% ( 173 / 1658 )
Lines: 22.78% ( 2252 / 9888 )
Branches: 12.32% ( 187 / 1518 )

Copy link

github-actions bot commented Nov 8, 2023

E2E Workflow Workers Coverage Report

Totals Coverage
Statements: 52.62% ( 341 / 648 )
Methods: 50% ( 40 / 80 )
Lines: 56.85% ( 282 / 496 )
Branches: 26.39% ( 19 / 72 )

Copy link

github-actions bot commented Nov 8, 2023

E2E Queue Consumers Coverage Report

Totals Coverage
Statements: 76.94% ( 564 / 733 )
Methods: 71.59% ( 63 / 88 )
Lines: 78.75% ( 493 / 626 )
Branches: 42.11% ( 8 / 19 )

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.

Nice effort @sh16011993 👍 thanks for doing the changes 👍

Copy link

github-actions bot commented Nov 8, 2023

E2E SIMS API Coverage Report

Totals Coverage
Statements: 55.08% ( 4064 / 7378 )
Methods: 51.98% ( 499 / 960 )
Lines: 59.82% ( 3298 / 5513 )
Branches: 29.5% ( 267 / 905 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
SIMS-Api SIMS-Api
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants