feat: board and status selects in deal editor

This commit is contained in:
2025-09-02 14:41:28 +04:00
parent a6d8948e9d
commit 72ed69db24
13 changed files with 192 additions and 121 deletions

View File

@ -174,14 +174,8 @@ export type DealSchema = {
* Lexorank
*/
lexorank: string;
/**
* Statusid
*/
statusId: number;
/**
* Boardid
*/
boardId: number;
status: StatusSchema;
board: BoardSchema;
/**
* Createdat
*/
@ -387,6 +381,10 @@ export type UpdateDealSchema = {
* Lexorank
*/
lexorank?: string | null;
/**
* Boardid
*/
boardId?: number | null;
/**
* Statusid
*/

View File

@ -52,6 +52,15 @@ export const zCreateDealRequest = z.object({
entity: zCreateDealSchema,
});
/**
* StatusSchema
*/
export const zStatusSchema = z.object({
id: z.int(),
name: z.string(),
lexorank: z.string(),
});
/**
* DealSchema
*/
@ -59,8 +68,8 @@ export const zDealSchema = z.object({
id: z.int(),
name: z.string(),
lexorank: z.string(),
statusId: z.int(),
boardId: z.int(),
status: zStatusSchema,
board: zBoardSchema,
createdAt: z.iso.datetime({
offset: true,
}),
@ -120,15 +129,6 @@ export const zCreateStatusRequest = z.object({
entity: zCreateStatusSchema,
});
/**
* StatusSchema
*/
export const zStatusSchema = z.object({
id: z.int(),
name: z.string(),
lexorank: z.string(),
});
/**
* CreateStatusResponse
*/
@ -248,6 +248,7 @@ export const zUpdateBoardResponse = z.object({
export const zUpdateDealSchema = z.object({
name: z.optional(z.union([z.string(), z.null()])),
lexorank: z.optional(z.union([z.string(), z.null()])),
boardId: z.optional(z.union([z.int(), z.null()])),
statusId: z.optional(z.union([z.int(), z.null()])),
});