fix(chat): allow nullable credit fields
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
*
|
||||
*/
|
||||
import { z } from "zod";
|
||||
import { booleanOrFalse, stringOrNull } from "../nullable-defaults";
|
||||
import { booleanOrFalse, numberOrZero, stringOrNull } from "../nullable-defaults";
|
||||
import { ChatImageSchema, ChatLockDetailSchema } from "./chat_payloads";
|
||||
|
||||
export const ChatSendResponseSchema = z.object({
|
||||
@@ -17,10 +17,10 @@ export const ChatSendResponseSchema = z.object({
|
||||
lockDetail: ChatLockDetailSchema,
|
||||
canSendMessage: z.boolean().default(true),
|
||||
cannotSendReason: stringOrNull,
|
||||
creditBalance: z.number().default(0),
|
||||
creditsCharged: z.number().default(0),
|
||||
requiredCredits: z.number().default(0),
|
||||
shortfallCredits: z.number().default(0),
|
||||
creditBalance: numberOrZero,
|
||||
creditsCharged: numberOrZero,
|
||||
requiredCredits: numberOrZero,
|
||||
shortfallCredits: numberOrZero,
|
||||
});
|
||||
|
||||
export type ChatSendResponseInput = z.input<typeof ChatSendResponseSchema>;
|
||||
|
||||
Reference in New Issue
Block a user