fix(SPG-1262): ONLINE BOOKING - Redirect ke antrian jika tidak sama dengan today - seharusnya diarahkan ke halaman login jika invoice tidak sama dengan today

pull/142/head 1.6.25-alpha.2
shancheas 2025-06-25 15:48:59 +07:00
parent 7be4c26ef2
commit 92b54635d0
2 changed files with 20 additions and 20 deletions

View File

@ -51,27 +51,27 @@ export class TicketDataService extends BaseDataService<QueueTicket> {
], ],
}); });
if (!order) { // if (!order) {
const { customer_name, customer_phone } = // const { customer_name, customer_phone } =
await this.transaction.findOneOrFail({ // await this.transaction.findOneOrFail({
where: { // where: {
id, // id,
}, // },
}); // });
const start = moment().startOf('day').valueOf(); // const start = moment().startOf('day').valueOf();
const end = moment().endOf('day').valueOf(); // const end = moment().endOf('day').valueOf();
const order = this.order.findOneOrFail({ // const order = this.order.findOneOrFail({
relations: ['tickets'], // relations: ['tickets'],
where: { // where: {
customer: customer_name, // customer: customer_name,
phone: customer_phone, // phone: customer_phone,
date: Between(start, end), // date: Between(start, end),
}, // },
}); // });
return order; // return order;
} // }
return order; return order;
} }

View File

@ -56,7 +56,7 @@ export class QueueOrchestrator {
return order; return order;
} catch (error) { } catch (error) {
throw new UnauthorizedException({ throw new UnauthorizedException({
message: 'Invoice tidak ditemukan', message: 'Invoice tidak ditemukan untuk tanggal hari ini',
error: 'INVOICE_NOT_FOUND', error: 'INVOICE_NOT_FOUND',
}); });
} }