package myHive::Controller::API::SiteSchedule;
use Moose;
use namespace::autoclean;

BEGIN {extends 'Catalyst::Controller'; }

=head1 NAME

myHive::Controller::API::SiteSchedule - Catalyst Controller

=head1 DESCRIPTION

Catalyst Controller.

=head1 METHODS

=cut


=head2 index

=cut


sub begin : Private {
        my ( $self, $c ) = @_;

        $c->config->{session}->{'Catalyst::Plugin::Session'} = 'bug';#horrible
        $c->{authentication}    = myHive::Model::Authentication->new;
        $c->{manager}           = myHive::Model::Site::Manager->new;

        return;
}



sub get :Local :Args() {
        my ( $self, $c, $seed, $date ) = @_;
        if ( $seed eq $c->session->{seed} ) {
                	$c->stash->{siteschedules} = $c->{manager}->getSitesSchedules( account => $c->session->{account_id}, date => $date );
        }
        $c->stash->{template} = 'rest/siteinspectionschedules.tt';
        return;

}




sub index :Path :Args(0) {
    my ( $self, $c ) = @_;

    $c->response->body('Matched myHive::Controller::API::SiteSchedule in API::SiteSchedule.');
}


=head1 AUTHOR

root

=head1 LICENSE

This library is free software. You can redistribute it and/or modify
it under the same terms as Perl itself.

=cut

__PACKAGE__->meta->make_immutable;

1;
