"use client";

/**
 * IChatStorage 接口
 *
 * 对齐 Dart 端 `IChatStorage`（lib/data/services/storage/chat/ichat_storage.dart）：
 *   - 游客每日聊天配额 + 游客总配额 两个独立字段的 CRUD
 *
 * 注：`GuestChatQuota` 模型见 `src/data/dto/chat/guest_chat_quota.ts`，
 * 数据形态 `{ remaining: number, date: string }`。
 * 跨天判断逻辑（`needsReset`）保留在 `GuestChatQuota` 类上。
 */

import type { Result } from "@/utils";
import type { GuestChatQuotaData } from "@/data/schemas/chat/guest_chat_quota";

export interface IChatStorage {
  getGuestDailyChatQuota(): Promise<Result<GuestChatQuotaData | null>>;
  setGuestDailyChatQuota(
    remaining: number,
    date: string,
  ): Promise<Result<void>>;
  clearGuestDailyChatQuota(): Promise<Result<void>>;

  getGuestTotalQuota(): Promise<Result<number | null>>;
  setGuestTotalQuota(remaining: number): Promise<Result<void>>;
  clearGuestTotalQuota(): Promise<Result<void>>;
}
