122 lines
3.5 KiB
TypeScript
122 lines
3.5 KiB
TypeScript
import type { ColumnType, Generated, Insertable, Selectable, Updateable } from "kysely";
|
|
|
|
export type Timestamp = ColumnType<Date, Date | string | undefined, Date | string>;
|
|
export type NullableTimestamp = ColumnType<
|
|
Date | null,
|
|
Date | string | null | undefined,
|
|
Date | string | null
|
|
>;
|
|
export type DateString = ColumnType<string | null, string | null | undefined, string | null>;
|
|
export type Json = JsonValue;
|
|
|
|
export type JsonValue =
|
|
| string
|
|
| number
|
|
| boolean
|
|
| null
|
|
| JsonValue[]
|
|
| { [key: string]: JsonValue };
|
|
|
|
export interface InvitationsTable {
|
|
id: Generated<string>;
|
|
token: string;
|
|
display_name: string;
|
|
language: string;
|
|
contact_email: string | null;
|
|
contact_phone: string | null;
|
|
max_party_size: number;
|
|
allow_member_edits: boolean;
|
|
save_the_date_sent_at: NullableTimestamp;
|
|
notes: string | null;
|
|
created_at: Timestamp;
|
|
updated_at: Timestamp;
|
|
}
|
|
|
|
export interface InvitationMembersTable {
|
|
id: Generated<string>;
|
|
invitation_id: string;
|
|
name: string;
|
|
is_primary_contact: boolean;
|
|
attending: boolean | null;
|
|
meal_preference: string | null;
|
|
dietary_restrictions: string | null;
|
|
notes: string | null;
|
|
created_at: Timestamp;
|
|
updated_at: Timestamp;
|
|
}
|
|
|
|
export interface InvitationResponsesTable {
|
|
id: Generated<string>;
|
|
invitation_id: string;
|
|
submitted_at: NullableTimestamp;
|
|
arrival_date: DateString | null;
|
|
departure_date: DateString | null;
|
|
stay_location: string | null;
|
|
needs_transport_help: boolean | null;
|
|
message_to_couple: string | null;
|
|
created_at: Timestamp;
|
|
updated_at: Timestamp;
|
|
}
|
|
|
|
export interface PhotoUploadsTable {
|
|
id: Generated<string>;
|
|
invitation_id: string;
|
|
bucket: string;
|
|
object_key: string;
|
|
original_filename: string | null;
|
|
content_type: string | null;
|
|
size_bytes: number | null;
|
|
created_at: Timestamp;
|
|
updated_at: Timestamp;
|
|
}
|
|
|
|
export interface ToastRequestsTable {
|
|
id: Generated<string>;
|
|
invitation_id: string;
|
|
member_id: string | null;
|
|
speaker_name: string;
|
|
estimated_minutes: number | null;
|
|
status: string;
|
|
created_at: Timestamp;
|
|
updated_at: Timestamp;
|
|
}
|
|
|
|
export interface AdminAuditEventsTable {
|
|
id: Generated<string>;
|
|
admin_email: string;
|
|
action: string;
|
|
target_type: string | null;
|
|
target_id: string | null;
|
|
metadata: Json | null;
|
|
created_at: Timestamp;
|
|
}
|
|
|
|
export interface Database {
|
|
invitations: InvitationsTable;
|
|
invitation_members: InvitationMembersTable;
|
|
invitation_responses: InvitationResponsesTable;
|
|
photo_uploads: PhotoUploadsTable;
|
|
toast_requests: ToastRequestsTable;
|
|
admin_audit_events: AdminAuditEventsTable;
|
|
}
|
|
|
|
export type Invitation = Selectable<InvitationsTable>;
|
|
export type NewInvitation = Insertable<InvitationsTable>;
|
|
export type InvitationUpdate = Updateable<InvitationsTable>;
|
|
|
|
export type InvitationMember = Selectable<InvitationMembersTable>;
|
|
export type NewInvitationMember = Insertable<InvitationMembersTable>;
|
|
export type InvitationMemberUpdate = Updateable<InvitationMembersTable>;
|
|
|
|
export type InvitationResponse = Selectable<InvitationResponsesTable>;
|
|
export type NewInvitationResponse = Insertable<InvitationResponsesTable>;
|
|
export type InvitationResponseUpdate = Updateable<InvitationResponsesTable>;
|
|
|
|
export type PhotoUpload = Selectable<PhotoUploadsTable>;
|
|
export type NewPhotoUpload = Insertable<PhotoUploadsTable>;
|
|
export type PhotoUploadUpdate = Updateable<PhotoUploadsTable>;
|
|
|
|
export type ToastRequest = Selectable<ToastRequestsTable>;
|
|
export type NewToastRequest = Insertable<ToastRequestsTable>;
|
|
export type ToastRequestUpdate = Updateable<ToastRequestsTable>;
|