set consumer customers and saleInvoices

This commit is contained in:
2026-04-08 18:15:44 +03:30
parent b8c5cb4c80
commit 89726c8904
22 changed files with 936 additions and 411 deletions
@@ -7,7 +7,7 @@ import {
import { Request } from 'express'
import { IConsumerPayload } from '../models'
export const ConsumerInfoInfo = createParamDecorator(
export const ConsumerInfo = createParamDecorator(
(data: keyof IConsumerPayload | undefined, ctx: ExecutionContext) => {
try {
const request = ctx.switchToHttp().getRequest<Request>()
+1 -3
View File
@@ -41,9 +41,7 @@ export class ConsumerGuard {
if (!consumer.license?.expires_at) {
throw new ForbiddenException('برای کاربر شما لایسنس ایجاد نشده است.')
}
if (
new Date().toUTCString() > new Date(consumer.license?.expires_at).toUTCString()
) {
if (new Date().getTime() > new Date(consumer.license?.expires_at).getTime()) {
throw new ForbiddenException('لایسنس شما منقضی شده است.')
}
}