database bi kiet pha banh roi

This commit is contained in:
2024-11-25 14:17:32 +07:00
parent 9515a3d9b3
commit 28d0374435
6 changed files with 55 additions and 60 deletions

View File

@@ -5,6 +5,7 @@ export interface ScheduleDateInput {
dayOfWeek: number
slot: number
serviceId: string
participants: string[]
orderId: string | null
}

View File

@@ -146,6 +146,20 @@ export class ScheduleSchema extends PothosSchema {
orderId: t.exposeID('orderId', {
nullable: true,
}),
participantIds: t.exposeStringList('participantIds', {
nullable: false,
}),
maxParticipants: t.exposeInt('maxParticipants', {
nullable: false,
}),
lateStart: t.expose('lateStart', {
type: 'DateTime',
nullable: true,
}),
collaborationSession: t.relation('CollaborationSession', {
description: 'The collaboration session of the schedule date.',
nullable: true,
}),
schedule: t.relation('schedule', {
description: 'The schedule the schedule date belongs to.',
}),

View File

@@ -68,7 +68,7 @@ export class ScheduleService {
const scheduleEnd = DateTime.fromJSDate(schedule.scheduleEnd)
const slotDuration = parseInt(config.slotDuration)
const slotBreakDuration = parseInt(config.slotBreakDuration)
// add participants to schedule dates
const scheduleDates: ScheduleDateInput[] = []
// loop each day from scheduleStart to scheduleEnd
@@ -96,6 +96,7 @@ export class ScheduleService {
end: endTime.toISO() ?? '',
dayOfWeek: date.weekday,
slot: slot,
participants: [],
serviceId: schedule.managedServiceId,
orderId: schedule.orderId,
})