export interface Payment {
  id: string;
  userId: string;
  tenantId: string;
  subscriptionId: string;
  amount: number;
  currency: string;
  status: 'pending' | 'completed' | 'failed' | 'refunded';
  paymentMethod: string;
  transactionId?: string;
  createdAt: Date;
  updatedAt: Date;
}

export class PaymentEntity {
  static create(data: Partial<Payment>): Payment {
    return {
      id: data.id || `pay-${Date.now()}`,
      userId: data.userId || '',
      tenantId: data.tenantId || '',
      subscriptionId: data.subscriptionId || '',
      amount: data.amount || 0,
      currency: data.currency || 'USD',
      status: data.status || 'pending',
      paymentMethod: data.paymentMethod || '',
      transactionId: data.transactionId,
      createdAt: data.createdAt || new Date(),
      updatedAt: data.updatedAt || new Date()
    };
  }
}
