package RPS::Import::Redeye::v12;

use strict;
use warnings;

use base 'RPS::Import::Redeye::v11';

sub _fieldMap {
    {
        countryCode  => 'J',
        dateBegin    => 'E',
        dateEnd      => 'E',
        productType  => 'A',
        artistName   => 'C',
        upc          => 'B',
        albumName    => 'D',
        totalRevenue => 'H',
    };
}

sub _unverifiedFieldMap {
    {
       _netUnits => 'F',
    };
}

sub productType {
    my $self = shift;

    my $type = $self->_getByFieldName('productType') || '';

    if ( $type =~ /^CD-/i ) {
        return RPS::File::Sale::TYPE_CD;
    } elsif ( $type =~ /^LP-/i ) {
        return RPS::File::Sale::TYPE_LP;
    } elsif ( $type =~ /^DVD-/i ) {
        return RPS::File::Sale::TYPE_DVD;
    } elsif ( $type =~ /^CS-/i ) {
        return RPS::File::Sale::TYPE_CASS;
    }

    $self->fail("Could not get product type from '$type'");
}

1;