package com.xzzn.ems.domain.vo;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

/**
 * 站点保护约束（供策略轮询仲裁）
 */
public class ProtectionConstraintVo implements Serializable {
    private static final long serialVersionUID = 1L;

    /** 最高保护等级：0-无保护，1/2/3 对应故障等级 */
    private Integer level;

    /** 是否允许充电 */
    private Boolean allowCharge;

    /** 是否允许放电 */
    private Boolean allowDischarge;

    /** 功率上限比例（0~1） */
    private BigDecimal powerLimitRatio;

    /** 是否强制待机 */
    private Boolean forceStandby;

    /** 是否强制停机 */
    private Boolean forceStop;

    /** 生效的方案ID列表 */
    private List<Long> sourcePlanIds;

    /** 更新时间戳（毫秒） */
    private Long updateAt;

    public Integer getLevel() {
        return level;
    }

    public void setLevel(Integer level) {
        this.level = level;
    }

    public Boolean getAllowCharge() {
        return allowCharge;
    }

    public void setAllowCharge(Boolean allowCharge) {
        this.allowCharge = allowCharge;
    }

    public Boolean getAllowDischarge() {
        return allowDischarge;
    }

    public void setAllowDischarge(Boolean allowDischarge) {
        this.allowDischarge = allowDischarge;
    }

    public BigDecimal getPowerLimitRatio() {
        return powerLimitRatio;
    }

    public void setPowerLimitRatio(BigDecimal powerLimitRatio) {
        this.powerLimitRatio = powerLimitRatio;
    }

    public Boolean getForceStandby() {
        return forceStandby;
    }

    public void setForceStandby(Boolean forceStandby) {
        this.forceStandby = forceStandby;
    }

    public Boolean getForceStop() {
        return forceStop;
    }

    public void setForceStop(Boolean forceStop) {
        this.forceStop = forceStop;
    }

    public List<Long> getSourcePlanIds() {
        return sourcePlanIds;
    }

    public void setSourcePlanIds(List<Long> sourcePlanIds) {
        this.sourcePlanIds = sourcePlanIds;
    }

    public Long getUpdateAt() {
        return updateAt;
    }

    public void setUpdateAt(Long updateAt) {
        this.updateAt = updateAt;
    }

    public static ProtectionConstraintVo empty() {
        ProtectionConstraintVo vo = new ProtectionConstraintVo();
        vo.setLevel(0);
        vo.setAllowCharge(true);
        vo.setAllowDischarge(true);
        vo.setPowerLimitRatio(BigDecimal.ONE);
        vo.setForceStandby(false);
        vo.setForceStop(false);
        vo.setSourcePlanIds(new ArrayList<>());
        vo.setUpdateAt(System.currentTimeMillis());
        return vo;
    }
}
