Journal dashboard widgets and quick-add; rich-text quick-add dialogs. Dashboard draft sync for live edit previews; assistant bubble + API tools. Journal UX: stress slider, mood grid, query cap fix.
55 lines
2.0 KiB
TypeScript
55 lines
2.0 KiB
TypeScript
import { z } from "zod";
|
|
|
|
export const containerInput = z.object({
|
|
name: z.string().trim().min(1).max(120),
|
|
type: z.string().trim().min(1).max(40).default("other"),
|
|
locationNotes: z.string().trim().max(500).nullable().optional(),
|
|
coverImageUrl: z.string().trim().max(500).nullable().optional(),
|
|
});
|
|
|
|
export const containerUpdateInput = containerInput.partial();
|
|
|
|
export const plantInput = z.object({
|
|
name: z.string().trim().min(1).max(120),
|
|
category: z.string().trim().min(1).max(40).default("other"),
|
|
containerId: z.string().uuid().nullable().optional(),
|
|
healthStatus: z.string().trim().min(1).max(40).default("healthy"),
|
|
growthStage: z.string().trim().max(40).nullable().optional(),
|
|
scientificName: z.string().trim().max(200).nullable().optional(),
|
|
speciesId: z.string().trim().max(100).nullable().optional(),
|
|
sunlight: z.string().trim().max(200).nullable().optional(),
|
|
wateringNotes: z.string().trim().max(2000).nullable().optional(),
|
|
fertilizingNotes: z.string().trim().max(2000).nullable().optional(),
|
|
notes: z.string().trim().max(2000).nullable().optional(),
|
|
acquisitionDate: z.string().nullable().optional(),
|
|
images: z.array(z.string().min(1)).max(10).default([]),
|
|
primaryImageUrl: z.string().min(1).nullable().optional(),
|
|
});
|
|
|
|
export const plantUpdateInput = plantInput.partial();
|
|
|
|
export const careLogInput = z.object({
|
|
plantId: z.string().uuid(),
|
|
careType: z.string().trim().min(1).max(40),
|
|
notes: z.string().trim().max(2000).nullable().optional(),
|
|
performedAt: z.string().optional(),
|
|
});
|
|
|
|
export const careScheduleInput = z.object({
|
|
plantId: z.string().uuid(),
|
|
careType: z.string().trim().min(1).max(40),
|
|
intervalDays: z.number().int().min(1).max(365),
|
|
enabled: z.boolean().optional(),
|
|
});
|
|
|
|
export const careScheduleToggleInput = z.object({
|
|
id: z.string().uuid(),
|
|
enabled: z.boolean(),
|
|
});
|
|
|
|
export const scheduleOnCalendarInput = z.object({
|
|
scheduleId: z.string().uuid(),
|
|
calendarId: z.string().uuid(),
|
|
reminderMinutesBefore: z.number().int().min(0).max(1440).optional(),
|
|
});
|