#------------------------------------------------------------
# Copyright (C) 2009 RoyaltyShare, Inc.   All Rights Reserved
#------------------------------------------------------------

# JPK - This package appears to be deprecated

package RPS::Mechanical::UK::Process::SaleException;
use lib '/app/tools/common/lib';
use Common::Assert;

sub new {
    my ( $class, $sale, $details ) = @_;

    my $self = bless {}, $class;

    return $self->_init( $sale, $details );
}

sub _init {
    my ( $self, $sale, $details ) = @_;
    assert($sale);
    $self->{sale} = $sale;

    # This is optional (but highly recommended!)
    #
    $self->{details} = $details;

    return $self;
}

sub sale {
    my ($self) = @_;
    return $self->{sale};
}

sub error {
    my ($self) = @_;

    die "ERROR - You must override the 'error' method";
}

sub details {
    my ($self) = @_;
    return $self->{details};
}

# ------------

package RPS::Mechanical::UK::Process::SaleException::NoLicense;
use strict;
use base 'RPS::Mechanical::UK::Process::SaleException';

sub error {
    return 'no matching license';
}

# ------------

package RPS::Mechanical::UK::Process::SaleException::NoPrice;
use strict;
use base 'RPS::Mechanical::UK::Process::SaleException';

sub error {
    return 'no price';
}

1;
