
* fix: availability creation and expand/collapse settings * additional fixes * Update pages/api/availability/eventtype.ts Co-authored-by: Alex Johansson <alexander@n1s.se> * update branch * fix: more fixes Co-authored-by: Alex Johansson <alexander@n1s.se> Co-authored-by: Bailey Pumfleet <pumfleet@hey.com> Co-authored-by: Mihai Colceriu <colceriumi@gmail.com>
66 lines
1.4 KiB
TypeScript
66 lines
1.4 KiB
TypeScript
import { SchedulingType } from "@prisma/client";
|
|
|
|
export type OpeningHours = {
|
|
days: number[];
|
|
startTime: number;
|
|
endTime: number;
|
|
};
|
|
|
|
export type DateOverride = {
|
|
date: string;
|
|
startTime: number;
|
|
endTime: number;
|
|
};
|
|
|
|
export type AdvancedOptions = {
|
|
eventName?: string;
|
|
periodType?: string;
|
|
periodDays?: number;
|
|
periodStartDate?: Date | string;
|
|
periodEndDate?: Date | string;
|
|
periodCountCalendarDays?: boolean;
|
|
requiresConfirmation?: boolean;
|
|
disableGuests?: boolean;
|
|
minimumBookingNotice?: number;
|
|
price?: number;
|
|
currency?: string;
|
|
schedulingType?: SchedulingType;
|
|
users?: {
|
|
value: number;
|
|
label: string;
|
|
avatar: string;
|
|
}[];
|
|
availability?: { openingHours: OpeningHours[]; dateOverrides: DateOverride[] };
|
|
customInputs?: EventTypeCustomInput[];
|
|
timeZone: string;
|
|
hidden: boolean;
|
|
};
|
|
|
|
export type EventTypeCustomInput = {
|
|
id: number;
|
|
label: string;
|
|
placeholder: string;
|
|
required: boolean;
|
|
type: string;
|
|
};
|
|
|
|
export type CreateEventType = {
|
|
title: string;
|
|
slug: string;
|
|
description: string;
|
|
length: number;
|
|
schedulingType?: SchedulingType;
|
|
};
|
|
|
|
export type EventTypeInput = AdvancedOptions & {
|
|
id: number;
|
|
title: string;
|
|
slug: string;
|
|
description: string;
|
|
length: number;
|
|
hidden: boolean;
|
|
locations: unknown;
|
|
customInputs: EventTypeCustomInput[];
|
|
timeZone: string;
|
|
availability?: { openingHours: OpeningHours[]; dateOverrides: DateOverride[] };
|
|
};
|