feat: implement invite onboarding and dynamic ticket fields
This commit is contained in:
parent
29a647f6c6
commit
f24a7f68ca
34 changed files with 2240 additions and 97 deletions
|
|
@ -77,6 +77,17 @@ export const ticketEventSchema = z.object({
|
|||
createdAt: z.coerce.date(),
|
||||
})
|
||||
export type TicketEvent = z.infer<typeof ticketEventSchema>
|
||||
|
||||
export const ticketFieldTypeSchema = z.enum(["text", "number", "select", "date", "boolean"])
|
||||
export type TicketFieldType = z.infer<typeof ticketFieldTypeSchema>
|
||||
|
||||
export const ticketCustomFieldValueSchema = z.object({
|
||||
label: z.string(),
|
||||
type: ticketFieldTypeSchema,
|
||||
value: z.union([z.string(), z.number(), z.boolean(), z.coerce.date()]).optional(),
|
||||
displayValue: z.string().optional(),
|
||||
})
|
||||
export type TicketCustomFieldValue = z.infer<typeof ticketCustomFieldValueSchema>
|
||||
|
||||
export const ticketSchema = z.object({
|
||||
id: z.string(),
|
||||
|
|
@ -131,7 +142,7 @@ export type Ticket = z.infer<typeof ticketSchema>
|
|||
|
||||
export const ticketWithDetailsSchema = ticketSchema.extend({
|
||||
description: z.string().optional(),
|
||||
customFields: z.record(z.string(), z.any()).optional(),
|
||||
customFields: z.record(z.string(), ticketCustomFieldValueSchema).optional(),
|
||||
timeline: z.array(ticketEventSchema),
|
||||
comments: z.array(ticketCommentSchema),
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue