chore: auto-fix Biome formatting and configure lint rules
All checks were successful
CI / ci (push) Successful in 15s
All checks were successful
CI / ci (push) Successful in 15s
Run biome check --write --unsafe to fix tabs, import ordering, and non-null assertions across entire codebase. Disable a11y rules not applicable to this single-user app. Exclude auto-generated routeTree. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,67 +1,67 @@
|
||||
import { z } from "zod";
|
||||
|
||||
export const createItemSchema = z.object({
|
||||
name: z.string().min(1, "Name is required"),
|
||||
weightGrams: z.number().nonnegative().optional(),
|
||||
priceCents: z.number().int().nonnegative().optional(),
|
||||
categoryId: z.number().int().positive(),
|
||||
notes: z.string().optional(),
|
||||
productUrl: z.string().url().optional().or(z.literal("")),
|
||||
imageFilename: z.string().optional(),
|
||||
name: z.string().min(1, "Name is required"),
|
||||
weightGrams: z.number().nonnegative().optional(),
|
||||
priceCents: z.number().int().nonnegative().optional(),
|
||||
categoryId: z.number().int().positive(),
|
||||
notes: z.string().optional(),
|
||||
productUrl: z.string().url().optional().or(z.literal("")),
|
||||
imageFilename: z.string().optional(),
|
||||
});
|
||||
|
||||
export const updateItemSchema = createItemSchema.partial().extend({
|
||||
id: z.number().int().positive(),
|
||||
id: z.number().int().positive(),
|
||||
});
|
||||
|
||||
export const createCategorySchema = z.object({
|
||||
name: z.string().min(1, "Category name is required"),
|
||||
icon: z.string().min(1).max(50).default("package"),
|
||||
name: z.string().min(1, "Category name is required"),
|
||||
icon: z.string().min(1).max(50).default("package"),
|
||||
});
|
||||
|
||||
export const updateCategorySchema = z.object({
|
||||
id: z.number().int().positive(),
|
||||
name: z.string().min(1).optional(),
|
||||
icon: z.string().min(1).max(50).optional(),
|
||||
id: z.number().int().positive(),
|
||||
name: z.string().min(1).optional(),
|
||||
icon: z.string().min(1).max(50).optional(),
|
||||
});
|
||||
|
||||
// Thread schemas
|
||||
export const createThreadSchema = z.object({
|
||||
name: z.string().min(1, "Thread name is required"),
|
||||
categoryId: z.number().int().positive(),
|
||||
name: z.string().min(1, "Thread name is required"),
|
||||
categoryId: z.number().int().positive(),
|
||||
});
|
||||
|
||||
export const updateThreadSchema = z.object({
|
||||
name: z.string().min(1).optional(),
|
||||
categoryId: z.number().int().positive().optional(),
|
||||
name: z.string().min(1).optional(),
|
||||
categoryId: z.number().int().positive().optional(),
|
||||
});
|
||||
|
||||
// Candidate schemas (same fields as items)
|
||||
export const createCandidateSchema = z.object({
|
||||
name: z.string().min(1, "Name is required"),
|
||||
weightGrams: z.number().nonnegative().optional(),
|
||||
priceCents: z.number().int().nonnegative().optional(),
|
||||
categoryId: z.number().int().positive(),
|
||||
notes: z.string().optional(),
|
||||
productUrl: z.string().url().optional().or(z.literal("")),
|
||||
imageFilename: z.string().optional(),
|
||||
name: z.string().min(1, "Name is required"),
|
||||
weightGrams: z.number().nonnegative().optional(),
|
||||
priceCents: z.number().int().nonnegative().optional(),
|
||||
categoryId: z.number().int().positive(),
|
||||
notes: z.string().optional(),
|
||||
productUrl: z.string().url().optional().or(z.literal("")),
|
||||
imageFilename: z.string().optional(),
|
||||
});
|
||||
|
||||
export const updateCandidateSchema = createCandidateSchema.partial();
|
||||
|
||||
export const resolveThreadSchema = z.object({
|
||||
candidateId: z.number().int().positive(),
|
||||
candidateId: z.number().int().positive(),
|
||||
});
|
||||
|
||||
// Setup schemas
|
||||
export const createSetupSchema = z.object({
|
||||
name: z.string().min(1, "Setup name is required"),
|
||||
name: z.string().min(1, "Setup name is required"),
|
||||
});
|
||||
|
||||
export const updateSetupSchema = z.object({
|
||||
name: z.string().min(1, "Setup name is required"),
|
||||
name: z.string().min(1, "Setup name is required"),
|
||||
});
|
||||
|
||||
export const syncSetupItemsSchema = z.object({
|
||||
itemIds: z.array(z.number().int().positive()),
|
||||
itemIds: z.array(z.number().int().positive()),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user