import { Column, Entity, Index, PrimaryColumn } from 'typeorm';

@Entity({ name: 'payments_payments' })
export class PaymentsPaymentOrmEntity {
  @PrimaryColumn({ type: 'text' })
  id!: string;

  @Index()
  @Column({ type: 'text' })
  leagueId!: string;

  @Index()
  @Column({ type: 'text' })
  payerId!: string;

  @Index()
  @Column({ type: 'text' })
  type!: string;

  @Column({ type: 'double precision' })
  amount!: number;

  @Column({ type: 'double precision' })
  platformFee!: number;

  @Column({ type: 'double precision' })
  netAmount!: number;

  @Column({ type: 'text' })
  payerType!: string;

  @Column({ type: 'text', nullable: true })
  seasonId!: string | null;

  @Index()
  @Column({ type: 'text' })
  status!: string;

  @Column({ type: 'timestamptz' })
  createdAt!: Date;

  @Column({ type: 'timestamptz', nullable: true })
  completedAt!: Date | null;
}
