package com.yuchen.saas.park.api.dto.property;

import com.thinkunion.park.service.common.utils.AmtUtil;
import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Positive;
import java.math.BigDecimal;

@Data
public class PropertyBillBeforehandDto {

    /**
     * 操作类型，是否收费：1-是，0-否 （仅生成账单）
     */
    @NotNull(message = "操作类型参数不能为空")
    private Integer isPay;

    @NotNull(message = "客户id不能为空")
    private Long customerId;

    @NotNull(message = "房源id不能为空")
    private Long houseId;

    /**
     * 期数
     */
    private Long numbers;

    /**
     * 费用合计: 元
     */
    @NotNull(message = "费用合计不能为空",groups = Pay.class)
    @Positive(message = "费用合计必须大于",groups = Pay.class)
    private BigDecimal noPayAmt;

    private Long noPayAmtFen;
    public Long getNoPayAmtFen() {
        return AmtUtil.yuanToFenObj(this.noPayAmt);
    }

    /**
     * 实收金额: 元
     */
    @NotNull(message = "实收金额不能为空",groups = Pay.class)
    @Positive(message = "实收金额必须大于",groups = Pay.class)
    private BigDecimal payAmt;

    private Long payAmtFen;
    public Long getPayAmtFen() {
        return AmtUtil.yuanToFenObj(this.payAmt);
    }

    public interface Pay {}


}
