feat(i18n): add internationalization support with English and Spanish translations
feat(kiosk): implement kiosk report submission functionality with offline support test(outbox): add tests for outbox functionality including report submission and error handling feat(outbox): create outbox management for queued reports with IndexedDB persistence feat(uuid): add UUID generation utility for client IDs feat(qr): implement QR code generation for reporting links by site and area feat(kiosk): create Kiosk page for reporting incidents without an account
This commit is contained in:
1 parent
3f6dff5f24
commit
3e964d1176
64 files changed
+10056
-267
No files matched your search
+11
-1
@@ -39,10 +39,12 @@ export const createIncidentSchema = z.object({
|
||||
description: optionalText(10_000),
|
||||
immediateAction: optionalText(10_000),
|
||||
anonymous: z.boolean().default(false),
|
||||
/** Random id from the reporting device; resubmitting the same id returns the existing report. */
|
||||
clientId: z.uuid().optional(),
|
||||
})
|
||||
|
||||
/** Status changes go through transitions, not updates. */
|
||||
export const updateIncidentSchema = createIncidentSchema.omit({ anonymous: true }).partial()
|
||||
export const updateIncidentSchema = createIncidentSchema.omit({ anonymous: true, clientId: true }).partial()
|
||||
|
||||
export const transitionSchema = z.object({ to: z.enum(incidentStatuses), note: optionalText(5_000) })
|
||||
|
||||
@@ -87,6 +89,13 @@ export const actionListQuery = z.object({
|
||||
filter: z.enum(['open', 'overdue', 'done', 'all']).default('open'),
|
||||
})
|
||||
|
||||
export const createKioskSchema = z.object({ name, siteId: z.uuid().nullish() })
|
||||
|
||||
export const updateKioskSchema = z.object({ name: name.optional(), siteId: z.uuid().nullish(), revoked: z.boolean().optional() })
|
||||
|
||||
/** Report filed through a reporting link (kiosk tablet or QR code), without an account. */
|
||||
export const kioskReportSchema = createIncidentSchema.omit({ anonymous: true }).extend({ reporterName: optionalText(200) })
|
||||
|
||||
export const emailOnlySchema = z.object({ email })
|
||||
|
||||
export const tokenSchema = z.object({ token: z.string().min(20).max(200) })
|
||||
@@ -105,6 +114,7 @@ export const incidentListQuery = z.object({
|
||||
|
||||
export type SetupInput = z.infer<typeof setupSchema>
|
||||
export type CreateIncidentInput = z.input<typeof createIncidentSchema>
|
||||
export type KioskReportInput = z.input<typeof kioskReportSchema>
|
||||
export type UpdateIncidentInput = z.infer<typeof updateIncidentSchema>
|
||||
export type CreateActionInput = z.input<typeof createActionSchema>
|
||||
export type UpdateActionInput = z.input<typeof updateActionSchema>
|
||||
|
||||
Reference in new issue
Block a user