#------------------------------------------------------------
# Copyright (C) 2009 RoyaltyShare, Inc.   All Rights Reserved
# $Id$
#------------------------------------------------------------
package RPS::RoyaltyRun::Status;

# The point of this package is simply to define the status types that all mechanical runs
# will share.  This makes it easier to write common control logic.
#
use strict;
use warnings;

use constant kRunning   => 0;
use constant kComplete  => 1;
use constant kCommitted => 2;
use constant kAborted   => 3;
use constant kError     => 4;
use constant kClosed    => 5;
use constant kWaitingToRun => 6;
use constant kWaitingToCommit => 7;
use constant kWaitingToDelete => 8;
use constant kInvalidated => 9;

my %gStatusStrings = (
kRunning()   => 'running',
kComplete()  => 'complete',
kCommitted() => 'committed',
kAborted()   => 'aborted',
kError()     => 'error',
kClosed()    => 'closed',
kWaitingToRun() => 'waiting to run',
kWaitingToCommit() => 'waiting to commit',
kWaitingToDelete() => 'waiting to delete',
kInvalidated() => 'invalidated',
);

sub StatusString
{
    my ($status) = @_;

    return $gStatusStrings{$status};
}

1;

