Map uq_users_docpair + uq_users_legajo 23505 → friendly Spanish across the 4 other user-writing paths (completar/actions.ts, perfil/actions.ts, user-actions.ts, users-actions.ts) — 077 uniques are global+live so a doc/legajo collision there raw-500s
Surfaced by coder during MARS-537. Migration 077's uq_users_docpair/uq_users_legajo partial-uniques are GLOBAL and already live. MARS-537 only wired the 23505 doc/legajo classification into the approval handler. Four other paths write users.numeroDocumento/legajo with NO doc/legajo 23505 classification and NO withAction wrapper — solicitar-acceso/completar/actions.ts, (protected)/perfil/actions.ts, src/lib/user-actions.ts, src/lib/users-actions.ts. A collision there raw-500s the user (admin edit / profile edit / signed-link completion) instead of a friendly Spanish message. Dedup prevention itself works (constraint holds); this is the messaging gap. Each path has bespoke error handling — map the two constraint names to friendly Spanish per-path with care.
Questions
Activity
-
Centralized users-table 23505→friendly Spanish map (friendlyUserUniqueViolation, nullable) wired across all constrained-field writers: approval handler, createUserWithContext, createAlumnoWithUser, updateUser, restoreUser, applyImport (was leaking raw constraint), perfil/updateDocumentInfo. Covers uq_users_docpair/uq_users_legajo + email/googleSub. Shipped d304fc8→5e31ef8, audit PASS. Class-S.