feat: update collaboration session handling and schedule date status

- Removed redundant code for adding current user ID to collaborators in collaboration sessions.
- Implemented updates to schedule date status based on collaboration session conditions, enhancing the workflow for both customers and mentors.
- Improved error handling to ensure only authorized users can access collaboration sessions, maintaining data integrity and user experience.
This commit is contained in:
2024-12-07 16:28:44 +07:00
parent 77e3526564
commit d59df7d2ab
2 changed files with 25 additions and 20 deletions

View File

@@ -20,7 +20,7 @@ export class CronService {
const schedules = await this.prisma.scheduleDate.findMany({
where: {
end: {
lt: DateTimeUtils.now().toJSDate(),
lt: DateTimeUtils.now().toJSDate(), // past
},
status: {
notIn: [ScheduleDateStatus.COMPLETED, ScheduleDateStatus.MISSING_MENTOR, ScheduleDateStatus.MISSING_CUSTOMER],
@@ -48,12 +48,12 @@ export class CronService {
}
}
if (collaborationSession.collaboratorsIds.length === 1) {
return {
id: schedule.id,
status: ScheduleDateStatus.MISSING_CUSTOMER,
}
}
// if (collaborationSession.collaboratorsIds.length === 1) {
// return {
// id: schedule.id,
// status: ScheduleDateStatus.MISSING_CUSTOMER,
// }
// }
if (collaborationSession.collaboratorsIds.length === 2) {
return {