From 30dab1af42bc3b7a52687f42f0b66b77cd060171 Mon Sep 17 00:00:00 2001 From: Sluijsens Date: Tue, 20 Oct 2026 01:07:36 +0200 Subject: [PATCH] Adds the Prijzen section to the homepage Shows the three live packages as cards with their price and what is included. Each card links to the contact section with ?pakket=, so the contact form can preselect it. Invalid packages from the CMS are skipped and the pakket value is only accepted when it names a package. Co-Authored-By: Claude Opus 5.5 --- .../features/homepage-sections/aidlc-state.md | 10 +- .../features/homepage-sections/audit.md | 100 ++++++++++++++++++ .../plans/prijzen-code-generation-plan.md | 62 +++++++++++ .../plans/prijzen-fd-questions.md | 50 +++++++++ .../plans/prijzen-functional-design-plan.md | 11 ++ .../construction/prijzen/code/code-summary.md | 51 +++++++++ .../functional-design/business-logic-model.md | 53 ++++++++++ .../functional-design/business-rules.md | 65 ++++++++++++ .../functional-design/domain-entities.md | 64 +++++++++++ .../functional-design/frontend-components.md | 48 +++++++++ web/src/app.test.tsx | 14 +++ web/src/assets/home/deco-1.png | Bin 0 -> 15491 bytes web/src/assets/home/deco-2.png | Bin 0 -> 42786 bytes .../home/Pricing/PriceCard.test.tsx | 45 ++++++++ web/src/components/home/Pricing/PriceCard.tsx | 98 +++++++++++++++++ .../components/home/Pricing/Pricing.test.tsx | 67 ++++++++++++ web/src/components/home/Pricing/Pricing.tsx | 73 +++++++++++++ web/src/content/homeContent.ts | 10 ++ web/src/content/packages.ts | 38 +++++++ web/src/content/types.ts | 15 +++ web/src/lib/bookLabel.test.ts | 33 ++++++ web/src/lib/bookLabel.ts | 19 ++++ web/src/lib/formatPrice.test.ts | 32 ++++++ web/src/lib/formatPrice.ts | 12 +++ web/src/lib/packageFromSearch.test.ts | 95 +++++++++++++++++ web/src/lib/packageFromSearch.ts | 14 +++ web/src/lib/visiblePackages.test.ts | 73 +++++++++++++ web/src/lib/visiblePackages.ts | 29 +++++ web/src/recipes/linkButton.ts | 10 ++ web/src/routes/index.tsx | 9 ++ web/src/test/arbitraries.ts | 50 ++++++++- web/src/theme.ts | 6 ++ 32 files changed, 1250 insertions(+), 6 deletions(-) create mode 100644 aidlc-docs/features/homepage-sections/construction/plans/prijzen-code-generation-plan.md create mode 100644 aidlc-docs/features/homepage-sections/construction/plans/prijzen-fd-questions.md create mode 100644 aidlc-docs/features/homepage-sections/construction/plans/prijzen-functional-design-plan.md create mode 100644 aidlc-docs/features/homepage-sections/construction/prijzen/code/code-summary.md create mode 100644 aidlc-docs/features/homepage-sections/construction/prijzen/functional-design/business-logic-model.md create mode 100644 aidlc-docs/features/homepage-sections/construction/prijzen/functional-design/business-rules.md create mode 100644 aidlc-docs/features/homepage-sections/construction/prijzen/functional-design/domain-entities.md create mode 100644 aidlc-docs/features/homepage-sections/construction/prijzen/functional-design/frontend-components.md create mode 100644 web/src/assets/home/deco-1.png create mode 100644 web/src/assets/home/deco-2.png create mode 100644 web/src/components/home/Pricing/PriceCard.test.tsx create mode 100644 web/src/components/home/Pricing/PriceCard.tsx create mode 100644 web/src/components/home/Pricing/Pricing.test.tsx create mode 100644 web/src/components/home/Pricing/Pricing.tsx create mode 100644 web/src/content/packages.ts create mode 100644 web/src/lib/bookLabel.test.ts create mode 100644 web/src/lib/bookLabel.ts create mode 100644 web/src/lib/formatPrice.test.ts create mode 100644 web/src/lib/formatPrice.ts create mode 100644 web/src/lib/packageFromSearch.test.ts create mode 100644 web/src/lib/packageFromSearch.ts create mode 100644 web/src/lib/visiblePackages.test.ts create mode 100644 web/src/lib/visiblePackages.ts diff --git a/aidlc-docs/features/homepage-sections/aidlc-state.md b/aidlc-docs/features/homepage-sections/aidlc-state.md index 952c15b..9c80103 100644 --- a/aidlc-docs/features/homepage-sections/aidlc-state.md +++ b/aidlc-docs/features/homepage-sections/aidlc-state.md @@ -5,7 +5,7 @@ - **Feature Slug**: homepage-sections - **Project Type**: Brownfield - **Start Date**: 2026-10-19T19:19:38Z -- **Current Stage**: CONSTRUCTION - Unit 2 Over mij - Code Generation (awaiting approval) +- **Current Stage**: CONSTRUCTION - Unit 3 Prijzen - Code Generation (awaiting approval) - **Branch**: feature/homepage-sections ## Workspace State @@ -62,11 +62,11 @@ - [x] Units Generation - EXECUTE (approved) ### ๐ŸŸข CONSTRUCTION PHASE -- [ ] Functional Design - EXECUTE (Prijzen, Lieve woorden, Contact) / SKIP (Lifestyle fotografie, Over mij, Instagram) +- [ ] Functional Design - EXECUTE (Prijzen โœ…, Lieve woorden, Contact) / SKIP (Lifestyle fotografie, Over mij, Instagram) - [ ] NFR Requirements - SKIP - [ ] NFR Design - SKIP - [ ] Infrastructure Design - SKIP -- [ ] Code Generation - EXECUTE (per unit) โ€” Unit 1 Lifestyle fotografie โœ… (approved) +- [ ] Code Generation - EXECUTE (per unit) โ€” Unit 1 Lifestyle fotografie โœ…, Unit 2 Over mij โœ… (desktop review deferred by user) - [ ] Build and Test - EXECUTE ### ๐ŸŸก OPERATIONS PHASE @@ -74,8 +74,8 @@ ## Current Status - **Lifecycle Phase**: CONSTRUCTION -- **Current Stage**: Unit 2 Over mij โ€” Code Generation complete, awaiting approval -- **Next Stage**: Unit 3 Prijzen โ€” Functional Design +- **Current Stage**: Unit 3 Prijzen โ€” Code Generation complete, awaiting approval +- **Next Stage**: Unit 3 Prijzen โ€” Code Generation ## Reverse Engineering Status - [x] Reverse Engineering - Artifacts refreshed on 2026-10-19T19:19:38Z at commit 38c5c3e (approved 2026-10-19T19:31:00Z) diff --git a/aidlc-docs/features/homepage-sections/audit.md b/aidlc-docs/features/homepage-sections/audit.md index 86c1ab9..f18d5d4 100644 --- a/aidlc-docs/features/homepage-sections/audit.md +++ b/aidlc-docs/features/homepage-sections/audit.md @@ -305,3 +305,103 @@ Nou is het nog een statische site zonder back-end dus het contactformulier kan n **Context**: CONSTRUCTION - Unit 2 Code Generation (complete, awaiting approval) --- + +## Unit 2 Over mij โ€” Approval + +**Timestamp**: 2026-10-20T01:25:00Z + +**User Input**: "Op mobiel ziet het er goed uit. Op desktop kan ik nu niet goed zien. Dus als ik daar issues mee heb zal ik het later via bugfixes oppakken.. ga verder" + +**AI Response**: "Unit 2 approved (desktop review deferred by the user; issues will come in as bug fixes). Proceeding to Unit 3 Prijzen โ€” Functional Design." + +**Context**: CONSTRUCTION - Unit 2 complete; Unit 3 start + +--- + +## Unit 3 Prijzen โ€” Functional Design Plan and Questions + +**Timestamp**: 2026-10-20T01:30:00Z + +**User Input**: (none โ€” AI-initiated) + +**AI Response**: "Created construction/plans/prijzen-functional-design-plan.md (7 steps) and prijzen-fd-questions.md with 5 questions: VAT note, accessible names for the three 'Boek je shoot' links, second click behaviour, keeping ?pakket in the URL, package without a price." + +**Context**: CONSTRUCTION - Unit 3 Functional Design (awaiting answers) + +--- + +## Unit 3 Prijzen โ€” Functional Design Answers + +**Timestamp**: 2026-10-20T01:40:00Z + +**User Input**: "1C +2b, mits dat past anders 2a. De knop moet 1 regel blijven. In ieder geval op desktop +3a +4b +5a" + +**AI Response**: "Recorded answers in prijzen-fd-questions.md. Interpretation: Q1 C โ€” Andrea uses the KOR, no VAT note. Q2 โ€” deterministic rule: visible 'Boek {name}' when the name is short enough to stay on one line down to a 320px phone (โ‰ค 14 characters), otherwise 'Boek je shoot' with the package name as visually hidden text; button never wraps. Q3 A โ€” last click wins. Q4 B โ€” ?pakket is removed from the URL (history replace, keeping #contact) as soon as the form has taken over the value; a reload no longer keeps the choice. Q5 A โ€” price required. Generating functional design artifacts." + +**Context**: CONSTRUCTION - Unit 3 Functional Design (answers received) + +--- + +## Unit 3 Prijzen โ€” Functional Design Complete + +**Timestamp**: 2026-10-20T01:55:00Z + +**User Input**: (none โ€” generation) + +**AI Response**: "Generated construction/prijzen/functional-design/: domain-entities.md (PricingPackage invariants, initial live data, KOR note), business-rules.md (BR-PRICE-01..03, BR-BOOK-01..03 with the 14-character label rule, BR-PARAM-01..04, two decision flowcharts, misuse notes), business-logic-model.md (booking sequence, four pure functions incl. new visiblePackages and bookLabel, 11 PBT properties, generators), frontend-components.md (Pricing, PriceCard, route validateSearch, accessibility). Prompt: Request Changes or Continue to Code Generation." + +**Context**: CONSTRUCTION - Unit 3 Functional Design (awaiting approval) + +--- + +## Unit 3 Prijzen โ€” Functional Design Approval + +**Timestamp**: 2026-10-20T02:00:00Z + +**User Input**: "Ga verder" + +**AI Response**: "Functional design approved. Proceeding to Code Generation Part 1 (planning) for unit 3." + +**Context**: CONSTRUCTION - Unit 3 Functional Design approved + +--- + +## Unit 3 Prijzen โ€” Code Generation Plan + +**Timestamp**: 2026-10-20T02:05:00Z + +**User Input**: (none โ€” AI-initiated) + +**AI Response**: "Created construction/plans/prijzen-code-generation-plan.md (17 steps): decorations copied, content types and data, four pure helpers with PBT, arbitraries, linkButton 'fit' size (nowrap, smaller phone padding), PriceCard, Pricing, route validateSearch, app tests, pnpm check with visual check at 1440/390/320, summary, commit. Prompt: approve plan or request changes." + +**Context**: CONSTRUCTION - Unit 3 Code Generation Part 1 (awaiting plan approval) + +--- + +## Unit 3 Prijzen โ€” Plan Approval + +**Timestamp**: 2026-10-20T02:08:00Z + +**User Input**: "Approve plan" + +**AI Response**: "Plan approved. Starting Code Generation Part 2." + +**Context**: CONSTRUCTION - Unit 3 Code Generation Part 2 (start) + +--- + +## Unit 3 Prijzen โ€” Code Generation Complete + +**Timestamp**: 2026-10-20T03:05:00Z + +**User Input**: (none โ€” generation) + +**AI Response**: "Executed all 17 steps. Step 13.5: tsc rejected search on chakra(Link) (route generics lost) โ€” switched the card link to TanStack's typed Link with the linkButton recipe via asChild; two test assertions corrected (NBSP normalisation, alt='' role); ESLint no-irregular-whitespace from escapes written as literal characters โ€” rewritten as escapes, src scanned. Visual check found the second decoration covered by the last card โ€” moved into the section's bottom padding. Final pnpm check green: 170 tests, 100% coverage on new lib files, Lighthouse home mobile 0.83โ€“0.89, desktop 1.0, a11y/BP/SEO 1.0. Committed locally (not pushed)." + +**Context**: CONSTRUCTION - Unit 3 Code Generation (complete, awaiting approval) + +--- diff --git a/aidlc-docs/features/homepage-sections/construction/plans/prijzen-code-generation-plan.md b/aidlc-docs/features/homepage-sections/construction/plans/prijzen-code-generation-plan.md new file mode 100644 index 0000000..7b282c6 --- /dev/null +++ b/aidlc-docs/features/homepage-sections/construction/plans/prijzen-code-generation-plan.md @@ -0,0 +1,62 @@ +# Code Generation Plan โ€” Unit 3: Prijzen + +**This plan is the single source of truth for Code Generation of unit 3.** + +## Unit context +- **Requirements**: FR-HP-04, FR-HP-11, FR-HP-12, NFR-HP-01/02/03/04/05/06 +- **Functional design**: [prijzen/functional-design/](../prijzen/functional-design/) โ€” BR-PRICE-01โ€ฆ03, BR-BOOK-01โ€ฆ03, BR-PARAM-01 (BR-PARAM-02โ€ฆ04 are carried out in unit 5) +- **Depends on**: unit 1 (`HomeSection`, `SectionHeading`, `Reveal`, `DeferredImage`, `ContentImage`) +- **Introduces for unit 5**: `PricingPackage`, `content/packages.ts`, `visiblePackages`, `packageFromSearch`, `pakket` search on `/` +- **PBT**: full enforcement โ€” properties from business-logic-model.md for all four helpers; generators per PBT-07. +- Conventions as in units 1โ€“2. + +## Steps + +### Assets and content +- [x] **Step 1** โ€” Copy `design/andreaslop-static/assets/img/deco-1.png` (143ร—112, 15 KB) and `deco-2.png` (239ร—224, 42 KB) unchanged to `web/src/assets/home/`. +- [x] **Step 2** โ€” `content/types.ts`: `PricingPackage { id; name; price; features }`; `HomeContent.pricing { title; lead; decorations: ContentImage[] }`. +- [x] **Step 3** โ€” `content/packages.ts`: the three live packages in live order (domain-entities.md). `content/homeContent.ts`: pricing title "Prijzen", lead "Pakketten", two decorations with `alt=""` and their sizes. + +### Pure helpers (each with example-based and property-based tests) +- [x] **Step 4** โ€” `lib/formatPrice.ts` (+ test): `Intl.NumberFormat('nl-NL', { style: 'currency', currency: 'EUR', maximumFractionDigits: 0 })`; ensures a non-breaking space after `โ‚ฌ` (BR-PRICE-01). Properties: digit round-trip, prefix and no regular space. +- [x] **Step 5** โ€” `lib/visiblePackages.ts` (+ test): invariants filter and first-wins de-duplication (BR-PRICE-02). Properties: every result valid, unique ids, subsequence, idempotent, oracle for valid unique input. +- [x] **Step 6** โ€” `lib/bookLabel.ts` (+ test): `BOOK_LABEL_MAX_NAME = 14`; `{ visible: 'Boek ' }` or `{ visible: 'Boek je shoot', hidden: ': ' }` (BR-BOOK-02). Properties: name always in the full text; visible form exactly per the length rule. +- [x] **Step 7** โ€” `lib/packageFromSearch.ts` (+ test): string only, trimmed, case-insensitive match โ†’ the package's id (BR-PARAM-01). Properties: result is undefined or a given id; any-case/whitespace oracle; non-strings undefined; idempotent. +- [x] **Step 8** โ€” `test/arbitraries.ts`: `pricingPackage` (valid), `uniquePackages`, `anyPackage` (incl. invalid: empty name, price 0 / negative / fractional / NaN, bad id, duplicates). + +### Styling +- [x] **Step 9** โ€” `recipes/linkButton.ts`: new `size` variant `fit` โ€” `white-space: nowrap`, horizontal padding 1.25 rem on phones and the design's 2.4 rem from `sm` (BR-BOOK-03); default size unchanged so the hero button stays as it is. Verify at an emulated 320 px phone that "Boek Zwangerschap" stays on one line inside the card. + +### Components +- [x] **Step 10** โ€” `components/home/Pricing/PriceCard.tsx`: `article` with h3, formatted price (`accent.deep`), feature list, `LinkButton` (`size="fit"`) to `/` with `search={{ pakket: id }}` and `hash="contact"`, label per `bookLabel` with `VisuallyHidden`; hover lift/border/shadow, none under reduced motion; `data-testid`s per frontend-components.md. +- [x] **Step 11** โ€” `components/home/Pricing/Pricing.tsx`: `HomeSection` (plain), decorations (`DeferredImage`, `aria-hidden`, positioned behind content), `SectionHeading` with lead, grid of `PriceCard`s from `visiblePackages` (1 column max 460 px centred below `lg`, 3 from `lg`), staggered `Reveal`; renders nothing when no package is valid. +- [x] **Step 12** โ€” `components/home/Pricing/Pricing.test.tsx` and `PriceCard.test.tsx`: region "Prijzen", three cards in order with h3, price `โ‚ฌ 175` etc., features as list items, link names "Boek Zwangerschap" / "Boek Newborn" / "Boek Gezin" with `href="/?pakket=#contact"`, long name โ†’ "Boek je shoot" + hidden name, invalid packages skipped, empty list โ†’ no section, decorations hidden from assistive technology, axe clean. + +### Route +- [x] **Step 13** โ€” `routes/index.tsx`: `validateSearch` โ†’ `{ pakket?: string }` (string kept, everything else dropped); render `Pricing` after `AboutBlock` with `homeContent.pricing` and `packages`. +- [x] **Step 14** โ€” `app.test.tsx`: "Prijzen" in the page-order check; `/?pakket=newborn` and `/?pakket=123` both render the homepage without errors. + +### Verification and wrap-up +- [x] **Step 15** โ€” `pnpm check` (coverage 100% for the new `lib/` files, Lighthouse); visual check desktop 1440 and phones 390 and 320. +- [x] **Step 16** โ€” `construction/prijzen/code/code-summary.md`. +- [x] **Step 17** โ€” Commit ("Adds the Prijzen section to the homepage" + attribution). Not pushed. + +## Requirement / rule traceability +| Item | Steps | +|---|---| +| FR-HP-04 | 2, 3, 10โ€“14 | +| BR-PRICE-01 | 4, 10 | +| BR-PRICE-02 | 5, 11 | +| BR-PRICE-03 | โ€” (no note rendered) | +| BR-BOOK-01 | 10, 12 | +| BR-BOOK-02 | 6, 10, 12 | +| BR-BOOK-03 | 9, 15 | +| BR-PARAM-01 | 7, 13, 14 | +| NFR-HP-01 | 10โ€“12, 15 | +| NFR-HP-03 / PBT | 4โ€“8, 12, 14, 15 | +| NFR-HP-05 | 1, 11, 15 | +| NFR-HP-06 | 2, 3 | + +## Extension compliance (planned) +- **Security**: `pakket` never reflected, only known ids come out (SECURITY-05 spirit for client input, SECURITY-11 misuse noted); no new dependencies or external resources. +- **PBT**: PBT-01 done in functional design; PBT-02 (round-trip formatPrice), PBT-03 (invariants), PBT-04 (idempotency), PBT-05 (oracles), PBT-07 (domain generators), PBT-08/09 (existing seed setup), PBT-10 (example tests alongside). PBT-06 N/A (no stateful component in this unit). diff --git a/aidlc-docs/features/homepage-sections/construction/plans/prijzen-fd-questions.md b/aidlc-docs/features/homepage-sections/construction/plans/prijzen-fd-questions.md new file mode 100644 index 0000000..4a0b964 --- /dev/null +++ b/aidlc-docs/features/homepage-sections/construction/plans/prijzen-fd-questions.md @@ -0,0 +1,50 @@ +# Functional Design Questions โ€” Unit 3: Prijzen + +Vul per vraag de letter in na `[Answer]:`. Past geen enkele optie, kies dan de laatste (Anders) en licht toe. Waar ik een voorkeur heb staat **(aanbevolen)**. + +## Vraag 1: BTW bij de prijzen +Voor consumenten moeten prijzen in Nederland inclusief btw getoond worden. Op de live site staat er niets bij. + +- A) De prijzen zijn inclusief btw; zet er een korte regel onder de kaarten: "Alle prijzen zijn inclusief btw." (aanbevolen, als Andrea btw rekent) +- B) De prijzen zijn inclusief btw; geen extra regel, net als nu op de live site +- C) Andrea valt onder de kleineondernemersregeling (KOR) en rekent geen btw; geen regel nodig +- X) Anders (beschrijf hieronder na de [Answer]:-tag) + +[Answer]: C + +## Vraag 2: Drie keer "Boek je shoot" +Elke kaart heeft een knop met dezelfde tekst. Een schermlezer die alle links opsomt, hoort dan drie keer "Boek je shoot" zonder te weten welk pakket. + +- A) Zichtbaar blijft "Boek je shoot"; voor schermlezers komt de naam van het pakket erbij ("Boek je shoot: Newborn"), via verborgen tekst. (aanbevolen) +- B) De zichtbare tekst wordt "Boek Newborn", "Boek Zwangerschap", enzovoort +- C) Zo laten, drie keer dezelfde tekst +- X) Anders (beschrijf hieronder na de [Answer]:-tag) + +[Answer]: B, mits dat past, anders A. De knop moet 1 regel blijven, in ieder geval op desktop. + +## Vraag 3: Nog een keer klikken +Een bezoeker klikt "Boek je shoot" bij Newborn, kiest in het formulier zelf toch "Gezin", scrolt terug en klikt "Boek je shoot" bij Zwangerschap. + +- A) De laatste klik wint: het formulier springt naar Zwangerschap. De bezoeker heeft immers net opnieuw gekozen. (aanbevolen) +- B) Wat de bezoeker zelf in het formulier koos, blijft staan; een klik vult alleen een lege keuze in +- X) Anders (beschrijf hieronder na de [Answer]:-tag) + +[Answer]: A + +## Vraag 4: `?pakket=` in de adresbalk +Na een klik staat bijvoorbeeld `andreaslop.nl/?pakket=newborn#contact` in de adresbalk. + +- A) Laten staan. De link is te delen ("boek een newbornshoot"), en een refresh houdt de keuze vast. (aanbevolen) +- B) Na het invullen van het formulier weghalen, zodat de adresbalk weer `andreaslop.nl/` toont; delen kan dan niet meer +- X) Anders (beschrijf hieronder na de [Answer]:-tag) + +[Answer]: B + +## Vraag 5: Pakket zonder prijs +Straks levert de API de pakketten. Wat als Andrea een pakket zonder vaste prijs toevoegt (bijv. een bruiloft)? + +- A) Prijs is altijd verplicht; een pakket zonder prijs kan niet (de API controleert dat). Eenvoudigst. (aanbevolen) +- B) Prijs is optioneel; zonder prijs toont de kaart "Prijs op aanvraag" +- X) Anders (beschrijf hieronder na de [Answer]:-tag) + +[Answer]: A diff --git a/aidlc-docs/features/homepage-sections/construction/plans/prijzen-functional-design-plan.md b/aidlc-docs/features/homepage-sections/construction/plans/prijzen-functional-design-plan.md new file mode 100644 index 0000000..e58c55f --- /dev/null +++ b/aidlc-docs/features/homepage-sections/construction/plans/prijzen-functional-design-plan.md @@ -0,0 +1,11 @@ +# Functional Design Plan โ€” Unit 3: Prijzen + +Scope: FR-HP-04 (cards, link with package), the package data that unit 5 reuses, and the `pakket` search parameter on `/`. Questions: [prijzen-fd-questions.md](prijzen-fd-questions.md). + +- [x] 1. Collect and analyze answers (follow-up questions if needed) +- [x] 2. `domain-entities.md` โ€” `PricingPackage`, its invariants (unique id slug, positive whole-euro price, non-empty features) and its relation to the contact form's shoot options +- [x] 3. `business-rules.md` โ€” price formatting, `pakket` search parameter (accepted values, unknown/invalid values, multiple values, case), link targets, what happens on a second "Boek je shoot" click, VAT note, accessible link names; decision flowchart +- [x] 4. `business-logic-model.md` โ€” flow from "Boek je shoot" via the URL to the preselected form value (unit 5 consumes it), and the pure functions `formatPrice` and `packageFromSearch` +- [x] 5. `frontend-components.md` โ€” `Pricing`, `PriceCard`, decorations; props, states (hover, focus, reduced motion), responsive layout, accessibility +- [x] 6. PBT-01 property identification for `formatPrice` and `packageFromSearch` (invariants, oracle, idempotency where relevant) +- [x] 7. Validate against FR-HP-04, NFR-HP-01/02/03/06 and the Security/PBT extensions diff --git a/aidlc-docs/features/homepage-sections/construction/prijzen/code/code-summary.md b/aidlc-docs/features/homepage-sections/construction/prijzen/code/code-summary.md new file mode 100644 index 0000000..a67b95c --- /dev/null +++ b/aidlc-docs/features/homepage-sections/construction/prijzen/code/code-summary.md @@ -0,0 +1,51 @@ +# Code Summary โ€” Unit 3: Prijzen + +Plan: [prijzen-code-generation-plan.md](../../plans/prijzen-code-generation-plan.md). Functional design: [../functional-design/](../functional-design/). Branch: `feature/homepage-sections`. + +## Files + +### Created +| File | Purpose | +|---|---| +| `web/src/assets/home/deco-1.png`, `deco-2.png` | Design decorations, unchanged (15 KB, 42 KB) | +| `web/src/content/packages.ts` | The three live packages (Zwangerschap 175, Newborn 185, Gezin 175) | +| `web/src/lib/formatPrice.ts` + test | `โ‚ฌ 175` with a non-breaking space (BR-PRICE-01) | +| `web/src/lib/visiblePackages.ts` + test | `isValidPackage` + filter with first-wins de-duplication (BR-PRICE-02) | +| `web/src/lib/bookLabel.ts` + test | "Boek " up to 14 characters, else "Boek je shoot" + hidden name (BR-BOOK-02) | +| `web/src/lib/packageFromSearch.ts` + test | `?pakket=` โ†’ known id or undefined (BR-PARAM-01) | +| `web/src/components/home/Pricing/Pricing.tsx` + test | The section: decorations, heading, card grid | +| `web/src/components/home/Pricing/PriceCard.tsx` + test | One package card with the booking link | + +### Modified +| File | Change | +|---|---| +| `web/src/content/types.ts` | `PricingPackage`; `HomeContent.pricing` | +| `web/src/content/homeContent.ts` | Pricing title, lead, decorations | +| `web/src/recipes/linkButton.ts` | `size: 'fit'` โ€” no wrapping, smaller side padding on phones (BR-BOOK-03); default unchanged | +| `web/src/theme.ts` | Shadow token `lift` for the card hover | +| `web/src/test/arbitraries.ts` | `pricingPackage`, `uniquePackages`, `anyPackage` | +| `web/src/routes/index.tsx` | `validateSearch` keeps `pakket` only as a string; renders `Pricing` after `AboutBlock` | +| `web/src/app.test.tsx` | "Prijzen" in the page order; `?pakket=newborn`, `?pakket=123` and `?pakket=