package com.red.circle.wallet.domain.salary;

import com.red.circle.tool.core.tuple.PennyAmount;
import lombok.Data;
import lombok.experimental.Accessors;

/**
 * 工资凭证响应.
 */
@Data
@Accessors(chain = true)
public class SalaryReceiptRes {

  /**
   * 流水记录ID.
   */
  private Long recordId;

  /**
   * 变动后余额.
   */
  private PennyAmount balance;

  /**
   * 变动后可用余额.
   */
  private PennyAmount availableBalance;

  /**
   * 变动金额.
   */
  private PennyAmount amount;

  public static SalaryReceiptRes of(Long recordId, PennyAmount balance, 
      PennyAmount availableBalance, PennyAmount amount) {
    return new SalaryReceiptRes()
        .setRecordId(recordId)
        .setBalance(balance)
        .setAvailableBalance(availableBalance)
        .setAmount(amount);
  }
}
