Something went wrong. Try again.
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182export type LunchEvent = { id: string; title: string; description: string; date: string; pricePerPerson: string; maxParticipants: string; cookId: string; shareToken: string; closed: boolean; foodReady: boolean; createdAt: string; updatedAt: string;};
export type Participant = { id: string; eventId: string; name: string; email: string; partySize: string; hasPaid: boolean; createdAt: string; updatedAt: string;};
export type UserProfile = { id: string; userId: string; bankIban: string; bankName: string; paypalLink: string; createdAt: string; updatedAt: string;};
export type Registration = { id: string; participantId: string; eventId: string; notifyOnClose: boolean; participant: Participant; event: LunchEvent;};
export type CloseNotification = { id: string; eventId: string; title: string; date: string; shareToken: string; pricePerPerson: string; partySize: string; kind: "closed" | "foodReady"; read: boolean; createdAt: string;};
export function formatDate(date: string): string { const parsed = new Date(`${date}T00:00:00.000Z`); return new Intl.DateTimeFormat("en-GB", { weekday: "short", day: "numeric", month: "short", year: "numeric", timeZone: "UTC", }).format(parsed);}
export function formatCurrency(amount: number): string { return new Intl.NumberFormat("de-DE", { style: "currency", currency: "EUR" }).format(amount);}
export function generateShareToken(): string { const chars = "abcdefghijklmnopqrstuvwxyz0123456789"; let token = ""; for (let i = 0; i < 12; i++) { token += chars[Math.floor(Math.random() * chars.length)]; } return token;}