package BookPub::Import::Importer::Unizin::Version3;

use strict;

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

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

# map version num to the field order
sub _fieldMap {
    my $self = shift;

    my %fieldMap = (
        3 => {
            dateBegin  => 'A',
            rAuthor    => 'H',
            rTitle     => 'G',
            rIsbn13    => 'F',
            rUnits     => 'E',
            rUnitPrice => 'K',
            rListPrice => 'J',
            rRevenue   => 'L',
        },
    );

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

sub rInstitution {
    my $self = shift;

    my $filename = $self->filename;

    $filename =~ /^Sage (.+) \w+ \d{4}/i;
    return $1;
}

1;
