Retention date calculation¶
Extensions.vb provides small extension methods used to compute data-retention cutoffs for Unit Stat policy units and to normalize a missing experience-rating modification (ER Mod) factor to a safe default. These are pure calculation helpers with no database access.
| Field | Value |
|---|---|
| Operation ID | OP-US-08 |
| Trigger | Caller invokes d.UnitArchiveDate(), d.UnitDeleteDate(), d.QuarterStartDate(), or target.ERModFactor() |
| Inputs | A Date (for the date extensions) or a clsPolicyPeriodRatingPlan instance (for ERModFactor) |
| Outputs | A calculated archive or delete cutoff Date, a quarter-start Date, or a Decimal ER Mod factor |
| Primary components | Extensions.UnitArchiveDate, Extensions.UnitDeleteDate, Extensions.QuarterStartDate, Extensions.ERModFactor |
| Entry point | Business\SAIF.Business.UnitStat\Extensions.vb |
Steps¶
- Quarter alignment.
QuarterStartDate(d)computes the first day of the calendar quarter containingd: it truncates(Month(d) - 1) / 3to find the zero-based quarter index, converts that back to a starting month (1,4,7, or10), and returns<month>/1/<year>for the input date's year. - Archive cutoff.
UnitArchiveDate(d)returnsQuarterStartDate(d)minus 155 months — used to determine the cutoff before which policy units are considered eligible for archiving (BR-US-025). - Delete cutoff.
UnitDeleteDate(d)returnsQuarterStartDate(d)minus 30 years — used to determine the cutoff before which policy units are considered eligible for permanent deletion (BR-US-025). - ER Mod factor default.
ERModFactor(target As clsPolicyPeriodRatingPlan)returnstarget.ERModconverted toDecimalif it is notNothing, otherwise returns1(100%) — this normalizes policy periods on non-ERP (non-experience-rated) rating plans, which have no ER Mod value, to behave as if their modification factor were neutral (1.00) rather than null, so that downstream rating-plan comparisons or calculations do not need separate null-handling logic for ERP versus non-ERP periods. - No orchestrating caller found in this library. The functions that would actually apply
UnitArchiveDate/UnitDeleteDateto a set of policy units and act on them (archiving/purging jobs) are not present in this library's traced source; these extension methods are exposed as reusable utilities but the archiving/deletion process itself is external to this library.**
Process flow¶
flowchart TD
Start([Caller invokes an extension method]) --> Which{Which extension?}
Which -->|QuarterStartDate| Quarter[Truncate month to<br>quarter start: Jan, Apr, Jul, or Oct 1]
Which -->|UnitArchiveDate| ArchiveCalc[QuarterStartDate minus 155 months]
Which -->|UnitDeleteDate| DeleteCalc[QuarterStartDate minus 30 years]
Which -->|ERModFactor| ERModCheck{Target.ERMod is Nothing?}
ERModCheck -->|Yes| DefaultMod([Return 1.00])
ERModCheck -->|No| ActualMod([Return Target.ERMod as Decimal])
Failure and edge-case behavior¶
- No code in this library was found that consumes
UnitArchiveDateorUnitDeleteDateto actually perform archiving or deletion; these two extension methods define the retention math but the orchestrating batch/archival process, if it exists, is outside this library's traced source.** ERModFactortreats a missing (Nothing)ERModas exactly1.00; any caller that needs to distinguish "no ER Mod applicable" from "ER Mod is exactly 1.00" cannot do so through this extension alone.
Related documentation¶
Note: Statements marked with
*were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts. Statements marked with**could not be confirmed; treat as unknown until verified.
Sources¶
Business\SAIF.Business.UnitStat\Extensions.vbBusiness\SAIF.Business.UnitStat\Constants.vb