28 lines
1.0 KiB
TypeScript
28 lines
1.0 KiB
TypeScript
import { z } from 'zod'
|
|
|
|
export const teamFunctionInputSchema = z.object({
|
|
organizationUnitId: z.string().trim().min(1).max(100),
|
|
revision: z.number().int().min(0),
|
|
leadEmployeeProfileId: z.string().trim().min(1).max(100).nullable(),
|
|
description: z.string().trim().max(2000),
|
|
branches: z.array(z.object({
|
|
label: z.string().trim().min(1).max(40),
|
|
items: z.array(z.string().trim().min(1).max(200)).min(1).max(30),
|
|
}).strict()).max(10),
|
|
}).strict()
|
|
|
|
export type TeamFunctionInput = z.infer<typeof teamFunctionInputSchema>
|
|
export type FunctionBranch = TeamFunctionInput['branches'][number]
|
|
export type TeamFunction = {
|
|
organizationUnitId: string
|
|
name: string
|
|
path: string
|
|
lead: { employeeProfileId: string; name: string } | null
|
|
leadStatus: 'active' | 'unset' | 'invalid'
|
|
description: string
|
|
branches: FunctionBranch[]
|
|
revision: number
|
|
candidates: { employeeProfileId: string; name: string; jobNumber: string | null }[]
|
|
}
|
|
export type TeamFunctionPayload = { teams: TeamFunction[]; canEdit: boolean }
|