Files
anouma/collections/Offers.ts
T
maroandClaude Sonnet 5 1cd15aff25 Add email verification, personal calendar feed, and full SEO implementation
- Customer accounts now require email verification (hashed, single-use,
  time-limited tokens) before they can request/confirm bookings, with
  resend flows on login/account/booking widget and rate limiting.
- Admins get a private, rotatable iCalendar (ICS) subscription feed of
  their confirmed bookings and public events, timezone-correct for
  Europe/Berlin including DST, never exposing meeting passwords.
- Adds a full SEO layer: per-page canonical/OG/Twitter metadata with
  CMS-editable overrides and content-derived fallbacks, a dynamic
  sitemap.xml and robots.txt driven by real published content, JSON-LD
  (Organization/LocalBusiness, WebSite, WebPage, BreadcrumbList, Service,
  Event, BlogPosting) that never fabricates data, and a CMS-managed
  redirect table for changed slugs.
- Global ANOUMA-naming audit: the brand name is never used to label
  personal account/calendar areas anywhere in the app, CMS, or emails.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-25 22:57:31 +02:00

130 lines
3.3 KiB
TypeScript

import type { CollectionConfig } from "payload";
import { isAdmin, publishedOrAdmin } from "@/access";
import { slugField } from "@/fields/slug";
import { seoFields } from "@/fields/seo";
// Groups the 7 individual offers for the mega menu and the /angebote
// overview page (Kindergruppen bundles Erdenkinder + Mädchenkreis, Singkreise
// bundles the three singing circles — matching the site's navigation).
export const OFFER_CATEGORIES = [
{ label: "Prozessbegleitung", value: "prozessbegleitung" },
{ label: "Doula-Begleitung", value: "doula-begleitung" },
{ label: "Kindergruppen", value: "kindergruppen" },
{ label: "Singkreise", value: "singkreise" },
] as const;
export const Offers: CollectionConfig = {
slug: "offers",
labels: {
singular: "Angebot",
plural: "Angebote",
},
admin: {
useAsTitle: "title",
defaultColumns: ["title", "category", "order", "_status"],
group: "Inhalte",
description: "Die Angebote von Anouma — erscheinen im Menü und auf /angebote.",
},
defaultSort: "order",
versions: {
drafts: true,
},
access: {
read: publishedOrAdmin,
create: isAdmin,
update: isAdmin,
delete: isAdmin,
},
fields: [
{
name: "title",
type: "text",
label: "Titel",
required: true,
},
slugField(),
{
name: "shortDescription",
type: "textarea",
label: "Kurzbeschreibung",
required: true,
admin: {
description: "Kurzer Satz für Karten, Menü und Übersicht.",
},
},
{
name: "description",
type: "richText",
label: "Beschreibung",
required: true,
},
{
name: "image",
type: "upload",
relationTo: "media",
label: "Bild",
},
{
name: "category",
type: "select",
label: "Kategorie",
required: true,
options: [...OFFER_CATEGORIES],
},
{
name: "order",
type: "number",
label: "Reihenfolge",
defaultValue: 0,
admin: {
position: "sidebar",
description: "Kleinere Zahl erscheint zuerst.",
},
},
{
name: "visibility",
type: "select",
label: "Sichtbarkeit",
required: true,
defaultValue: "public",
options: [
{ label: "Öffentlich (Menü, Übersicht)", value: "public" },
{ label: "Privat (nur über direkten Link/Buchung)", value: "private" },
],
admin: {
position: "sidebar",
description: "Private Angebote wie „Einzelbegleitung“ erscheinen nicht im Menü oder auf /angebote.",
},
},
{
name: "bookable",
type: "checkbox",
label: "Buchbar",
defaultValue: false,
admin: {
position: "sidebar",
description: "Aktiviert die Terminbuchung mit Kalenderauswahl auf der Angebotsseite.",
},
},
{
type: "row",
fields: [
{
name: "price",
type: "text",
label: "Preis bzw. Preistext",
admin: { width: "50%", description: "z. B. „80 €“ oder „auf Anfrage“." },
},
{
name: "durationMinutes",
type: "number",
label: "Dauer (Minuten)",
min: 5,
admin: { width: "50%", condition: (data) => Boolean(data?.bookable) },
},
],
},
seoFields(),
],
};