package BookPub::Import::Importer::ProQuestSubscription::v17;

# this service of the importer has been renamed from Ebrary to ProQuestSubscription
# see RSD-4469

use strict;
use warnings;

use lib '/app/tools/bookpub/lib';
use parent 'BookPub::Import::Importer::ebrary::Version15';

sub _headerIdentifier { rTitle => 'Title' }
sub rListPriceCurrency { 'USD' }

sub _fieldMap {
    {
        rAuthor          => 'F',
        rTitle           => 'I',
        rIsbn13          => 'B',
        serviceProductID => 'A',
        rRevenue         => 'P',
    },
}

sub serviceProductID {
    my $self = shift;

    my $serviceProductID = $self->_getByFieldName('serviceProductID') || 0;
    if ( $serviceProductID =~ /^[0-9.]+$/ ) {
        return sprintf "%d", $serviceProductID;
    }

    return $serviceProductID;
}


1;