"shelf_time": {"!=": null},
"cancel_time": null
}
+ },
+ "hold_request.long_wait" : {
+ "context_org": "pickup_lib",
+ "filter": {
+ "frozen": "f",
+ "cancel_time": null,
+ "capture_time": null
+ }
}
}
<link field="id" reltype="might_have" key="id" map="" class="circ"/>
</links>
</class>
- <class id="rhrr" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::hold_request_record" oils_persist:tablename="reporter.hold_request_record" reporter:label="Hold Request Record">
+ <class id="rhrr" controller="open-ils.reporter-store open-ils.cstore" oils_obj:fieldmapper="reporter::hold_request_record" oils_persist:tablename="reporter.hold_request_record" reporter:label="Hold Request Record">
<fields oils_persist:primary="id">
<field reporter:label="Hold ID" name="id" reporter:datatype="id" />
<field reporter:label="Hold Target" name="target" reporter:datatype="int" />
install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
);
-INSERT INTO config.upgrade_log (version) VALUES ('0083'); -- miker
+INSERT INTO config.upgrade_log (version) VALUES ('0084'); -- senator
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
( 7, 'pickup_lib.billing_address'),
( 7, 'usr');
+-- long wait hold request notifications
+
+INSERT INTO action_trigger.hook (
+ key,
+ core_type,
+ description,
+ passive
+ ) VALUES (
+ 'hold_request.long_wait',
+ 'ahr',
+ 'A patron has been waiting on a hold to be fulfilled for a long time.',
+ TRUE
+ );
+
+INSERT INTO action_trigger.event_definition (
+ id,
+ active,
+ owner,
+ name,
+ hook,
+ validator,
+ reactor,
+ delay,
+ delay_field,
+ group_field,
+ template
+ ) VALUES (
+ 9,
+ FALSE,
+ 1,
+ 'Hold waiting for pickup for long time',
+ 'hold_request.long_wait',
+ 'NOOP_True',
+ 'SendEmail',
+ '6 MONTHS',
+ 'request_time',
+ 'usr',
+$$
+[%- USE date -%]
+[%- user = target.0.usr -%]
+To: [%- params.recipient_email || user.email %]
+From: [%- params.sender_email || default_sender %]
+Subject: Long Wait Hold Notification
+
+Dear [% user.family_name %], [% user.first_given_name %]
+
+You requested hold(s) on the following item(s), but unfortunately
+we have not been able to fulfill your request after a considerable
+length of time. If you would still like to recieve these items,
+no action is required.
+
+[% FOR hold IN target %]
+ Title: [% hold.bib_rec.bib_record.simple_record.title %]
+ Author: [% hold.bib_rec.bib_record.simple_record.author %]
+[% END %]
+$$
+);
+
+INSERT INTO action_trigger.environment (event_def, path)
+ VALUES
+ (9, 'pickup_lib'),
+ (9, 'usr'),
+ (9, 'bib_rec.bib_record.simple_record');
+
+
+
SELECT SETVAL('action_trigger.event_definition_id_seq'::TEXT, 100);
-- Org Unit Settings for configuring org unit weights and org unit max-loops for hold targeting
--- /dev/null
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0084'); -- senator
+
+INSERT INTO action_trigger.hook (
+ key,
+ core_type,
+ description,
+ passive
+ ) VALUES (
+ 'hold_request.long_wait',
+ 'ahr',
+ 'A patron has been waiting on a hold to be fulfilled for a long time.',
+ TRUE
+ );
+
+INSERT INTO action_trigger.event_definition (
+ id,
+ active,
+ owner,
+ name,
+ hook,
+ validator,
+ reactor,
+ delay,
+ delay_field,
+ group_field,
+ template
+ ) VALUES (
+ 9,
+ FALSE,
+ 1,
+ 'Hold waiting for pickup for long time',
+ 'hold_request.long_wait',
+ 'NOOP_True',
+ 'SendEmail',
+ '6 MONTHS',
+ 'request_time',
+ 'usr',
+$$
+[%- USE date -%]
+[%- user = target.0.usr -%]
+To: [%- params.recipient_email || user.email %]
+From: [%- params.sender_email || default_sender %]
+Subject: Long Wait Hold Notification
+
+Dear [% user.family_name %], [% user.first_given_name %]
+
+You requested hold(s) on the following item(s), but unfortunately
+we have not been able to fulfill your request after a considerable
+length of time. If you would still like to recieve these items,
+no action is required.
+
+[% FOR hold IN target %]
+ Title: [% hold.bib_rec.bib_record.simple_record.title %]
+ Author: [% hold.bib_rec.bib_record.simple_record.author %]
+[% END %]
+$$
+);
+
+INSERT INTO action_trigger.environment (
+ event_def,
+ path
+ ) VALUES
+ (9, 'pickup_lib'),
+ (9, 'usr'),
+ (9, 'bib_rec.bib_record.simple_record');
+
+
+COMMIT;