fix/api-demanda
needs attentionviewing older commitdf813ca · fullPR #348reviewed 2026-07-24 20:23 UTC1H · 2M · 1L- Purpose
- Surface Demanda Contratada and Carga Conectada via the public API's per-bill concepts map — quick fix for a customer-reported gap.
- Goal
- Add hiredDemand and connectedCharge to API_DEFAULT_CONCEPTS so concepts map reads from per-bill line items rather than unreliable contract-level columns.
- Sub-goals
- Add two concepts to API_DEFAULT_CONCEPTS seed list
- Keep seed source in sync with the live prod patch already applied
- What
- One array in seed-column-configurations.ts gains two entries plus a date-stamped explanatory comment.
- Why
- ~1,400 wizard-created contracts have null in utility_contracts.hired_demand_kw / connected_charge_kw. The per-bill line items carry the values reliably.
- Areas
- packages/database+8−0
- Blast
- 1 file, +8/−0. Seed-only; additive to API surface (36→38 concepts).
Findings · 4
conventions1
Stale concept count in comment (36 → 38)
packages/database/src/seed-column-configurations.ts:145
Comment reads '// Locked at 36 concepts on 2026-05-07'. With this PR the count is 38. Update count and date.
tests1
No test verifying hiredDemand/connectedCharge appear in the api config after seeding
packages/database/src/seed-column-configurations.ts:164
General buildConceptMap logic is tested (19/19), but an accidental removal from API_DEFAULT_CONCEPTS won't be caught until prod.
improvement2
EnrichWizardContract follow-up should be a tracked Linear issue before closing this PR
domains/utility/src/utility-contract/utility-contract.shells.ts
Shell drops hiredDemandKw/connectedChargeKw even though the decision computes them. ~1,400 wizard contracts affected; newly enriched contracts continue writing null.
Staging/preview seed step undocumented in PR
Add 'Run pnpm db:seed:column-configs on preview/staging post-deploy' to the PR body.