Archived
Add multi-day events (frontend), attendance register and certificates
Event wizard: one date or multiple sessions with a repeat-pattern builder, and a new Attendance step (late joining and pricing, check-in window, session reminders, certificates with preview). Public pages show the schedule and late prices; the scanner picks today's session; new attendance register page, My Certificates, and a public verify page. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -150,6 +150,93 @@ export type Event = {
|
||||
closedById?: string | null;
|
||||
reopenedAt?: string | null;
|
||||
reopenedById?: string | null;
|
||||
// Multi-day events (see backend utils/sessions.js). startDate/endDate follow the sessions.
|
||||
scheduleType?: "single" | "sessions";
|
||||
attendanceMode?: "whole" | "pick";
|
||||
sessions?: EventSession[];
|
||||
nextSession?: EventSession | null;
|
||||
// When public registration closes: the deadline, the first session (or session N with
|
||||
// late joining), or the end date — whichever applies.
|
||||
registrationClosesAt?: string;
|
||||
lateJoinEnabled?: boolean;
|
||||
lateJoinUntilSessionId?: string | null;
|
||||
latePricing?: "full" | "prorata" | "fixed";
|
||||
lateFixedPrice?: number | null;
|
||||
lateJoin?: LateJoinInfo | null;
|
||||
checkInWindow?: "whole_day" | "session_only";
|
||||
sessionReminders?: { offsets: number[]; channels: ("email" | "whatsapp")[] } | null;
|
||||
certificatesEnabled?: boolean;
|
||||
certificateConfig?: CertificateConfig | null;
|
||||
// Set by GET /api/events while an early-bird tier is still running.
|
||||
earlyBirdEndsAt?: string | null;
|
||||
isSoldOut?: boolean;
|
||||
};
|
||||
|
||||
export type EventSession = {
|
||||
id: string;
|
||||
eventId?: string;
|
||||
label?: string | null;
|
||||
startsAt: string;
|
||||
endsAt: string;
|
||||
location?: string | null;
|
||||
cancelledAt?: string | null;
|
||||
cancelled?: boolean;
|
||||
order?: number;
|
||||
};
|
||||
|
||||
export type LateJoinInfo = {
|
||||
active: boolean;
|
||||
mode: "full" | "prorata" | "fixed";
|
||||
sessionsLeft: number;
|
||||
totalSessions: number;
|
||||
fixedPrice: number | null;
|
||||
};
|
||||
|
||||
export type CertificateTemplate = "classic" | "modern" | "church" | "kids";
|
||||
export type CertificateConfig = {
|
||||
template: CertificateTemplate;
|
||||
title: string;
|
||||
body: string;
|
||||
signatureName?: string;
|
||||
signatureRole?: string;
|
||||
signatureImage?: string;
|
||||
rule: { type: "all" | "count" | "percent"; value: number | null };
|
||||
sendOnIssue?: boolean;
|
||||
};
|
||||
|
||||
// GET /api/attendance/:eventId
|
||||
export type AttendanceColumn = { id: string; label: string; startsAt: string; endsAt: string; cancelled: boolean };
|
||||
export type AttendanceRow = {
|
||||
ticketId: string;
|
||||
name: string;
|
||||
bookedBy: string;
|
||||
email: string;
|
||||
phone: string;
|
||||
option: string;
|
||||
variant: string | null;
|
||||
quantity: number;
|
||||
checkIns: Record<string, number>;
|
||||
attended: number;
|
||||
total: number;
|
||||
completed: boolean;
|
||||
certificate: { id: string; code: string; issuedAt: string; revokedAt: string | null; manual: boolean; emailedAt: string | null } | null;
|
||||
};
|
||||
export type AttendanceRegister = {
|
||||
event: Pick<Event, "id" | "title" | "scheduleType" | "startDate" | "endDate" | "cashupStatus" | "certificatesEnabled"> & { certificateConfig: CertificateConfig };
|
||||
columns: AttendanceColumn[];
|
||||
rows: AttendanceRow[];
|
||||
totals: Record<string, number>;
|
||||
};
|
||||
|
||||
// GET /api/attendance/certificates/mine
|
||||
export type MyCertificate = {
|
||||
id: string;
|
||||
code: string;
|
||||
name: string;
|
||||
issuedAt: string;
|
||||
sessionsAttended: number;
|
||||
totalSessions: number;
|
||||
event: { id: string; title: string; endDate: string };
|
||||
};
|
||||
|
||||
export type BundleItem = { id?: string; eventOptionId: string; variantId?: string | null; quantity: number; eventOption?: { id: string; name: string; price?: number } | null; variant?: { id: string; name: string } | null };
|
||||
|
||||
Reference in New Issue
Block a user