package BookPub::Import::Importer::WeRead4You::Version2;

use strict;

use Common::Country;

use lib '/app/tools/bookpub/lib';
use base 'BookPub::Import::Importer';

sub _headerIdentifier { ( rTitle => 'Title' ) }

sub _fieldMap {
    {
        countryCode => 'D',
        dateBegin   => 'A',
        isbn        => 'C',
        rTitle      => 'B',
        rUnits      => 'F',
        rListPrice  => 'E',
        rRevenue    => 'G',
    };
}

sub priceType    { 'rrp' }
sub purchaseType { BookPub::DB::Item::Sale::kPurchaseTypeDownload }
sub productType  { BookPub::DB::Item::Sale::kProductTypeAudioBook }
sub currencyCode { 'USD' }

sub countryCode {
    my $self = shift;
    my $code = $self->_getByFieldName('countryCode');

    $code =~ s/\s\(\w\)//;

    return $code;
}

1;
