Subversion Repositories SmartDukaan

Rev

Blame | Last modification | View Log | RSS feed

package com.spice.profitmandi.dao.model.warehouse;

/**
 * What still ties a physical warehouse to operations: stock on its floor, orders billing from it, franchise stores
 * ordering into it and brand-mapping routes through it. Decides whether it may be suspended or closed.
 */
public class WarehouseUsage {

    private final int warehouseId;
    private final long stockUnits;
    private final long stockValue;
    private final long uncostedUnits;
    private final long openOrders;
    private final long franchiseStores;
    private final long brandMappingRows;

    public WarehouseUsage(int warehouseId, long stockUnits, long stockValue, long uncostedUnits, long openOrders,
                          long franchiseStores, long brandMappingRows) {
        this.warehouseId = warehouseId;
        this.stockUnits = stockUnits;
        this.stockValue = stockValue;
        this.uncostedUnits = uncostedUnits;
        this.openOrders = openOrders;
        this.franchiseStores = franchiseStores;
        this.brandMappingRows = brandMappingRows;
    }

    public static WarehouseUsage none(int warehouseId) {
        return new WarehouseUsage(warehouseId, 0, 0, 0, 0, 0, 0);
    }

    public int getWarehouseId() {
        return warehouseId;
    }

    public long getStockUnits() {
        return stockUnits;
    }

    /** Receipt cost of the units that carry one; see uncostedUnits for the rest. */
    public long getStockValue() {
        return stockValue;
    }

    public long getUncostedUnits() {
        return uncostedUnits;
    }

    /** Orders billing from it that have not shipped: submitted (3) or billed (7). */
    public long getOpenOrders() {
        return openOrders;
    }

    public long getFranchiseStores() {
        return franchiseStores;
    }

    public long getBrandMappingRows() {
        return brandMappingRows;
    }
}