Skip to content

Commit

Permalink
Merge pull request #3 from indexdata/CIRCSTORE-452
Browse files Browse the repository at this point in the history
Circstore 452
  • Loading branch information
nielserik authored Oct 3, 2023
2 parents e7fde38 + f2ea5fe commit 8c306de
Show file tree
Hide file tree
Showing 14 changed files with 68 additions and 26 deletions.
2 changes: 1 addition & 1 deletion descriptors/ModuleDescriptor-template.json
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@
},
{
"id": "scheduled-notice-storage",
"version": "0.5",
"version": "0.6",
"handlers": [
{
"methods": ["GET"],
Expand Down
2 changes: 1 addition & 1 deletion ramls/anonymize-storage-loans-response.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
}
},
"notAnonymizedLoans": {
"description": "tbd",
"description": "Not anonymized loan IDs",
"type": "array",
"items": {
"description": "Collection of loans",
Expand Down
10 changes: 5 additions & 5 deletions ramls/cancellation-reason.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "tbd",
"description": "Request cancellation reason",
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"description": "tbd",
"description": "Reason name",
"type": "string"
},
"description" : {
"description": "tbd",
"description": "Internal reason description",
"type": "string"
},
"publicDescription": {
"description": "tbd",
"description": "Public reason description",
"type": "string"
},
"requiresAdditionalInformation": {
"description": "tbd",
"description": "Flag that indicates whether reason requires additional information",
"type": "boolean"
},
"source": {
Expand Down
5 changes: 3 additions & 2 deletions ramls/fixed-due-date-schedule.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,17 @@
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"name": {
"description": "tbd",
"description": "Schedule name",
"type": "string"
},
"description": {
"description": "tbd",
"description": "Schedule description",
"type": "string"
},
"schedules": {
"description": "tbd",
"id": "schedules",
"description": "List date ranges with a due date for each",
"type": "array",
"items": {
"type": "object",
Expand Down
17 changes: 9 additions & 8 deletions ramls/kv-configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,42 @@
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "tbd",
"type": "object",
"description": "Configuration entry",
"properties": {
"id": {
"type": "string",
"$ref": "raml-util/schemas/uuid.schema"
},
"module": {
"description": "tbd",
"description": "Name of a FOLIO module",
"type": "string"
},
"configName": {
"description": "tbd",
"description": "Configuration name",
"type": "string"
},
"code": {
"description": "tbd",
"description": "Configuration code",
"type": "string"
},
"description": {
"description": "tbd",
"description": "Configuration description",
"type": "string"
},
"default": {
"description": "tbd",
"description": "Flag that indicates whether this is the default configuration",
"type": "boolean"
},
"enabled": {
"description": "tbd",
"description": "Flag that indicates whether this configuration is enabled",
"type": "boolean"
},
"value": {
"description": "tbd",
"description": "Configuration value",
"type": "string"
},
"userId": {
"description": "tbd",
"description": "User ID",
"type": "string"
},
"metadata": {
Expand Down
2 changes: 2 additions & 0 deletions ramls/kv-configurations.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "tbd",
"type": "object",
"description": "Collection of configuration entries",
"properties": {
"configs": {
"description": "tbd",
"id": "configurationData",
"description": "An array of configuration entries",
"type": "array",
"items": {
"type": "object",
Expand Down
8 changes: 7 additions & 1 deletion ramls/loan-policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@
"type": "string"
},
"loanable": {
"description": "tbd",
"description": "Flag that indicates whether this policy allows loans",
"type": "boolean"
},
"loansPolicy": {
"description": "tbd",
"type": "object",
"description": "Settings for loans",
"additionalProperties": false,
"properties": {
"profileId": {
Expand Down Expand Up @@ -66,6 +67,7 @@
"renewalsPolicy": {
"description": "tbd",
"type": "object",
"description": "Settings for renewals",
"properties": {
"unlimited": {
"type": "boolean",
Expand Down Expand Up @@ -97,11 +99,13 @@
"requestManagement": {
"description": "tbd",
"type": "object",
"description": "Settings for various request types",
"additionalProperties": false,
"properties": {
"recalls": {
"description": "tbd",
"type": "object",
"description": "Settings for recall requests",
"additionalProperties": false,
"properties": {
"alternateGracePeriod": {
Expand Down Expand Up @@ -134,6 +138,7 @@
"holds": {
"description": "tbd",
"type": "object",
"description": "Settings for hold requests",
"additionalProperties": false,
"properties": {
"alternateCheckoutLoanPeriod": {
Expand All @@ -155,6 +160,7 @@
"pages": {
"description": "tbd",
"type": "object",
"description": "Settings for page requests",
"additionalProperties": false,
"properties": {
"alternateCheckoutLoanPeriod": {
Expand Down
9 changes: 9 additions & 0 deletions ramls/patron-notice-policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
"sendOptions": {
"description": "tbd",
"type": "object",
"description": "Notice sending options",
"additionalProperties": false,
"properties": {
"sendHow": {
Expand Down Expand Up @@ -95,11 +96,13 @@
"sendBy": {
"description": "tbd",
"type": "object",
"description": "Delay before the first attempt to send a notice",
"$ref": "interval.json"
},
"sendEvery": {
"description": "tbd",
"type": "object",
"description": "Interval between attempts to send a recurring notice",
"$ref": "interval.json"
}
},
Expand Down Expand Up @@ -158,6 +161,7 @@
"sendOptions": {
"description": "tbd",
"type": "object",
"description": "Notice sending options",
"additionalProperties": false,
"properties": {
"sendHow": {
Expand All @@ -182,11 +186,13 @@
"sendBy": {
"description": "tbd",
"type": "object",
"description": "Delay before the first attempt to send a notice",
"$ref": "interval.json"
},
"sendEvery": {
"description": "tbd",
"type": "object",
"description": "Interval between attempts to send a recurring notice",
"$ref": "interval.json"
}
},
Expand Down Expand Up @@ -245,6 +251,7 @@
"sendOptions": {
"description": "tbd",
"type": "object",
"description": "Notice sending options",
"additionalProperties": false,
"properties": {
"sendHow": {
Expand Down Expand Up @@ -272,11 +279,13 @@
"sendBy": {
"description": "tbd",
"type": "object",
"description": "Delay before the first attempt to send a notice",
"$ref": "interval.json"
},
"sendEvery": {
"description": "tbd",
"type": "object",
"description": "Interval between attempts to send a recurring notice",
"$ref": "interval.json"
}
},
Expand Down
1 change: 1 addition & 0 deletions ramls/period.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "tbd",
"type": "object",
"description": "Time interval defined by its duration",
"properties": {
"duration": {
"type": "integer",
Expand Down
2 changes: 1 addition & 1 deletion ramls/scheduled-notice-storage.raml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#%RAML 1.0
title: Scheduled Notice Storage
version: v0.5
version: v0.6
protocols: [ HTTP, HTTPS ]
baseUri: http://localhost:9130

Expand Down
2 changes: 2 additions & 0 deletions ramls/scheduled-notice.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "tbd",
"type": "object",
"description": "Scheduled patron notice",
"properties": {
"id": {
"type": "string",
Expand Down Expand Up @@ -58,6 +59,7 @@
"noticeConfig": {
"description": "tbd",
"type": "object",
"description": "Scheduled notice configuration",
"properties": {
"timing": {
"type": "string",
Expand Down
9 changes: 5 additions & 4 deletions ramls/staff-slip.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,25 @@
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "tbd",
"type": "object",
"description": "Staff slip",
"properties": {
"id": {
"type": "string"
},
"name": {
"description": "tbd",
"description": "Staff slip name",
"type": "string"
},
"description": {
"description": "tbd",
"description": "Staff slip description",
"type": "string"
},
"active": {
"description": "tbd",
"description": "Flag that indicates whether staff slip is active",
"type": "boolean"
},
"template": {
"description": "tbd",
"description": "Staff slip template",
"type": "string"
},
"metadata": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
-- ensure that there will be one row only
ALTER TABLE ${myuniversity}_${mymodule}.${table.tableName}
ADD COLUMN IF NOT EXISTS
lock boolean DEFAULT true UNIQUE CHECK(lock=true);
DO $$
BEGIN
-- create constraints only if they do not exist, otherwise they are piling up
IF NOT EXISTS (
SELECT constraint_name
FROM information_schema.constraint_column_usage
WHERE table_schema = '${myuniversity}_${mymodule}'
AND table_name = '${table.tableName}'
AND column_name = 'lock'
AND constraint_name LIKE '${table.tableName}_lock_%'
) THEN
ALTER TABLE ${myuniversity}_${mymodule}.${table.tableName}
-- this will create constraints even when column already exists
ADD COLUMN IF NOT EXISTS lock boolean DEFAULT true UNIQUE CHECK(lock=true);
END IF;
END $$;
INSERT INTO ${myuniversity}_${mymodule}.${table.tableName}
SELECT id, jsonb_build_object('id', id, 'rulesAsText', '')
FROM (SELECT md5('${myuniversity}_${mymodule}.${table.tableName}.rulesAsText')::uuid AS id) AS alias
Expand Down
6 changes: 6 additions & 0 deletions src/main/resources/templates/db_scripts/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,12 @@
"caseSensitive": false,
"removeAccents": false,
"sqlExpression": "(jsonb->'agedToLostDelayedBilling'->>'dateLostItemShouldBeBilled')"
},
{
"fieldName": "action",
"tOps": "ADD",
"caseSensitive": false,
"removeAccents": true
}
],
"fullTextIndex": [
Expand Down

0 comments on commit 8c306de

Please sign in to comment.