import {LoanModel} from './loan.model';
import {UploadMetaModel} from './uploadMetaModel';

export class PayInModel {
  public Id: number;
  public Amount: number;
  public Balance: number;
  public Lender: string;
  public LoanId: string;
  public LoanNumber: string;
  public OffsetBalance: number;
  public Settlement: Date;
  public IncomeAmount: number;
  public IncomeType: string;
  public Ts: Date;
  public UploadId: number;
  constructor(payload: Partial<PayInModel>){
    if ( payload === null ) {
      payload = {};
    }
    this.Id = payload.Id || 0;
    this.Amount = payload.Amount || 0;
    this.Balance = payload.Balance || 0;
    this.Lender = payload.Lender || '';
    this.LoanId = payload.LoanId || '' ;
    this.LoanNumber = payload.LoanNumber || '';
    this.OffsetBalance = payload.OffsetBalance || 0;
    if (payload.Settlement === undefined || payload.Settlement === null) {
      this.Settlement = new Date();
    }else{
      this.Settlement = new Date(payload.Settlement);
    }
    this.Settlement = new Date(payload.Settlement);
    this.IncomeAmount = payload.IncomeAmount || 0 ;
    this.IncomeType = payload.IncomeType || '';
    if (payload.Ts === undefined || payload.Ts === null) {
      this.Ts = new Date();
    }else{
      this.Ts = new Date(payload.Ts);
    }
    this.UploadId = payload.UploadId;
  }
}


