Add read-only Noya admin panel with assignments and UX polish.
Ship admin auth, user overview, assessments, chats, assignment filters/export, security hardening, and a separate desktop admin shell with clearer assessment answers. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
export const assignmentListFilterSchema = z.object({
|
||||
filter: z.enum(['active', 'pending_report', 'completed', 'all']).optional().default('all'),
|
||||
});
|
||||
|
||||
/** Soft experience note — does not complete the assignment by itself. */
|
||||
export const assignmentReportBodySchema = z.object({
|
||||
reportText: z.string().trim().min(3).max(5000),
|
||||
reportStatus: z.enum(['completed', 'in_progress', 'difficult', 'not_started']),
|
||||
});
|
||||
|
||||
export const assignmentEntryBodySchema = z.object({
|
||||
entryDate: z
|
||||
.string()
|
||||
.regex(/^\d{4}-\d{2}-\d{2}$/, 'entryDate must be YYYY-MM-DD')
|
||||
.optional(),
|
||||
dayStatus: z.enum(['done', 'skipped', 'difficult']).optional().default('done'),
|
||||
responseData: z.record(z.unknown()),
|
||||
note: z.string().trim().max(2000).optional().nullable(),
|
||||
});
|
||||
|
||||
export const assignmentEntryPatchSchema = z.object({
|
||||
dayStatus: z.enum(['done', 'skipped', 'difficult']).optional(),
|
||||
responseData: z.record(z.unknown()).optional(),
|
||||
note: z.string().trim().max(2000).optional().nullable(),
|
||||
});
|
||||
|
||||
export const assignmentStartSchema = z.object({}).optional();
|
||||
|
||||
export const assignmentCompleteSchema = z.object({
|
||||
completionNote: z.string().trim().max(2000).optional().nullable(),
|
||||
});
|
||||
|
||||
export const assignmentDraftSchema = z.object({
|
||||
draftData: z.record(z.unknown()),
|
||||
/** When true, required fields must be valid and the assignment is marked COMPLETED. */
|
||||
completeIfValid: z.boolean().optional().default(false),
|
||||
});
|
||||
Reference in New Issue
Block a user