diff --git a/docs/deployment.md b/docs/deployment.md index 23e516b..aeee69e 100644 --- a/docs/deployment.md +++ b/docs/deployment.md @@ -134,6 +134,14 @@ Run both, in order, before the new images go live: the new services-counter read Run both before `service-whatsapp` starts. Give the services' database user the same rights on `service-whatsapp` as on the other schemas. `99-rollback.sql` in the same folder removes the modules and drops the schema with every stored chat. +| File | What it does | +|---|---| +| `openspec/changes/archive/-add-zh-cn-messages/sql/01-locales.sql` | Creates `service-system`.`supported_locale` (the languages staff can pick: English and 简体中文 on; Malay, Traditional Chinese and Indonesian off) and `catalog_meta` (the label catalog version). DDL. | +| `openspec/changes/archive/-add-zh-cn-messages/sql/02-modules.sql` | Adds the back-office modules `BO_MESSAGES` (Translations) and `BO_LOCALES` (Languages) under System. No role gets them; super admins grant them under Roles. | +| `openspec/changes/archive/-add-zh-cn-messages/sql/03-zh-cn-messages.sql` | Loads the first-pass Chinese for every back-office label into `service-system`.`message`: inserts the labels that are missing, sets their Chinese, gives four rows (`LogIn`, `Member`, `Tree`, `Wallet`) the back office's English, and bumps the catalog version. Generated; run it once. | + +Run the three in order before the new services-system, gateway and mobile-api go live. `01` needs a user that may create tables. Run `03` once only: it overwrites the Chinese of every back-office label, so running it again after staff have edited translations undoes their edits. `99-rollback.sql` in the same folder drops the two tables and removes the modules; the Chinese stays in `message`, which the previous images never read. + **Review the privacy notice before go-live.** The seeded text is a starting template written for the PDPA, not legal advice. INS and CV should each have theirs checked; a super admin changes it under **Companies → Privacy notice**. A company with no notice has no working QR codes. **Database user:** @@ -377,6 +385,8 @@ data: - **Other Tastefully defaults.** The sender addresses in `service-email` and the `CUSTOMER_PORTAL_BASE_URL` fallback point at Tastefully. Override them as described in section 6. - **Leaked SMS key.** An SMS360 API key from Tastefully was in `service-email`'s config and is in git history. It has been removed from the config, but it must be rotated with SMS360 before go-live, by whoever owns that Tastefully account. - **Deploy by SHA, not `latest`.** CI pushes the images one by one, so if a push fails halfway, `latest` can differ between images. +- **Chinese labels.** Staff switch the back office to 简体中文 with the language switcher, including on the sign-in page. The Chinese is a first pass, not checked by a native speaker. Grant `BO_MESSAGES` to the reviewer's role: under **Translations**, the **Missing Chinese** filter lists labels with no Chinese or with English copied in, and a saved change shows on the next page load. Export and Import move all labels through a JSON file for review offline; import matches labels by code and never adds or removes languages. Grant `BO_LOCALES` only to whoever decides which languages staff can pick: English cannot be switched off. Only the back office is translated; visitor pages and emails keep their own wording. +- **Gateway paths for labels.** The gateway used to let every `/message/` path through without a user token. It now lets through only the label reads (`/message/catalogVersion`, `/message/getAllMessages/`, `/message/getMessageJsonByAreaAndLocale//`, `/message/getMessageJsonForMobile/...`, the code lookups) and `GET /locale/findAllEnabled`. Saving, searching and the language writes need the user token mobile-api forwards. The gateway also gains a `/locale/**` route to services-system. - **WhatsApp roles.** Staff need `BO_WHATSAPP` to see the inbox and their own chats. A WhatsApp admin needs both `BO_WHATSAPP` and `BO_WHATSAPP_ADMIN`: the menu entry and the page need the first, and the second adds every chat of the company, owner changes and template sync. A chat's owner is set automatically to the salesperson of the newest lead with that mobile number; an admin can set an owner by hand, which sticks until "Automatic" is chosen again. A user who is disabled or loses `BO_WHATSAPP` loses their chats to Unassigned. - **WhatsApp limits at go-live.** - Lists and chats refresh by polling (30 s for the list and the badge, 10 s for an open chat), not instantly. diff --git a/openspec/changes/add-zh-cn-messages/tasks.md b/openspec/changes/add-zh-cn-messages/tasks.md index 6c3823f..4e7f37e 100644 --- a/openspec/changes/add-zh-cn-messages/tasks.md +++ b/openspec/changes/add-zh-cn-messages/tasks.md @@ -54,7 +54,7 @@ Verify commands: ## 7. Release -- [ ] 7.1 `docs/deployment.md`: the SQL order, the modules, the first-pass note for the native-speaker review, and the gateway narrowing. +- [x] 7.1 `docs/deployment.md`: the SQL order, the modules, the first-pass note for the native-speaker review, and the gateway narrowing. - [ ] 7.2 Live Playwright check on the local stack, at 1280 and 360 px: - switch to 简体中文 and walk every sidebar page; - English unchanged after sign-in ("Log in");