adding script to add student profile for LOPL
authorChris Sharp <csharp@georgialibraries.org>
Thu, 31 Jan 2019 20:27:27 +0000 (15:27 -0500)
committerChris Sharp <csharp@georgialibraries.org>
Thu, 31 Jan 2019 20:27:27 +0000 (15:27 -0500)
sql/add_student_card_profile.sql [new file with mode: 0644]

diff --git a/sql/add_student_card_profile.sql b/sql/add_student_card_profile.sql
new file mode 100644 (file)
index 0000000..2824b09
--- /dev/null
@@ -0,0 +1,74 @@
+-- adding the LOPL student card pilot
+BEGIN;
+
+-- create user group
+insert into permission.grp_tree (
+    name, 
+    parent, 
+    usergroup, 
+    perm_interval, 
+    description, 
+    application_perm
+) values (
+    'Student Card (pilot)',
+    (select id from permission.grp_tree where name = 'Patrons'),
+    true,
+    '1 year',
+    'Student card pilot program for LOPL',
+    'group_application.user.patron'
+);
+
+-- 2 items out at a time
+insert into permission.grp_penalty_threshold (
+    grp,
+    org_unit,
+    penalty,
+    threshold
+) values (
+    (select id from permission.grp_tree where name = 'Student Card (pilot)'),
+    1,
+    (select id from config.standing_penalty where name = 'PATRON_EXCEEDS_CHECKOUT_COUNT'),
+    2.00
+);
+
+-- no fines
+insert into config.circ_matrix_matchpoint (
+    org_unit,
+    grp,
+    circulate,
+    max_fine_rule
+) values (
+    1,
+    (select id from permission.grp_tree where name = 'Student Card (pilot)'),
+    true,
+    (select id from config.rule_max_fine where name = 'no_fines')
+);
+
+-- 2 holds at a time
+insert into config.hold_matrix_matchpoint (
+    requestor_grp,
+    usr_grp,
+    stop_blocked_user,
+    max_holds
+) values (
+    1,
+    (select id from permission.grp_tree where name = 'Student Card (pilot)'),
+    true,
+    2
+);
+
+-- set display entry
+insert into permission.grp_tree_display_entry (
+    position,
+    org,
+    grp,
+    parent
+) values (
+    5,
+    1,
+    (select id from permission.grp_tree where name = 'Student Card (pilot)'),
+    1
+);
+
+COMMIT;
+