Files
co-lite/openspec/changes/add-page-drafts-and-templates/tasks.md
T

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 into local/seed/; apply locally.
  • 1.2 services-counter: draft on the entity and DTO, hasDraft on list rows; save rules for published pages; publish (re-validate, slug check) and discard endpoints; findPublished unchanged.
    • Verify: mvn -T 1C -B -pl solvway-services-counter -am verify
  • 1.3 mobile-api: POST /api/admin/pages/{id}/publish and /discard, scoped, refusals relayed like save.
    • Verify: mvn -T 1C -B -pl solvway-mobile-api -am 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.ts and zh_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

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.