feat: Add services, company documents, company timesheet export
- Add services table and CRUD endpoints (/api/services) - Add company documents upload/download functionality - Add company timesheet XLSX export endpoint - Remove admin requirement from event routes (all authenticated users can manage events) - Add service validators Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -177,7 +177,7 @@ export const updateTimeEntrySchema = z.object({
|
||||
export const createEventSchema = z.object({
|
||||
title: z.string().min(1, 'Názov je povinný'),
|
||||
description: z.string().optional(),
|
||||
type: z.enum(['meeting', 'event', 'important']).default('meeting'),
|
||||
type: z.enum(['meeting', 'event', 'important', 'dostupnost', 'ine']).default('meeting'),
|
||||
start: z.string().min(1, 'Začiatok je povinný'),
|
||||
end: z.string().min(1, 'Koniec je povinný'),
|
||||
assignedUserIds: z.array(z.string().uuid('Neplatný formát user ID')).optional(),
|
||||
@@ -186,8 +186,30 @@ export const createEventSchema = z.object({
|
||||
export const updateEventSchema = z.object({
|
||||
title: z.string().min(1).optional(),
|
||||
description: z.string().optional(),
|
||||
type: z.enum(['meeting', 'event', 'important']).optional(),
|
||||
type: z.enum(['meeting', 'event', 'important', 'dostupnost', 'ine']).optional(),
|
||||
start: z.string().optional(),
|
||||
end: z.string().optional(),
|
||||
assignedUserIds: z.array(z.string().uuid('Neplatný formát user ID')).optional(),
|
||||
});
|
||||
|
||||
// Service validators
|
||||
export const createServiceSchema = z.object({
|
||||
name: z
|
||||
.string({
|
||||
required_error: 'Názov služby je povinný',
|
||||
})
|
||||
.min(1, 'Názov služby nemôže byť prázdny')
|
||||
.max(255, 'Názov služby môže mať maximálne 255 znakov'),
|
||||
price: z
|
||||
.string({
|
||||
required_error: 'Cena je povinná',
|
||||
})
|
||||
.min(1, 'Cena nemôže byť prázdna'),
|
||||
description: z.string().max(1000).optional(),
|
||||
});
|
||||
|
||||
export const updateServiceSchema = z.object({
|
||||
name: z.string().min(1).max(255).optional(),
|
||||
price: z.string().min(1).optional(),
|
||||
description: z.string().max(1000).optional().or(z.literal('').or(z.null())),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user