export class RewardByUserModel {
  public Id: number;
  public Ts: Date;
  public To: string;
  public Amount: number;
  public Description: string;
  public LoanId: string;
  public PayOutId: number;
  public ToFirst: string;
  public ToMiddle: string;
  public ToLast: string;
  public ToTitle: string;
  public ToDisplay: string;
  public ToNick: string;
  public Item: string;
  public Status: string;
  public Settlement: Date;

  constructor(payload: Partial<RewardByUserModel>) {
    this.Id = payload.Id || 0;
    this.Ts = new Date(payload.Ts);
    this.To = payload.To || '';
    this.Amount = payload.Amount || 0;
    this.Description = payload.Description || '';
    this.LoanId = payload.LoanId || '';
    this.PayOutId = payload.PayOutId || 0;
    this.ToFirst = payload.ToFirst || '';
    this.ToMiddle = payload.ToMiddle || '';
    this.ToLast = payload.ToLast || '';
    this.ToTitle = payload.ToTitle || '';
    this.ToDisplay = payload.ToDisplay || '';
    this.ToNick = payload.ToNick || '';
    this.Item = payload.Item || '';
    this.Status = payload.Status || '';
    this.Settlement = new Date(payload.Settlement);
  }
  get Paid(): boolean{
    return this.PayOutId > 0 ;
  }
}
