package com.aps.macroplanner.data;

import java.time.LocalDate;

/**
 * 在途供应 (InTransitSupply) — 原材料供应商已发货、将在未来到货的固定供应量。
 *
 * <p>与初始库存不同，在途供应是计划在未来某个日期到达的固定流入量，
 * 不是决策变量，而是作为物料平衡约束中的已知常量。</p>
 *
 * <p>典型场景: 供应商已承诺在 2026-01-07 交付 100 件原材料 R1</p>
 *
 * <p>arrivalDate 通过 TestDataBuilder.getPeriodByDate() 映射到对应的周期。</p>
 */
public class InTransitSupply {
    private final Product product;
    private final StockingPoint stockingPoint;
    private final LocalDate arrivalDate;
    private final double quantity;

    public InTransitSupply(Product product, StockingPoint stockingPoint,
                           LocalDate arrivalDate, double quantity) {
        this.product = product;
        this.stockingPoint = stockingPoint;
        this.arrivalDate = arrivalDate;
        this.quantity = quantity;
    }

    public Product getProduct() { return product; }
    public StockingPoint getStockingPoint() { return stockingPoint; }
    public LocalDate getArrivalDate() { return arrivalDate; }
    public double getQuantity() { return quantity; }

    @Override
    public String toString() {
        return product.getId() + "@" + stockingPoint.getId()
                + " 到货" + arrivalDate + " " + quantity + "件";
    }
}