export type OrganizationPlan = "solo" | "team" | "annual";
export type RequiredOrganizationPlan = "solo" | "team";

export type OrganizationSummary = {
  id: number;
  logo_url: string | null;
  member_count: number;
  name: string;
  plan: OrganizationPlan;
  tablo_count: number;
};

export type OrganizationMember = {
  avatar_url: string | null;
  created_at: string | null;
  email: string | null;
  first_name: string | null;
  id: string;
  last_name: string | null;
  name: string | null;
  plan: OrganizationPlan;
};

export type OrganizationInvite = {
  created_at: string;
  id: number;
  invited_email: string;
  invited_member: {
    avatar_url: string | null;
    email: string | null;
    first_name: string | null;
    id: string;
    last_name: string | null;
    name: string | null;
  } | null;
  invited_user_id: string | null;
};

export type OrganizationBillingState = {
  active_subscription_plan: OrganizationPlan | null;
  active_subscription_quantity: number;
  invites_sent: OrganizationInvite[];
  is_billing_owner: boolean;
  is_trial_expired: boolean;
  members: OrganizationMember[];
  organization: OrganizationSummary;
  required_plan: RequiredOrganizationPlan;
  required_team_quantity: number;
  trial_ends_at: string;
  trial_starts_at: string;
};
