use OpenILS::Application::AppUtils;
my $U = "OpenILS::Application::AppUtils";
+use Digest::MD5 qw(md5_hex);
+
use DateTime;
use DateTime::Format::ISO8601;
arrival => { '!=' => undef},
delivered => { '>' => 'today'},
},{
- limit => 1,
- order_by => { acsp => {delivered => {direction => 'desc'}} }
+ idlist => 1, order_by => { acsp => {delivered => {direction => 'desc'}} }
}]);
- return @$slots ? $$slots[0]->delivered : undef;
+ return md5_hex( join(',', @$slots) );
}
__PACKAGE__->register_method(
method => "fetch_latest_delivered",
{type => 'string', desc => 'Authentication token'},
{type => 'number', desc => 'Library ID'},
],
- return => { desc => 'Most recent delivery timestamp from today, or error event'}
+ return => { desc => 'Hash of appointment IDs delivered today, or error event'}
}
);
arrival => { '!=' => undef},
delivered => undef,
},{
- limit => 1, order_by => { acsp => { arrival => { direction => 'desc' } } }
+ idlist => 1, order_by => { acsp => { arrival => { direction => 'desc' } } }
}]);
- return @$slots ? $$slots[0]->arrival : undef;
+ return md5_hex( join(',', @$slots) );
}
__PACKAGE__->register_method(
method => "fetch_latest_arrived",
{type => 'string', desc => 'Authentication token'},
{type => 'number', desc => 'Library ID'},
],
- return => { desc => 'Most recent arrival time on undelivered appointments'}
+ return => { desc => 'Hash of appointment IDs for undelivered appointments'}
}
);
staged => { '!=' => undef},
arrival => undef
},{
- limit => 1, order_by => { acsp => { slot => { direction => 'desc' } } }
+ idlist => 1, # fully ordered IDs will capture insertion, deletion, AND edit
+ order_by => [
+ { class => acsp => field => slot => direction => 'desc' },
+ { class => acsp => field => id => direction => 'desc' }
+ ]
}]);
- return @$slots ? $$slots[0]->staged : undef;
+ return md5_hex( join(',', @$slots) );
}
__PACKAGE__->register_method(
method => "fetch_latest_staged",
{type => 'string', desc => 'Authentication token'},
{type => 'number', desc => 'Library ID'},
],
- return => { desc => 'Time of most recently staged appointment'}
+ return => { desc => 'Hash of appointment IDs for staged appointment'}
}
);
staged => undef,
slot => { '<=' => $horizon->strftime('%FT%T%z') },
},{
- limit => 1, order_by => { acsp => { slot => { direction => 'desc' } } }
+ idlist => 1, # fully ordered IDs will capture insertion, deletion, AND edit
+ order_by => [
+ { class => acsp => field => slot => direction => 'desc' },
+ { class => acsp => field => id => direction => 'desc' }
+ ]
}]);
- return @$slots ? $$slots[0]->slot : undef;
+ return md5_hex( join(',', @$slots) );
}
__PACKAGE__->register_method(
method => "fetch_latest_to_be_staged",
{type => 'string', desc => 'Authentication token'},
{type => 'number', desc => 'Library ID'},
],
- return => { desc => 'Appointment time of the latest slot that needs to be staged'}
+ return => { desc => 'Hash of appointment IDs that needs to be staged'}
}
);