- Customer accounts (separate auth collection) with /konto area - Availability + AvailabilityOverrides collections driving real slot calculation - BookingRequests with race-safe confirmation (Postgres advisory lock + transaction) - Booking emails (request received, admin notify, confirmed, rejected, alternative proposed/accepted, cancelled) - Confirmed online bookings auto-create a private linked video-call Event - Custom Payload admin calendar view (month grid + day schedule) - Wired booking widget into offer pages and /termin-buchen
85 lines
2.6 KiB
TypeScript
85 lines
2.6 KiB
TypeScript
import { postgresAdapter } from "@payloadcms/db-postgres";
|
|
import { lexicalEditor } from "@payloadcms/richtext-lexical";
|
|
import path from "path";
|
|
import { buildConfig } from "payload";
|
|
import { fileURLToPath } from "url";
|
|
import sharp from "sharp";
|
|
|
|
import { Users } from "@/collections/Users";
|
|
import { Media } from "@/collections/Media";
|
|
import { Events } from "@/collections/Events";
|
|
import { Posts } from "@/collections/Posts";
|
|
import { Offers } from "@/collections/Offers";
|
|
import { EventRegistrations } from "@/collections/EventRegistrations";
|
|
import { Customers } from "@/collections/Customers";
|
|
import { Availability } from "@/collections/Availability";
|
|
import { AvailabilityOverrides } from "@/collections/AvailabilityOverrides";
|
|
import { BookingRequests } from "@/collections/BookingRequests";
|
|
|
|
import { Home } from "@/globals/Home";
|
|
import { About } from "@/globals/About";
|
|
import { AngeboteIntro } from "@/globals/AngeboteIntro";
|
|
import { AktuellesIntro } from "@/globals/AktuellesIntro";
|
|
import { Contact } from "@/globals/Contact";
|
|
import { Booking } from "@/globals/Booking";
|
|
import { MeetingSettings } from "@/globals/MeetingSettings";
|
|
import { BookingSettings } from "@/globals/BookingSettings";
|
|
|
|
const filename = fileURLToPath(import.meta.url);
|
|
const dirname = path.dirname(filename);
|
|
|
|
export default buildConfig({
|
|
serverURL: process.env.NEXT_PUBLIC_SERVER_URL || "http://localhost:3000",
|
|
admin: {
|
|
user: Users.slug,
|
|
importMap: {
|
|
baseDir: path.resolve(dirname),
|
|
},
|
|
meta: {
|
|
titleSuffix: "— Anouma Admin",
|
|
},
|
|
components: {
|
|
afterNavLinks: ["/components/admin/CalendarNavLink#CalendarNavLink"],
|
|
views: {
|
|
kalender: {
|
|
Component: "/components/admin/AdminCalendarView#AdminCalendarView",
|
|
path: "/kalender",
|
|
exact: true,
|
|
meta: { title: "Kalender" },
|
|
},
|
|
},
|
|
},
|
|
},
|
|
collections: [
|
|
Users,
|
|
Customers,
|
|
Media,
|
|
Events,
|
|
Posts,
|
|
Offers,
|
|
EventRegistrations,
|
|
Availability,
|
|
AvailabilityOverrides,
|
|
BookingRequests,
|
|
],
|
|
globals: [Home, About, AngeboteIntro, AktuellesIntro, Contact, Booking, MeetingSettings, BookingSettings],
|
|
editor: lexicalEditor(),
|
|
secret: process.env.PAYLOAD_SECRET || "",
|
|
typescript: {
|
|
outputFile: path.resolve(dirname, "payload-types.ts"),
|
|
},
|
|
db: postgresAdapter({
|
|
pool: {
|
|
connectionString: process.env.DATABASE_URI || "",
|
|
},
|
|
}),
|
|
sharp,
|
|
// Server-side upload size limit; the Media collection restricts formats.
|
|
upload: {
|
|
limits: {
|
|
fileSize: 10 * 1024 * 1024, // 10 MB
|
|
},
|
|
},
|
|
plugins: [],
|
|
});
|