</unix_config>
</opensrf.dbmath>
- <open-ils.penalty>
- <keepalive>3</keepalive>
- <stateless>1</stateless>
- <language>perl</language>
- <implementation>OpenILS::Application::Penalty</implementation>
- <max_requests>99</max_requests>
- <unix_config>
- <max_requests>1000</max_requests>
- <unix_log>open-ils.penalty_unix.log</unix_log>
- <unix_sock>open-ils.penalty_unix.sock</unix_sock>
- <unix_pid>open-ils.penalty_unix.pid</unix_pid>
- <min_children>1</min_children>
- <max_children>15</max_children>
- <min_spare_children>1</min_spare_children>
- <max_spare_children>5</max_spare_children>
- </unix_config>
- <app_settings>
- <patron_penalty>penalty/patron_penalty.js</patron_penalty>
- <script_path>LIBDIR/javascript</script_path>
- <script_path>LOCALSTATEDIR</script_path>
- <script_path>LOCALSTATEDIR/catalog</script_path>
- </app_settings>
- </open-ils.penalty>
-
<open-ils.justintime>
<keepalive>5</keepalive>
<stateless>1</stateless>
<appname>open-ils.auth</appname>
<appname>open-ils.auth_proxy</appname>
<appname>open-ils.storage</appname>
- <appname>open-ils.penalty</appname>
<appname>open-ils.justintime</appname>
<appname>open-ils.cstore</appname>
<appname>open-ils.collections</appname>
+++ /dev/null
-package OpenILS::Application::Penalty;
-use strict; use warnings;
-use OpenSRF::EX qw(:try);
-use OpenILS::Application;
-use OpenILS::Utils::Penalty;
-use OpenILS::Utils::CStoreEditor qw/:funcs/;
-use base 'OpenILS::Application';
-
-__PACKAGE__->register_method (
- method => 'patron_penalty',
- api_name => 'open-ils.penalty.patron_penalty.calculate',
- signature => q/
- Calculates the patron's standing penalties
- @param args An object of named params including:
- patronid The id of the patron
- update True if this call should update the database
- background True if this call should return immediately,
- then go on to process the penalties. This flag
- works only in conjunction with the 'update' flag.
- @return An object with keys 'fatal_penalties' and
- 'info_penalties' who are themeselves arrays of 0 or
- more penalties. Returns event on error.
- /
-);
-
-# --------------------------------------------------------------
-# if $args->{background} is true, immediately respond complete
-# to the caller, then finish the calculation
-# --------------------------------------------------------------
-sub patron_penalty {
- my( $self, $conn, $args ) = @_;
- $conn->respond_complete(1) if $$args{background};
- my $e = new_editor(xact => 1);
- OpenILS::Utils::Penalty->calculate_penalties($e, $args->{patronid}, $args->{context_org});
- my $p = OpenILS::Utils::Penalty->retrieve_penalties($e, $args->{patronid}, $args->{context_org});
- $e->commit;
- return $p
-}
-
-
-1;
#!perl -T
use utf8;
-use Test::More tests => 13;
+use Test::More tests => 12;
BEGIN {
use_ok( 'OpenILS::Application' );
use_ok( 'OpenILS::Application::Booking' );
use_ok( 'OpenILS::Application::Collections' );
use_ok( 'OpenILS::Application::Fielder' );
-use_ok( 'OpenILS::Application::Penalty' );
use_ok( 'OpenILS::Application::PermaCrud' );
use_ok( 'OpenILS::Application::Reporter' );
use_ok( 'OpenILS::Application::ResolverResolver' );
* `open-ils.pcrud`: Supports access to Evergreen fieldmapper objects,
restricted by staff user permissions. This is a private service.
objects.
- * `open-ils.penalty`: Supports the calculation of penalties for users, such as
- being blocked from further borrowing, for conditions such as having too many
- items checked out or too many unpaid fines.
* `open-ils.permacrud`: Supports access to Evergreen fieldmapper objects,
restricted by staff user permissions. This is a private service.
* `open-ils.reporter`: Supports the creation and scheduling of reports.