refactor(dto): centralize backend schema defaults

This commit is contained in:
2026-07-06 11:14:56 +08:00
parent 2d736f00ba
commit 473f6a3726
40 changed files with 513 additions and 231 deletions
@@ -4,11 +4,13 @@
*/
import { z } from "zod";
import { arrayOrEmpty, numberOrZero } from "../nullable-defaults";
export const CreditsHistoryDataSchema = z.object({
records: z.array(z.record(z.string(), z.unknown())),
total: z.number(),
limit: z.number(),
offset: z.number(),
records: arrayOrEmpty(z.record(z.string(), z.unknown())),
total: numberOrZero,
limit: numberOrZero,
offset: numberOrZero,
});
export type CreditsHistoryDataInput = z.input<typeof CreditsHistoryDataSchema>;