Files
dvbooking/admin/src/app/features/calendar/models/events-in-range-dto.model.ts

47 lines
1.1 KiB
TypeScript

import { Event } from '../../events/models/event.model';
import { EventType } from '../../event-type/models/event-type.model';
export interface EventsInRangeDTO {
startTime?: Date;
endTime?: Date;
}
export type BookingUserDto = {
id: number;
name: string; // Assuming user has a 'name' property
email: string; // Assuming user has a 'name' property
};
// This represents a booking with nested user info
export type BookingWithUserDto = {
user: BookingUserDto | null;
id: number;
};
export interface EventExceptionDto {
id: number,
description: string;
eventId: number;
isCancelled: boolean;
newEndTime: string;
newStartTime: string;
originalStartTime: string;
title: string;
}
// The final shape of a calendar event occurrence
export type CalendarEventDto = {
id: number;
title: string;
startTime: string,
originalStartTime: string,
endTime: string,
description: string,
isModified?: boolean;
eventBookings: BookingWithUserDto[];
isCancelled: boolean;
isRecurring: boolean;
eventType: EventType
exceptions: EventExceptionDto[]
};