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

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.thinkunion.park.service.common.utils.AmtUtil;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;


@Data
@TableName("property_business_charges_detail")
public class PropertyBusinessChargesDetail implements Serializable {

    /**
     * id主键
     */
    @TableId(type = IdType.ASSIGN_ID)
    private Long id;
    /**
     * 经营性收费id
     */
    private Long businessChargesId;
    /**
     * 客户id
     */
    private Long customerId;
    /**
     * 收费标准id
     */
    private Long feeId;
    /**
     * 应收金额
     */
    private long receivableAmtFen;
    /**
     * 开始日期
     */
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    private Date startDate;
    /**
     * 结束日期
     */
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    private Date endDate;
    /**
     * 应收日期
     */
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    private Date receivableDate;
    /**
     * 备注
     */
    private String remark;

    private Date createTime;

    /**
     * 收费标准名称
     */
    @TableField(exist = false)
    private String feeName;
    @TableField(exist = false)
    private BigDecimal receivableAmt;
    public BigDecimal getReceivableAmt() {
        return AmtUtil.fenToYuanObj(this.receivableAmtFen);
    }
}
