#------------------------------------------------------------
# Copyright (C) 2008 RoyaltyShare, Inc.   All Rights Reserved
#------------------------------------------------------------
package RPS::Portal::Job::SendNotification;

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/rps/lib';
use RPS::Config;

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

use base 'Job::Job';

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

    my $clientID  = $self->clientID();
    my $runID     = $self->getCommandLineArg('runID');
    my $payeeList = $self->getCommandLineArg('payeeList');
    my $payeeType = $self->getCommandLineArg('payeeType');

    my $config     = RPS::Config->new();
    my $scriptPath = $config->get('portal_script_dir');

    my $commandLine = "nice $scriptPath/send_notification.pl -c $clientID -r $runID -t $payeeType -p $payeeList";
    return $commandLine;
}

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

    my $config = RPS::Config->new();
    return $config->get('portal_log_dir');
}

sub _defaultClass    { return 'Portal'; }
sub _defaultSubclass { return 'SendNotification'; }
sub _defaultPriority { return Job::Job::kPriorityHigh; }


1;
