database bi kiet pha banh roi
This commit is contained in:
@@ -85,6 +85,9 @@ export class PayosService {
|
||||
status: ScheduleStatus.IN_PROGRESS,
|
||||
},
|
||||
})
|
||||
if (!schedule) {
|
||||
throw new Error('Schedule not found')
|
||||
}
|
||||
// get mentor id from managed service
|
||||
const managedService = await tx.managedService.findUniqueOrThrow({
|
||||
where: { id: schedule?.managedServiceId },
|
||||
@@ -111,13 +114,18 @@ export class PayosService {
|
||||
chatRoomId: chatRoom.id,
|
||||
},
|
||||
})
|
||||
// update orderId for schedule dates
|
||||
// add participants to schedule dates where customer and mentor are
|
||||
const customerId = order.userId
|
||||
|
||||
// update orderId
|
||||
await tx.scheduleDate.updateMany({
|
||||
where: { scheduleId: schedule?.id },
|
||||
where: { scheduleId: schedule.id },
|
||||
data: {
|
||||
orderId: order.id,
|
||||
participantIds: [customerId, mentorId],
|
||||
},
|
||||
})
|
||||
|
||||
/* --------------- send first message from mentor to customer --------------- */
|
||||
await tx.message.create({
|
||||
data: {
|
||||
|
||||
Reference in New Issue
Block a user