export type CafeCompanionOwnerType = 'npc' | 'hired_player';
export type CafeCompanionChatRole = 'system' | 'user' | 'assistant';
export type CafeCompanionAgentProtocol = 'openai' | 'anthropic';

export interface CafeCompanionServicePoint {
  id: string;
  role_type: string;
  label: string;
}

export interface CafeCompanionAgent {
  id: string;
  owner_type: CafeCompanionOwnerType;
  owner_id: string;
  persona_name: string;
  protocol: CafeCompanionAgentProtocol;
  base_url: string;
  token: string;
  model: string;
  persona_prompt: string;
  welcome_message: string;
  enabled: boolean;
}

export interface CafeCompanionModelOption {
  id: string;
  label: string;
  object?: string;
  owned_by?: string;
}

export interface CafeCompanionOccupant {
  id: string;
  service_point_id: string;
  occupant_type: CafeCompanionOwnerType;
  persona_name: string;
  chat_agent_id: string;
  owner_user_id?: string;
  employment_starts_at?: string;
  employment_ends_at?: string;
  employment_minutes?: number;
  employment_status?: 'active' | 'ended';
  earned_whale_coin?: number;
}

export interface CafeCompanionChatProduct {
  minutes: number;
  price: number;
  currency: 'whale_coin';
  label: string;
}

export interface CafeCompanionChatMessage {
  id: string;
  role: CafeCompanionChatRole;
  content: string;
  created_at: string;
}

export interface CafeCompanionChatSession {
  id: string;
  user_id: string;
  service_point_id: string;
  occupant_id: string;
  chat_agent_id: string;
  purchased_minutes: number;
  expires_at: string;
  messages: CafeCompanionChatMessage[];
  created_at: string;
  updated_at: string;
}
