<request_timeout>60</request_timeout>
</app_settings>
</open-ils.ebook_api>
+
+ <open-ils.selfcheck>
+ <keepalive>5</keepalive>
+ <stateless>1</stateless>
+ <language>perl</language>
+ <implementation>OpenILS::Application::Selfcheck</implementation>
+ <max_requests>1000</max_requests>
+ <unix_config>
+ <unix_sock>selfcheck_unix.sock</unix_sock>
+ <unix_pid>selfcheck_unix.pid</unix_pid>
+ <unix_log>selfcheck_unix.log</unix_log>
+ <max_requests>1000</max_requests>
+ <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>
+ </app_settings>
+ </open-ils.selfcheck>
</apps>
</default>
<event code='7029' textcode='MAX_AUTO_RENEWALS_REACHED'>
<desc xml:lang="en-US">Circulation has no more auto-renewals remaining</desc>
</event>
+ <event code='7033' textcode='SELFCHECK_NOT_ALLOWED'>
+ <desc xml:lang="en-US">Self-checkout is not enabled for this location</desc>
+ </event>
<!-- ================================================================ -->
--- /dev/null
+package OpenILS::Application::Selfcheck;
+
+use strict;
+use warnings;
+
+use POSIX qw/strftime/;
+use OpenSRF::AppSession;
+use OpenILS::Application;
+use base qw/OpenILS::Application/;
+
+use OpenILS::Utils::DateTime qw/:datetime/;
+use OpenILS::Utils::CStoreEditor qw/:funcs/;
+use OpenILS::Utils::Fieldmapper;
+use OpenILS::Application::AppUtils;
+my $U = "OpenILS::Application::AppUtils";
+
+use DateTime;
+use DateTime::Format::ISO8601;
+
+my $date_parser = DateTime::Format::ISO8601->new;
+
+use OpenSRF::Utils::Logger qw/$logger/;
+
+sub enabled {
+ return $U->is_true(
+ $U->ou_ancestor_setting_value($org, 'circ.selfcheck')
+ );
+}
+__PACKAGE__->register_method(
+ method => "enabled",
+ api_name => "open-ils.selfcheck.enabled",
+ stream => 1,
+ argc => 0,
+ signature => {
+ desc => 'Check if selfcheck is enabled',
+ return => {
+ desc => 'True if enabled, false if not'
+ type => 'bool'
+ }
+ }
+);
+
+1;
--- /dev/null
+BEGIN;
+
+INSERT INTO config.org_unit_setting_type (name, label, grp, description, datatype)
+VALUES (
+ 'circ.selfcheck',
+ 'Allow patron self-check',
+ 'circ',
+ 'When set to TRUE patrons will have the ability to checkout items using the mobile app.',
+ 'bool'
+);
+
+COMMIT;