task-h.5.3

This commit is contained in:
phaichayon
2026-06-19 17:15:28 +07:00
parent fd01ebf7c7
commit 51d67ef7c2
35 changed files with 4301 additions and 633 deletions

View File

@@ -0,0 +1,33 @@
# Task H.5.3: PDF Template Version Remap + Static Labels
## Outcome
- created active `1.1` quotation PDF template versions for both `ALLA` and `ONVALLA`
- retained historical `1.0` versions as inactive records
- rebuilt active mappings from the current template inventory instead of copying the old version wholesale
- restored runtime values for `tel_label`, `email_label`, `att_label`, `project_label`, and `site_label`
## Field Inventory Result
- deleted from previous version: `exclusion_data`, `exclusion_label`
- new active templates keep dynamic topic bases `topic` and `data_topic`
- designer-owned static visuals such as `line`, `quotation_date_labe`, and `quotation_code_lable` remain classified but unmapped
- compatibility tokens `quotation_price` and `currency` remain mapped because the active price table still embeds those placeholders
## Seed / Remap Flow
- `npm run seed:pdf-template-version` reads the latest JSON from `src/pdfme_template/*.json`
- if the schema already exists in DB, it re-activates and reconciles mappings idempotently
- if the schema is new, it creates the next minor version, activates it, and deactivates the previous active version
- mappings are rebuilt only for fields or tokens still present in that target version
## Verification
- `npx tsc --noEmit` passed
- `npm run seed:pdf-template-version` passed
- `npm run audit:pdf` passed with overall status `PASS`
## Remaining Risks
- active templates still rely on compatibility tokens `quotation_price` and `currency` inside the table content; those should be removed only in a future controlled template revision
- the audit fixture now points to active `1.1`; production-approved historical quotations still need operator discipline so their stored template version is never rewritten manually