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 { isUsedError, notFoundError, relationError } from "../utils/error";
|
||||||
import { precisionRound } from "../utils/arithmetic";
|
import { precisionRound } from "../utils/arithmetic";
|
||||||
import { queryOrNot } from "../utils/relation";
|
import { queryOrNot } from "../utils/relation";
|
||||||
|
import { filterStatus } from "../services/prisma";
|
||||||
|
|
||||||
type QuotationCreate = {
|
type QuotationCreate = {
|
||||||
registeredBranchId: string;
|
registeredBranchId: string;
|
||||||
|
|
@ -84,6 +85,9 @@ type QuotationCreate = {
|
||||||
type QuotationUpdate = {
|
type QuotationUpdate = {
|
||||||
registeredBranchId?: string;
|
registeredBranchId?: string;
|
||||||
status?: "ACTIVE" | "INACTIVE";
|
status?: "ACTIVE" | "INACTIVE";
|
||||||
|
|
||||||
|
quotationStatus?: "Accepted";
|
||||||
|
|
||||||
remark?: string | null;
|
remark?: string | null;
|
||||||
|
|
||||||
workName?: string;
|
workName?: string;
|
||||||
|
|
@ -183,6 +187,7 @@ export class QuotationController extends Controller {
|
||||||
@Query() page: number = 1,
|
@Query() page: number = 1,
|
||||||
@Query() pageSize: number = 30,
|
@Query() pageSize: number = 30,
|
||||||
@Query() payCondition?: PayCondition,
|
@Query() payCondition?: PayCondition,
|
||||||
|
@Query() status?: Status,
|
||||||
@Query() query = "",
|
@Query() query = "",
|
||||||
) {
|
) {
|
||||||
const where = {
|
const where = {
|
||||||
|
|
@ -204,6 +209,7 @@ export class QuotationController extends Controller {
|
||||||
]),
|
]),
|
||||||
payCondition,
|
payCondition,
|
||||||
registeredBranch: isSystem(req.user) ? undefined : { OR: permissionCond(req.user) },
|
registeredBranch: isSystem(req.user) ? undefined : { OR: permissionCond(req.user) },
|
||||||
|
...filterStatus(status),
|
||||||
} satisfies Prisma.QuotationWhereInput;
|
} satisfies Prisma.QuotationWhereInput;
|
||||||
|
|
||||||
const [result, total] = await prisma.$transaction([
|
const [result, total] = await prisma.$transaction([
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue