package com.usky.vpp.domain;

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 lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * vpp_contract
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("vpp_contract")
public class VppContract implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @TableField("contract_no")
    @NotBlank(message = "合同编号不能为空！")
    private String contractNo;

    @TableField("customer_id")
    @NotNull(message = "客户ID不能为空！")
    private Long customerId;

    @TableField("template_id")
    @NotNull(message = "合同模板ID不能为空！")
    private Long templateId;

    /** 关联合同ID（居间/普通一对一） */
    @TableField("related_contract_id")
    private Long relatedContractId;

    /**
     * 1购售电 2需求响应合作 3聚合代理 4服务代理 5居民充电桩 6自有资产
     */
    @TableField("contract_type")
    @NotNull(message = "合同类型不能为空！")
    private Integer contractType;

    @TableField("contract_name")
    @NotNull(message = "合同名称不能为空！")
    private String contractName;

    /** 甲方 */
    @TableField("party_a")
    private String partyA;

    /** 乙方 */
    @TableField("party_b")
    private String partyB;

    /** 合同金额 */
    @TableField("contract_amount")
    private BigDecimal contractAmount;

    /**
     * 0草稿 1审核中 2待生效 3已生效 4已驳回 5已到期 6已终止
     */
    @NotNull(message = "合同状态不能为空！")
    @TableField("contract_status")
    private Integer contractStatus;

    @TableField("sign_date")
    private LocalDate signDate;

    @TableField("effective_date")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate effectiveDate;

    @TableField("expire_date")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate expireDate;

    @TableField("file_url")
    private String fileUrl;

    /**
     * 客户比例
    */
    @TableField("customer_ratio")
    private BigDecimal customerRatio;

    /**
     * 运营商比例
     */
    @TableField("operator_ratio")
    private BigDecimal operatorRatio;

    @TableField("price_json")
    private String priceJson;

    @TableField("account_info_json")
    private String accountInfoJson;

    @TableField("remark")
    private String remark;

    @TableField("tenant_id")
    private Integer tenantId;

    @TableField("create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @TableField("update_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

    @TableField("created_by")
    private String createdBy;

    @TableField("updated_by")
    private String updatedBy;

    @TableField("delete_flag")
    private Integer deleteFlag;

    @TableField("deleted_at")
    private LocalDateTime deletedAt;
}
