package com.ffii.core.response;

import java.util.List;

import com.fasterxml.jackson.annotation.JsonInclude;

public class RecordsRes<T> {
  private List<T> records;

  @JsonInclude(JsonInclude.Include.NON_NULL)
  private Integer total;

  /** Lines where approver has not completed (approverQty and finalQty both null). */
  @JsonInclude(JsonInclude.Include.NON_NULL)
  private Integer totalWaitingForApprover;

  /** Lines where approver has completed (approverQty or finalQty set). */
  @JsonInclude(JsonInclude.Include.NON_NULL)
  private Integer totalApproved;

  /**
   * 當 {@link #total} 表示全域 available 行數時，此欄為目前 API 篩選後的筆數（供分頁）。
   */
  @JsonInclude(JsonInclude.Include.NON_NULL)
  private Integer filteredRecordCount;

  public RecordsRes() {
  }

  public RecordsRes(List<T> records) {
    this.records = records;
  }

  public RecordsRes(List<T> records, Integer total) {
    this.records = records;
    this.total = total;
  }

  public List<T> getRecords() {
    return records;
  }

  public void setRecords(List<T> records) {
    this.records = records;
  }

  public Integer getTotal() {
    return total;
  }

  public void setTotal(Integer total) {
    this.total = total;
  }

  public Integer getTotalWaitingForApprover() {
    return totalWaitingForApprover;
  }

  public void setTotalWaitingForApprover(Integer totalWaitingForApprover) {
    this.totalWaitingForApprover = totalWaitingForApprover;
  }

  public Integer getTotalApproved() {
    return totalApproved;
  }

  public void setTotalApproved(Integer totalApproved) {
    this.totalApproved = totalApproved;
  }

  public Integer getFilteredRecordCount() {
    return filteredRecordCount;
  }

  public void setFilteredRecordCount(Integer filteredRecordCount) {
    this.filteredRecordCount = filteredRecordCount;
  }

}
