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

Ignore restrictions for specific disbursement(s) within an assessment #1815

Closed
14 of 16 tasks
JasonCTang opened this issue Mar 16, 2023 · 5 comments
Closed
14 of 16 tasks
Assignees
Labels
Ministry Ministry Features User Story

Comments

@JasonCTang
Copy link
Collaborator

JasonCTang commented Mar 16, 2023

As a Ministry user I want the ability to ignore a restriction for any number of disbursements for the current application So That the next disbursement only will be disbursed OR all outstanding disbursements for that application will still be disbursed.*

When Ministry users select to 'ignore' a restriction, they can choose to ignore it for the application OR for ALL remaining disbursements of that assessment. When a restriction is ignored for a disbursement, it will not be considered when determining if the ECert should be generated for that application. A function to reverse the ignore status and have it be reviewed at ECert generation needs to also be developed.

Note that the ignore action is applied at the disbursement level for the application. So if the application is reassessed, the restriction WILL be automatically ignored for the new assessment. In other words, Ministry users can ignore the restriction for subsequent assessment or reassessments within the single application. If the ministry want to reapply the restriction to the application they will need to have a function to remove the the ignored restriction status. The student would then be expected to call the Ministry and ask for the restriction to be ignored again in this case.

When a Ministry user chooses to ignore a restriction, automatically generate a note at the time it is selected with information on which restriction was ignored for which application and who performed the ignore. (No user input for this note.)

Ministry staff will also need the ability to undo this ignoring of a restriction so that it becomes effective on the assessment again and will block ECert generation.

Linked with UX/UI piece in Ticket #1862

Acceptance Criteria

  • Allow Ministry staff to ignore any restriction (provincial or federal) for:
  • The next disbursement sent for the application. Whichever disbursement sent happens after that option is enabled, the eCert check continues to ignore/bypass that restriction. (I.e. any re-assessment will still disable the flag on the first eCert occuring since the restriction was ignored). Once the first eCert goes out after the rule was applied resets/removed the ignore rule.
  • OR all disbursements associated with an application. If application gets re-assessed, all disbursements are still ignored.
  • Ministry can apply this 'ignore' rule at any time, and do this for an infinite number of applications associated with the student.

Technical

  • Create DB migration for the new table.
    • Name: sims.application_restriction_bypasses
      • id: Auto-generated sequential primary key column.
      • application_id: Reference to the student application that will have the bypass applied.
      • student_restriction_id: Active student restriction to be bypassed.
      • bypass_behavior (Postgres Enum): Defines how the bypass should behave, for instance, until when it will be valid.
      • is_active: Indicates if the bypass should be considered active.
      • creation_note_id: Note when the bypass was created.
      • bypass_created_by: User that created the bypass.
      • bypass_created_date: Date and time the bypass was created.
      • removal_note_id: Note when the bypass was removed.
      • bypass_removed_by: User that removed the bypass.
      • bypass_removed_date: Date and time the bypass was removed.
      • [audit fields]
  • Active bypasses should behave accordingly to below behaviors.
    • All disbursements: any disbursement associated with the application will have this restriction ignored if the bypass is active. Any reassessment will continue to ignore the restrictions.
    • Next disbursement only: when the first e-Cert is marked as Ready to send the restriction bypass will be updated
      • is_active will be set to false.
      • bypass_removed_by will be set to the system user.
      • bypass_removed_date will be set to the current date.
      • removal_note_id will be saved with the text: "Automatically removing the bypass from the application number 1234567890 after the first e-Cert was generated.".
      • Create a new step to be executed last for part-time and full-time, suggested name RestrictionBypassesResolutionStep.
  • While executing the restrictions validations for part-time/full-time list all the active bypasses considered.
  • Once a restriction is bypassed it will also not be returned as a result from the method executePreValidations, which means:
    • be ignored while the student is accepting an assessment;
    • do not be listed in the application tracker information.
  • Implement the below processes to ignore restriction actions.
    • Stop part time disbursement should check for all restrictions (currently checking if at least one exists). If at least one is present and not ignored, the disbursement will be blocked. To be applied in the ValidateDisbursementPartTimeStep.
    • Stop full time disbursement should check for all restrictions (currently checking if at least one exists). If at least one is present and not ignored, the disbursement will be blocked. To be applied in the ValidateDisbursementFullTimeStep.
    • Stop full time BC funding once ignored should allow a manually triggered reassessment to have the BC awards full amounts disbursed (in case it was partially paid the regular process will deduct any value already paid, as usual).
  • E2E Tests
    • Should generate BC awards amounts with no restriction deductions when a student has an active 'Stop full time BC funding' restriction and it is bypassed.
      • Assert expected log messages for both ignored steps.
    • Should have the e-Cert generated for a full-time application when a student has an active 'Stop full time disbursement' restriction and it is bypassed.
    • Should have the e-Cert generated for a part-time application when a student has an active 'Stop part time disbursement' restriction and it is bypassed.
    • Should prevent an e-Cert generation when multiple 'Stop full time disbursement' restrictions exist and only one is bypassed.
    • Should prevent an e-Cert generation when multiple 'Stop part time disbursement' restrictions exist and only one is bypassed.
@michesmith michesmith added the Question Further information is requested label Aug 1, 2023
@michesmith michesmith added Question Further information is requested and removed Question Further information is requested labels Aug 11, 2023
@JasonCTang JasonCTang changed the title Ignore restrictions for specific applications Ignore restrictions for specific disbursement(s) within an assessment Aug 29, 2023
@michesmith michesmith added Question Further information is requested and removed Question Further information is requested labels Sep 25, 2023
@HRAGANBC HRAGANBC removed the Question Further information is requested label Oct 3, 2023
@HRAGANBC
Copy link
Collaborator

HRAGANBC commented Feb 6, 2024

@Joshua-Lakusta @CarlyCotton

As a business process, do we need any supplementary steps when the application is re-assessed and the restriction is automaticaly re-applied? Like an email trigger to JIRA notifying them?

@ninosamson
Copy link
Collaborator

Discuss whether or not this can be ignored at application level rather than assessment.

@michesmith michesmith added the Ministry Ministry Features label Feb 15, 2024
@Joshua-Lakusta
Copy link
Collaborator

@HRAGANBC @CarlyCotton. Please review for any errors in my update.
Thank you

@HRAGANBC
Copy link
Collaborator

@Joshua-Lakusta revised the logic to make clear what happens when re-assessment occurs. Otherwise good from my end

@michesmith michesmith added this to the 4.5 Ministry View and Manage Student Profile milestone Mar 12, 2024
@michesmith michesmith removed this from the 4.5 Ministry View and Manage Student Profile milestone May 3, 2024
@sslaws sslaws added the Dev & Architecture Development and Architecture label May 3, 2024
@michesmith michesmith added this to the 2.0 Part-Time Students MVP milestone May 3, 2024
@HRAGANBC HRAGANBC removed their assignment Jul 24, 2024
@andrewsignori-aot andrewsignori-aot self-assigned this Aug 30, 2024
@ninosamson ninosamson removed the Dev & Architecture Development and Architecture label Sep 3, 2024
andrewsignori-aot added a commit that referenced this issue Sep 4, 2024
- Created new DB migrations for the type
`sims.restriction_bypass_behaviors`.
- Created new DB migrations for the new table
`sims.application_restriction_bypasses`.
github-merge-queue bot pushed a commit that referenced this issue Sep 11, 2024
…sessment (#3679)

- Created the `restrictionBypassesResolutionStep` to resolve active
bypasses when needed as the last step in the e-Cert generation process
for part-time and full-time.
- Changed the `getEligibleDisbursements` query adding the information
from the active bypasses and the restriction bypassed.
- Method `getRestrictionByActionType` was changed to use the effective
restrictions (active restrictions not bypassed) instead of the active
restrictions.
- The BCLM step is ignored at the beginning of its execution. If the
BCLM restriction is in place the method would not be executed (logic
already in place). The condition based on the bypass was added either
way to ensure that whatever happens to the BCLM logic the bypass will
guarantee that the store step will be ignored.
- A log was created to list all the active restrictions known during the
e-Cert calculation. The log records the restriction code and the student
restriction ID for easier troubleshooting.
- Created factories for the new table `ApplicationRestrictionBypass`.

### E2E Tests

#### Full-time
- Should generate BC awards amounts with no restriction deductions and
resolve the restriction bypass when a student has an active 'BCLM'
restriction and it is bypassed with behavior 'Next disbursement only'.
- Should have the e-Cert generated for a full-time application and the
bypass active when a student has an active 'Stop full time disbursement'
restriction and it is bypassed with behavior 'All disbursements'.
- Should prevent an e-Cert generation and keep the bypass active when
multiple 'Stop full time disbursement' restrictions exist and only one
is bypassed and it is bypassed with behavior 'Next disbursement only'.

#### Part-time
- Should have the e-Cert generated for a part-time application and the
bypass resolved when a student has an active 'Stop part time
disbursement' restriction and it is bypassed with behavior 'Next
disbursement only'.
- Should prevent an e-Cert generation and keep the bypass active when
multiple 'Stop part time disbursement' restrictions exist and only one
is bypassed and it is bypassed with behavior 'Next disbursement only'.

### Log sample without the bypass


![image](https://github.com/user-attachments/assets/cc75c575-df20-49b3-aefc-ebaac508b9f3)

### Log sample with a bypass in place.


![image](https://github.com/user-attachments/assets/be96088b-458e-41d2-abf1-f56d5d610d1b)

### Noted generated when a bypass is resolved by the system

AC was adjusted later to include the application number.

![image](https://github.com/user-attachments/assets/49f3180e-ae52-4f08-b169-9fe5ac93628d)
@andrewsignori-aot
Copy link
Collaborator

andrewsignori-aot commented Sep 13, 2024

Demo

Student Portal

  • Login as student andrew_signori_13.
  • Show part-time application 2024000032 with assessment blocked.
  • Active the bypass manually on DB.
  • Accept the assessment.

Institution

  • Log in to institution SIMS_COLLE.
  • Approve the COE.

Student Portal

  • Deactivate the bypass manually on DB.
  • Show the restriction message in the cards.
  • Active the bypass manually on DB.
  • Show the restriction message in the cards.
  • Deactivate the bypass manually on DB.
  • Try to generate the e-Cert
  • Show the queue logs.
  • Active the bypass manually on DB.
  • Show the queue logs.
  • Show student notes.

@CarlyCotton this is what is planned for the demo.

@sslaws sslaws closed this as completed Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ministry Ministry Features User Story
Projects
None yet
Development

No branches or pull requests

7 participants