refactor: rename the profiling vocabulary for the RD deployment - #611
refactor: rename the profiling vocabulary for the RD deployment#611mrivas00 wants to merge 4 commits into
Conversation
|
Why |
b0887b8 to
8821621
Compare
24be92e to
054bd47
Compare
8821621 to
a02887a
Compare
04338e9 to
873c157
Compare
781cc21 to
23ce2b3
Compare
MMARN asked for "actividad económica" instead of "rubro" and for step 1
to stop being called "Perfilamiento". The three renames land together
because they share files and a partial rename would not compile: the
DeleteWarningDialog union has to match its call sites.
- Perfilamiento → Datos generales (step 1 and the maintainer sidebar
group).
- rubro / subrubro → sector / actividad económica across screens,
maintainers, charts, transparency, the Excel export, the API error
copy and the inline explanations.
- Actividad principal → unidad de actividad. The field holds intensity
denominators (toneladas producidas, MWh generados), so its old name
collided with the economic-activity fields the RD registration form is
about to gain. Its explanation now says what it actually measures.
- The representative identifier drops the Chilean "Rut" literal and
names the document instead.
Two of the four subjects are now feminine ("actividad económica",
"unidad de actividad"), so the copy that used to hardcode masculine
agreement derives it: DeleteWarningDialog keeps a gender per entity
label, and getApiErrorMessage replaces `activeAdjective` with a `gender`
field that drives the adjective, the participle and the direct-object
pronoun.
Routes, table names and API contracts are untouched — this is copy.
The deployment is Dominican, so `OrganizationData.taxId` is an RNC. Sets TAX_ID_LABEL / TAX_ID_LABEL_SHORT accordingly and routes the applicant section through the constant instead of its hardcoded "ID/Rut", which bypassed it.
Every worked example of a tax identifier was a Chilean RUT (`76123456-7`, `12345678-9`), which the RNC labels this PR introduces turned into a contradiction: assertions now read `RNC 76123456-7`. Organizations get `131-2345678-9` and representatives `001-1234567-8`, both in the Dominican XXX-XXXXXXX-X shape. The cross-format illustrations keep their point — the same identifier written two ways, `131-2345678-9` against `13123456789`. Also drops the Chilean company forms the same fixtures carried: `Acme SpA` becomes `Acme SRL`, `Acme Chile` becomes `Acme RD`, and one test name still called the field a RUT.
873c157 to
239b843
Compare
23ce2b3 to
56e56e4
Compare
Why
Two of MMARN's ten observations are about words. The platform calls step 1
Perfilamientoand the economic-activity catalogrubro/subrubro— neither term is used in Dominican regulation, and page 5 of the observations asks explicitly to replacerubrowithActividad económica. A third rename is forced by what comes next: the field labelledActividad principal de la organizaciónactually holds intensity denominators (toneladas producidas,MWh generados), so it would collide head-on with the primary/secondary economic-activity fields PR 7 adds to the same form.PR 2 of 8 · base
feat/mati/rd-deployment-identity(PR 1).What
Perfilamiento(step 1, sidebar group)Datos generalesrubro/Rubrossector/Sectoressubrubro/Subrubrosactividad económica/Actividades económicasactividad principalunidad de actividadRUT / RUC / ID Tributario,RUTRNC (Registro Nacional de Contribuyentes),RNCID representante / Rut,ID/RutTAX_ID_LABEL76123456-7,12345678-9(Chilean RUT examples)131-2345678-9/001-1234567-8(DominicanXXX-XXXXXXX-X)Acme SpA,Acme ChileAcme SRL,Acme RDRoutes, table names, Prisma models and API contracts are untouched — this is copy: 60 files across screens, maintainers, charts, transparency, the Excel export, API error messages, the ten inline explanation markdowns and two dev docs.
Review notes
The gender problem is the only real logic here. Two of the four catalog subjects are now feminine (
actividad económica,unidad de actividad) where all four used to be masculine bar one. Copy that hardcoded masculine agreement now derives it:DeleteWarningDialogkeeps anENTITY_GENDERmap beside the label union and derives the demonstrative (este/esta), the participle (asignado/asignada) and the pronoun (eliminarlo/eliminarla).getApiErrorMessagereplacesactiveAdjectivewith agenderfield onRESOURCE_LABELS, which drives the adjective (activo/activa), the parent participle (eliminado/eliminada), the restore imperative (Restáuralo/Restáurala) and the direct-object pronoun used across the re-parenting copy. The fallback subject is stillel registro, so unknown resource types keep masculine agreement.getApiErrorMessage.test.tswas already exercising the agreement paths, so the updated expectations are the best place to check the wording reads correctly in Spanish.The tax-id examples were Chilean. Every worked example of a tax identifier
in the repo was a RUT, which the RNC labels here turned into a contradiction —
assertions that read
RNC 76123456-7. Organizations now use131-2345678-9andrepresentatives
001-1234567-8, both in the DominicanXXX-XXXXXXX-Xshape,across the collision fixtures, the
.restrequest samples, the trimming test andthree docs. The cross-format illustrations keep their point: the same identifier
written two ways,
131-2345678-9against13123456789. The same fixtures alsocarried Chilean company forms (
Acme SpA,Acme Chile), nowAcme SRLandAcme RD, and one test name still called the field a RUT.No validation was added:
taxIdstays a generic string, with no RNC formatcheck, no verifier digit and no normalization — the comment in
organizationIdentityCollision.tsstill says so, and it is still true.Why the renames are one commit. They share files and a partial rename does not compile — the
ProfilingEntityLabelunion has to match its four call sites. The RNC labels are a separate commit.One rename is a judgement call:
actividad principal→unidad de actividad.The field is
OrganizationMainActivity, and its values are intensitydenominators —
m² construidos,millones de RD$ de ingresos,MWh generados,pasajeros-km— the unit the footprint is divided by to express intensity. Itsold label named an activity, which is a different thing. Left alone, the form in
PR 7 would have shown these two fields next to each other:
Actividad económica principalActividad principal de la organizaciónm² construidosThe new label follows the sidebar entry
Unidades de Actividad, and the field'sexplanation markdown now states what it measures instead of describing it as "the
most specific descriptor of what an organization does".
This is a label change only: the table, the Prisma model and the
mainActivityIdfield of the API contract are all unchanged, so no data and no request shape
moves. It lands here rather than in PR 7 because PR 7 edits the same form file —
renaming afterwards would mean touching it twice, and reviewing the new
economic-activity fields against the colliding label.
Verification
pnpm format && pnpm lint && pnpm type-check && pnpm test:weball green, and the full API suite is green too (2,304 passing).The rename broke two integration tests, and this now fixes them.
getMainActivityEquivalenceandgetEmissionsDetailedSummaryfall back to a literal when an organization'smainActivityIdresolves to nothing, and that literal moves fromactividad principaltounidad de actividadalong with the rest of the vocabulary. Two tests asserted the old wording. They were never run — no database was available while the stack was authored — so the failure only surfaced once one was. Both assertions follow the rename, in the same commit that makes it.grep -rni 'rubro\|subrubro\|perfilamiento'overapps/,packages/andtools/seed/src/data/base/explanations/returns nothing, and so does a sweep for the Chilean tax-id formats (76123456-7,12345678-9,76.123.456-7).Known gap: the user manual (
user_manual/**,.claude/user-manual-plugin/data/**) still saysRubro. Its slides embed screenshots of the old sidebar, so text-only edits would contradict the images — it needs a screenshot pass against a running RD environment and is left out of this stack deliberately.