Functional design, code generation plan and summary of the shared contact blocks, plus the coordination with the parallel features. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3.1 KiB
3.1 KiB
Domain Entities — Unit 2: Shared contact blocks
Entity relationships
graph TD
Site["SiteContent"] -->|"has"| Email["EmailAddress (user, domain)"]
Site -->|"has 0..n, in display order"| Social["SocialLink (platform, href, label?)"]
Site -->|"has"| FormCfg["contactForm (enabled, replyTime)"]
Social -->|"platform refers to"| Platform["socialPlatforms entry (name, icon)"]
Email -->|"becomes 0..1"| Channel["ContactChannel"]
Social -->|"becomes 0..1 when valid"| Channel
Packages["PricingPackage list"] -->|"gives"| Options["ShootOption list (+ Overig)"]
Panel["ContactPanel input"] -->|"uses"| FormCfg
Panel -->|"uses"| Options
Panel -->|"raw pakket"| Preselect["Preselect (shoot id, key)"]
classDef content fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000;
classDef derived fill:#FFA726,stroke:#E65100,stroke-width:1px,color:#000;
classDef registry fill:#e2e8f0,stroke:#4a5568,stroke-width:1px,color:#000;
class Site,Email,Social,FormCfg,Packages content;
class Channel,Options,Preselect,Panel derived;
class Platform registry;
Text alternative: site content holds the e-mail address, the social links and the form settings; each valid e-mail or social link becomes one contact channel; the packages give the shoot options; the panel combines form settings, options and the preselect derived from the raw package value.
Content entities (API-shaped, content/types.ts)
| Entity | Field | Type | Change | Notes |
|---|---|---|---|---|
SocialLink |
platform |
SocialPlatform |
— | facebook or instagram |
href |
string |
— | shown only as a valid https URL | |
label |
string? |
new | visible link text in the contact card; without it, the platform name | |
SiteContent |
contactForm.enabled |
boolean |
— | the gate switch |
contactForm.replyTime |
string |
new | e.g. "1-2 werkdagen"; one value for the thank-you and the contact page intro | |
socials |
SocialLink[] |
order changed | Instagram first, then Facebook (Q1 = A); footer follows |
Values in siteContent.ts
- Instagram:
hrefunchanged,label: '@andreaslopfotografie' - Facebook:
hrefunchanged,label: 'Andrea Slop Fotografie'(Q2 = A) contactForm: { enabled: false, replyTime: '1-2 werkdagen' }
Derived entities (pure, not stored)
ContactChannel (lib/contactChannels.ts)
| Field | Type | Meaning |
|---|---|---|
kind |
'email' | 'social' |
which kind of channel |
platform |
SocialPlatform? |
for social only; selects name and icon |
href |
string |
mailto: link with the default subject, or the profile URL |
label |
string |
visible link text |
external |
boolean |
true for socials: open in a new tab with the hidden hint |
ContactPanel input
idPrefix, packages, enabled, email, replyTime, raw pakket?, load: 'lazy' | 'eager' (see component-methods.md). The preselect { shoot, key } and the mail subject are derived inside, exactly as ContactSection does today.