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 java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * vpp_dr_subsidy_prediction - 需求响应补贴金额预测
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("vpp_dr_subsidy_prediction")
public class VppDrSubsidyPrediction implements Serializable {

    private static final long serialVersionUID = 1L;

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

    @TableField("invitation_id")
    private Long invitationId;

    @TableField("dr_event_id")
    private Long drEventId;

    @TableField("site_id")
    private Long siteId;

    @TableField("site_name")
    private String siteName;

    /** 企业/客户ID */
    @TableField("customer_id")
    private Long customerId;

    /** 企业名称 */
    @TableField("customer_name")
    private String customerName;

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

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

    @TableField("response_duration_min")
    private Integer responseDurationMin;

    @TableField("subsidy_price")
    private BigDecimal subsidyPrice;

    /** 预估响应容量（兼容旧字段，等同平台实际响应量） */
    @TableField("estimated_capacity_kw")
    private BigDecimal estimatedCapacityKw;

    /** 实际出清（兼容旧字段，等同申报出清量） */
    @TableField("cleared_capacity_kw")
    private BigDecimal clearedCapacityKw;

    /** 实际响应量-电网 kW */
    @TableField("actual_response_grid_kw")
    private BigDecimal actualResponseGridKw;

    /** 实际响应量-平台 kW */
    @TableField("actual_response_platform_kw")
    private BigDecimal actualResponsePlatformKw;

    /** 申报出清量 kW */
    @TableField("declared_cleared_kw")
    private BigDecimal declaredClearedKw;

    /** 分成比例 0~1 */
    @TableField("share_ratio")
    private BigDecimal shareRatio;

    /** 按响应量系数（比例）命中响应量偏差价格调整表得到的价格调整系数。 */
    @TableField("price_adjustment_coefficient")
    private BigDecimal priceAdjustmentCoefficient;

    /** 完成率（百分比）= 实际出清 / 预估响应容量 × 100 */
    @TableField("completion_rate")
    private BigDecimal completionRate;

    /** 偏差率（百分比）= (1 − 完成率) × 100 */
    @TableField("deviation_rate")
    private BigDecimal deviationRate;

    /** 预估补贴金额（元）= 预估响应容量 × 时长(h) × 竞价价格 × 价格调整系数 */
    @TableField("estimated_subsidy_amount")
    private BigDecimal estimatedSubsidyAmount;

    @TableField("tenant_id")
    private Integer tenantId;

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

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