package BookPub::Import::Importer::Capella::v4;

use strict;
use warnings;

# ! This importer is not in use anymore !
# Use Vital Source v23 instead (RSD-6811)

use lib '/app/tools/bookpub/lib';
use parent 'BookPub::Import::Importer::Capella::v1';

sub _fieldMap {
    {
        rServiceName         => 'G',
        dateBegin            => 'B',
        dateEnd              => 'B',
        rProductType         => 'T',
        priceType            => 'AF',
        rAuthor              => 'AB',
        rTitle               => 'AA',
        rIsbn13              => 'Y',
        rInstitution         => 'G',
        rState               => 'K',
        rPostalCode          => 'J',
        countryCode          => 'L',
        serviceProductID     => 'Z',
        rUnits               => 'AE',
        rUnitPrice           => 'AJ',
        rListPrice           => 'AG',
        rListPriceCurrency   => 'AI',
        rRevenue             => 'AH',
        currencyCode         => 'AM',
        rTaxAmount           => 'AL',
        rFee                 => 'AK',
        rDuration            => 'AD',
        rDeliveryMethod      => 'M',
        rTransactionCategory => 'C',
    };
}

sub priceType {
    my $self = shift;

    my $type = $self->_getByFieldName('priceType');
    return 'rrp' if !$type || $type =~ /^Custom$/i;

    $self->fail("Unable to determine priceType from: '$type'.");
}


1;
