fix(seeder): fix bank_codes for expenses seeder

This commit is contained in:
Matthieu Haineault 2025-09-02 15:16:03 -04:00
parent 93cf2d571b
commit 5063c1dfec
2 changed files with 3 additions and 6 deletions

View File

@ -42,7 +42,7 @@ async function getOrCreateTimesheet(employee_id: number, start_date: Date) {
async function main() {
// Codes autorisés (aléatoires à chaque dépense)
const BANKS = ['G517', 'G56', 'G502', 'G202', 'G234'] as const;
const BANKS = ['G517', 'G503', 'G502', 'G202', 'G234'] as const;
const bcRows = await prisma.bankCodes.findMany({
where: { bank_code: { in: BANKS as unknown as string[] } },
select: { id: true, bank_code: true },
@ -83,7 +83,7 @@ async function main() {
// 4) Montant varié
const amount =
randomCode === 'G56'
randomCode === 'G503'
? rndAmount(1000, 7500) // 10.00..75.00
: rndAmount(2000, 25000); // 20.00..250.00

View File

@ -75,9 +75,6 @@ export class TimesheetsQueryService {
orderBy: { date: 'asc' },
});
const to_num = (value: any) => typeof value.toNumber === 'function' ? value.toNumber() : Number(value);
// data mapping
const shifts: ShiftRow[] = raw_shifts.map(shift => ({
date: shift.date,