import type { PrivateZoneVideoPost } from "@/data/schemas/private-zone";
import type { PaymentGuidance } from "@/data/schemas/chat";

export interface PrivateZonePostPaywallRequest {
  postId: string;
  reason: string;
  requiredCredits: number;
  currentCredits: number;
  shortfallCredits: number;
  paymentGuidance?: PaymentGuidance | null;
}

export interface PrivateZonePostState {
  characterId: string;
  items: readonly PrivateZoneVideoPost[];
  creditBalance: number;
  nextCursor: string | null;
  hasMore: boolean;
  errorMessage: string | null;
  pendingConfirmPostId: string | null;
  unlockingPostId: string | null;
  unlockErrorMessage: string | null;
  unlockPaywallRequest: PrivateZonePostPaywallRequest | null;
  unlockSuccessNonce: number;
}

export function createInitialPrivateZonePostState(
  characterId: string,
): PrivateZonePostState {
  return {
    characterId,
    items: [],
    creditBalance: 0,
    nextCursor: null,
    hasMore: false,
    errorMessage: null,
    pendingConfirmPostId: null,
    unlockingPostId: null,
    unlockErrorMessage: null,
    unlockPaywallRequest: null,
    unlockSuccessNonce: 0,
  };
}
