import type { DespachoPlan } from '../constants/despacho-plans';

export interface Tenant {
  id: string;
  nombre: string;
  rfc: string;
  plan: DespachoPlan;
  databaseName: string;
  active: boolean;
  createdAt: Date;
  expiresAt: Date | null;
}

export interface TenantUsage {
  cfdiCount: number;
  usersCount: number;
  plan: DespachoPlan;
}

export interface Subscription {
  id: string;
  tenantId: string;
  plan: DespachoPlan;
  mpPreapprovalId?: string;
  status: 'pending' | 'authorized' | 'paused' | 'cancelled';
  amount: number;
  frequency: 'monthly' | 'yearly';
  currentPeriodStart?: string;
  currentPeriodEnd?: string;
  createdAt: string;
  updatedAt: string;
}

export interface Payment {
  id: string;
  tenantId: string;
  subscriptionId?: string;
  mpPaymentId?: string;
  amount: number;
  status: 'approved' | 'pending' | 'rejected' | 'refunded';
  paymentMethod?: string;
  paidAt?: string;
  createdAt: string;
}
