CostApplicationMethod.java

package com.tradecloud.domain.costing.clean;

/**
 * How costs are applied. We support 3 methods currently
 * <p>
 * 1) By container..X amount per container type
 * 2) Fixed amount (or per shipment) $1500 agency fees per shipment
 * 3) A percentage of some amount (A corresponding function is required to give the amount)
 *
 * @author ronan
 */
public enum CostApplicationMethod {

    /**
     * Allocate the cost per container
     * Involves a container lookup
     * <p>
     * e.g. USD 200 for a 20'GP Container
     */
    CONTAINER("Container", "Look for a matching container rate and apply per container type", true),
    /**
     * Fixed amount cost.
     * <p>
     * e.g. ZAR 1500.00 Agency Fee)
     */
    FIXED_AMOUNT("Fixed Amount", "Apply the fixed amount from the cost definition", true),
    /**
     * Apply an amount based off of a function
     * <p>
     * e.g. Direct cost (function calculates the direct COST)
     */
    FUNCTION_AMOUNT("A Cost computed as a function", "A cost computed by calculating a function amount", true),
    /**
     * Allocate the cost as a percentage of the DIRECT_COST cost line total
     * <p>
     * e.g. Apply 5% to the direct cost
     */
    PERCENTAGE("A Percentage Cost", "A percentage amount...must have a functiona associated with it", true);

    private final String name;
    private final boolean selectable;
    private final String description;

    private CostApplicationMethod(String name, String description, boolean selectable) {
        this.name = name;
        this.description = description;
        this.selectable = selectable;
    }
}