SPB Git

Repository Public

types.tsx 2.2 KB 29 lines tsx

1/** Shapes returned by the admin API (src/lib/api/admin.ts). */2export interface Req {3  id: string; status: "pending" | "approved" | "declined" | "expired" | "cancelled" | "reschedule_requested";4  startsAt: string; endsAt: string; visitorTz: string; locale: string; holdExpiresAt: string | null; holds: boolean;5  reason: string; internalNote: string; declineMessage: string;6  proposal: { startsAt: string; endsAt: string; expiresAt: string | null; message: string } | null;7  rescheduleOf: { bookingId: string; currentStartsAt: string | null } | null;8  bookingId: string | null; conflictFlag: string; conflict: string | null; createdAt: string; decidedAt: string | null;9  type: { id: string; title: string; color: string; locationKind: string };10  contact: { id: string; name: string; email: string; organization: string } | null;11  answers: { label: string; value: string }[];12}13export interface Bk {14  id: string; title: string; startsAt: string; endsAt: string; status: "confirmed" | "cancelled"; locationKind: string; locationText: string;15  cancelledAt: string | null; cancelledBy: string | null; cancelReason: string; sequence: number; createdAt: string;16  type: { id: string; title: string; color: string } | null; contact: { id: string; name: string; email: string } | null;17  reason: string; requestId: string | null; internalNote: string;18}19export interface Block { id: string; startsAt: string; endsAt: string; title: string; note: string; source: "manual" | "external"; calendar: string | null; blocksAvailability: boolean }20export interface HistoryItem { action: string; actor: string; at: string }21export interface MailItem { kind: string; status: string; sentAt: string | null; error: string | null }22export interface EventTypeLite { id: string; title: string; color: string; duration_min: number; active: boolean }23export interface Dashboard {24  upcoming: Bk[]; open: Req[]; cancelled: Bk[];25  alerts: { level: "warn" | "danger"; code: string; detail?: string }[];26  indicators: { next7: number; next30: number; approved90: number; declined90: number; openRequests: number };27}28export interface AgendaData { timezone: string; bookings: Bk[]; blocks: Block[]; requests: Req[]; open: { startsAt: string; endsAt: string }[] }29
Files main
Menu

Theme