package BookPub::Tracker::Job::FTPRoyaltyReport;

use strict;
use warnings;

use Sys::Hostname;

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

use lib '/app/tools/bookpub/lib';
use BookPub::Config;

use lib '/app/tools/job/lib';
use Job::Job;

use base 'Job::Job';

sub _generateCommandLine {
    my ($self) = @_;

    # Let's go ahead and construct everything now.
    #
    my $clientID    = $self->getCommandLineArg('clientID');
    my $reportEmail = $self->getCommandLineArg('report_email');
    my $errorEmail  = $self->getCommandLineArg('error_email');

    if ( !$clientID ) {
        $clientID = $self->clientID();
    }

    my $periodID = $self->getCommandLineArg('periodID');
    assert( $periodID, "ERROR - missing period ID" );

    my $config     = BookPub::Config->new();
    my $scriptPath = $config->get('dump_report_script_dir');

    my $commandLine =
      "nice $scriptPath/ftp_royalty_report.pl -c $clientID -p $periodID --report_email $reportEmail --error_email $errorEmail";

    return $commandLine;
}

sub _defaultClass    { return 'Tracker'; }
sub _defaultSubclass { return 'FTPRoyaltyReport'; }
# sub _defaultHostname { return hostname(); }
sub _defaultPriority { return Job::Job::kPriorityNormal; }

###
1;    #
###
