import type { Plan } from '../constants/plans';

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

export interface TenantUsage {
  cfdiCount: number;
  cfdiLimit: number;
  usersCount: number;
  usersLimit: number;
  plan: Plan;
}

export interface Subscription {
  id: string;
  tenantId: string;
  plan: Plan;
  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;
}
