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

package RPS::Report::Dynamic::SecondTestGroup::AnotherTest;
use strict;

use lib '/app/tools/common/lib';
use lib '/app/tools/report/lib';
use lib '/app/tools/rps/lib';
use lib '/app/tools/appuser/lib';
use base 'Report::Dynamic::SingleQuery';

use Common::Log;
use Common::Assert;
use File::Path;
use AppUser::DB::Item::AccessLevel;
use Text::CSV::Encoded;
use Report::Dynamic::Parameters;

#
#  ((((((((((  Public Interface
#

sub Group {
    my ($class) = @_;
    return 'Second Test Group';
}

sub Type {
    my ($class) = @_;
    return 'Another Test';
}

sub UserLevelIsValid {
    my ( $class, $userLevel ) = @_;
    my %validLevels = (
        AppUser::DB::Item::AccessLevel::kRSAdmin()      => 1,
        AppUser::DB::Item::AccessLevel::kRSAccountRep() => 1,
        AppUser::DB::Item::AccessLevel::kAdmin()        => 1,
    );

    return $validLevels{$userLevel};
}

sub _OptionalData {
    return {
        'Flagellated' => {
            type  => Report::Dynamic::Parameters::kTypeBoolean,    # or you could just say 'bool'
            value => 1,                                            # Flaggelate by default
        }
    };
}

sub _Criteria {
    return {
        'StartDate' => {
            type => Report::Dynamic::Parameters::kTypeDate,
        },
        'EndDate' => {
            type => Report::Dynamic::Parameters::kTypeDate,
        },
    };
}

# TODO
sub _header {
    assert( 0, 'override this' );
}

sub _JobSubclass {
    assert( 0, 'override this' );
}

sub _columns {
    my ($class) = @_;

    # Override this to return an array ref of column names that
    # match the DB::Item your collection query returns.
    #
    assert( 0, 'override' );
}

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

    # Override this to return a DB::ItemCollection of row data.
    # Essentially, you will usually be making a call into a DB::Item
    # class, passing along the correct parameters.
    # That's going to be left as an exercise for the reader...
    #
    assert( 0, 'override' );
}

1;
