Inventory: competitor prices, as checked

Each Inventory entry can hold its plans' prices: the plan, the price,
what it's per, when it was checked and where. Comparison and alternative
pages, and new sections, state a competitor's price only as entered,
with the month it was checked; a missing one is left out and listed as a
to-do. A price checked more than six months ago is flagged on the entry
and adds a to-do to every page that names the competitor. Prices go out
and come back with the Inventory's YAML.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-24 08:18:31 -07:00
co-authored by Claude Opus 5.5
parent e0e74af86c
commit f5d87164ac
10 changed files with 357 additions and 4 deletions
+4
View File
@@ -50,6 +50,7 @@ type Entry struct {
Keywords []string `json:"keywords,omitempty" yaml:"keywords,omitempty"`
TalkingPoints string `json:"talking_points,omitempty" yaml:"talking_points,omitempty"`
MentionPolicy string `json:"mention_policy,omitempty" yaml:"mention_policy,omitempty"`
Prices []Price `json:"prices,omitempty" yaml:"prices,omitempty"` // their plans' prices, as checked
}
// Normalize tidies an entry and checks it.
@@ -74,6 +75,9 @@ func (e *Entry) Normalize() error {
e.RSS = profile.CleanList(e.RSS)
e.Keywords = profile.CleanList(e.Keywords)
e.TalkingPoints = strings.TrimSpace(e.TalkingPoints)
if err := e.normalizePrices(); err != nil {
return err
}
subs := profile.CleanList(e.Subreddits)
for i, s := range subs {