package jnpf.model.attendance.model;

import cn.hutool.core.collection.CollUtil;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.util.List;
import java.util.Objects;

/**
 * @author shitou
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class LeaveTypeStaModel {
    /**
     * 是否调休(0-否  1-是)
     */
    private Integer isRest;
    /**
     * 请假天数
     */
    private BigDecimal leaveDays = BigDecimal.ZERO;
    /**
     * 请假小数数
     */
    private BigDecimal leaveHours = BigDecimal.ZERO;
    /**
     * 请假计薪小时数
     */
    private BigDecimal leavePayrollHours = BigDecimal.ZERO;
    /**
     * 请假申请记录集合
     */
    private List<LeaveTypeStaDetailsModel> applyList = CollUtil.newArrayList();

    public BigDecimal getLeavePayrollHours() {
        if (Objects.nonNull(leavePayrollHours)) {
            return leavePayrollHours;
        }
        return leaveHours;
    }
}
