movilba
MOVILBA-385
Admin opciones: explicar duplicados del catálogo con mensaje específico
Done low
cmcoder03-mba-l-cc
MOVILBA-384 adjacent-admin code sweep: opciones create retains the original PG error through repository and service to handleApiError, which maps 23505 to generic DUPLICATE_ENTRY/400. Checked schema names uq_opciones_grupo_campo_valor_active (grupo_nombre,campo_nombre,valor_opcion), active rows only. No specific duplicate precheck/business label. This is message quality, NOT an unmapped SQLSTATE or opaque500. Consider named-constraint Spanish message and matching precheck as a single pattern item; do not infer live index state from schema snapshot. No browser attempt or DB write performed. Filed at coder02 request; not fixed in384.
Activity
-
coder03-mba-l-cc / coder
-
db03-mba-l-cc
-
db04-mba-l-ca
-
db03-mba-l-cc / db
-
VERIFIED db03 2026-10-09: uq_opciones_grupo_campo_valor_active confirmed live on PROD and DEV, identical definition - UNIQUE INDEX (not a pg_constraint row, it's a partial index: WHERE borrado_en IS NULL), on (grupo_nombre, campo_nombre, valor_opcion). Matches the ticket's original schema claim. 23505 mapping confirmed at src/lib/errors.ts:258-259 -> generic DUPLICATE_ENTRY/'Entrada duplicada' (src/lib/errors.ts:69), no named-constraint branch. This item's entire remedy (precheck + specific Spanish message) is app-code (src/lib/errors.ts and/or the opciones service/action layer) - no DDL, no schema change. Per db-lane scope (only view/column DDL is db-lane; app writer/reader logic is coder-lane even when assignedRole says db), redirecting the fix itself to coder-lane.
-
coder03-mba-l-cc / coder
-
audit-mba-l-cc 2026-10-09. PASS. Author coder03-mba-l-cc. src/utils/database-error-mapper.ts 2c2bec29, one line: CONSTRAINT_LABELS gains uq_opciones_grupo_campo_valor_active -> Spanish duplicate-opcion message. Confirmed independently (not from the DM claim): index is a real unique partial index on public.opciones(grupo_nombre, campo_nombre, valor_opcion) WHERE borrado_en IS NULL, exact name match, identical in PROD and DEV (not a pg_constraint row - a unique index, which libpq still reports via error.constraint the same way, so the lookup at line 165/190 works unchanged). Follows the existing named-index/constraint label pattern. typecheck rc=0. No DB write, no migration.
-
audit pass: Diff read, index existence+definition confirmed live both bases, typecheck run fresh
payload
{"scope":"Diff read, index existence+definition confirmed live both bases, typecheck run fresh","outcome":"pass","evidence":"uq_opciones_grupo_campo_valor_active present identical PROD+DEV as unique partial index; typecheck rc=0","reportRef":null} -
Shipped dev 3557e7db / prod ca7ee0ed (v5.6.237). Audit PASSed. Named-constraint message added to CONSTRAINT_LABELS.
improvement
5w ago by wi-cli-venus
1w ago
2026-10-09 04:51