export interface User {
  id: string;
  name: string;
  email: string;
  role: string;
  tenantId: string;
  isOwner?: boolean;
  status?: string;
}

export interface TenantSummary {
  id: string;
  name: string;
  document: string;
  plan: string;
  role?: string;
}

export interface AuthTokens {
  access_token: string;
  user: User;
  tenants?: TenantSummary[];
}

export interface Tenant {
  id: string;
  name: string;
  document: string;
  email: string;
  plan: string;
  status: string;
}

export interface Client {
  id: string;
  tenantId: string;
  type: string;
  name: string;
  document?: string;
  email?: string;
  phone?: string;
  phoneCommercial?: string;
  phoneFinancial?: string;
  emailCommercial?: string;
  emailFinancial?: string;
  emailNf?: string;
  status: string;
  createdAt: string;
}

export interface Product {
  id: string;
  tenantId: string;
  name: string;
  description?: string;
  status: string;
  isUsed?: boolean;
  createdAt: string;
}

export interface Proposal {
  id: string;
  tenantId: string;
  clientId: string;
  number: string;
  title?: string;
  total: number;
  status: string;
  createdAt: string;
}

export interface Contract {
  id: string;
  tenantId: string;
  clientId: string;
  number: string;
  title?: string;
  total: number;
  startDate: string;
  status: string;
  createdAt: string;
}

export interface Charge {
  id: string;
  tenantId: string;
  clientId: string;
  contractId?: string;
  number: string;
  amount: number;
  amountPaid?: number;
  discount?: number;
  fine?: number;
  interest?: number;
  description?: string;
  dueDate: string;
  paidAt?: string;
  paymentMethod?: string;
  paymentReference?: string;
  paymentNotes?: string;
  status: string;
  // gateway (v.api)
  gateway?: string;
  gatewayChargeId?: string;
  pixCopyPaste?: string;
  pixTxid?: string;
  boletoUrl?: string;
  boletoBarcode?: string;
  cardLinkUrl?: string;
  linkExpiresAt?: string;
  createdAt: string;
}

export interface Invoice {
  id: string;
  tenantId: string;
  clientId: string;
  chargeId?: string;
  rpsNumber: number;
  nfseNumber?: string;
  nfseVerifyCode?: string;
  nfseUrl?: string;
  competenceDate?: string;
  serviceAmount: number;
  issAliquota?: number;
  issRetained?: boolean;
  issAmount?: number;
  status: string;
  errorMessage?: string;
  retryCount?: number;
  emailSentAt?: string;
  createdAt: string;
}

export interface ApiError {
  statusCode: number;
  message: string;
}
