feat(admin) : persist drafts and add constellation conditions
This commit is contained in:
+13
-6
@@ -77,15 +77,22 @@ export const artifactSectionSchema = z.strictObject({
|
||||
note: z.string().trim().max(2_000).nullable(),
|
||||
});
|
||||
|
||||
const constellationRowsSchema = z.array(z.strictObject({
|
||||
level: z.number().int().min(1).max(6),
|
||||
detail: z.string().trim().min(1).max(2_000),
|
||||
cumulativePercent: percent,
|
||||
isGreat: z.boolean(),
|
||||
})).max(6).refine((rows) => new Set(rows.map((row) => row.level)).size === rows.length, {
|
||||
message: "แต่ละเงื่อนไขต้องมีระดับกลุ่มดาวไม่ซ้ำกัน",
|
||||
});
|
||||
|
||||
export const constellationSectionSchema = z.strictObject({
|
||||
expectedVersion: z.number().int().positive(),
|
||||
note: z.string().trim().max(2_000).nullable(),
|
||||
rows: z.array(z.strictObject({
|
||||
level: z.number().int().min(1).max(6),
|
||||
detail: z.string().trim().min(1).max(2_000),
|
||||
cumulativePercent: percent,
|
||||
isGreat: z.boolean(),
|
||||
})).max(6),
|
||||
groups: z.array(z.strictObject({
|
||||
note: z.string().trim().max(2_000).nullable(),
|
||||
rows: constellationRowsSchema,
|
||||
})).max(20),
|
||||
});
|
||||
|
||||
export const teamSectionSchema = z.strictObject({
|
||||
|
||||
Reference in New Issue
Block a user