package BookPub::Import::Importer::Amazon::Version61;

use strict;
use warnings;

use parent 'BookPub::Import::Importer::Amazon::Version6';

sub _fieldMap {
    {
        dateBegin              => 'A',
        dateEnd                => 'A',
        rFormat                => 'I',
        rAuthor                => 'G',
        rTitle                 => 'F',
        rIsbn13                => 'E',
        rImprint               => 'H',
        serviceProductID       => 'B',
        rReturns               => 'K',
        rSales                 => 'J',
        rUnits                 => 'L',
        rAdjustments           => 'N',
        rListPrice             => 'Q',
        rListPriceCurrency     => 'R',
        rPurchasePrice         => 'O',
        rPurchasePriceCurrency => 'P',
        rDiscount              => 'S',
        rRevenue               => 'T',
        currencyCode           => 'U',
        rModel                 => 'V',
    };
}

sub rServiceName { 'Amazon' }
sub rProductType { BookPub::DB::Item::Sale::kProductTypeEBook }

sub _getDateEnd { shift->_getDateBegin }

sub priceType {
    my $self = shift;

    my $clientID = Common::RSApp::GetClientID;
    return 'agency' if $clientID =~ /^355$/;              # HUK
    return 'rrp'    if $clientID =~ /^(?:314|328|361)$/;  # Bloomsbury (USA|US|WW)
    return 'rrp'    if $clientID =~ /^348$/;              # MMAU
}


1;