fix(build): ship jalaali types with production dependencies

Move @types/jalaali-js into dependencies and add a local module declaration so nest build works when installing without devDependencies.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-27 18:59:38 +03:30
co-authored by Cursor
parent edfbdb3469
commit 3034c59319
4 changed files with 27 additions and 8 deletions
+6 -5
View File
@@ -434,12 +434,12 @@ export class TenantsService {
}
private handleUnique(error: unknown) {
if (
error instanceof Prisma.PrismaClientKnownRequestError &&
error.code === 'P2002'
) {
if (!(error instanceof Prisma.PrismaClientKnownRequestError)) {
return;
}
if (error.code === 'P2002') {
const targets = Array.isArray(error.meta?.target)
? (error.meta?.target as string[])
? (error.meta.target as string[])
: [];
if (targets.includes('slug')) {
throw new ConflictException('slug تکراری است — این slug قبلاً برای نسخه دیگری ثبت شده');
@@ -451,5 +451,6 @@ export class TenantsService {
}
throw new ConflictException('slug یا domain تکراری است');
}
}
}
}
+19
View File
@@ -0,0 +1,19 @@
declare module 'jalaali-js' {
export function toJalaali(
gy: number,
gm: number,
gd: number,
): { jy: number; jm: number; jd: number }
export function toGregorian(
jy: number,
jm: number,
jd: number,
): { gy: number; gm: number; gd: number }
export function isValidJalaaliDate(jy: number, jm: number, jd: number): boolean
export function isLeapJalaaliYear(jy: number): boolean
export function jalaaliMonthLength(jy: number, jm: number): number
}