return defined($env->{target}->checkin_time) ? 0 : 1;
}
+sub MaxPassiveDelayAge {
+ my $self = shift;
+ my $env = shift;
+ my $target = $env->{target};
+ my $delay_field = $env->{event}->event_def->delay_field;
+
+ my $delay_field_ts = DateTime::Format::ISO8601->new->parse_datetime(clense_ISO8601($target->$delay_field()));
+ $delay_field_ts->add( seconds => interval_to_seconds( $env->{params}->{max_delay_age} ) );
+
+ return 0 if $delay_field_ts > DateTime->now;
+ return 1;
+}
+
sub CircIsOverdue {
my $self = shift;
my $env = shift;
install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
);
-INSERT INTO config.upgrade_log (version) VALUES ('0052'); -- Scott McKellar
+INSERT INTO config.upgrade_log (version) VALUES ('0053'); -- miker
CREATE TABLE config.bib_source (
INSERT INTO action_trigger.validator (module,description) VALUES ('CircIsOpen','Check that the circulation is still open');
INSERT INTO action_trigger.validator (module,description) VALUES ('HoldIsAvailable','Check that an item is on the hold shelf');
INSERT INTO action_trigger.validator (module,description) VALUES ('CircIsOverdue','Check that the circulation is overdue');
+INSERT INTO action_trigger.validator (module,description) VALUES ('MaxPassiveDelayAge','Check that the event is not too far past the delay_field time -- requires a max_delay_age interval parameter');
-- After an event passes validation (action_trigger.validator), the reactor processes it.
CREATE TABLE action_trigger.reactor (
+BEGIN;
+
INSERT INTO config.upgrade_log (version) VALUES ('0052');
CREATE TABLE asset.copy_location_order
--- /dev/null
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0053');
+
+INSERT INTO action_trigger.validator (module,description) VALUES ('MaxPassiveDelayAge','Check that the event is not too far past the delay_field time -- requires a max_delay_age interval parameter');
+
+COMMIT;
+