feat: add sellerId in quotation
All checks were successful
Spell Check / Spell Check with Typos (push) Successful in 5s

This commit is contained in:
Kanjana 2025-07-04 14:40:46 +07:00
parent 859a1e3def
commit e0be1f6ab5

View file

@ -84,6 +84,8 @@ type QuotationCreate = {
installmentNo?: number; installmentNo?: number;
workerIndex?: number[]; workerIndex?: number[];
}[]; }[];
sellerId?: string;
}; };
type QuotationUpdate = { type QuotationUpdate = {
@ -142,6 +144,8 @@ type QuotationUpdate = {
installmentNo?: number; installmentNo?: number;
workerIndex?: number[]; workerIndex?: number[];
}[]; }[];
sellerId?: string;
}; };
const VAT_DEFAULT = config.vat; const VAT_DEFAULT = config.vat;
@ -211,6 +215,7 @@ export class QuotationController extends Controller {
@Query() query = "", @Query() query = "",
@Query() startDate?: Date, @Query() startDate?: Date,
@Query() endDate?: Date, @Query() endDate?: Date,
@Query() sellerId?: string,
) { ) {
const where = { const where = {
OR: queryOrNot<Prisma.QuotationWhereInput[]>(query, [ OR: queryOrNot<Prisma.QuotationWhereInput[]>(query, [
@ -259,6 +264,7 @@ export class QuotationController extends Controller {
} }
: undefined, : undefined,
...whereDateQuery(startDate, endDate), ...whereDateQuery(startDate, endDate),
sellerId: sellerId ? sellerId : null,
} satisfies Prisma.QuotationWhereInput; } satisfies Prisma.QuotationWhereInput;
const [result, total] = await prisma.$transaction([ const [result, total] = await prisma.$transaction([