03922764db
Schema: - Client model: add tags String[] field - Shared types + Zod schemas updated for tags API: - client.create/update: accept tags array - client.delete: with safety checks (no projects, no children) - client.batchUpdateSortOrder: batch reorder in transaction UI (complete redesign of ClientsAdminClient): - Drag-and-drop reordering via @dnd-kit (sortable) - Inline editing: click name/sortOrder to edit in-place - Tag pills: auto-colored by hash, add/remove inline - Tag auto-suggest from existing tags across all clients - Sticky "Add Client" input row at top - Search/filter by name, code, or tag - Delete with inline confirmation - Optimistic reorder (instant UI update) - Full dark theme support Co-Authored-By: claude-flow <ruv@ruv.net>
22 lines
731 B
TypeScript
22 lines
731 B
TypeScript
import { z } from "zod";
|
|
|
|
export const CreateClientSchema = z.object({
|
|
name: z.string().min(1).max(300),
|
|
code: z.string().max(50).optional(),
|
|
parentId: z.string().optional(),
|
|
sortOrder: z.number().int().default(0),
|
|
tags: z.array(z.string().max(50)).optional(),
|
|
});
|
|
|
|
export const UpdateClientSchema = z.object({
|
|
name: z.string().min(1).max(300).optional(),
|
|
code: z.string().max(50).nullable().optional(),
|
|
sortOrder: z.number().int().optional(),
|
|
isActive: z.boolean().optional(),
|
|
parentId: z.string().nullable().optional(),
|
|
tags: z.array(z.string().max(50)).optional(),
|
|
});
|
|
|
|
export type CreateClientInput = z.infer<typeof CreateClientSchema>;
|
|
export type UpdateClientInput = z.infer<typeof UpdateClientSchema>;
|