← all branches

fix/api-demanda

needs attentionviewing older commit
df813ca · fullPR #348reviewed 2026-07-24 20:23 UTC1H · 2M · 1L
The branch
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
The changes (whole branch)
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+80
Blast
1 file, +8/−0. Seed-only; additive to API surface (36→38 concepts).
public-api follow-up: EnrichWizardContract wizard bug unresolved
typecheck· @batu/database typecheck cleanmapper-tests· public-v1 bills mapper tests 19/19 passe2e-prod· RPU 977251204377 now returns hiredDemand=875, connectedCharge=1126ci· GitHub checks API inaccessible from this runner tokencoderabbit· No .coderabbit.yaml in repo

Findings · 4

conventions1

medium

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

medium

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

high

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.

low

Staging/preview seed step undocumented in PR

Add 'Run pnpm db:seed:column-configs on preview/staging post-deploy' to the PR body.

History · 3 commits

  1. e65506fsafeincremental0H · 0M · 3L2026-07-24 20:56
  2. 3d60435needs attentionincremental0H · 2M · 3L2026-07-24 20:38
  3. df813caneeds attentionfull1H · 2M · 1L2026-07-24 20:23current