-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(instance-date-types): implement instance-date-types endpoint
Closes: MODINVSTOR-1235
- Loading branch information
Showing
30 changed files
with
653 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
ramls/examples/instance-date-types/instanceDateTypePatch.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"name": "new name" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"instanceDateTypes": [ | ||
{ | ||
"id": "c0b423e1-a885-4c09-a965-4d6979a97e53", | ||
"name": "Detailed date", | ||
"code": "e", | ||
"displayFormat": { | ||
"delimiter": ",", | ||
"keepDelimiter": true | ||
}, | ||
"source": "folio" | ||
}, | ||
{ | ||
"id": "2a0915ff-7246-463b-96a4-4473cd027c6b", | ||
"name": "Range of years of bulk of collection", | ||
"code": "k", | ||
"displayFormat": { | ||
"delimiter": "-", | ||
"keepDelimiter": false | ||
}, | ||
"source": "folio" | ||
} | ||
], | ||
"totalRecords": 2 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
#%RAML 1.0 | ||
title: Inventory Storage Instance Date Type API | ||
version: v1.0 | ||
protocols: [ HTTP, HTTPS ] | ||
baseUri: http://localhost | ||
|
||
traits: | ||
pageable: !include raml-util/traits/pageable.raml | ||
searchable: !include raml-util/traits/searchable.raml | ||
validate: !include raml-util/traits/validation.raml | ||
|
||
types: | ||
instanceDateTypes: !include instance-date-types/instanceDateTypes.json | ||
instanceDateTypePatch: !include instance-date-types/instanceDateTypePatch.json | ||
errors: !include raml-util/schemas/errors.schema | ||
|
||
/instance-date-types: | ||
displayName: Instances Date Types API | ||
get: | ||
description: Retrieve a list of instances date type items. | ||
is: [ | ||
searchable: {description: "with valid searchable fields", example: "code=a"}, | ||
pageable | ||
] | ||
responses: | ||
200: | ||
description: "Returns a list of instances date type items" | ||
body: | ||
application/json: | ||
type: instanceDateTypes | ||
example: | ||
strict: false | ||
value: examples/instance-date-types/instanceDateTypes.json | ||
400: | ||
description: "Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response." | ||
body: | ||
text/plain: | ||
example: "unable to list instances date type -- malformed parameter 'query', syntax error at column 6" | ||
401: | ||
description: "Not authorized to perform requested action" | ||
body: | ||
text/plain: | ||
example: "unable to list instances date type -- unauthorized" | ||
500: | ||
description: "Internal server error, e.g. due to misconfiguration" | ||
body: | ||
text/plain: | ||
example: "internal server error, contact administrator" | ||
/{id}: | ||
patch: | ||
description: "Update Instances Date Type item with given id" | ||
is: [ validate ] | ||
body: | ||
application/json: | ||
type: instanceDateTypePatch | ||
example: | ||
strict: false | ||
value: examples/instance-date-types/instanceDateTypePatch.json | ||
responses: | ||
204: | ||
description: "Update accepted" | ||
400: | ||
description: "Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response." | ||
body: | ||
text/plain: | ||
example: | | ||
"unable to list instances date type -- malformed parameter 'query', syntax error at column 6" | ||
401: | ||
description: "Not authorized to perform requested action" | ||
body: | ||
text/plain: | ||
example: | | ||
"unable to list instances date type -- unauthorized" | ||
404: | ||
description: "Item with a given ID not found" | ||
body: | ||
text/plain: | ||
example: | | ||
"instances date type not found" | ||
500: | ||
description: "Internal server error, e.g. due to misconfiguration" | ||
body: | ||
text/plain: | ||
example: "internal server error, contact administrator" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-04/schema#", | ||
"description": "An instance date type that indicates the type of dates given in Date 1 and Date 2", | ||
"type": "object", | ||
"properties": { | ||
"id": { | ||
"type": "string", | ||
"description": "Unique ID of the instance date type; a UUID", | ||
"readonly": true | ||
}, | ||
"name": { | ||
"type": "string", | ||
"description": "Name of the instance date type", | ||
"readonly": true | ||
}, | ||
"code": { | ||
"type": "string", | ||
"description": "Code of the instance date type", | ||
"maxLength": 1, | ||
"readonly": true | ||
}, | ||
"displayFormat": { | ||
"type": "object", | ||
"description": "Describes how to format Date 1 and Date 2", | ||
"properties": { | ||
"delimiter": { | ||
"type": "string", | ||
"description": "Delimiter that will be used to format Date 1 and Date 2", | ||
"example": ",", | ||
"readonly": true | ||
}, | ||
"keepDelimiter": { | ||
"type": "boolean", | ||
"description": "Define if formated date string should keep delimiter if one of dates is not exist", | ||
"example": false, | ||
"readonly": true | ||
} | ||
}, | ||
"readonly": true, | ||
"additionalProperties": false | ||
}, | ||
"source": { | ||
"type": "string", | ||
"description": "label indicating where the instance date type entry originates from, i.e. 'folio' or 'local'", | ||
"enum": [ | ||
"folio", | ||
"local" | ||
], | ||
"readonly": true | ||
}, | ||
"metadata": { | ||
"type": "object", | ||
"$ref": "../raml-util/schemas/metadata.schema", | ||
"readonly": true | ||
} | ||
}, | ||
"additionalProperties": false | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-04/schema#", | ||
"description": "Object that represents patch operation for instance date type", | ||
"type": "object", | ||
"properties": { | ||
"name": { | ||
"type": "string", | ||
"description": "Name of the instance date type" | ||
} | ||
}, | ||
"additionalProperties": false | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-04/schema#", | ||
"description": "A collection of instance date types", | ||
"type": "object", | ||
"properties": { | ||
"instanceDateTypes": { | ||
"description": "List of instance date types", | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"$ref": "instanceDateType.json" | ||
} | ||
}, | ||
"totalRecords": { | ||
"description": "Estimated or exact total number of records", | ||
"type": "integer" | ||
} | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
reference-data/instance-date-types/continuing-resource-ceased-publication.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"id": "42dac21e-3c81-4cb1-9f16-9e50c81bacc4", | ||
"name": "Continuing resource ceased publication", | ||
"code": "d", | ||
"displayFormat": { | ||
"delimiter": "-", | ||
"keepDelimiter": true | ||
}, | ||
"source": "folio" | ||
} |
10 changes: 10 additions & 0 deletions
10
reference-data/instance-date-types/continuing-resource-currently-published.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"id": "0750f52b-3bfc-458d-9307-e9afc8bcdffa", | ||
"name": "Continuing resource currently published", | ||
"code": "c", | ||
"displayFormat": { | ||
"delimiter": "-", | ||
"keepDelimiter": true | ||
}, | ||
"source": "folio" | ||
} |
10 changes: 10 additions & 0 deletions
10
reference-data/instance-date-types/continuing-resource-status-unknown.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"id": "5a1a1adb-de71-45e6-ba94-1c0838969f04", | ||
"name": "Continuing resource status unknown", | ||
"code": "e", | ||
"displayFormat": { | ||
"delimiter": "-", | ||
"keepDelimiter": true | ||
}, | ||
"source": "folio" | ||
} |
10 changes: 10 additions & 0 deletions
10
reference-data/instance-date-types/date-of-distribution.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"id": "5f84208a-0aa6-4694-a58f-5310b654f012", | ||
"name": "Date of distribution/release/issue and production/recording session when different", | ||
"code": "p", | ||
"displayFormat": { | ||
"delimiter": ",", | ||
"keepDelimiter": false | ||
}, | ||
"source": "folio" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"id": "e77bb7ed-2e53-4c62-8b06-5907b8934ba7", | ||
"name": "Dates unknown", | ||
"code": "n", | ||
"displayFormat": { | ||
"delimiter": ",", | ||
"keepDelimiter": false | ||
}, | ||
"source": "folio" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"id": "9669a463-5971-42dc-9eee-046bbd678fb1", | ||
"name": "Detailed date", | ||
"code": "e", | ||
"displayFormat": { | ||
"delimiter": ",", | ||
"keepDelimiter": false | ||
}, | ||
"source": "folio" | ||
} |
10 changes: 10 additions & 0 deletions
10
reference-data/instance-date-types/inclusive-dates-of-collection.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"id": "6de732c5-c29b-4a10-9db0-0729ca960f12", | ||
"name": "Inclusive dates of collection", | ||
"code": "i", | ||
"displayFormat": { | ||
"delimiter": "-", | ||
"keepDelimiter": true | ||
}, | ||
"source": "folio" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"id": "8fa6d067-41ff-4362-96a0-96b16ddce267", | ||
"name": "Multiple dates", | ||
"code": "m", | ||
"displayFormat": { | ||
"delimiter": ",", | ||
"keepDelimiter": false | ||
}, | ||
"source": "folio" | ||
} |
10 changes: 10 additions & 0 deletions
10
reference-data/instance-date-types/no-attempt-to-code.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"id": "6f8cd9a8-26ac-4df6-8709-62fe2c0d04f8", | ||
"name": "No attempt to code", | ||
"code": "|", | ||
"displayFormat": { | ||
"delimiter": ",", | ||
"keepDelimiter": false | ||
}, | ||
"source": "folio" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"id": "77a09c3c-37bd-4ad3-aae4-9d86fc1b33d8", | ||
"name": "No dates given; BC date involved", | ||
"code": "b", | ||
"displayFormat": { | ||
"delimiter": ",", | ||
"keepDelimiter": false | ||
}, | ||
"source": "folio" | ||
} |
Oops, something went wrong.