Privacy policy link in the footer and checkout, notes hint, and a policy draft

Site design → Footer picks the privacy policy page; it is linked from the footer and from a short notice above Pay. The notes field asks customers not to write health details (special-category data). 'Create a privacy policy draft' makes an unpublished page describing what this software does with customer data, with gaps for the studio to fill in. No consent checkbox: booking data is processed to perform the contract. Also adds the PrivacyGlobal type used by the retention settings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VaXE9U7AmW3dfD2w6cbLfk
This commit is contained in:
agent 2026-10-24 10:44:45 +00:00
parent 73e8c5dc5d
commit 5828d65a00
7 changed files with 129 additions and 5 deletions

View file

@ -3,7 +3,7 @@
import { browser } from '$app/environment';
import { goto } from '$app/navigation';
import { page } from '$app/state';
import type { BasketLine, CheckoutBlockData } from '$shared/types';
import { DEFAULT_NOTES_HINT, DEFAULT_PRIVACY_NOTICE, type BasketLine, type CheckoutBlockData } from '$shared/types';
import { getBasketContext } from '$shared/basket.svelte';
import { DEFAULT_TIMEZONE, formatInstant, formatPrice } from '$shared/calendar';
import { loadStripe } from '$shared/stripe-client';
@ -12,6 +12,8 @@
let { data = {} } = $props<{ data: CheckoutBlockData }>();
const basket = getBasketContext();
// Not set in the admin preview, which has no footer data.
const privacyPage = $derived(page.data.footer?.privacyPage || '');
const customer = $state({ name: '', email: '', phone: '', notes: '' });
let payState = $state<'idle' | 'creating' | 'ready' | 'confirming' | 'error'>('idle');
@ -446,11 +448,20 @@
<textarea
id="checkout-notes"
rows="3"
aria-describedby="checkout-notes-hint"
class="w-full rounded-xl border border-charcoal/15 bg-white px-4 py-3 focus:ring-2 focus:ring-sage/50 focus:outline-none"
bind:value={customer.notes}
></textarea>
<p id="checkout-notes-hint" class="mt-1 text-sm text-fg-body/70">{data.notesHint || DEFAULT_NOTES_HINT}</p>
</div>
<p class="text-sm text-fg-body/70">
{data.privacyNotice || DEFAULT_PRIVACY_NOTICE}
{#if privacyPage}
<a class="underline underline-offset-2 hover:text-sage-dark" href={`/${privacyPage}`} target="_blank" rel="noopener">Privacy policy</a>
{/if}
</p>
{#if payState === 'idle' || payState === 'creating'}
<button
type="submit"

View file

@ -73,6 +73,8 @@ export type FooterGlobal = {
email: string;
socialLinks: { platform: string; url: string }[];
copyrightText: string;
/** Slug of the privacy policy page, linked from the footer and the checkout ('' = none). */
privacyPage?: string;
};
export const defaultHeader: HeaderGlobal = {
@ -93,7 +95,24 @@ export const defaultFooter: FooterGlobal = {
phone: '',
email: '',
socialLinks: [{ platform: 'instagram', url: '' }],
copyrightText: `© ${new Date().getFullYear()} Eva Shafik Massage. All rights reserved.`
copyrightText: `© ${new Date().getFullYear()} Eva Shafik Massage. All rights reserved.`,
privacyPage: ''
};
/**
* How long customer details are kept (the `privacy` global). Applied daily by
* pocketbase/pb_hooks/privacy, which has the same defaults.
*/
export type PrivacyGlobal = {
/** Unpaid baskets, with whatever was typed at checkout, are deleted after this many days. */
abandonedBasketDays: number;
/** Orders are anonymised this many months after they were placed; 0 = never automatically. */
anonymiseOrdersAfterMonths: number;
};
export const defaultPrivacy: PrivacyGlobal = {
abandonedBasketDays: 30,
anonymiseOrdersAfterMonths: 0
};
// ── Commerce types ─────────────────────────────────────────────────────
@ -207,8 +226,15 @@ export type CheckoutBlockData = {
title?: string;
heading?: string;
notesLabel?: string;
/** Under the notes field; steers customers away from sharing health details. */
notesHint?: string;
/** Above the Pay button, next to the privacy policy link. */
privacyNotice?: string;
};
export const DEFAULT_NOTES_HINT = "Please don't include health details here — we'll talk about anything we should know at your appointment.";
export const DEFAULT_PRIVACY_NOTICE = 'We use your details only to arrange your booking and send your confirmation.';
// ── Email types ───────────────────────────────────────────────────────
// Email blocks are a separate, smaller set than page blocks: email clients