feat: add status filter query string
This commit is contained in:
parent
a18d56503d
commit
070fd7ed36
1 changed files with 6 additions and 0 deletions
|
|
@ -25,6 +25,7 @@ import { isSystem } from "../utils/keycloak";
|
|||
import { isUsedError, notFoundError, relationError } from "../utils/error";
|
||||
import { precisionRound } from "../utils/arithmetic";
|
||||
import { queryOrNot } from "../utils/relation";
|
||||
import { filterStatus } from "../services/prisma";
|
||||
|
||||
type QuotationCreate = {
|
||||
registeredBranchId: string;
|
||||
|
|
@ -84,6 +85,9 @@ type QuotationCreate = {
|
|||
type QuotationUpdate = {
|
||||
registeredBranchId?: string;
|
||||
status?: "ACTIVE" | "INACTIVE";
|
||||
|
||||
quotationStatus?: "Accepted";
|
||||
|
||||
remark?: string | null;
|
||||
|
||||
workName?: string;
|
||||
|
|
@ -183,6 +187,7 @@ export class QuotationController extends Controller {
|
|||
@Query() page: number = 1,
|
||||
@Query() pageSize: number = 30,
|
||||
@Query() payCondition?: PayCondition,
|
||||
@Query() status?: Status,
|
||||
@Query() query = "",
|
||||
) {
|
||||
const where = {
|
||||
|
|
@ -204,6 +209,7 @@ export class QuotationController extends Controller {
|
|||
]),
|
||||
payCondition,
|
||||
registeredBranch: isSystem(req.user) ? undefined : { OR: permissionCond(req.user) },
|
||||
...filterStatus(status),
|
||||
} satisfies Prisma.QuotationWhereInput;
|
||||
|
||||
const [result, total] = await prisma.$transaction([
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue