1.1 KiB
1.1 KiB
Implementer — F-026 CMS module
Summary
Implemented simple CMS module with slug-based public pages and draft/publish states. Slug uniqueness enforced at DB level. Admin operations require admin role.
Files changed
project/migrations/020_cms.jsproject/src/modules/cms/**project/src/app/build-app.ts
Acceptance evidence
- AC1 published page:
cms-service.test.tsreturns page for published status. - AC2 draft page: same test rejects with
PageNotPublishedError. - AC3 duplicate slug: schema enforces UNIQUE (slug); repository uses ON CONFLICT DO NOTHING and service throws DuplicateSlugError.
Commands run
cd project && npm run lint/typecheck/build/testpassedcd project && TEST_DATABASE_URL='postgres://mdv:mdv_dev_only@localhost:5432/mdv_test' npm run test:integration -- migrations.itestpassed; 14 files, 53 tests./scripts/verify.shpassed
Notes
- Slugs restricted to kebab-case via zod regex.
- Public store front consumption is out of scope for this slice; service exposes
getPublicPageBySlugwhich throws when status is not 'published'.