Reads the shoot packages and an optional banner from the CMS at build time
The build asks GET /api/v1/offerings and bakes the packages into the pages, with a committed snapshot as fallback so a CMS outage never breaks the build or shows an empty price. The form choices and ?pakket= use the same list. An offering with layout=banner becomes an optional band under the price cards. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
# AI-DLC State Tracking
|
||||
|
||||
## Project Information
|
||||
- **Feature Name**: ASF packages and banner from the CMS (build-time)
|
||||
- **Feature Slug**: asf-packages-cms
|
||||
- **Project Type**: Brownfield
|
||||
- **Start Date**: 2026-11-12
|
||||
- **Current Stage**: CONSTRUCTION - code generated, awaiting CMS data on ASF-test for a test deploy
|
||||
- **Branch**: feature/asf-packages-cms (from feature/contact-form-cms 7737104; merge order: contact-form-cms first)
|
||||
- **Worktree**: K:\Development\SlpSoftware\Projects\AndreaSlopFotografie-packages
|
||||
|
||||
## Language Configuration
|
||||
- **Documentation Language**: English
|
||||
- **Conversation Language**: User Language (Dutch)
|
||||
- **Source**: aidlc-docs/language-preference.md
|
||||
|
||||
## Extension Configuration
|
||||
- Security Baseline: Yes (inherited from contact-form-cms)
|
||||
- Property-Based Testing: Partial (inherited)
|
||||
|
||||
## Operations Configuration
|
||||
- **Include Operations Phase**: No for now (deployment is the existing CI; rebuild trigger is a pending decision by Bryan)
|
||||
|
||||
## Stage Progress
|
||||
- [x] INCEPTION - Workspace Detection, Requirements (approved by SLP Software - SLS - Main for Bryan, 2026-11-12)
|
||||
- [x] INCEPTION - Workflow Planning (single unit: build step + site wiring)
|
||||
- [x] CONSTRUCTION - Functional Design (see requirements.md, design recorded there; approved: snapshot fallback, one source, banner as own block)
|
||||
- [x] CONSTRUCTION - Code Generation (build step, mapping, snapshot, banner, tests)
|
||||
- [ ] CONSTRUCTION - Build and Test on ASF-test with real CMS data (blocked: Offerings module + 3 packages in the ASF-test CMS, asked of the CMS session)
|
||||
- [ ] OPERATIONS - rebuild trigger (webhook or nightly) decided by Bryan
|
||||
@@ -0,0 +1,25 @@
|
||||
# Requirements and design: packages and banner from the CMS
|
||||
|
||||
Decided by Bryan via SLP Software - SLS - Main, 2026-11-12. Source of truth: the CMS API `GET /api/v1/offerings` (fields: id, slug, title, description, price as free text, priceNote, features[], ctaLabel, featured, displayOrder, categoryId, category, layout `card|banner`; at most one banner per site).
|
||||
|
||||
## Requirements
|
||||
- FR-PK-01 The build asks the CMS for the offerings and bakes them into the pages (prices in the HTML and in the structured data). The browser never calls the offerings API.
|
||||
- FR-PK-02 Fallback: with no address, an unreachable CMS or an answer without a valid package the committed snapshot (`src/content/offerings.snapshot.json`, the three packages) is used. The build never fails because of the CMS and never shows an empty or wrong price. The log names the source.
|
||||
- FR-PK-03 One source: the price cards, the "welke shoot" choices of the contact form and the `?pakket=` check use the same list (`content/packages.ts`).
|
||||
- FR-PK-04 Mapping: `slug` is the package id (kept `zwangerschap`, `newborn`, `gezin`: they appear in `?pakket=` and the form), `title` the name, the price text is read as whole euros ("€ 175", "€ 1.250", "175,-"); a card with an unreadable price, no features or a bad slug is skipped; order by `displayOrder`.
|
||||
- FR-PK-05 Banner: the first usable offering with `layout=banner` becomes an optional dark band under the cards (own block, price as free text). It is not a package: not in the form choices, not in the package count, no booking link with a package.
|
||||
- FR-PK-06 The rebuild trigger (CMS change leads to a new build) is separate from the build; decision for Bryan (webhook to workflow_dispatch or a nightly build). Until then a change shows after the next build.
|
||||
- NFR-PK-01 Tests use the snapshot only (no dependence on a build or network).
|
||||
|
||||
## Design
|
||||
- `web/config/offerings.ts` pure mapping and validation (unit and property tests).
|
||||
- `web/config/fetchOfferings.ts` build step (`pnpm build` runs it first): `OFFERINGS_URL` (the site's own address serving the API), 10 s timeout, 2 attempts, writes the gitignored `src/content/offerings.generated.json`.
|
||||
- `web/src/content/packages.ts` picks generated data (build) or the snapshot (tests, missing file).
|
||||
- CI: the Build step gets `OFFERINGS_URL` from the repo variable `ASF_OFFERINGS_URL`. The artifact built there is also what goes to production, so the variable must point to the CMS holding the real data.
|
||||
- `PriceBanner` component inside `Pricing`.
|
||||
|
||||
## Open
|
||||
- Offerings module on the ASF-test host and the three packages in the ASF-test CMS (asked of the CMS session; 2026-11-12 the endpoint answered 404 on test.andreaslop.nl).
|
||||
- Repo variable `ASF_OFFERINGS_URL` (who sets it: Bryan or SLS).
|
||||
- Rebuild trigger.
|
||||
- ASF production CMS address does not exist yet.
|
||||
Reference in New Issue
Block a user