package BookPub::Import::Importer::Google::Version25;

use strict;
use warnings;

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

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


sub _fieldMap {
    {
        dateBegin                => 'B',
        purchaseType             => 'D',
        rProductType             => 'AD',
        rAuthor                  => 'K',
        rTitle                   => 'J',
        rIsbn13                  => 'H',
        rImprint                 => 'I',
        rState                   => 'T',
        rPostalCode              => 'U',
        countryCode              => 'S',
        rReturns                 => 'E',
        rSales                   => 'E',
        rUnits                   => 'G',
        rListPrice               => 'M',
        rListPriceCurrency       => 'L',
        rNativeListPrice         => 'M',
        rNativeListPriceCurrency => 'L',
        rPurchasePrice           => 'R',
        rPurchasePriceCurrency   => 'Q',
        rDiscount                => 'X',
        rRevenue                 => 'AB',
        currencyCode             => 'AA',
        rTaxAmount               => 'W',
        isPreOrder               => 'F',
        conversionRate           => 'AC',
        rDuration                => 'D',
        rTransactionCategory     => 'E',
    };
}

sub _unverifiedFieldMap {
    {
        publisherRevenue    => 'Y',
        revenueWithTaxAUD   => 'AB',
        listPriceWithTax    => 'O',
        listPriceWithoutTax => 'P',
        productType         => 'AD',
    };
}

sub productType {
	my $self = shift;

	my $productType = $self->_getByFieldName('productType') || '';
	if ( $productType =~ /^E\-Book$/i ) {
		return BookPub::DB::Item::Sale::kProductTypeEBook;
	}

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


1;
