DataVault / datavault

DataVault Project
MIT License
19 stars 16 forks source link

RSS408-230 - Further fixes for calculating Review Date for a vault. #751

Closed johnpinto1 closed 1 year ago

johnpinto1 commented 2 years ago

Changes to satisfy algorithm:

The minimum review date for any vault is 3 years in the future. So in order to help the user, we pre-populate the Review date field in the create-vault form to 3 years hence. In addition to validation checking the 3 years when they submit the form.

Default value in absence of retention policy:

Today + 3 years => default Review Date

eg 2021-10-14 + 3 years => Review Date is 2024-10-14

The DataVault should re-calculate the Review Date as soon as the value of the Grant End Date (GED) or Retention Policy fields change. This is a two-step calculation in terms of the dates:

Grant End Date + Retention Policy => Compliance date;

If Compliance date <= three years in the future, Default review date remains 3 years from now;

Else Default review date = Compliance date

e.g.

If GED is 2002-07-31 + Retention Policy is 5 years and today's date is 2022-09-28

=> Compliance date was in 2007 (we never suggest a review date less than 3 years in the future)

=> minimum storage period is applicable

= > Review date is 2025-09-28.

If GED is 2021-10-31 + Retention Policy is 5 years and today's date is 2022-09-28

=> Compliance date is 2026, which is further away than the minimum storage period, so the review date should be set to the compliance date

=> Review date is 2026-10-31.