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

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.thinkunion.park.service.common.utils.AmtUtil;
import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Positive;
import javax.validation.constraints.Size;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@Data
public class PropertyChargeFeesDeductDto {

    /**
     * 房源id
     */
    private Long houseId;
    /**
     * 账单ids
     */
    private List<Long> billIdList;

    /**
     * 实收金额；分
     */
    @JsonIgnore
    private long payAmtFen;
    public long getPayAmtFen() {
        return AmtUtil.yuanToFen(this.payAmt);
    }

    /**
     * 实扣金额：单位元
     */
    @NotNull(message = "收费总计不能为空")
    @Positive(message = "收费总计必须大于0")
    private BigDecimal payAmt;

    /**
     * 收款日期
     */
    @NotNull(message = "收款日期不能为空")
    private Date recordTime;

//    @JsonIgnore
//    private BillDetail billDetail = new BillDetail();

    /**
     * 账单列表
     */
    @Size(min = 1,message = "列表参数不能为空")
    private List<BillDetail> billDetailList;

    @Data
    public class BillDetail {
        private Long billId;
        private Long parkId;
        private Long customerId;
        private Long houseId;
        /**预存款账户id*/
        private Long feeItemId;
    }


}
