Currently on package ingest, if a coverage statement is made as part of the ingest, this results in updates to:
- PCI Coverage
- PTI Coverage
- TI Coverage
By allowing users to update coverage on the PCI directly via the UI this brings in new scenarios for updating coverage, and this can include removing as well as adding coverage information.
The backend should ensure that when a PCI coverage is updated the appropriate PTI and TI coverage is also updated if necessary. The PTI coverage should represent the totality of coverage offered by the PCIs, and the TI coverage should represent the totality of coverage offered by the TIs.
Therefor if the PCI coverage is updated the PTI and TI coverages may need to be updated - first the PTI coverage, and if the PTI coverage changes then the TI coverage may change.
The change in coverage can be a reduction as well as an extension (as currently)
At all levels there can be multiple coverage statements because there can be gaps in coverage.
To help with testing there are 5 files attached which can be loaded. Assuming start with an empty KB the expected results would be:
- Load file 1: PCI, PTI and TI each with one coverage statement 1980-01-01 -> 1985-12-31
- Load file 2: No effect because this doesn't extend the coverage
- Load file 3: add new coverage statements for 1990-01-01 -> 1991-12-31 to PCI, PTI and TI
- Load file 4: replace all existing coverage statements with new coverage 1980-01-01 -> 1991-12-31 on all of PCI, PTI and TI
- Load file 5: replace all existing coverage statements with new coverage 1970-01-01 -> * on all of PCI, PTI, TI
Note the file load does not address the situation of reducing the coverage on the PCI which is supported via the UI now - which would require PTI and TI coverage to be re-calculated across all existing PCIs to check it was no larger than the maximum coverage indicated by the PCIs