Refactor CollaborationSession and Document schemas to improve code clarity and functionality. Enhance error handling in collaboration session retrieval and update logic. Introduce new request sync events in Document schema and update Minio service for document page management. Adjust cron job to use current date for future schedule date checks. Update user schema for better error handling and improve service descriptions in order schema. Remove global decorators from Workshop modules for better module encapsulation.
This commit is contained in:
@@ -98,6 +98,7 @@ export class CronService {
|
||||
@Cron(CronExpression.EVERY_MINUTE)
|
||||
async handleRefundTicket() {
|
||||
Logger.log('Handling refund ticket', 'handleRefundTicket')
|
||||
const now = new Date()
|
||||
// get all orders where status is REFUNDED and has schedule.dates in future
|
||||
const orders = await this.prisma.order.findMany({
|
||||
where: {
|
||||
@@ -106,7 +107,7 @@ export class CronService {
|
||||
dates: {
|
||||
some: {
|
||||
end: {
|
||||
gt: new Date(),
|
||||
gt: now,
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -130,7 +131,10 @@ export class CronService {
|
||||
// remove schedule date in future
|
||||
for (const order of orders) {
|
||||
await this.prisma.scheduleDate.deleteMany({
|
||||
where: { id: { in: order.schedule.dates.map((d) => d.id) } },
|
||||
where: {
|
||||
id: { in: order.schedule.dates.map((d) => d.id) },
|
||||
start: { gt: now },
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user