fix: the discount code bug in apply for invoice
This commit is contained in:
@@ -725,7 +725,7 @@ export class InvoicesService {
|
||||
|
||||
if (discount?.user?.id && discount?.user?.id !== userId) throw new BadRequestException(InvoiceMessage.DISCOUNT_NOT_FOR_THIS_USER);
|
||||
|
||||
if (discount?.isActive) throw new BadRequestException(InvoiceMessage.DISCOUNT_IS_NOT_ACTIVE);
|
||||
if (!discount?.isActive) throw new BadRequestException(InvoiceMessage.DISCOUNT_IS_NOT_ACTIVE);
|
||||
|
||||
if (discount.endDate && dayjs(discount.endDate).isBefore(dayjs())) throw new BadRequestException(InvoiceMessage.DISCOUNT_EXPIRED);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user