/*
 * Copyright (c) 2004, 2005, ADAPT project partners (IST-2001-37126).
 * 
 * ManufacturerPurchaseOrder.java
 */

package org.eu.adapt.demonstrator.web.demo;

public class ManufacturerPurchaseOrder
{
    public static final int STATUS_UNKNOWN        = 0;
    public static final int STATUS_UNACKNOWLEDGED = 1;
    public static final int STATUS_ACKNOWLEDGED   = 2;
    public static final int STATUS_REJECTED       = 3;
    public static final int STATUS_COMPLETE       = 4;
    
    public String getManufacturerPurchaseOrderNumber()
    {
        return _manufacturerPurchaseOrderNumber;
    }

    public ManufacturerPurchaseOrder(String manufacturerPurchaseOrderNumber, int status)
    {
        _manufacturerPurchaseOrderNumber = manufacturerPurchaseOrderNumber;
        _status                          = status;
    }

    public void setStatus(int status)
    {
        _status = status;
    }

    public String getStatusAsString()
    {
        return statusToString(_status);
    }

    public int getStatus()
    {
        return _status;
    }
    
    public static String statusToString(int status)
    {
        switch (status)
        {
            case STATUS_ACKNOWLEDGED:
                return "Acknowledged";
            case STATUS_UNACKNOWLEDGED:
                return "Unacknowledged";
            case STATUS_REJECTED:
                return "Rejected";
            case STATUS_COMPLETE:
                return "Complete";
            default:
                return "Unknown";
        }
    }

    public String _manufacturerPurchaseOrderNumber;
    public int    _status;
}