update schedule

This commit is contained in:
2024-12-16 20:00:11 +07:00
parent b61e4dfc73
commit 6b0b95bb32
3 changed files with 80 additions and 54 deletions

View File

@@ -421,7 +421,19 @@ d72a864e-2f41-45ab-9c9b-bf0512a31883,e9be51fd-2382-4e43-9988-74e76fde4b56,2024-1
})
const existingScheduleDates = await this.prisma.scheduleDate.findMany({
where: {
serviceId: args.schedule.managedService.connect?.id,
AND: [
{ serviceId: args.schedule.managedService.connect?.id },
{
status: {
notIn: [
ScheduleDateStatus.COMPLETED,
ScheduleDateStatus.MISSING_MENTOR,
ScheduleDateStatus.MISSING_CUSTOMER,
ScheduleDateStatus.EXPIRED,
],
},
},
],
},
})
// check if there is any overlapping with existing schedule dates in same service using DateTimeUtils