import { Entity, Column } from 'typeorm';
import { BaseEntity } from '@genex/common';

export enum ClaimStatus {
  PENDING = 'pending',
  PROCESSING = 'processing',
  PAID = 'paid',
  REJECTED = 'rejected',
}

@Entity('insurance_claims')
export class InsuranceClaim extends BaseEntity {
  @Column({ name: 'user_id', type: 'uuid' })
  userId: string;

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

  @Column({ type: 'decimal', precision: 18, scale: 2 })
  amount: string;

  @Column({ type: 'enum', enum: ClaimStatus, default: ClaimStatus.PENDING })
  status: ClaimStatus;

  @Column({ name: 'related_order_id', type: 'uuid', nullable: true })
  relatedOrderId: string;

  @Column({ name: 'processed_at', type: 'timestamptz', nullable: true })
  processedAt: Date;
}
