Class PriceHistory
java.lang.Object
ai.redouble.demo.pricing.PriceHistory
The logic of "which price is current", with no model in it. Every mention from every
document is placed under its product (the canonicalizer's groups say which names are
one product), then per audience and currency the prices the documents present as in
force compete by date, as of the day the run answers for: the latest one dated on or
before that day is current, one dated after it is scheduled, every other statement of
the same amount confirms the current one, the earlier ones with another amount are
superseded by it, two that disagree on the same latest date are a conflict for a person,
and one stated by a document with no date cannot be ranked and says so. What a document itself
calls a former price, a proposal, or a cost never competes; a discontinuation dates the
product's end. A point's date is the price's own effective date, else the statement's
date, else the document's.
- Since:
- 0.1 (2026-09-15)
- Author:
- Andrey Santrosyan
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordWhat the reconciliation produced: the products, and the mentions it could not use.static final recordOne mention with where it came from and the date its document carries. -
Method Summary
Modifier and TypeMethodDescriptionstatic PriceHistory.Resultreconcile(List<PriceHistory.Sourced> mentions, ProductGroups groups, LocalDate asOf)
-
Method Details
-
reconcile
public static PriceHistory.Result reconcile(List<PriceHistory.Sourced> mentions, ProductGroups groups, LocalDate asOf) - Parameters:
asOf- the day the run answers for: a price dated after it is scheduled, not current
-