-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CIRCSTORE-331 Create actual-cost-record entity CRUD (#341)
* CIRCSTORE-331 Create actual-cost-record entity CRUD * CIRCSTORE-331 Refactor tests and change schema descriptions * CIRCSTORE-331 Remove imports * Fix comments * Add required fields to the schema * Make id not required * CIRSTORE-331 Remove package import * CIRCSTORE-331 Create actual cost record and tlr feature toggle job interfaces * Rename interface * CIRCSTORE-331 Change effective call number schema * CIRCSTORE-331 Fix test * Delete type ID of call number components * CIRCSTORE-331 Rename call number field name * CIRCSTORE-331 Change schema description] * CIRCSTORE-331 Change descriptions in schema * CIRCSTORE-331 Change descriptions in schema * CIRCSTORE-331 Change descriptions in schema * CIRCSTORE-331 Rename RAML file * CIRCSTORE-331 Remove redundant symbol * CIRCSTORE-331 Change raml descriptions Co-authored-by: Roman Barannyk <[email protected]>
- Loading branch information
1 parent
ab1151c
commit e999beb
Showing
13 changed files
with
550 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#%RAML 1.0 | ||
title: Actual Cost Record Storage | ||
version: v0.1 | ||
protocols: [ HTTP, HTTPS ] | ||
baseUri: http://localhost:9130 | ||
|
||
documentation: | ||
- title: Actual cost record API | ||
content: <b>Storage for actual cost record</b> | ||
|
||
types: | ||
actual-cost-record: !include actual-cost-record.json | ||
actual-cost-records: !include actual-cost-records.json | ||
errors: !include raml-util/schemas/errors.schema | ||
parameters: !include raml-util/schemas/parameters.schema | ||
|
||
traits: | ||
language: !include raml-util/traits/language.raml | ||
pageable: !include raml-util/traits/pageable.raml | ||
searchable: !include raml-util/traits/searchable.raml | ||
validate: !include raml-util/traits/validation.raml | ||
|
||
resourceTypes: | ||
collection: !include raml-util/rtypes/collection.raml | ||
collection-item: !include raml-util/rtypes/item-collection.raml | ||
|
||
/actual-cost-record-storage: | ||
/actual-cost-records: | ||
displayName: Actual cost records | ||
type: | ||
collection: | ||
exampleCollection: !include examples/actual-cost-records.json | ||
exampleItem: !include examples/actual-cost-record.json | ||
schemaCollection: actual-cost-records | ||
schemaItem: actual-cost-record | ||
get: | ||
is: [pageable, | ||
searchable: {description: "by using CQL", | ||
example: "lossType=\"Aged to lost\""} | ||
] | ||
post: | ||
is: [validate] | ||
body: | ||
application/json: | ||
type: actual-cost-record | ||
/{id}: | ||
type: | ||
collection-item: | ||
exampleItem: !include examples/actual-cost-record.json | ||
schema: actual-cost-record | ||
get: | ||
description: "Get actual cost record" | ||
put: | ||
description: "Update actual cost record" | ||
is: [validate] | ||
delete: | ||
description: "Delete actual cost record" | ||
is: [language] | ||
|
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,141 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-04/schema#", | ||
"type": "object", | ||
"description": "Actual cost record", | ||
"properties": { | ||
"id": { | ||
"description": "Actual cost record ID", | ||
"type": "string", | ||
"$ref": "raml-util/schemas/uuid.schema" | ||
}, | ||
"userId": { | ||
"description": "ID of the patron the actual cost record was created for", | ||
"type": "string", | ||
"$ref": "raml-util/schemas/uuid.schema" | ||
}, | ||
"userBarcode": { | ||
"description": "Barcode of the patron the actual cost record was created for", | ||
"type": "string" | ||
}, | ||
"loanId": { | ||
"description": "Unique ID (generated UUID) of the loan", | ||
"type": "string", | ||
"$ref": "raml-util/schemas/uuid.schema" | ||
}, | ||
"itemLossType": { | ||
"description": "Type of the item loss", | ||
"type": "string", | ||
"enum": [ | ||
"Aged to lost", | ||
"Declared lost" | ||
] | ||
}, | ||
"dateOfLoss": { | ||
"description": "Date and time when the item was lost", | ||
"type": "string", | ||
"format": "date-time" | ||
}, | ||
"title": { | ||
"description": "The primary title (or label) associated with the resource", | ||
"type": "string" | ||
}, | ||
"identifiers": { | ||
"type": "array", | ||
"description": "An extensible set of name-value pairs of identifiers associated with the resource", | ||
"minItems": 0, | ||
"items": { | ||
"type": "object", | ||
"properties": { | ||
"value": { | ||
"type": "string", | ||
"description": "Resource identifier value" | ||
}, | ||
"identifierTypeId": { | ||
"type": "string", | ||
"description": "UUID of resource identifier type (e.g. ISBN, ISSN, LCCN, CODEN, Locally defined identifiers)", | ||
"$ref": "raml-util/schemas/uuid.schema" | ||
} | ||
}, | ||
"additionalProperties": false, | ||
"required": [ | ||
"value", | ||
"identifierTypeId" | ||
] | ||
} | ||
}, | ||
"itemBarcode": { | ||
"description": "Barcode of the lost item", | ||
"type": "string" | ||
}, | ||
"loanType": { | ||
"description": "Loan type of the lost item", | ||
"type": "string" | ||
}, | ||
"effectiveCallNumberComponents": { | ||
"type": "object", | ||
"description": "Elements of a full call number generated from the item or holding", | ||
"properties": { | ||
"callNumber": { | ||
"type": "string", | ||
"description": "Effective Call Number is an identifier assigned to an item or its holding and associated with the item.", | ||
"readonly": true | ||
}, | ||
"prefix": { | ||
"type": "string", | ||
"description": "Effective Call Number Prefix is the prefix of the identifier assigned to an item or its holding and associated with the item.", | ||
"readonly": true | ||
}, | ||
"suffix": { | ||
"type": "string", | ||
"description": "Effective Call Number Suffix is the suffix of the identifier assigned to an item or its holding and associated with the item.", | ||
"readonly": true | ||
} | ||
} | ||
}, | ||
"permanentItemLocation": { | ||
"description": "Permanent item location of the lost item", | ||
"type": "string" | ||
}, | ||
"feeFineOwnerId": { | ||
"description": "Fee/fine owner ID", | ||
"type": "string", | ||
"$ref": "raml-util/schemas/uuid.schema" | ||
}, | ||
"feeFineOwner": { | ||
"description": "Fee/fine owner name", | ||
"type": "string" | ||
}, | ||
"feeFineTypeId": { | ||
"description": "Fee/fine type ID", | ||
"type": "string", | ||
"$ref": "raml-util/schemas/uuid.schema" | ||
}, | ||
"feeFineType": { | ||
"description": "Fee/fine type name", | ||
"type": "string" | ||
}, | ||
"metadata": { | ||
"description": "Metadata about creation and changes, provided by the server (client should not provide)", | ||
"type": "object", | ||
"$ref": "raml-util/schemas/metadata.schema" | ||
} | ||
}, | ||
"additionalProperties": false, | ||
"required": [ | ||
"userId", | ||
"userBarcode", | ||
"loanId", | ||
"itemLossType", | ||
"dateOfLoss", | ||
"title", | ||
"identifiers", | ||
"itemBarcode", | ||
"loanType", | ||
"effectiveCallNumberComponents", | ||
"permanentItemLocation", | ||
"feeFineOwnerId", | ||
"feeFineOwner", | ||
"feeFineTypeId", | ||
"feeFineType" | ||
] | ||
} |
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,24 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-04/schema#", | ||
"description": "Collection of Actual cost records", | ||
"type": "object", | ||
"properties": { | ||
"actualCostRecords": { | ||
"description": "List of Actual cost records", | ||
"id": "actualCostRecords", | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"$ref": "actual-cost-record.json" | ||
} | ||
}, | ||
"totalRecords": { | ||
"type": "integer" | ||
} | ||
}, | ||
"required": [ | ||
"actualCostRecords", | ||
"totalRecords" | ||
] | ||
} | ||
|
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,27 @@ | ||
{ | ||
"id": "89105c06-dbdb-4aa0-9695-d4d19c733270", | ||
"userId": "88805c06-dbdb-4aa0-9695-d4d19c733221", | ||
"userBarcode": "777", | ||
"loanId": "98805c06-dbdb-4aa0-9695-d4d19c733221", | ||
"itemLossType": "Aged to lost", | ||
"dateOfLoss": "2022-01-01T22:25:37Z", | ||
"title": "Test Title", | ||
"identifiers": [ | ||
{ | ||
"identifierTypeId": "8261054f-be78-422d-bd51-4ed9f33c3422", | ||
"value": "9781466636897" | ||
} | ||
], | ||
"itemBarcode": "888", | ||
"loanType": "Can Circulate", | ||
"effectiveCallNumber": { | ||
"callNumber": "TX809.M17J66", | ||
"suffix": "1993", | ||
"prefix": "f" | ||
}, | ||
"permanentItemLocation": "UC/HP/JCL/Sci", | ||
"feeFineOwnerId": "88805c06-dbdb-4aa0-9695-d4d19c733221", | ||
"feeFineOwner": "Main circ desk", | ||
"feeFineTypeId": "88805c06-dbdb-4aa0-9695-d4d19c733221", | ||
"feeFineType": "Lost Item fee (actual cost)" | ||
} |
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,32 @@ | ||
{ | ||
"actualCostRecords" : [ | ||
{ | ||
"id": "89105c06-dbdb-4aa0-9695-d4d19c733270", | ||
"userId": "88805c06-dbdb-4aa0-9695-d4d19c733221", | ||
"userBarcode": "777", | ||
"loanId": "98805c06-dbdb-4aa0-9695-d4d19c733221", | ||
"itemLossType": "Aged to lost", | ||
"dateOfLoss": "2022-01-01T22:25:37Z", | ||
"title": "Test Title", | ||
"identifiers": [ | ||
{ | ||
"identifierTypeId": "8261054f-be78-422d-bd51-4ed9f33c3422", | ||
"value": "9781466636897" | ||
} | ||
], | ||
"itemBarcode": "888", | ||
"loanType": "Can Circulate", | ||
"effectiveCallNumber": { | ||
"callNumber": "TX809.M17J66", | ||
"suffix": "1993", | ||
"prefix": "f" | ||
}, | ||
"permanentItemLocation": "UC/HP/JCL/Sci", | ||
"feeFineOwnerId": "88805c06-dbdb-4aa0-9695-d4d19c733221", | ||
"feeFineOwner": "Main circ desk", | ||
"feeFineTypeId": "88805c06-dbdb-4aa0-9695-d4d19c733221", | ||
"feeFineType": "Lost Item fee (actual cost)" | ||
} | ||
], | ||
"totalRecords": 1 | ||
} |
Oops, something went wrong.