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

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

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

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

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

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

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

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

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