refactor(dto): centralize backend schema defaults
This commit is contained in:
@@ -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>;
|
||||
|
||||
Reference in New Issue
Block a user