(root)/ – Rev 37527
Rev 37526 |
Rev 37528 |
Go to most recent revision |
Compare with Previous |
Directory listing |
View Log
| RSS feed
Last modification
- Rev 37527 – 36 d 10 h
- Author: amit
- Log message:
- offer circular: a new month supersedes every older one
Publishing a circular expires still-running offers from earlier circulars, at the
offers level and again for the web offers they produced.
Why: the new circular restates whatever is still live, so leaving the old month
ACTIVE means the same cashback is current twice. Verified Aug'26 -> Sep'26: all 24
SKUs covered by August's four still-running Apple offers were carried into
September, six of them twice.
- expireOlderDocumentOffers: status ACTIVE -> EXPIRED for earlier documents.
end_date is deliberately NOT touched - it is what the OEM said, and older offers
stay readable as reference. They simply stop being current.
- expireIfSuperseded: the converse, so re-ingesting an OLD circular while a newer
one is live cannot resurrect it. With both, 'newest circular wins' holds whatever
order documents are ingested in.
- deactivateOlderPeriods / hasNewerPublishedPeriod do the same for dtr.web_offer.
Verified on real data in a rolled-back transaction: publishing Sep expired 165
still-ACTIVE Aug offers (many stale since the 18 Aug ingest), Sep did not expire
itself, and re-ingesting Aug while Sep is live self-expired its 4 revived offers.