Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
3.5 KiB
3.5 KiB
Tasks
Design: design.md. All tasks run serially: each builds on the one before.
1. Data
- 1.1 Add the
BO_EMAILSmodule row (design decision 3) tolocal/seed/03-colite.sql, and keepsql/01-email-module.sqlin this change identical to it.- Apply the row to the running local database, a local-only, additive insert of the same statement.
- Check that the admin's menu gets an Emails entry.
- Scope:
local/seed/03-colite.sql,openspec/changes/add-admin-email-listing/sql/** - Verify: the row is present (
selectonmodule), and/api/admin/authmenu data includes/emailsfor the super admin.
2. Backend
-
2.1 mobile-api
AdminEmailControllerandAdminEmailService(design decision 1).Tests first:
- List:
- it sends only the given properties, sorted by
datetimedescending; fromandtoare converted to dd-MM-yyyy;- rows map to id, datetime, recipient addresses, subject and status;
- no
bodykey in any row.
- it sends only the given properties, sorted by
- Detail:
- it returns the body and recipients;
- an empty upstream body gives 404
EMAIL_NOT_FOUND; - a non-super caller and a super-admin recipient give 403
SUPER_ADMIN_REQUIRED; - a non-super caller and a non-super recipient succeed;
- a super-admin caller skips the recipient lookup;
- the audit line has the id and username but not the body.
- Controller: class-level
@AdminModule("BO_EMAILS"), and the endpoints map their parameters.
Live check through the gateway as the dev admin:
- trigger forgot-password for a made-up local admin;
- list the emails, open that one, and read the password;
- as a made-up non-super admin with
BO_EMAILS, get 403 on an email to the super admin; - as
noevents(noBO_EMAILS), get refused. - Scope:
solvway-mobile-api/src/**(new admin email files, the email constants, tests) - Verify:
mvn -T 1C -B -q -pl solvway-mobile-api -am verify
- List:
3. Portal
-
3.1
/emailslist and/emails/[id]detail (design decision 2): proxy routes, a service and i18n keys.Tests first:
- List:
- it renders the rows newest first;
- the filters go into the query;
- paging;
- a row links to its detail.
- Detail:
- it shows the metadata;
- the body is in an iframe with an empty
sandboxandsrcDoc, and not in the page DOM; - 404 shows not-found;
- 403 shows the super-admin message.
- Proxy routes: they forward the query and the id, and pass refusals through with their code.
- Module gate:
RequireModulegates both pages. - Scope:
solvway-admin-portal/app/emails/**,solvway-admin-portal/app/api/emails/**,solvway-admin-portal/app/lib/** - Verify:
cd solvway-admin-portal && npx vitest run && npx tsc --noEmit && npm run lint && npm run build
- List:
4. Check and docs
- 4.1 Browser check and handover.
- Playwright on the local stack:
- as admin, trigger forgot-password for a made-up user;
- open Emails, find it, open it, and read the password in the frame;
- sign in with that password and get the forced change;
- as a made-up non-super admin with
BO_EMAILS, open an email to the super admin and see the refusal; - as
noevents, see no Emails menu entry, and see Not authorized at/emails; - check both pages at 360px.
- Docs:
docs/deployment.mdsection 3 (the new SQL file) and section 10 (the workaround). - Scope:
docs/deployment.md - Verify: screenshots, and the steps above observed.
- Playwright on the local stack:
Workflow follow-up
- Whole-branch review, push, PR to main and merge, then archive on its own branch.