package com.aps.macroplanner.output.dto;

import java.util.ArrayList;
import java.util.List;

/**
 * 需求满足汇总 — 按产品/周期聚合需求量、满足量、满足率。
 *
 * <h3>结构</h3>
 * <pre>
 *   productId:         产品ID
 *   totalDemand:       总需求量
 *   totalFulfilled:    总满足量
 *   totalUnmet:        总未满足量
 *   fulfillmentRate:   整体满足率
 *   periodEntries:     每周期明细
 * </pre>
 */
public class DemandSummaryResult {

    private String productId;

    /** 按周期明细 */
    private final List<PeriodEntry> periodEntries = new ArrayList<>();

    /** 跨周期汇总 */
    private double totalDemand;
    private double totalFulfilled;
    private double totalUnmet;
    private double fulfillmentRate;

    // ==================== 内嵌类 ====================

    public static class PeriodEntry {
        public int periodIndex;
        public String periodStartDate;
        public double demandQty;
        public double fulfilledQty;
        public double unmetQty;
        public double fulfillmentRate;
    }

    // ==================== Getters / Setters ====================

    public String getProductId() { return productId; }
    public void setProductId(String v) { this.productId = v; }

    public List<PeriodEntry> getPeriodEntries() { return periodEntries; }

    public double getTotalDemand() { return totalDemand; }
    public void setTotalDemand(double v) { this.totalDemand = v; }

    public double getTotalFulfilled() { return totalFulfilled; }
    public void setTotalFulfilled(double v) { this.totalFulfilled = v; }

    public double getTotalUnmet() { return totalUnmet; }
    public void setTotalUnmet(double v) { this.totalUnmet = v; }

    public double getFulfillmentRate() { return fulfillmentRate; }
    public void setFulfillmentRate(double v) { this.fulfillmentRate = v; }
}
