update some complex logic

This commit is contained in:
2024-11-24 22:25:14 +07:00
parent edcd340d0b
commit 68dabd186a
6 changed files with 141 additions and 24 deletions

View File

@@ -12,6 +12,7 @@ import type {
} from '@payos/node/lib/type'
import {
ChatRoomType,
MessageType,
OrderStatus,
PaymentStatus,
ScheduleDateStatus,
@@ -117,6 +118,16 @@ export class PayosService {
orderId: order.id,
},
})
// send first message from mentor to customer
await tx.message.create({
data: {
content:
'Xin chào, mình là hướng dẫn viên của bạn, hãy bắt đầu học ngay nhé!',
type: MessageType.TEXT,
chatRoomId: chatRoom.id,
senderId: mentorId,
},
})
return {
message: 'Payment received',
}