1 package OpenILS::Application::Trigger::Validator;
2 use strict; use warnings;
4 use DateTime::Format::ISO8601;
5 use OpenSRF::Utils qw/:datetime/;
6 use OpenSRF::Utils::Logger qw/:logger/;
7 use OpenILS::Const qw/:const/;
8 sub fourty_two { return 42 }
9 sub NOOP_True { return 1 }
10 sub NOOP_False { return 0 }
16 return defined($env->{target}->checkin_time) ? 0 : 1;
22 my $circ = $env->{target};
24 return 0 if $circ->checkin_time;
25 return 0 if $circ->stop_fines and not $circ->stop_fines =~ /MAXFINES|LONGOVERDUE/;
27 my $due_date = DateTime::Format::ISO8601->new->parse_datetime(clense_ISO8601($circ->due_date));
28 return 0 if $due_date > DateTime->now;
37 my $hold = $env->{target};
40 !$hold->cancel_time and
41 $hold->capture_time and
42 $hold->current_copy and
43 $hold->current_copy->status == OILS_COPY_STATUS_ON_HOLDS_SHELF;