import { Expose } from 'class-transformer';

/**
 * FIFO 원천 Entity
 * 충전/적립/지급 건별 잔액 추적
 */
export class MoneySourceEntity {
  @Expose()
  msrId!: number;

  @Expose()
  memId!: number;

  @Expose()
  mwlId!: number;

  @Expose()
  msrType!: string;

  @Expose()
  msrMoneyType!: string;

  @Expose()
  msrOriginalAmount!: number;

  @Expose()
  msrRemainingAmount!: number;

  @Expose()
  mniId!: number | null;

  @Expose()
  mngId!: number | null;

  @Expose()
  mpyId!: number | null;

  @Expose()
  msrExpiredAt!: string | null;

  @Expose()
  msrCreatedAt!: string;
}

/**
 * 사용 상세 Entity
 * source 잔액 변동 기록 (FIFO 추적)
 */
export class MoneyUsageEntity {
  @Expose()
  musId!: number;

  @Expose()
  mwlId!: number;

  @Expose()
  msrId!: number;

  @Expose()
  musType!: string;

  @Expose()
  musAmount!: number;

  @Expose()
  musCreatedAt!: string;

  // 조인된 데이터 (wallet 정보)
  @Expose()
  mwlType?: string;

  @Expose()
  mwlDescription?: string | null;
}

/**
 * 이용내역 탭 조회용 Entity
 * source → usage → wallet 조인 결과
 */
export class PaymentUsageHistoryEntity {
  @Expose()
  musId!: number;

  @Expose()
  mwlType!: string;

  @Expose()
  mwlDescription!: string | null;

  @Expose()
  musAmount!: number;

  @Expose()
  mwlCreatedAt!: string;
}
