package cn.iocoder.yudao.module.system.dal.dataobject.biz;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;

import java.time.LocalDate;
import java.util.*;
import java.math.BigDecimal;


import com.baomidou.mybatisplus.annotation.*;

import static cn.iocoder.yudao.framework.common.util.date.DateUtils.*;

/**
 * 日常费用 DO
 *
 * @author 管理员
 */
@TableName("elderly_daily_expenses")
@KeySequence("elderly_daily_expenses_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库，可不写。
@Data
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class DailyExpensesDO {

    /**
     * 日常费用ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    /**
     * 长者ID
     */
    private Long elderId;
    /**
     * 费用账单单号
     */
    private String expenseOrderNumber;
    /**
     * 收费费用ID
     */
    @Schema(description = "收费项ID")
    private Long itemId;
    /**
     * 费用分类
     */
    @Schema(description = "费用分类")
    private String itemCategory;
    /**
     * 费用名称
     */
    @Schema(description = "费用名称")
    private String itemName;
    /**
     * 费用来源
     */
    @Schema(description = "费用来源类型,1:日常 2：变更 3：外出 4:额外 5:分期 6:赠送 7:点餐 8:优惠抵扣 9:用药")
    private Integer type;
    /**
     * 单价
     */
    @Schema(description = "单价")
    private BigDecimal price;
    /**
     * 金额
     */
    @Schema(description = "总金额")
    private BigDecimal amount;
    /**
     * 取整金额，四舍五入后取整
     */
    @Schema(description = "取整金额")
    private BigDecimal roundAmount;

    @Schema(description = "金额（四舍五入保留两位小数）")
    private BigDecimal roundTwoDecimalAmount;
    /**
     * 缴费状态
     */
    private Integer status;
    /**
     * 备注
     */
    @Schema(description = "备注")
    private String remarks;
    /**
     * 创建人
     */
    private String createdBy;
    /**
     * 费用创建时间
     */
    @Schema(description = "费用创建时间")
    @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT)
    private Date createdTime;
    /**
     * 记账时间
     */
    @Schema(description = "记账时间")
    @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT)
    private Date accountingTime;
    /**
     * 数量
     */
    @Schema(description = "数量")
    private Integer count;

    /**
     * 归属账单月
     */
    @Schema(description = "归属账单月")
    private String attributionBillTime;

    /**
     * 是否生成过账单，0：否 1：是
     */
    private Integer isGenerateBill;

    private Long tenantId;

    @Schema(description = "开始日期")
    @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY)
    private LocalDate startDate;

    @Schema(description = "结束日期")
    @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY)
    private LocalDate endDate;



    @TableField(exist = false)
    private String elderName;


    @TableField(exist = false)
    private String idCard;

    @TableField(exist = false)
    private String bedName;

    @TableField(exist = false)
    private String tenantName;
}