package BookPub::Import::Importer::Epic;

use strict;

use Date::Calc qw(Decode_Month);

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

use Date::Calc qw( Add_Delta_YM );

sub _headerIdentifier { ( rIsbn13 => 'ISBN13' ) }

sub _fieldMap {
    my $self = shift;

    my %fieldMap = (
        1 => {
            countryCode    => 'I',
            dateBegin      => 'A',
            rIsbn13        => 'B',
            rTitle         => 'C',
            rAuthor        => 'D',
            rUnits         => 'E',
            rListPrice     => 'F',
            rPurchasePrice => 'G',
            rRevenue       => 'H',
        },
    );

    return $fieldMap{ $self->_version() };
}

sub _useIsSaleRec              { 1 }
sub _autoParseTitleAndSubtitle { 1 }

sub rServiceName {
    return BookPub::Tracker::Service::GetDefaultServiceName( service_id => shift->serviceID );
}

sub priceType              { 'agency' }
sub currencyCode           { 'USD' }
sub rListPriceCurrency     { 'USD' }
sub rPurchasePriceCurrency { 'USD' }
sub purchaseType           { BookPub::DB::Item::Sale::kPurchaseTypeSubscriptionDL }
sub productType            { BookPub::DB::Item::Sale::kProductTypeEBook }

1;
