import { z } from "zod"; export const ChapterStatusSchema = z.enum([ "card-generated", "drafting", "drafted", "auditing", "audit-passed", "audit-failed", "revising", "ready-for-review", "approved", "rejected", "published", ]); export type ChapterStatus = z.infer; export const ChapterMetaSchema = z.object({ number: z.number().int().min(1), title: z.string(), status: ChapterStatusSchema, wordCount: z.number().int().default(0), createdAt: z.string().datetime(), updatedAt: z.string().datetime(), auditIssues: z.array(z.string()).default([]), reviewNote: z.string().optional(), detectionScore: z.number().min(0).max(1).optional(), detectionProvider: z.string().optional(), detectedAt: z.string().datetime().optional(), }); export type ChapterMeta = z.infer;