#---------------------------------------------------------------
# ____                   _ _         ____  _
#|  _ \ ___  _   _  __ _| | |_ _   _/ ___|| |__   __ _ _ __ ___
#| |_) / _ \| | | |/ _` | | __| | | \___ \| '_ \ / _` | '__/ _ \
#|  _ < (_) | |_| | (_| | | |_| |_| |___) | | | | (_| | | |  __/
#|_| \_\___/ \__, |\__,_|_|\__|\__, |____/|_| |_|\__,_|_|  \___|
#            |___/             |___/
#
# Copyright (C) 2013 RoyaltyShare, Inc.   All Rights Reserved
#---------------------------------------------------------------

package RPS::Import::Merlin::v23;

use strict;

use Date::Calc qw(Days_in_Month Decode_Month);

use Carp qw(croak);

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

use lib '/app/tools/rps/lib';
use RPS::Import::ServiceMap;

use base 'RPS::Import::Merlin::v13';

sub _fieldMap {
    {
        dateBegin    => 'A',    # Header only
        labelName    => 'I',
        serviceID    => 'A',
        countryCode  => 'C',
        formatType   => 'O',
        artistName   => 'F',
        upc          => 'E',
        albumName    => 'H',
        isrc         => 'D',
        trackName    => 'G',
        units        => 'J',
        currencyCode => 'M',
        price        => 'L',
        mediaType    => 'N',
    };
}

sub _unverifiedFieldMap {
    {
        # Footer
        distFee => 'M',
    };
}

# dist fee from sales file is optional; enter via UI if needed
#
sub distFeeOptional { 1 }

sub saleDates {
    my $self = shift;

    # from header; see _preProcess
    return ( $self->{_startDate}, $self->{_endDate} ) if ( $self->{_startDate} );
}

1;
