Adds a holdable_formats option to concerto's populate_hold() function.
Inserts one metarecord hold for testing.
Signed-off-by: Bill Erickson <berickxx@gmail.com>
requestor INTEGER,
pickup_lib INTEGER,
frozen BOOLEAN,
- thawdate TIMESTAMP WITH TIME ZONE
+ thawdate TIMESTAMP WITH TIME ZONE,
+ holdable_formats TEXT DEFAULT NULL
) RETURNS void AS $$
BEGIN
INSERT INTO action.hold_request (
requestor, hold_type, target, usr, pickup_lib,
- request_lib, selection_ou, frozen, thaw_date)
+ request_lib, selection_ou, frozen, thaw_date, holdable_formats)
VALUES (
requestor,
hold_type,
pickup_lib,
pickup_lib,
frozen,
- thawdate
+ thawdate,
+ holdable_formats
);
-- Create hold notes for staff-placed holds: 1 public, 1 private
DROP FUNCTION evergreen.populate_circ
(INTEGER, INTEGER, BIGINT, INTEGER, TEXT, TEXT, TEXT, BOOLEAN);
DROP FUNCTION evergreen.populate_hold
- (TEXT, BIGINT, INTEGER, INTEGER, INTEGER, BOOLEAN, TIMESTAMP WITH TIME ZONE);
+ (TEXT, BIGINT, INTEGER, INTEGER, INTEGER, BOOLEAN, TIMESTAMP WITH TIME ZONE, TEXT);
END LOOP;
END LOOP;
+
+ -- finally, add a metarecord hold w/ a holdable_format
+ -- for patron id=2 (home_ou=9)
+ PERFORM evergreen.populate_hold(
+ 'M', 42, 2, 2, 9, FALSE, NULL,
+ '{"0":[{"_attr":"mr_hold_format","_val":"score"}]}'
+ );
+
END $$;