Files
cozsweet-frontend-nextjs/src/data/schemas/chat/response/unlock_private_response.ts
T
Codex 8c0d1ad3ce
Docker Image / Build and Push Docker Image (push) Successful in 5m2s
feat(chat): render role-bound payment guidance
2026-07-27 18:21:13 +08:00

45 lines
1.3 KiB
TypeScript

import { z } from "zod";
import {
booleanOrFalse,
numberOrZero,
stringOrEmpty,
stringOrNull,
} from "../../nullable-defaults";
import { ChatLockTypeSchema } from "../chat_lock_type";
import { ChatImageSchema } from "../chat_payloads";
import { PaymentGuidanceSchema } from "./chat_send_response";
/**
* 单条历史付费 / 私密消息解锁响应。
*/
export const UnlockPrivateReasonSchema = stringOrEmpty;
export const UnlockPrivateResponseSchema = z
.object({
unlocked: booleanOrFalse,
content: stringOrEmpty,
messageId: stringOrEmpty,
clientLockId: stringOrNull,
lockType: ChatLockTypeSchema.nullable().default(null),
audioUrl: stringOrEmpty,
image: ChatImageSchema,
reason: UnlockPrivateReasonSchema,
creditBalance: numberOrZero,
creditsCharged: numberOrZero,
requiredCredits: numberOrZero,
shortfallCredits: numberOrZero,
paymentGuidance: PaymentGuidanceSchema.nullish().default(null),
})
.readonly();
export type UnlockPrivateReason = z.output<typeof UnlockPrivateReasonSchema>;
export type UnlockPrivateResponseInput = z.input<
typeof UnlockPrivateResponseSchema
>;
export type UnlockPrivateResponseData = z.output<
typeof UnlockPrivateResponseSchema
>;
export type UnlockPrivateResponse = UnlockPrivateResponseData;