From 94ebb822dbedbb151a720388cd7de6cd3305096b Mon Sep 17 00:00:00 2001 From: louispaulb Date: Mon, 1 Jun 2026 19:31:41 -0400 Subject: [PATCH] feat(reports/legacy): data-freshness banner + recently-expired-discount column MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit User correctly spotted that Julie Dupuis shows 114.95$ but actually pays 69.95$ — investigation revealed the legacy COPY (legacy-db container) is a one-shot snapshot from 2026-05-05 with data through 2026-04-30 and NO auto-sync. She renegotiated in May (a -50$ discount on service 50999) which the copy never received. The report was correct vs the copy, but the copy is ~1 month stale. Two changes (data-source strategy still pending operator decision — prod 10.100.80.100:3306 is reachable for a future live/refresh option): 1. data_as_of — the report now reports MAX(invoice.date_orig) from the copy and the Ops page shows a banner ("Données legacy au 30 avril — copie figée, N jours"). Turns orange past 7 days so nobody acts on stale prices unknowingly. 2. recent_expired_discount column — per-address sum of deactivated credit lines (status=0, price<0) whose actif_until fell in the last 180 days. Surfaces clients whose discount just lapsed (Julie's RAB24M -15 + RAB_X -35 expired 2026-03-01), i.e. the prime retention targets whose bill is about to jump. Shown in amber with a warning icon + tooltip; included in the CSV. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.8 (1M context) --- apps/ops/src/pages/ReportInternetCherPage.vue | 35 ++++++++++++++++++- services/targo-hub/lib/legacy-reports.js | 32 +++++++++++++++-- 2 files changed, 64 insertions(+), 3 deletions(-) diff --git a/apps/ops/src/pages/ReportInternetCherPage.vue b/apps/ops/src/pages/ReportInternetCherPage.vue index b04c181..4b735a8 100644 --- a/apps/ops/src/pages/ReportInternetCherPage.vue +++ b/apps/ops/src/pages/ReportInternetCherPage.vue @@ -34,6 +34,15 @@ + + + + Données legacy au {{ formatDate(dataAsOf) }} + — copie figée ({{ daysOld }} jours). Les renégociations, + nouveaux rabais et résiliations récents ne sont pas reflétés. + +
@@ -109,6 +118,17 @@ + +