feat: deals filters

This commit is contained in:
2025-09-01 17:54:31 +04:00
parent ab7ef1e753
commit 48d539154c
24 changed files with 489 additions and 306 deletions

View File

@ -178,6 +178,10 @@ export type DealSchema = {
* Statusid
*/
statusId: number;
/**
* Boardid
*/
boardId: number;
/**
* Createdat
*/
@ -303,6 +307,8 @@ export type ProjectSchema = {
name: string;
};
export type SortDir = "asc" | "desc";
/**
* StatusSchema
*/
@ -585,14 +591,26 @@ export type GetDealsData = {
body?: never;
path?: never;
query?: {
/**
* Projectid
*/
projectId?: number | null;
/**
* Boardid
*/
boardId?: number | null;
/**
* Projectid
* Statusid
*/
projectId?: number | null;
statusId?: number | null;
/**
* Id
*/
id?: number | null;
/**
* Name
*/
name?: string | null;
/**
* Page
*/
@ -601,6 +619,14 @@ export type GetDealsData = {
* Itemsperpage
*/
itemsPerPage?: number | null;
/**
* Sortingfield
*/
sortingField?: string | null;
/**
* Sortingdirection
*/
sortingDirection?: SortDir | null;
};
url: "/deal/";
};

View File

@ -60,6 +60,7 @@ export const zDealSchema = z.object({
name: z.string(),
lexorank: z.string(),
statusId: z.int(),
boardId: z.int(),
createdAt: z.iso.datetime({
offset: true,
}),
@ -217,6 +218,8 @@ export const zHttpValidationError = z.object({
detail: z.optional(z.array(zValidationError)),
});
export const zSortDir = z.enum(["asc", "desc"]);
/**
* UpdateBoardSchema
*/
@ -360,10 +363,15 @@ export const zGetDealsData = z.object({
path: z.optional(z.never()),
query: z.optional(
z.object({
boardId: z.optional(z.union([z.int(), z.null()])),
projectId: z.optional(z.union([z.int(), z.null()])),
boardId: z.optional(z.union([z.int(), z.null()])),
statusId: z.optional(z.union([z.int(), z.null()])),
id: z.optional(z.union([z.int(), z.null()])),
name: z.optional(z.union([z.string(), z.null()])),
page: z.optional(z.union([z.int(), z.null()])),
itemsPerPage: z.optional(z.union([z.int(), z.null()])),
sortingField: z.optional(z.union([z.string(), z.null()])),
sortingDirection: z.optional(z.union([zSortDir, z.null()])),
})
),
});