fix(awards): apply the per-reference validity window
References are not forever: a park is delisted, a district merged, a castle loses its number. A QSO made while the reference existed is a valid contact and must keep counting; one made afterwards must not. The JSON format did not need to change — ValidFrom/ValidTo were already on awardref.Ref, already columns in award_references, already round-tripping through export and import. They were simply never read: awardRefMetas dropped them on the way into the engine, so nothing downstream could enforce them. This carries them through and checks them in keepRefs. Empty means the award's own window governs, which inScope already enforces for every QSO in the award. That fallback is deliberately NOT duplicated per reference — two places enforcing the same dates is two places for them to disagree. The editor shows the award's dates as the hint under the boxes so the operator can see what empty inherits. Dates are compared as ISO strings rather than parsed times: the stored shape is "2006-01-02", lexical order on it IS chronological, and this cannot fail on a malformed value the way a parse can — a reference with a typo in its window keeps counting instead of silently vanishing from an operator's totals. The Explain trace names the date and the cutoff, because "did not count" on a contact the operator remembers making is exactly when they need to be told it is the reference that has a window, not their log that is wrong.
This commit is contained in:
@@ -4486,6 +4486,7 @@ func (a *App) awardRefMetas(defs []award.Def) map[string][]award.RefMeta {
|
||||
metas = append(metas, award.RefMeta{
|
||||
Code: rf.Code, Name: rf.Name, Group: rf.Group, SubGrp: rf.SubGrp,
|
||||
DXCCList: dxccList, Pattern: rf.Pattern, Valid: rf.Valid,
|
||||
ValidFrom: rf.ValidFrom, ValidTo: rf.ValidTo,
|
||||
})
|
||||
}
|
||||
out[code] = metas
|
||||
|
||||
Reference in New Issue
Block a user