#------------------------------------------------------------
# Copyright (C) 2006 RoyaltyShare, Inc.   All Rights Reserved
# $Id$
#------------------------------------------------------------
package BookPub::Admin::PriceVarianceForm;

use strict;
use warnings;

use lib '/app/tools/common/lib';
use Common::Assert;

use lib '/app/tools/bookpub/lib';
use BookPub::Price::PriceTypeVarianceList;

use Common::FormObject;
use base 'Common::FormObject';

sub _init {
    my ( $self, %args ) = @_;

    $self->SUPER::_init(%args);

    $self->{PriceTypeVarianceList} = BookPub::Price::PriceTypeVarianceList->new();

    return $self;
}

sub _propertyIsEditable {
    my ( $self, $propertyName ) = @_;

    # The Product (and contained objects) can be edited.
    #
    if ( $propertyName eq 'PriceTypeVarianceList' ) {
        return 1;
    }
    return 0;
}

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

    $self->{PriceTypeVarianceList}->save();
}

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

    my $valid = $self->{PriceTypeVarianceList}->validate();

    return $valid;
}

###
1;    #
###
