feat: CSV exports, PDF improvements, play internal/external with hour split, roles cleanup, admin companies with 'Cliente avulso', ticket list spacing/alignment fixes, status translations and mappings
This commit is contained in:
parent
addd4ce6e8
commit
3bafcc5a0a
45 changed files with 1401 additions and 256 deletions
|
|
@ -5,7 +5,6 @@ export const ticketStatusSchema = z.enum([
|
|||
"AWAITING_ATTENDANCE",
|
||||
"PAUSED",
|
||||
"RESOLVED",
|
||||
"CLOSED",
|
||||
])
|
||||
|
||||
export type TicketStatus = z.infer<typeof ticketStatusSchema>
|
||||
|
|
@ -26,14 +25,21 @@ export type TicketChannel = z.infer<typeof ticketChannelSchema>
|
|||
export const commentVisibilitySchema = z.enum(["PUBLIC", "INTERNAL"])
|
||||
export type CommentVisibility = z.infer<typeof commentVisibilitySchema>
|
||||
|
||||
export const userSummarySchema = z.object({
|
||||
export const userSummarySchema = z.object({
|
||||
id: z.string(),
|
||||
name: z.string(),
|
||||
email: z.string().email(),
|
||||
avatarUrl: z.string().url().optional(),
|
||||
teams: z.array(z.string()).default([]),
|
||||
})
|
||||
export type UserSummary = z.infer<typeof userSummarySchema>
|
||||
})
|
||||
export type UserSummary = z.infer<typeof userSummarySchema>
|
||||
|
||||
export const ticketCompanySummarySchema = z.object({
|
||||
id: z.string(),
|
||||
name: z.string(),
|
||||
isAvulso: z.boolean().optional(),
|
||||
})
|
||||
export type TicketCompanySummary = z.infer<typeof ticketCompanySummarySchema>
|
||||
|
||||
export const ticketCategorySummarySchema = z.object({
|
||||
id: z.string(),
|
||||
|
|
@ -88,7 +94,7 @@ export const ticketCustomFieldValueSchema = z.object({
|
|||
})
|
||||
export type TicketCustomFieldValue = z.infer<typeof ticketCustomFieldValueSchema>
|
||||
|
||||
export const ticketSchema = z.object({
|
||||
export const ticketSchema = z.object({
|
||||
id: z.string(),
|
||||
reference: z.number(),
|
||||
tenantId: z.string(),
|
||||
|
|
@ -98,8 +104,9 @@ export const ticketSchema = z.object({
|
|||
priority: ticketPrioritySchema,
|
||||
channel: ticketChannelSchema,
|
||||
queue: z.string().nullable(),
|
||||
requester: userSummarySchema,
|
||||
assignee: userSummarySchema.nullable(),
|
||||
requester: userSummarySchema,
|
||||
assignee: userSummarySchema.nullable(),
|
||||
company: ticketCompanySummarySchema.optional().nullable(),
|
||||
slaPolicy: z
|
||||
.object({
|
||||
id: z.string(),
|
||||
|
|
@ -126,11 +133,14 @@ export const ticketSchema = z.object({
|
|||
workSummary: z
|
||||
.object({
|
||||
totalWorkedMs: z.number(),
|
||||
internalWorkedMs: z.number().optional().default(0),
|
||||
externalWorkedMs: z.number().optional().default(0),
|
||||
activeSession: z
|
||||
.object({
|
||||
id: z.string(),
|
||||
agentId: z.string(),
|
||||
startedAt: z.coerce.date(),
|
||||
workType: z.string().optional(),
|
||||
})
|
||||
.nullable(),
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue