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

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

public class RetailerPurchaseOrder
{
    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 getRetailerPurchaseOrderNumber()
    {
        return _retailerPurchaseOrderNumber;
    }

    public RetailerPurchaseOrder(String retailerPurchaseOrderNumber, int status)
    {
        _retailerPurchaseOrderNumber = retailerPurchaseOrderNumber;
        _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 _retailerPurchaseOrderNumber;
    public int    _status;
}