Only GET of a published page, a page image and an active company's branding, each anchored to its exact shape. Writes still need a token. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EFUzfiCVCgCVJZq4NDEqZs
5.7 KiB
5.7 KiB
Tasks: add-landing-pages
Design: design.md and docs/superpowers/specs/2026-12-02-landing-pages-design.md.
- Every task is TDD. Ported tasks first list the babyboo rules they port (
openspec/specs/cms-pages,admin-portal-cms-pages-uiand theCmsBlockstests in~/Projects/babyboo), turn them into failing tests, then build. - The owner said no workers, so everything runs serially in the main session with a self-review per task.
Verify commands:
- Backend:
mvn -T 1C -B -q -pl <modules> -am verify. - Portal:
cd solvway-admin-portal && npx vitest run; echo VITEST=$? && npx tsc --noEmit && npm run lint(check the vitest exit code).
1. Data
- 1.1 SQL in
sql/:01-pages.sql:cms_pageandpage_imagein the counter schema, withcompany_id, and a unique key on the company and the lower-cased slug;02-event-lead-web.sql:page_path,utm_source,utm_mediumandutm_campaignon the event lead;03-company-branding.sql:logo_image_idandaccent_coloroncompany;04-module.sql:BO_PAGES, under the Events menu, granted to no role;99-rollback.sql.- Mirror 01 to 04 into
local/seed/. - Verify: load the seed into a throwaway local MySQL volume and list the tables, columns and module.
2. services-counter
- 2.1 Page model, validation and endpoints:
- save, which replaces the blocks;
- find by id within a company, list within a company with search, delete;
- find a published page by company and slug, ignoring case.
- Port babyboo's field, block, link and limit rules, plus the script checks and the company checks on images and FORM events.
- 2.2 Page images:
- upload (magic-byte check, 2 MB limit, company);
- read by id, returning the bytes and the content type.
- 2.3 Registration:
- source
WEBwithpagePathand the UTM values, each cut to 100 characters; - a WEB registration never sets the attended time;
- its notes say "Registered by web page with: …".
- Verify (2.1 to 2.3):
mvn -T 1C -B -q -pl solvway-services-counter -am verify
- source
3. services-system
- 3.1 Company
logoImageIdandaccentColor:#RRGGBBvalidation;- a read of the branding by company code, with no user data.
- Verify:
mvn -T 1C -B -q -pl solvway-services-system -am verify
4. Gateway
- 4.1 Open paths for the published page read, the image read and the branding read. Tests show that page writes and image uploads still need a token.
- Security code: read the whole diff.
- Verify:
mvn -T 1C -B -q -pl solvway-api-gateway -am verify
5. mobile-api
- 5.1
/api/admin/pages/**and/api/admin/page-images(BO_PAGES):- company scoping as on the other admin screens, with a super admin choosing a company on create;
- saves and deletes audited;
- field errors relayed with their path.
- 5.2 Public endpoints
/api/public/pages/{company}/{slug}(published page and branding),/api/public/page-images/{id}andPOST /api/public/pages/{company}/{slug}/form/{block}:- the submit finds the FORM block's event;
- it applies the QR flow's conditions, normalisation and abuse limits;
- it registers with source WEB.
- 5.3 The company endpoints carry
logoImageIdandaccentColor. The event lead detail carriessource,pagePathand the UTM values.- Verify (5.1 to 5.3):
mvn -T 1C -B -q -pl solvway-mobile-api -am verify
- Verify (5.1 to 5.3):
6. Portal
- 6.1 Route handlers for
app/api/pages/**andapp/api/page-images/**, the public page and image proxies,routeModules, and the sidebar entry with its icon.- The upstreamQuery, upstreamPath and hardcodedCopy sweeps stay green.
- 6.2 The Pages list at
/pages: title, address, status, updated time and search, with a Company column for a multi-company scope. - 6.3 The page editor ported from babyboo's
PageEditorandBlockFields:- Tiptap (new dependency, babyboo's versions);
- image upload on save;
- the FORM event picker;
- field errors at their fields;
- the view link, the delete confirmation and the unsaved-edits guard;
- the draft preview at
/pages/{id}/preview.
- 6.4 The public page
/p/[company]/[slug]:- a server component with metadata;
- blocks ported from babyboo's
CmsBlocks; sanitize-html(new dependency) with an allow-list;- the branding header and the accent button with contrast text;
- the form block using
RegistrationForm, with the UTM tags and the closed state; isPublicPathcovers/p, and the not-found page is the same for every miss.
- 6.5 Branding fields on Companies: logo upload and accent colour. Event lead detail: the page address and UTM values. The source label is Web page.
- 6.6 Labels in
defaultMessages.tswith Chinese inzh_CN.seed.json, thennpm run i18n:sql. This change'ssql/05-page-labels.sqlholds only the new labels.- Verify (6.1 to 6.6): portal verify.
7. Release
- 7.1
docs/deployment.md:- the SQL order and the module;
- the public hostname and its route;
- creating each company's standing "enquiries" event;
- the image ceiling;
- the two new dependencies.
- 7.2 Live Playwright check on the local stack, at 1280 and 360 px:
- build the INS page from the proof of concept's content in the editor;
- publish it, then open it signed out;
- submit the form with UTM tags, then see the event lead with source Web page, not attended, with page and campaign;
- draft not found for visitors, preview for staff;
- a script link refused at its field;
- another company's event not offered;
- branding colour and logo;
- the closed form after the event ends.
- 7.3 Whole-branch self-review (security: the gateway, sanitising and the public submit), then the PR to main and the merge.
Workflow Follow-Up
- Archive after
add-zh-cn-messages, because of the sidebar delta.