diff --git a/lib/Pear/LocalLoop.pm b/lib/Pear/LocalLoop.pm index 7ace853..a58e075 100644 --- a/lib/Pear/LocalLoop.pm +++ b/lib/Pear/LocalLoop.pm @@ -173,6 +173,7 @@ sub startup { $api_public->post('/register')->to('api-register#post_register'); $api_public->post('/logout')->to('api-auth#post_logout'); $api_public->post('/feedback')->to('api-feedback#post_feedback'); + $api_public->post('/check-device-token')->to('api-devices#check_token'); $api_public->post('/add-device-token')->to('api-devices#add_token'); $api_public->post('/get-topics')->to('api-sendmessage#get_topics'); @@ -282,8 +283,7 @@ sub startup { $admin_routes->post('/categories')->to('admin-categories#create'); $admin_routes->get('/categories/:id')->to('admin-categories#get'); $admin_routes->post('/categories/:id')->to('admin-categories#update'); - $admin_routes->post('/categories/:id/delete') - ->to('admin-categories#del'); + $admin_routes->post('/categories/:id/delete')->to('admin-categories#del'); $admin_routes->get('/users')->to('admin-users#index'); $admin_routes->get('/users/:id')->to('admin-users#read'); diff --git a/lib/Pear/LocalLoop/Command/codepoint_open.pm b/lib/Pear/LocalLoop/Command/codepoint_open.pm index b4570b4..adcaf0e 100644 --- a/lib/Pear/LocalLoop/Command/codepoint_open.pm +++ b/lib/Pear/LocalLoop/Command/codepoint_open.pm @@ -55,7 +55,7 @@ sub run { { key => 'primary' }, ); } - + return 1; } diff --git a/lib/Pear/LocalLoop/Command/dev_transactions.pm b/lib/Pear/LocalLoop/Command/dev_transactions.pm index adcdf51..614f723 100644 --- a/lib/Pear/LocalLoop/Command/dev_transactions.pm +++ b/lib/Pear/LocalLoop/Command/dev_transactions.pm @@ -90,7 +90,7 @@ sub run { } } } - + return 1; } diff --git a/lib/Pear/LocalLoop/Command/latlong_setup.pm b/lib/Pear/LocalLoop/Command/latlong_setup.pm index 9c34136..81c0db7 100644 --- a/lib/Pear/LocalLoop/Command/latlong_setup.pm +++ b/lib/Pear/LocalLoop/Command/latlong_setup.pm @@ -29,7 +29,7 @@ sub run { ); $result->update( { distance => $distance } ) if defined $distance; } - + return 1; } @@ -55,7 +55,7 @@ sub _set_lat_long_for_result { ); } } - + return 1; } diff --git a/lib/Pear/LocalLoop/Command/leaderboard.pm b/lib/Pear/LocalLoop/Command/leaderboard.pm index bd5df60..91c09b6 100644 --- a/lib/Pear/LocalLoop/Command/leaderboard.pm +++ b/lib/Pear/LocalLoop/Command/leaderboard.pm @@ -71,7 +71,7 @@ sub run { } } } - + return 1; } diff --git a/lib/Pear/LocalLoop/Command/recalc_leaderboards.pm b/lib/Pear/LocalLoop/Command/recalc_leaderboards.pm index 5ea8fa5..ed61d6e 100644 --- a/lib/Pear/LocalLoop/Command/recalc_leaderboards.pm +++ b/lib/Pear/LocalLoop/Command/recalc_leaderboards.pm @@ -13,7 +13,7 @@ sub run { my $leaderboard_rs = $self->app->schema->resultset('Leaderboard'); $leaderboard_rs->recalculate_all; - + return 1; } diff --git a/lib/Pear/LocalLoop/Command/recur_transactions.pm b/lib/Pear/LocalLoop/Command/recur_transactions.pm index 58bf927..78268f8 100644 --- a/lib/Pear/LocalLoop/Command/recur_transactions.pm +++ b/lib/Pear/LocalLoop/Command/recur_transactions.pm @@ -153,7 +153,7 @@ sub run { $recur_result->update( { last_updated => $purchase_time } ); } - + return 1; } diff --git a/lib/Pear/LocalLoop/Controller/Admin.pm b/lib/Pear/LocalLoop/Controller/Admin.pm index 01049d3..e130761 100644 --- a/lib/Pear/LocalLoop/Controller/Admin.pm +++ b/lib/Pear/LocalLoop/Controller/Admin.pm @@ -34,7 +34,7 @@ sub home { pending => $pending_feedback_rs->count, }, ); - + return 1; } @@ -54,7 +54,7 @@ sub auth_login { . "]" ); $c->redirect_to('/admin'); } - + return 1; } @@ -63,7 +63,7 @@ sub auth_logout { $c->logout; $c->redirect_to('/admin'); - + return 1; } diff --git a/lib/Pear/LocalLoop/Controller/Admin/Categories.pm b/lib/Pear/LocalLoop/Controller/Admin/Categories.pm index bb539c6..c5b1687 100644 --- a/lib/Pear/LocalLoop/Controller/Admin/Categories.pm +++ b/lib/Pear/LocalLoop/Controller/Admin/Categories.pm @@ -12,7 +12,7 @@ sub idx { my $category_rs = $c->result_set; $category_rs->result_class('DBIx::Class::ResultClass::HashRefInflator'); $c->stash( categories => [ $category_rs->all ] ); - + return 1; } @@ -45,7 +45,7 @@ sub create { $c->result_set->create( { name => $category_name } ); } $c->redirect_to('/admin/categories'); - + return 1; } @@ -62,7 +62,7 @@ sub get { $c->flash( error => 'No Category found' ); $c->redirect_to('/admin/categories'); } - + return 1; } @@ -101,7 +101,7 @@ sub update { $c->flash( error => 'No Category found' ); $c->redirect_to('/admin/categories'); } - + return 1; } @@ -120,7 +120,7 @@ sub del { $c->flash( error => 'No Category found' ); } $c->redirect_to('/admin/categories'); - + return 1; } diff --git a/lib/Pear/LocalLoop/Controller/Admin/Feedback.pm b/lib/Pear/LocalLoop/Controller/Admin/Feedback.pm index 2a39fb1..ccffb5e 100644 --- a/lib/Pear/LocalLoop/Controller/Admin/Feedback.pm +++ b/lib/Pear/LocalLoop/Controller/Admin/Feedback.pm @@ -18,7 +18,7 @@ sub idx { }, ); $c->stash( feedback_rs => $feedback_rs ); - + return 1; } @@ -34,7 +34,7 @@ sub get { $c->flash( error => 'No Feedback found' ); $c->redirect_to('/admin/feedback'); } - + return 1; } @@ -52,7 +52,7 @@ sub actioned { $c->flash( error => 'No Feedback found' ); $c->redirect_to('/admin/feedback'); } - + return 1; } diff --git a/lib/Pear/LocalLoop/Controller/Admin/Import.pm b/lib/Pear/LocalLoop/Controller/Admin/Import.pm index 43a8945..01514ed 100644 --- a/lib/Pear/LocalLoop/Controller/Admin/Import.pm +++ b/lib/Pear/LocalLoop/Controller/Admin/Import.pm @@ -21,7 +21,7 @@ sub idx { }, ); $c->stash( import_rs => $import_rs ); - + return 1; } @@ -48,13 +48,13 @@ sub list { import_org_rs => $import_org_rs, import_lookup_rs => $import_lookup_rs, ); - + return 1; } sub get_add { my $c = shift; - + return 1; } @@ -71,7 +71,7 @@ sub post_add { } ); - ## no critic (InputOutput::RequireBriefOpen) + ## no critic (InputOutput::RequireBriefOpen) open my $fh, '<', \$csv_data; # List context returns the actual headers @@ -100,7 +100,7 @@ sub post_add { } my $csv_output = $csv->getline_hr_all($fh); - + close $fh; ## use critic @@ -157,7 +157,7 @@ sub post_add { $c->flash( success => 'Created Value Set' ); $c->redirect_to( '/admin/import/' . $value_set->id ); - + return 1; } @@ -172,7 +172,7 @@ sub _csv_flash_error { #csv_data => $c->param('csv'), date_format => $c->param('date_format'), ); - + return 1; } @@ -223,7 +223,7 @@ sub get_user { lookup => $lookup_result, user_name => $user_name, ); - + return 1; } @@ -274,7 +274,7 @@ sub get_org { lookup => $lookup_result, org_name => $org_name, ); - + return 1; } diff --git a/lib/Pear/LocalLoop/Controller/Admin/ImportFrom.pm b/lib/Pear/LocalLoop/Controller/Admin/ImportFrom.pm index b55916f..2c08780 100644 --- a/lib/Pear/LocalLoop/Controller/Admin/ImportFrom.pm +++ b/lib/Pear/LocalLoop/Controller/Admin/ImportFrom.pm @@ -15,7 +15,7 @@ sub idx { ]; $c->app->max_request_size(104857600); - + return 1; } @@ -127,12 +127,11 @@ sub org_search { }, ); - my @results = ( - map { { label => $_->name, value => $_->entity->id, } } $rs->all - ); + my @results = + ( map { { label => $_->name, value => $_->entity->id, } } $rs->all ); $c->render( json => \@results ); - + return 1; } diff --git a/lib/Pear/LocalLoop/Controller/Admin/Organisations.pm b/lib/Pear/LocalLoop/Controller/Admin/Organisations.pm index 620949f..e9cd313 100644 --- a/lib/Pear/LocalLoop/Controller/Admin/Organisations.pm +++ b/lib/Pear/LocalLoop/Controller/Admin/Organisations.pm @@ -21,13 +21,13 @@ sub list { ); $c->stash( orgs_rs => $orgs_rs, ); - + return 1; } sub add_org { my $c = shift; - + return 1; } @@ -91,7 +91,7 @@ sub add_org_submit { $c->redirect_to( '/admin/organisations/' . $organisation->id ); } }; - + return 1; } @@ -118,12 +118,12 @@ sub valid_read { transactions => $transactions, associations => $assoc, ); - + return 1; } sub valid_edit { - my ($c, $warning) = @_; + my ( $c, $warning ) = @_; my $validation = $c->validation; $validation->required('name'); @@ -191,7 +191,7 @@ sub valid_edit { } }; $c->redirect_to( '/admin/organisations/' . $c->param('id') ); - + return 1; } @@ -222,7 +222,7 @@ sub merge_list { org_result => $org_result, org_rs => $org_rs, ); - + return 1; } @@ -251,7 +251,7 @@ sub merge_detail { org_result => $org_result, target_result => $target_result, ); - + return 1; } @@ -309,7 +309,7 @@ sub merge_confirm { } $c->redirect_to( '/admin/organisations/' . $org_id . '/merge/' . $target_id ); - + return 1; } diff --git a/lib/Pear/LocalLoop/Controller/Admin/Reports.pm b/lib/Pear/LocalLoop/Controller/Admin/Reports.pm index 8040fdf..6362701 100644 --- a/lib/Pear/LocalLoop/Controller/Admin/Reports.pm +++ b/lib/Pear/LocalLoop/Controller/Admin/Reports.pm @@ -59,7 +59,7 @@ sub transaction_data { json => { json => { data => $transaction_data } }, html => { transaction_rs => encode_json($transaction_data) }, ); - + return 1; } diff --git a/lib/Pear/LocalLoop/Controller/Admin/Tokens.pm b/lib/Pear/LocalLoop/Controller/Admin/Tokens.pm index eb3ec8d..356a372 100644 --- a/lib/Pear/LocalLoop/Controller/Admin/Tokens.pm +++ b/lib/Pear/LocalLoop/Controller/Admin/Tokens.pm @@ -12,7 +12,7 @@ sub idx { my $token_rs = $c->result_set; $token_rs->result_class('DBIx::Class::ResultClass::HashRefInflator'); $c->stash( tokens => [ $token_rs->all ] ); - + return 1; } @@ -45,7 +45,7 @@ sub create { $c->result_set->create( { name => $token_name } ); } $c->redirect_to('/admin/tokens'); - + return 1; } @@ -62,7 +62,7 @@ sub get { $c->flash( error => 'No Token found' ); $c->redirect_to('/admin/tokens'); } - + return 1; } @@ -95,7 +95,7 @@ sub update { $c->flash( error => 'No Token found' ); $c->redirect_to('/admin/tokens'); } - + return 1; } @@ -113,7 +113,7 @@ sub del { $c->flash( error => 'No Token found' ); } $c->redirect_to('/admin/tokens'); - + return 1; } diff --git a/lib/Pear/LocalLoop/Controller/Admin/Transactions.pm b/lib/Pear/LocalLoop/Controller/Admin/Transactions.pm index 23d5b18..a88902f 100644 --- a/lib/Pear/LocalLoop/Controller/Admin/Transactions.pm +++ b/lib/Pear/LocalLoop/Controller/Admin/Transactions.pm @@ -68,7 +68,7 @@ sub index { count => $count, }, ); - + return 1; } @@ -86,7 +86,7 @@ sub read { $c->flash( error => 'No transaction found' ); $c->redirect_to('/admin/transactions'); } - + return 1; } @@ -103,7 +103,7 @@ sub image { else { $c->reply->static('image/no_transaction.jpg'); } - + return 1; } @@ -126,7 +126,7 @@ sub delete { $c->flash( error => 'No transaction found' ); $c->redirect_to('/admin/transactions'); } - + return 1; } diff --git a/lib/Pear/LocalLoop/Controller/Admin/Users.pm b/lib/Pear/LocalLoop/Controller/Admin/Users.pm index 292a0f9..b77589e 100644 --- a/lib/Pear/LocalLoop/Controller/Admin/Users.pm +++ b/lib/Pear/LocalLoop/Controller/Admin/Users.pm @@ -34,7 +34,7 @@ sub index { } ); $c->stash( user_rs => $user_rs ); - + return 1; } @@ -63,14 +63,14 @@ sub read { $c->flash( error => 'No User found' ); $c->redirect_to('/admin/users'); } - + return 1; } ## no critic (Subroutines::ProhibitBuiltinHomonyms) sub update { ## use critic - my ($c, $error) = @_; + my ( $c, $error ) = @_; my $id = $c->param('id'); @@ -199,7 +199,7 @@ sub update { } $c->redirect_to( '/admin/users/' . $id ); - + return 1; } diff --git a/lib/Pear/LocalLoop/Controller/Api/Auth.pm b/lib/Pear/LocalLoop/Controller/Api/Auth.pm index 64ca702..a40d6a7 100644 --- a/lib/Pear/LocalLoop/Controller/Api/Auth.pm +++ b/lib/Pear/LocalLoop/Controller/Api/Auth.pm @@ -124,6 +124,8 @@ sub post_login { sub post_logout { my $c = shift; + print STDERR "TEST"; + my $session_key = $c->req->json('/session_key'); my $session_result = @@ -139,7 +141,7 @@ sub post_logout { message => 'Logged Out', } ); - + return 1; } diff --git a/lib/Pear/LocalLoop/Controller/Api/Sendmessage.pm b/lib/Pear/LocalLoop/Controller/Api/Sendmessage.pm index 399360e..3cbee6a 100644 --- a/lib/Pear/LocalLoop/Controller/Api/Sendmessage.pm +++ b/lib/Pear/LocalLoop/Controller/Api/Sendmessage.pm @@ -9,10 +9,6 @@ use Carp; has error_messages => sub { return { - #devicetokens => { - # required => { message => 'Device token is required', status => 400 }, - # in_resultset => { message => 'Device token not found', status => 400 }, - #}, topic => { required => { message => 'Topic is required', status => 400 }, }, @@ -27,12 +23,8 @@ has error_messages => sub { }; }; -=begin comment - Credit: Peter Scott/StackOverflow - https://stackoverflow.com/a/53357961/4580273 - Credit: jeffez/StackOverflow - https://stackoverflow.com/q/56556438/4580273 -=cut +# Credit: Peter Scott/StackOverflow https://stackoverflow.com/a/53357961/4580273 +# Credit: jeffez/StackOverflow https://stackoverflow.com/q/56556438/4580273 my $jwt = create_jwt_from_path_and_scopes( './localspend-47012.json', 'email https://www.googleapis.com/auth/cloud-platform' ); @@ -104,7 +96,6 @@ sub post_message { my $validation = $c->validation; $validation->input( $c->stash->{api_json} ); -#$validation->required('devicetokens')->in_resultset('token', $c->schema->resultset('DeviceToken')); $validation->required('topic'); $validation->required('sender') ->in_resultset( 'name', $c->schema->resultset('Organisation') ); diff --git a/lib/Pear/LocalLoop/Controller/Api/Stats.pm b/lib/Pear/LocalLoop/Controller/Api/Stats.pm index 2e8bef1..e4afde4 100644 --- a/lib/Pear/LocalLoop/Controller/Api/Stats.pm +++ b/lib/Pear/LocalLoop/Controller/Api/Stats.pm @@ -460,12 +460,11 @@ sub post_leaderboards { my @leaderboard_array = $today_values->all; if ( $validation->param('type') =~ /total$/ ) { - ## no critic (ValuesAndExpressions::ProhibitCommaSeparatedStatements) + ## no critic (ValuesAndExpressions::ProhibitCommaSeparatedStatements) @leaderboard_array = ( map { { - %$_, - value => $_->{value} / 100000 + %$_, value => $_->{value} / 100000 } } @leaderboard_array ); @@ -545,7 +544,7 @@ sub post_leaderboards_paged { $values_count = $today_values->pager->total_entries; if ( $validation->param('type') =~ /total$/ ) { - ## no critic (ValuesAndExpressions::ProhibitCommaSeparatedStatements) + ## no critic (ValuesAndExpressions::ProhibitCommaSeparatedStatements) @leaderboard_array = ( map { { diff --git a/lib/Pear/LocalLoop/Controller/Api/V1/Supplier/Location.pm b/lib/Pear/LocalLoop/Controller/Api/V1/Supplier/Location.pm index ae5d049..087287e 100644 --- a/lib/Pear/LocalLoop/Controller/Api/V1/Supplier/Location.pm +++ b/lib/Pear/LocalLoop/Controller/Api/V1/Supplier/Location.pm @@ -122,7 +122,7 @@ sub idx { } }, ); - + return 1; } @@ -206,7 +206,7 @@ sub trail_load { } }, ); - + return 1; } diff --git a/lib/Pear/LocalLoop/Controller/Root.pm b/lib/Pear/LocalLoop/Controller/Root.pm index 9106a7f..bf286d8 100644 --- a/lib/Pear/LocalLoop/Controller/Root.pm +++ b/lib/Pear/LocalLoop/Controller/Root.pm @@ -9,7 +9,7 @@ sub index { # if ( $c->is_user_authenticated ) { # $c->redirect_to('/home'); # } - + return 1; } @@ -32,7 +32,7 @@ sub auth_login { else { $c->redirect_to('/'); } - + return 1; } @@ -41,13 +41,13 @@ sub auth_logout { $c->logout; $c->redirect_to('/'); - + return 1; } sub home { my $c = shift; - + return 1; } diff --git a/lib/Pear/LocalLoop/Import/LCCCsv/Postcodes.pm b/lib/Pear/LocalLoop/Import/LCCCsv/Postcodes.pm index e44be58..22438b8 100644 --- a/lib/Pear/LocalLoop/Import/LCCCsv/Postcodes.pm +++ b/lib/Pear/LocalLoop/Import/LCCCsv/Postcodes.pm @@ -24,7 +24,7 @@ sub import_csv { while ( my $row = $self->get_csv_line ) { $self->_row_to_result($row); } - + return 1; } @@ -47,7 +47,7 @@ sub _row_to_result { return if $postcode_r->ward; $postcode_r->update( { ward_id => $ward->id } ); - + return 1; } diff --git a/lib/Pear/LocalLoop/Import/LCCCsv/Suppliers.pm b/lib/Pear/LocalLoop/Import/LCCCsv/Suppliers.pm index d0df5c6..7e3dcd5 100644 --- a/lib/Pear/LocalLoop/Import/LCCCsv/Suppliers.pm +++ b/lib/Pear/LocalLoop/Import/LCCCsv/Suppliers.pm @@ -22,7 +22,7 @@ sub import_csv { while ( my $row = $self->get_csv_line ) { $self->_row_to_result($row); } - + return 1; } @@ -34,7 +34,8 @@ sub _row_to_result { my $address = ( defined $addr2 ? ( $row->{"address line 2"} . ' ' . $addr2 ) - : $row->{"address line 2"} ); + : $row->{"address line 2"} + ); return if $self->external_result->organisations->find( @@ -58,7 +59,7 @@ sub _row_to_result { } } ); - + return 1; } diff --git a/lib/Pear/LocalLoop/Import/LCCCsv/Transactions.pm b/lib/Pear/LocalLoop/Import/LCCCsv/Transactions.pm index c711a8b..4ad3616 100644 --- a/lib/Pear/LocalLoop/Import/LCCCsv/Transactions.pm +++ b/lib/Pear/LocalLoop/Import/LCCCsv/Transactions.pm @@ -46,7 +46,7 @@ sub import_csv { while ( my $row = $self->get_csv_line ) { $self->_row_to_result( $row, $lcc_org ); } - + return 1; } @@ -183,7 +183,7 @@ sub _row_to_result { ), } ); - + return 1; } diff --git a/lib/Pear/LocalLoop/Plugin/BootstrapPagination.pm b/lib/Pear/LocalLoop/Plugin/BootstrapPagination.pm index b69cad3..f8e9917 100644 --- a/lib/Pear/LocalLoop/Plugin/BootstrapPagination.pm +++ b/lib/Pear/LocalLoop/Plugin/BootstrapPagination.pm @@ -99,11 +99,15 @@ sub register { if ( $number eq ".." && $last_num < $actual ) { my $offset = ceil( ( $actual - $round ) / 2 ) + 1; $html .= "url_with->query( [ $param => $start == 0 ? $offset + 1 : $offset ] ) @@ -115,11 +119,15 @@ sub register { my $forw = $round + $actual; my $offset = ceil( ( ( $back - $forw ) / 2 ) + $forw ); $html .= "url_with->query( [ $param => $start == 0 ? $offset + 1 : $offset ] ) @@ -131,18 +139,23 @@ sub register { "
  • $show_number
  • "; + : "" + ) . ">$show_number"; } else { $html .= "url_with->query( [ $param => $number ] ) . $query @@ -176,7 +189,7 @@ sub register { return b($html); } ); - + return 1; } diff --git a/lib/Pear/LocalLoop/Plugin/Currency.pm b/lib/Pear/LocalLoop/Plugin/Currency.pm index 287b7ae..9dd2466 100644 --- a/lib/Pear/LocalLoop/Plugin/Currency.pm +++ b/lib/Pear/LocalLoop/Plugin/Currency.pm @@ -24,7 +24,7 @@ sub register { return sprintf( '£%.2f', $value / 100000 ); } ); - + return 1; } diff --git a/lib/Pear/LocalLoop/Plugin/Minion.pm b/lib/Pear/LocalLoop/Plugin/Minion.pm index b4edba7..e706485 100644 --- a/lib/Pear/LocalLoop/Plugin/Minion.pm +++ b/lib/Pear/LocalLoop/Plugin/Minion.pm @@ -34,7 +34,7 @@ sub register { else { $app->log->debug('No Minion Config'); } - + return 1; } diff --git a/lib/Pear/LocalLoop/Plugin/Minion/Job/csv_postcode_import.pm b/lib/Pear/LocalLoop/Plugin/Minion/Job/csv_postcode_import.pm index e1e491c..b79d2df 100644 --- a/lib/Pear/LocalLoop/Plugin/Minion/Job/csv_postcode_import.pm +++ b/lib/Pear/LocalLoop/Plugin/Minion/Job/csv_postcode_import.pm @@ -10,7 +10,7 @@ sub run { csv_file => $filename, schema => $self->app->schema )->import_csv; - + return 1; } diff --git a/lib/Pear/LocalLoop/Plugin/Minion/Job/csv_supplier_import.pm b/lib/Pear/LocalLoop/Plugin/Minion/Job/csv_supplier_import.pm index d051b14..69dee82 100644 --- a/lib/Pear/LocalLoop/Plugin/Minion/Job/csv_supplier_import.pm +++ b/lib/Pear/LocalLoop/Plugin/Minion/Job/csv_supplier_import.pm @@ -10,7 +10,7 @@ sub run { csv_file => $filename, schema => $self->app->schema )->import_csv; - + return 1; } diff --git a/lib/Pear/LocalLoop/Plugin/Minion/Job/csv_transaction_import.pm b/lib/Pear/LocalLoop/Plugin/Minion/Job/csv_transaction_import.pm index 8ec0841..41a8af2 100644 --- a/lib/Pear/LocalLoop/Plugin/Minion/Job/csv_transaction_import.pm +++ b/lib/Pear/LocalLoop/Plugin/Minion/Job/csv_transaction_import.pm @@ -11,7 +11,7 @@ sub run { schema => $self->app->schema, target_entity_id => $entity_id, )->import_csv; - + return 1; } diff --git a/lib/Pear/LocalLoop/Plugin/Minion/Job/entity_postcode_lookup.pm b/lib/Pear/LocalLoop/Plugin/Minion/Job/entity_postcode_lookup.pm index 48f6a20..183835c 100644 --- a/lib/Pear/LocalLoop/Plugin/Minion/Job/entity_postcode_lookup.pm +++ b/lib/Pear/LocalLoop/Plugin/Minion/Job/entity_postcode_lookup.pm @@ -30,7 +30,7 @@ sub run { } } } - + return 1; } diff --git a/lib/Pear/LocalLoop/Plugin/Minion/Job/leaderboards_recalc.pm b/lib/Pear/LocalLoop/Plugin/Minion/Job/leaderboards_recalc.pm index 5046aa3..aa08259 100644 --- a/lib/Pear/LocalLoop/Plugin/Minion/Job/leaderboards_recalc.pm +++ b/lib/Pear/LocalLoop/Plugin/Minion/Job/leaderboards_recalc.pm @@ -7,7 +7,7 @@ sub run { my $leaderboard_rs = $self->app->schema->resultset('Leaderboard'); $leaderboard_rs->recalculate_all; - + return 1; } diff --git a/lib/Pear/LocalLoop/Plugin/Minion/Job/test.pm b/lib/Pear/LocalLoop/Plugin/Minion/Job/test.pm index 6fd0230..10413ea 100644 --- a/lib/Pear/LocalLoop/Plugin/Minion/Job/test.pm +++ b/lib/Pear/LocalLoop/Plugin/Minion/Job/test.pm @@ -8,7 +8,7 @@ sub run { for my $arg (@args) { $self->job->app->log->debug($arg); } - + return 1; } diff --git a/lib/Pear/LocalLoop/Plugin/Postcodes.pm b/lib/Pear/LocalLoop/Plugin/Postcodes.pm index 60e8ddf..b0bc59a 100644 --- a/lib/Pear/LocalLoop/Plugin/Postcodes.pm +++ b/lib/Pear/LocalLoop/Plugin/Postcodes.pm @@ -71,7 +71,7 @@ sub register { return; } ); - + return 1; } diff --git a/lib/Pear/LocalLoop/Plugin/TemplateHelpers.pm b/lib/Pear/LocalLoop/Plugin/TemplateHelpers.pm index b540f0d..0c1a539 100644 --- a/lib/Pear/LocalLoop/Plugin/TemplateHelpers.pm +++ b/lib/Pear/LocalLoop/Plugin/TemplateHelpers.pm @@ -15,7 +15,7 @@ sub register { } } ); - + return 1; } diff --git a/lib/Pear/LocalLoop/Plugin/Validators.pm b/lib/Pear/LocalLoop/Plugin/Validators.pm index 6acb616..a2ffcc7 100644 --- a/lib/Pear/LocalLoop/Plugin/Validators.pm +++ b/lib/Pear/LocalLoop/Plugin/Validators.pm @@ -101,7 +101,7 @@ sub register { ); $app->helper( validation_error => sub { _validation_error(@_) } ); - + return 1; } diff --git a/lib/Pear/LocalLoop/Schema/Result/EntityAssociation.pm b/lib/Pear/LocalLoop/Schema/Result/EntityAssociation.pm index 4de3d20..4af5f06 100644 --- a/lib/Pear/LocalLoop/Schema/Result/EntityAssociation.pm +++ b/lib/Pear/LocalLoop/Schema/Result/EntityAssociation.pm @@ -34,5 +34,5 @@ __PACKAGE__->set_primary_key("id"); __PACKAGE__->belongs_to( "entity", "Pear::LocalLoop::Schema::Result::Entity", "entity_id", ); - + 1; diff --git a/lib/Pear/LocalLoop/Schema/Result/Organisation.pm b/lib/Pear/LocalLoop/Schema/Result/Organisation.pm index a9be49e..c52ad50 100644 --- a/lib/Pear/LocalLoop/Schema/Result/Organisation.pm +++ b/lib/Pear/LocalLoop/Schema/Result/Organisation.pm @@ -146,7 +146,7 @@ sub sqlt_deploy_hook { else { $pending_field->{default_value} = \"false"; } - + return 1; } diff --git a/lib/Pear/LocalLoop/Schema/Result/Transaction.pm b/lib/Pear/LocalLoop/Schema/Result/Transaction.pm index 5e96089..00f6e79 100644 --- a/lib/Pear/LocalLoop/Schema/Result/Transaction.pm +++ b/lib/Pear/LocalLoop/Schema/Result/Transaction.pm @@ -103,7 +103,7 @@ sub sqlt_deploy_hook { else { $pending_field->{default_value} = \"false"; } - + return 1; } diff --git a/lib/Pear/LocalLoop/Schema/Result/User.pm b/lib/Pear/LocalLoop/Schema/Result/User.pm index 4340470..0ac7615 100644 --- a/lib/Pear/LocalLoop/Schema/Result/User.pm +++ b/lib/Pear/LocalLoop/Schema/Result/User.pm @@ -99,7 +99,7 @@ sub sqlt_deploy_hook { else { $pending_field->{default_value} = \"false"; } - + return 1; } diff --git a/lib/Pear/LocalLoop/Schema/ResultSet/Category.pm b/lib/Pear/LocalLoop/Schema/ResultSet/Category.pm index 0020c6c..ef74e08 100644 --- a/lib/Pear/LocalLoop/Schema/ResultSet/Category.pm +++ b/lib/Pear/LocalLoop/Schema/ResultSet/Category.pm @@ -8,12 +8,8 @@ use base 'DBIx::Class::ResultSet'; sub as_hash { my ($self) = @_; - my %category_list = ( - ( - map { $_->id => $_->name, } $self->all - ), - 0 => 'Uncategorised', - ); + my %category_list = + ( ( map { $_->id => $_->name, } $self->all ), 0 => 'Uncategorised', ); return \%category_list; } @@ -21,9 +17,7 @@ sub as_hash_name_icon { my ($self) = @_; my %category_list = ( - ( - map { $_->name => $_->line_icon, } $self->all - ), + ( map { $_->name => $_->line_icon, } $self->all ), 0 => 'Uncategorised', ); return \%category_list; diff --git a/lib/Pear/LocalLoop/Schema/ResultSet/ImportSet.pm b/lib/Pear/LocalLoop/Schema/ResultSet/ImportSet.pm index 186425e..ef0a8dd 100644 --- a/lib/Pear/LocalLoop/Schema/ResultSet/ImportSet.pm +++ b/lib/Pear/LocalLoop/Schema/ResultSet/ImportSet.pm @@ -39,7 +39,7 @@ sub _unordered_get_values { } sub get_users { - my ($self, $set_id) = @_; + my ( $self, $set_id ) = @_; return $self->_unordered_get_values($set_id)->search( {}, diff --git a/lib/Pear/LocalLoop/Schema/ResultSet/Leaderboard.pm b/lib/Pear/LocalLoop/Schema/ResultSet/Leaderboard.pm index fdb794b..70257e3 100644 --- a/lib/Pear/LocalLoop/Schema/ResultSet/Leaderboard.pm +++ b/lib/Pear/LocalLoop/Schema/ResultSet/Leaderboard.pm @@ -92,7 +92,7 @@ sub recalculate_all { warn "Unrecognised Set"; } } - + return 1; } @@ -107,7 +107,7 @@ sub _recalculate_leaderboard { $lb_result->create_new($date); } ); - + return 1; } diff --git a/lib/Pear/LocalLoop/Schema/Script/DeploymentHandler.pm b/lib/Pear/LocalLoop/Schema/Script/DeploymentHandler.pm index 11b332a..33c298a 100644 --- a/lib/Pear/LocalLoop/Schema/Script/DeploymentHandler.pm +++ b/lib/Pear/LocalLoop/Schema/Script/DeploymentHandler.pm @@ -207,7 +207,7 @@ sub cmd_write_ddl { } ); } - + return 1; } @@ -227,7 +227,7 @@ sub cmd_install_dh { version => $self->version, } ); - + return 1; } @@ -245,7 +245,7 @@ sub cmd_install { version => $self->version, } ); - + return 1; } @@ -259,7 +259,7 @@ sub cmd_upgrade { my ($self) = @_; $self->dh->upgrade; - + return 1; } diff --git a/lib/Test/Pear/LocalLoop.pm b/lib/Test/Pear/LocalLoop.pm index 5119cfb..ef9c323 100644 --- a/lib/Test/Pear/LocalLoop.pm +++ b/lib/Test/Pear/LocalLoop.pm @@ -14,7 +14,7 @@ sub BUILD { or die "you need Test::PostgreSQL to run PG testing"; Test::PostgreSQL->import; } - + return 1; } @@ -25,7 +25,7 @@ sub DEMOLISH { $self->mojo->app->schema->storage->dbh->disconnect; $self->pg->stop; } - + return 1; } @@ -145,7 +145,7 @@ sub register_customer { $self->framework->post_ok( '/api/register' => json => $json ) ->status_is(200)->or( $self->dump_error ) ->json_is( '/success', Mojo::JSON->true )->or( $self->dump_error ); - + return 1; } @@ -157,7 +157,7 @@ sub register_organisation { $self->framework->post_ok( '/api/register' => json => $args ) ->status_is(200)->or( $self->dump_error ) ->json_is( '/success', Mojo::JSON->true )->or( $self->dump_error ); - + return 1; } @@ -180,7 +180,7 @@ sub logout { '/api/logout' => json => { session_key => $session_key } ) ->status_is(200)->json_is( '/success', Mojo::JSON->true ) ->json_like( '/message', qr/Logged Out/ ); - + return 1; } @@ -251,7 +251,7 @@ sub install_fixtures { } ); } - + return 1; }