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