/**
 * 本地用户权益快照
 *
 * 只持久化 UI 初始化必须的两个字段，完整权益数据仍由
 * `GET /api/user/entitlements` 实时获取。
 */
import { z } from "zod";

import { booleanOrFalse, numberOrZero } from "../nullable-defaults";

export const UserEntitlementSnapshotSchema = z.object({
  isVip: booleanOrFalse,
  creditBalance: numberOrZero,
});

export type UserEntitlementSnapshotInput = z.input<
  typeof UserEntitlementSnapshotSchema
>;
export type UserEntitlementSnapshotData = z.output<
  typeof UserEntitlementSnapshotSchema
>;
