Add SMS OTP, harden auth, and fix order/checkout server bugs.
Ship 4-digit OTP with rate-limit attempts, Tehran-safe expiry/rass math, larger JSON body limit for check images, and safer order pricing/status guards. Include rebuilt dist for prebuilt deploy. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Vendored
+19
-7
@@ -23,7 +23,9 @@ let CompaniesService = class CompaniesService {
|
||||
where: activeOnly ? { isActive: true } : undefined,
|
||||
orderBy: [{ displayOrder: 'asc' }, { name: 'asc' }],
|
||||
include: {
|
||||
_count: { select: { catalogs: true, products: true, bankAccounts: true } },
|
||||
_count: {
|
||||
select: { catalogs: true, products: true, bankAccounts: true },
|
||||
},
|
||||
},
|
||||
});
|
||||
return companies.map((c) => this.mapCompany(c));
|
||||
@@ -33,7 +35,9 @@ let CompaniesService = class CompaniesService {
|
||||
where: { id },
|
||||
include: {
|
||||
bankAccounts: { orderBy: { displayOrder: 'asc' } },
|
||||
_count: { select: { catalogs: true, products: true, bankAccounts: true } },
|
||||
_count: {
|
||||
select: { catalogs: true, products: true, bankAccounts: true },
|
||||
},
|
||||
},
|
||||
});
|
||||
if (!company)
|
||||
@@ -58,13 +62,16 @@ let CompaniesService = class CompaniesService {
|
||||
isActive: dto.isActive ?? true,
|
||||
},
|
||||
include: {
|
||||
_count: { select: { catalogs: true, products: true, bankAccounts: true } },
|
||||
_count: {
|
||||
select: { catalogs: true, products: true, bankAccounts: true },
|
||||
},
|
||||
},
|
||||
});
|
||||
return this.mapCompany(company);
|
||||
}
|
||||
catch (e) {
|
||||
if (e instanceof client_1.Prisma.PrismaClientKnownRequestError && e.code === 'P2002') {
|
||||
if (e instanceof client_1.Prisma.PrismaClientKnownRequestError &&
|
||||
e.code === 'P2002') {
|
||||
throw new common_1.ConflictException('اسلاگ شرکت تکراری است');
|
||||
}
|
||||
throw e;
|
||||
@@ -89,13 +96,16 @@ let CompaniesService = class CompaniesService {
|
||||
isActive: dto.isActive,
|
||||
},
|
||||
include: {
|
||||
_count: { select: { catalogs: true, products: true, bankAccounts: true } },
|
||||
_count: {
|
||||
select: { catalogs: true, products: true, bankAccounts: true },
|
||||
},
|
||||
},
|
||||
});
|
||||
return this.mapCompany(company);
|
||||
}
|
||||
catch (e) {
|
||||
if (e instanceof client_1.Prisma.PrismaClientKnownRequestError && e.code === 'P2002') {
|
||||
if (e instanceof client_1.Prisma.PrismaClientKnownRequestError &&
|
||||
e.code === 'P2002') {
|
||||
throw new common_1.ConflictException('اسلاگ شرکت تکراری است');
|
||||
}
|
||||
throw e;
|
||||
@@ -107,7 +117,9 @@ let CompaniesService = class CompaniesService {
|
||||
where: { id },
|
||||
data: { isActive },
|
||||
include: {
|
||||
_count: { select: { catalogs: true, products: true, bankAccounts: true } },
|
||||
_count: {
|
||||
select: { catalogs: true, products: true, bankAccounts: true },
|
||||
},
|
||||
},
|
||||
});
|
||||
return this.mapCompany(company);
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user