Deadline validation error (#68)

* validation errors fixed

* Deadline card design

* Update components/deadlines/DeadlineCard.tsx

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

* Update lib/api/schemas.ts

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

* Update components/deadlines/DeadlineCard.tsx

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

---------

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
This commit is contained in:
Mattsson
2026-03-21 00:47:54 +01:00
committed by GitHub
co-authored by greptile-apps[bot]
parent 5811fe8d00
commit 8df816a292
4 changed files with 242 additions and 144 deletions
+8 -8
View File
@@ -450,16 +450,16 @@ export const EvaluateMappingRulesSchema = z.union([
export const CreateDeadlineSchema = z.object({
title: z.string().min(1, 'Title is required'),
due_date: isoDate,
due_time: timeString.optional(),
due_time: timeString.nullish(),
deadline_type: DeadlineTypeSchema,
priority: DeadlinePrioritySchema.optional(),
customer_id: uuid.optional(),
notes: z.string().optional(),
tax_deadline_type: TaxDeadlineTypeSchema.optional(),
tax_period: z.string().optional(),
priority: DeadlinePrioritySchema.nullish(),
customer_id: uuid.nullish(),
notes: z.string().nullish(),
tax_deadline_type: TaxDeadlineTypeSchema.nullish(),
tax_period: z.string().nullish(),
source: DeadlineSourceSchema.optional(),
linked_report_type: z.string().optional(),
linked_report_period: z.record(z.string(), z.unknown()).optional(),
linked_report_type: z.string().nullish(),
linked_report_period: z.record(z.string(), z.unknown()).nullish(),
})
// ============================================================
+3 -3
View File
@@ -242,9 +242,9 @@ export const PRIORITY_LABELS: Record<string, string> = {
// Priority colors for styling
export const PRIORITY_COLORS: Record<string, { bg: string; text: string; border: string }> = {
critical: { bg: 'bg-red-50', text: 'text-red-700', border: 'border-red-200' },
important: { bg: 'bg-orange-50', text: 'text-orange-700', border: 'border-orange-200' },
normal: { bg: 'bg-gray-50', text: 'text-gray-700', border: 'border-gray-200' }
critical: { bg: 'bg-red-50 dark:bg-red-950/40', text: 'text-red-700 dark:text-red-400', border: 'border-red-200 dark:border-red-800/50' },
important: { bg: 'bg-orange-50 dark:bg-orange-950/40', text: 'text-orange-700 dark:text-orange-400', border: 'border-orange-200 dark:border-orange-800/50' },
normal: { bg: 'bg-gray-50 dark:bg-gray-800/40', text: 'text-gray-700 dark:text-gray-300', border: 'border-gray-200 dark:border-gray-700/50' }
}
// ============================================================