From 4b090083fb227971961623f7dc990d3340a3fd16 Mon Sep 17 00:00:00 2001 From: ngqile Date: Mon, 30 Nov 2026 12:14:30 +0800 Subject: [PATCH] fix: address the email-listing branch review List each email once when the recipient join returns it twice. The proposal, design and handover now say Emails exposes every saved email, including member verification codes and form submissions, not only password emails. The design names the single catch-all proxy, the later-SQL table sits after the 04 check, and the seed header says the release package is frozen. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM --- docs/deployment.md | 6 +++--- local/seed/03-colite.sql | 2 ++ openspec/changes/add-admin-email-listing/design.md | 5 +++-- openspec/changes/add-admin-email-listing/proposal.md | 1 + .../com/solvway/mobile/api/service/AdminEmailService.java | 6 +++++- .../solvway/mobile/api/service/AdminEmailServiceTest.java | 8 ++++++++ 6 files changed, 22 insertions(+), 6 deletions(-) diff --git a/docs/deployment.md b/docs/deployment.md index eeb37a9..b0330e3 100644 --- a/docs/deployment.md +++ b/docs/deployment.md @@ -69,14 +69,14 @@ The Service names matter: read -rs PW; printf '%s' "$PW" | docker run --rm -i httpd:2.4-alpine htpasswd -inBC 10 "" | tr -d ':\n'; unset PW ``` +After running `04`, `SELECT LENGTH(password) FROM \`service-system\`.\`user\` WHERE id = 1;` must return 60. The administrator signs in as `admin` and must set a new password before anything else. + **Later SQL, after the package, in this order:** | File | What it does | |---|---| | `openspec/changes/archive/2026-11-30-add-admin-email-listing/sql/01-email-module.sql` | Adds the Emails back-office module (`BO_EMAILS`). | -After running `04`, `SELECT LENGTH(password) FROM \`service-system\`.\`user\` WHERE id = 1;` must return 60. The administrator signs in as `admin` and must set a new password before anything else. - **Database user:** - Create one user with `SELECT, INSERT, UPDATE, DELETE, EXECUTE` on the five schemas. EXECUTE is needed: service-member calls a stored function. - Every Java service reads the same variables (section 6): `MYSQLHOST`, `MYSQLPORT`, `MYSQLUSER`, `MYSQLPWD`. @@ -263,7 +263,7 @@ data: ## 10. Known gaps at go-live -- **No email provider yet.** Staff onboarding does not need one: the admin types each new user's first password, and "Set temporary password" on a user's page unlocks a user who forgot theirs. Both force a password change at the next sign-in. Forgot-password and "Send password reset" still create an email with a temporary password. Nobody receives it, but `service-email` saves every email first, so a super admin (or a role granted Emails) can read it under **Emails** and pass the password on in person. The user must change it at the next sign-in. Grant Emails narrowly: it shows every saved email, including other users' temporary passwords. +- **No email provider yet.** Staff onboarding does not need one: the admin types each new user's first password, and "Set temporary password" on a user's page unlocks a user who forgot theirs. Both force a password change at the next sign-in. Forgot-password and "Send password reset" still create an email with a temporary password. Nobody receives it, but `service-email` saves every email first, so a super admin (or a role granted Emails) can read it under **Emails** and pass the password on in person. The user must change it at the next sign-in. Grant Emails narrowly: it shows every saved email, including other users' temporary passwords, member email-verification codes, and contact or distributor form submissions with the sender's personal data. - **Reference data from Tastefully.** It still holds some Tastefully business text (message templates with a phone number, bank account and form links; a public image bucket URL; Tastefully usernames in audit columns). Review it before go-live. - **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. diff --git a/local/seed/03-colite.sql b/local/seed/03-colite.sql index 6e99652..1c04766 100644 --- a/local/seed/03-colite.sql +++ b/local/seed/03-colite.sql @@ -1,6 +1,8 @@ -- Local dev only. Applies the change SQL (company, BO modules) and creates one admin login. -- Admin login: admin / colite-dev-admin (dev password, documented in local/README.md). -- Keep the statements below in step with openspec/changes/*/sql/ (and the archive once archived). +-- The release package (add-release-ci-packaging/sql/03-colite.sql) is frozen; this seed equals that +-- package plus the later change SQL listed in docs/deployment.md section 3, plus the dev admin login. USE `service-system`; -- add-admin-auth-users-roles/sql/01-company.sql diff --git a/openspec/changes/add-admin-email-listing/design.md b/openspec/changes/add-admin-email-listing/design.md index eced65b..615f1d5 100644 --- a/openspec/changes/add-admin-email-listing/design.md +++ b/openspec/changes/add-admin-email-listing/design.md @@ -36,7 +36,7 @@ - `/emails` is a list page following the Lead Listing pattern: filters, a paged table, and newest first. A row opens `/emails/[id]`. - The detail page shows the metadata and the body in `