From c71f06ef87eeadd1024f11d3c036e8dde5717b3c Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Tue, 19 May 2020 15:08:32 -0400 Subject: [PATCH] Data structure This commit defines the data structures needed to record and interact with the curbside interfaces and business logic. Signed-off-by: Galen Charlton --- Open-ILS/examples/fm_IDL.xml | 20 +++++ .../src/sql/Pg/upgrade/XXXX.schema.curbside.sql | 85 ++++++++++++++++++++++ 2 files changed, 105 insertions(+) create mode 100644 Open-ILS/src/sql/Pg/upgrade/XXXX.schema.curbside.sql diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml index 560d372eab..a3195072e3 100644 --- a/Open-ILS/examples/fm_IDL.xml +++ b/Open-ILS/examples/fm_IDL.xml @@ -4629,6 +4629,26 @@ SELECT usr, + + + + + + + + + + + + + + + + + + + + diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.curbside.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.curbside.sql new file mode 100644 index 0000000000..1cf0010db0 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.curbside.sql @@ -0,0 +1,85 @@ +BEGIN; + +CREATE TABLE action.curbside ( + id SERIAL PRIMARY KEY, + patron INT NOT NULL REFERENCES actor.usr (id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED, + org INT NOT NULL REFERENCES actor.org_unit (id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED, + slot TIMESTAMPTZ, + staged TIMESTAMPTZ, + stage_staff INT REFERENCES actor.usr (id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED, + arrival TIMESTAMPTZ, + delivered TIMESTAMPTZ, + delivery_staff INT REFERENCES actor.usr (id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED, + notes TEXT +); + +INSERT INTO config.org_unit_setting_type (name, label, grp, description, datatype) +VALUES ( + 'circ.curbside', + 'Allow patrons to select a curbside pickup time', + 'circ', + 'When set to TRUE patrons will have the ability to schedule curbside pickup of holds that become available for pickup.', + 'bool' +); + +INSERT INTO config.org_unit_setting_type (name, label, grp, description, datatype) +VALUES ( + 'circ.curbside.granularity', + 'Time interval between curbside appointments', + 'circ', + 'Time interval between curbside appointments', + 'interval' +); + +INSERT INTO config.org_unit_setting_type (name, label, grp, description, datatype) +VALUES ( + 'circ.curbside.max_concurrent', + 'Maximum number of patrons that may select a particular curbside pickup time', + 'circ', + 'Maximum number of patrons that may select a particular curbside pickup time', + 'integer' +); + +INSERT INTO actor.org_unit_setting (org_unit, name, value) + SELECT id, 'circ.curbside', 'false' FROM actor.org_unit WHERE parent_ou IS NULL + UNION + SELECT id, 'circ.curbside.max_concurrent', '10' FROM actor.org_unit WHERE parent_ou IS NULL + UNION + SELECT id, 'circ.curbside.granularity', '"15 minutes"' FROM actor.org_unit WHERE parent_ou IS NULL +; + +INSERT INTO action_trigger.hook (key, core_type, description, passive) +VALUES ( + 'hold.offer_curbside', + 'ahr', + oils_i18n_gettext( + 'hold.offer_curbside', + 'Hook used to trigger the notification of an offer of curbside pickup', + 'ath', + 'description' + ), + TRUE +); + +INSERT INTO action_trigger.hook (key, core_type, description, passive) +VALUES ( + 'hold.confirm_curbside', + 'acsp', + oils_i18n_gettext( + 'hold.confirm_curbside', + 'Hook used to trigger the notification of the creation or update of a curbside pickup appointment with an arrival URL', + 'ath', + 'description' + ), + TRUE +); + +INSERT INTO action_trigger.reactor (module, description) VALUES ( + 'CurbsideSlot', 'Create a curbside pickup appointment slot when necessary' +); + +INSERT INTO action_trigger.validator (module, description) VALUES ( + 'Curbside', 'Confirm that curbside pickup is enabled for the hold pickup library' +); + +COMMIT; -- 2.11.0