Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EFUzfiCVCgCVJZq4NDEqZs
1.8 KiB
1.8 KiB
Tasks: add-page-drafts-and-templates
Design: design.md and docs/superpowers/specs/2026-12-03-page-builder-design.md (change 2). Every task is TDD. Work is serial in the main session, with a self-review per task.
1. Data and services
- 1.1 SQL:
sql/01-page-draft.sql,sql/99-rollback.sql; mirror 01 intolocal/seed/; apply locally. - 1.2 services-counter:
drafton the entity and DTO,hasDrafton list rows; save rules for published pages; publish (re-validate, slug check) and discard endpoints;findPublishedunchanged.- Verify:
mvn -T 1C -B -pl solvway-services-counter -am verify
- Verify:
- 1.3 mobile-api:
POST /api/admin/pages/{id}/publishand/discard, scoped, refusals relayed like save.- Verify:
mvn -T 1C -B -pl solvway-mobile-api -am verify
- Verify:
2. Portal
- 2.1 BFF routes for publish and discard; services; the editor loads the draft, the published-page banner with Publish changes and Discard changes (confirm); preview shows the draft; list badge.
- 2.2 Templates (
pageTemplates.ts, with a rules test) and the start picker on New page; Duplicate in the list and editor. - 2.3 Labels in
defaultMessages.tsandzh_CN.seed.json,npm run i18n:sql,sql/02-draft-template-labels.sql; rollback lines.- Verify (2.1 to 2.3):
cd solvway-admin-portal && npx vitest run; echo VITEST=$? && npx tsc --noEmit && npm run lint
- Verify (2.1 to 2.3):
3. Release
- 3.1
docs/deployment.md: SQL rows (01 before services-counter starts), the draft behaviour for staff. - 3.2 Live check (Playwright), on disposable pages: edit a published page and save (the visitor still sees the old version, preview shows the new); Publish changes; Discard changes; New page from each template (refused without an event, then saved); Duplicate; 1280 and 360 px.