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

Business validations for Bulk Withdrawal Upload #2112

Closed
15 tasks
JasonCTang opened this issue Jul 13, 2023 · 1 comment
Closed
15 tasks

Business validations for Bulk Withdrawal Upload #2112

JasonCTang opened this issue Jul 13, 2023 · 1 comment
Assignees
Labels
Institution Institution Features Task

Comments

@JasonCTang
Copy link
Collaborator

JasonCTang commented Jul 13, 2023

Describe the task
Business validations for Bulk Withdrawal Upload.
Assuming the file parsing and file format validation is already done the dependency ticket https://app.zenhub.com/workspaces/student-information-management-system-5fce9df5aa1b45000e937014/issues/gh/bcgov/sims/2111

Reference figma Design
https://www.figma.com/file/9Om2tzLAVEoMQrjmrH4fhu/MOD-SIMS?type=design&node-id=12566-163067&mode=design&t=LyYYv68zdOfihIDs-0

Additional Context

  • File Layout: https://app.zenhub.com/files/319429847/d246b205-1c6f-449d-b998-b8c75d8e08b2/download
  • File is based off all applications that have had an assessment since the last file was sent
  • Workaround: Institutions that use a bulk withdrawal file still have the ability to enter withdrawals through Insitution Portal.
  • Process each record as if it were an manually entered withdrawal.
  • Although this is an "integration" file, it currently still requires a manual process to be executed by the Institution user in SFAS where they have the opportunity to review the warnings prior to committing the changes to SFAS. Therefore, we are suggesting the same approach as the Bulk Offering Upload.
  • Each record are proceeded as if it were a manually entered withdrawal.
  • Only BC Public institutions are allowed to use and perform this upload.
  • Only Institution Administrator role are allowed to perform this upload.
  • Affected Student Application belongs to the institution uploading the file.
  • Follow the same approach as bulk offering file upload, only process file if all records pass validation (all or nothing), display issues on the page, etc.

Acceptance Criteria

  • Ensure that the affected Student Application belongs to the institution uploading the file.
  • If the application number is not found, assume it is an SFAS application and just skip over it, do not perform any other validations on the record and proceed onto the next record to continue processing the file. Generate warning to user: "Application number not found. The withdrawal request for this application will not be processed."
  • Create an interface in the SIMS application to upload the file, similar to the bulk offering file upload, using the same validation models structure.
    • In case one or multiple validations failed, return the validation errors.
    • Allow the process to be executed as validation only, that will check for the next for possible business validation errors but should not persist any data to the database.
      • Validate if the combination of the SIN, Application number and institution match with a record on SIMS, if not, return the line as a warning message "Application number not found. The withdrawal request for this application will not be processed."
      • For each record, validate if the application belongs to the institution location provided as the originator in the header of the file. [Confirmed with @HRAGANBC]. If the institution location for a record does not match as per the file originator field, throw the error "Application number not found. The withdrawal request for this application will not be processed."
      • If the file contains a line for an application that already has a withdrawal recorded, return the line as a warning message "This application is already withdrawn and is going to be skipped." [Confirmed with @JasonCTang]
      • Verify if the application is in "Completed" status and not archived to execute the withdrawal, if not, return it as 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 should be displayed.
      • Line number: record number including the header in the count.
      • Application Number (even if invalid): display the file content to show what was interpreted as the "Application Number".
      • Withdrawal Date (even if invalid): display the file content to show what was interpreted as the "Withdrawal Date".
      • Validations: display a user-friendly message about why the record was not considered valid.
      • If there is a withdrawal already in place- skip the record from processing.
@michesmith
Copy link
Collaborator

Question

  • Why does the manual withdrawal entry check that the application has no ongoing assessments when applying the withdrawal? Is there a business reason for this or is it purely a technical reason? If technical, does moving assessment to a queue address this so that we can remove this requirement? -- this is covered with Que'd assessments

@sh16011993 sh16011993 self-assigned this Oct 19, 2023
@michesmith michesmith added this to the Sprint 53 milestone Oct 24, 2023
sh16011993 added a commit that referenced this issue Nov 8, 2023
## As a part of this PR, the following tasks were completed:

- [x] Checked to ensure that the affected Student Application belongs to
the institution uploading the file.
- [x] 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."
- [x] 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.
- [x] Centralized the error validation code to the `validation-utils`
file.

### Screenshots [validation errors and warnings]:

<img width="1919" alt="image"
src="https://github.com/bcgov/SIMS/assets/7859295/d1c586fd-0e23-4d65-b8ba-472ae146e29f">


------------------------------------------------------------------------------------------------------------------------------------------

<img width="1919" alt="image"
src="https://github.com/bcgov/SIMS/assets/7859295/e47a9861-ce5e-499f-9676-37044ee232c5">


------------------------------------------------------------------------------------------------------------------------------------------

<img width="1918" alt="image"
src="https://github.com/bcgov/SIMS/assets/7859295/00a65201-a240-4337-a5fd-c7ca8febcdc9">


------------------------------------------------------------------------------------------------------------------------------------------

<img width="1920" alt="image"
src="https://github.com/bcgov/SIMS/assets/7859295/7f176c57-cde9-4ab9-9b83-ddff9ea7325f">


------------------------------------------------------------------------------------------------------------------------------------------

<img width="1920" alt="image"
src="https://github.com/bcgov/SIMS/assets/7859295/880628ff-3479-46a9-9947-5db8c958c1b0">


------------------------------------------------------------------------------------------------------------------------------------------

<img width="1919" alt="image"
src="https://github.com/bcgov/SIMS/assets/7859295/82f89661-b0eb-4fa6-9bc5-64ebaa37dd31">
sh16011993 added a commit that referenced this issue Nov 9, 2023
…2490)

### As a part of this PR, the following bug is fixed:

**Bug:** UI shows success message in the snackbar when there are
validation errors for one or more application bulk withdrawal errors.

**Fix:** This is fixed to show no success message when there are one or
more validation errors.

### Bug:

<img width="1918" alt="image"
src="https://github.com/bcgov/SIMS/assets/7859295/a4b95895-4250-4a40-abf4-07a97c0dd1a2">

### Fix:

<img width="1915" alt="image"
src="https://github.com/bcgov/SIMS/assets/7859295/4b9a230a-adf0-4b96-bc03-251fc12edac4">
sh16011993 added a commit that referenced this issue Nov 9, 2023
…2491)

## As a part of this PR, the following is fixed:

**Bug:** When an application record in the bulk withdrawal file where
the student has previously withdrawn from the program (scholastic
standing) is processed and the same record in the file also has an
incorrect value of SIN:
 
### The below errors and warnings are shown:

<img width="1918" alt="image"
src="https://github.com/bcgov/SIMS/assets/7859295/a485250e-395d-4552-8bc1-18f5b43836f2">

### **[Fix]** Instead the following errors and warnings must be shown:

<img width="1920" alt="image"
src="https://github.com/bcgov/SIMS/assets/7859295/7df329e7-7660-424b-a2fc-c0f92115508d">
sh16011993 added a commit that referenced this issue Nov 9, 2023
…2493)

### As a part of this PR, the following is fixed:

**Bug:** If the application is withdrawn due to the **student withdrew
from program (this very specific type of scholastic standing only)**,
then the error message resulting from the application getting archived
shows up.

**[Bug Screenshot]**

<img width="1920" alt="image"
src="https://github.com/bcgov/SIMS/assets/7859295/ff5bb5ee-dbea-4c09-8d72-847b17fb1e61">

**Fix:** If the application is withdrawn due to student withdrew from
program, then the error message resulting from the application getting
archived shouldn't be shown. Only the warning message: "This application
is already withdrawn and going to be skipped." is shown.

As per the new message request in the story, the withdrawal date is also
not shown in the UI.

**[Fix Screenshot]**

The application in the below screenshot has scholastic standing: Student
withdrew from program. Hence, only the warning message "This application
is already withdrawn and going to be skipped." is shown.

<img width="1918" alt="image"
src="https://github.com/bcgov/SIMS/assets/7859295/9a2c5b34-f894-473f-be49-bcfc500291e3">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Institution Institution Features Task
Projects
None yet
Development

No branches or pull requests

4 participants