// ============================================================================
// Residence request / response types
// Generated from:
//   honeyDueAPI-go/internal/dto/requests/residence.go
//   honeyDueAPI-go/internal/dto/responses/residence.go
// ============================================================================

// ---------------------------------------------------------------------------
// Requests
// ---------------------------------------------------------------------------

export interface CreateResidenceRequest {
  name: string;
  property_type_id?: number | null;
  street_address?: string;
  apartment_unit?: string;
  city?: string;
  state_province?: string;
  postal_code?: string;
  country?: string;
  bedrooms?: number | null;
  bathrooms?: string | null;
  square_footage?: number | null;
  lot_size?: string | null;
  year_built?: number | null;
  description?: string;
  purchase_date?: string | null;
  purchase_price?: string | null;
  is_primary?: boolean | null;
}

export interface UpdateResidenceRequest {
  name?: string | null;
  property_type_id?: number | null;
  street_address?: string | null;
  apartment_unit?: string | null;
  city?: string | null;
  state_province?: string | null;
  postal_code?: string | null;
  country?: string | null;
  bedrooms?: number | null;
  bathrooms?: string | null;
  square_footage?: number | null;
  lot_size?: string | null;
  year_built?: number | null;
  description?: string | null;
  purchase_date?: string | null;
  purchase_price?: string | null;
  is_primary?: boolean | null;
}

export interface JoinWithCodeRequest {
  code: string;
}

export interface GenerateShareCodeRequest {
  expires_in_hours?: number;
}

// ---------------------------------------------------------------------------
// Responses
// ---------------------------------------------------------------------------

export interface ResidenceTypeResponse {
  id: number;
  name: string;
}

export interface ResidenceUserResponse {
  id: number;
  username: string;
  email: string;
  first_name: string;
  last_name: string;
}

export interface ResidenceResponse {
  id: number;
  owner_id: number;
  owner?: ResidenceUserResponse | null;
  users?: ResidenceUserResponse[];
  name: string;
  property_type_id: number | null;
  property_type?: ResidenceTypeResponse | null;
  street_address: string;
  apartment_unit: string;
  city: string;
  state_province: string;
  postal_code: string;
  country: string;
  bedrooms: number | null;
  bathrooms: string | null;
  square_footage: number | null;
  lot_size: string | null;
  year_built: number | null;
  description: string;
  purchase_date: string | null;
  purchase_price: string | null;
  is_primary: boolean;
  is_active: boolean;
  overdue_count: number;
  created_at: string;
  updated_at: string;
}

export interface TotalSummary {
  total_residences: number;
  total_tasks: number;
  total_pending: number;
  total_overdue: number;
  tasks_due_next_week: number;
  tasks_due_next_month: number;
}

export interface MyResidencesResponse {
  residences: ResidenceResponse[];
}

export interface ResidenceWithSummaryResponse {
  data: ResidenceResponse;
  summary: TotalSummary;
}

export interface ResidenceDeleteWithSummaryResponse {
  data: string;
  summary: TotalSummary;
}

export interface ShareCodeResponse {
  id: number;
  code: string;
  residence_id: number;
  created_by_id: number;
  is_active: boolean;
  expires_at: string | null;
  created_at: string;
}

export interface JoinResidenceResponse {
  message: string;
  residence: ResidenceResponse;
  summary: TotalSummary;
}

export interface GenerateShareCodeResponse {
  message: string;
  share_code: ShareCodeResponse;
}

export interface SharePackageResponse {
  share_code: string;
  residence_name: string;
  shared_by: string;
  expires_at?: string | null;
}
