data-to-insight / csc-validator-be-cin

1 stars 1 forks source link

Bug: Rule 4014 - Incorrectly discounts duplicate CIN Plans #366

Closed SLornieCYC closed 1 year ago

SLornieCYC commented 1 year ago

Describe the bug Where there are two CIN Plans in CINplanDates that have the exact same CINPlanStartDate and CINPlanEndDate this is being filtered out by the rule coding and not flagged as an error. This is different behaviour to the DFE CIN portal which does flag the duplicate CIN Plans as "overlapping dates". The CIN Validator front-end also only appears to show the CIN Plan once despite existing twice in the source data.

To Reproduce Steps to reproduce the problem, e.g.:

Expected behavior

  1. Both records in CINplanDates should be returned in the CIN Validator front-end.
  2. Both records should be flagged as in-error due to overlapping dates.

Proposed fix (Optional) Instead of excluding CIN Plans where CINPlanStartDate = CINPlanStartDate this should exclude plans where ROW_ID = ROW_ID (based on original table index).

https://github.com/data-to-insight/CIN-validator/blob/dc4559d2362e0efacfe47ebb9b4b3d538c7d0094/cin_validator/rules/cin2022_23/rule_4014.py#L64-L67