foliolib.folio.api.circulationStorage.ActualCostRecordStorage
- class foliolib.folio.api.circulationStorage.ActualCostRecordStorage(tenant: str, okapi: Optional[foliolib.okapi.okapiClient.OkapiClient] = None)
Bases:
foliolib.folio.FolioApiActual cost record API
Storage for actual cost record
- Parameters
tenant (str) – Tenant id
okapi (OkapiClient, optional) – Instance of OkapiClient. Defaults to None.
Methods
delete_actualCostRecord(actualCostRecordsId, ...)Delete actual cost record
get_actualCostRecord(actualCostRecordsId)Get actual cost record
get_actualCostRecords(**kwargs)Retrieve a list of actualCostRecord items.
modify_actualCostRecord(actualCostRecordsId, ...)Update actual cost record
set_actualCostRecord(actualCostRecord)Create a new actualCostRecord item.
- delete_actualCostRecord(actualCostRecordsId: str, **kwargs)
Delete actual cost record
DELETE /actual-cost-record-storage/actual-cost-records/{actualCostRecordsId}- Parameters
actualCostRecordsId (str) –
**kwargs (properties) – Keyword Arguments
- Keyword Arguments
lang (str) – (default=en) Requested language. Optional. [lang=en]
- Raises
OkapiRequestNotFound – Not Found
OkapiRequestError – Bad Request
OkapiFatalError – Server Error
- get_actualCostRecord(actualCostRecordsId: str)
Get actual cost record
GET /actual-cost-record-storage/actual-cost-records/{actualCostRecordsId}- Parameters
actualCostRecordsId (str) –
- Returns
See Schema below
- Return type
dict
- Raises
OkapiRequestNotFound – Not Found
OkapiFatalError – Server Error
Schema
{ "$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" }, "lossType": { "description": "Type of the item loss", "type": "string", "enum": [ "Aged to lost", "Declared lost" ] }, "lossDate": { "description": "Date and time when the item was lost", "type": "string", "format": "date-time" }, "expirationDate": { "description": "Expiration date and time of actual cost record", "type": "string", "format": "date-time" }, "user": { "description": "User info", "type": "object", "javaType": "org.folio.rest.jaxrs.model.ActualCostRecordUser", "properties": { "id": { "description": "User ID", "type": "string", "$ref": "raml-util/schemas/uuid.schema" }, "barcode": { "description": "User barcode", "type": "string" }, "firstName": { "description": "User first name", "type": "string" }, "lastName": { "description": "User last name", "type": "string" }, "middleName": { "description": "User middle name", "type": "string" }, "patronGroupId": { "description": "Patron group ID", "type": "string", "$ref": "raml-util/schemas/uuid.schema" }, "patronGroup": { "description": "Patron group name", "type": "string" } }, "additionalProperties": false, "required": [ "id", "lastName" ] }, "loan": { "description": "Loan info", "type": "object", "javaType": "org.folio.rest.jaxrs.model.ActualCostRecordLoan", "properties": { "id": { "description": "Loan ID", "type": "string", "$ref": "raml-util/schemas/uuid.schema" } }, "additionalProperties": false, "required": [ "id" ] }, "item": { "description": "Item info", "type": "object", "javaType": "org.folio.rest.jaxrs.model.ActualCostRecordItem", "properties": { "id": { "description": "Item ID", "type": "string", "$ref": "raml-util/schemas/uuid.schema" }, "barcode": { "description": "Item barcode", "type": "string" }, "materialTypeId": { "description": "Material type ID", "type": "string", "$ref": "raml-util/schemas/uuid.schema" }, "materialType": { "description": "Material type name", "type": "string" }, "permanentLocationId": { "description": "Permanent location ID", "type": "string", "$ref": "raml-util/schemas/uuid.schema" }, "permanentLocation": { "description": "Permanent location name", "type": "string" }, "effectiveLocationId": { "description": "Effective location ID", "type": "string", "$ref": "raml-util/schemas/uuid.schema" }, "effectiveLocation": { "description": "Effective location name", "type": "string" }, "loanTypeId": { "description": "Loan type ID", "type": "string", "$ref": "raml-util/schemas/uuid.schema" }, "loanType": { "description": "Loan type name", "type": "string" }, "holdingsRecordId": { "description": "Holdings record ID", "type": "string", "$ref": "raml-util/schemas/uuid.schema" }, "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." }, "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." }, "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." } }, "additionalProperties": false }, "volume": { "type": "string", "description": "Volume is intended for monographs when a multipart monograph (e.g. a biography of George Bernard Shaw in three volumes)." }, "enumeration": { "type": "string", "description": "Enumeration is the descriptive information for the numbering scheme of a serial." }, "chronology": { "type": "string", "description": "Chronology is the descriptive information for the dating scheme of a serial." }, "copyNumber": { "type": "string", "description": "Copy number is the piece identifier. The copy number reflects if the library has a copy of a single-volume monograph; one copy of a multi-volume, (e.g. Copy 1, or C.7.)" } }, "additionalProperties": false, "required": [ "id", "materialTypeId", "materialType", "loanTypeId", "loanType", "holdingsRecordId" ] }, "instance": { "description": "Instance info", "type": "object", "javaType": "org.folio.rest.jaxrs.model.ActualCostRecordInstance", "properties": { "id": { "description": "Instance ID", "type": "string", "$ref": "raml-util/schemas/uuid.schema" }, "title": { "description": "Instance title", "type": "string" }, "identifiers": { "type": "array", "description": "An extensible set of name-value pairs of identifiers associated with the resource", "minItems": 0, "items": { "type": "object", "javaType": "org.folio.rest.jaxrs.model.ActualCostRecordIdentifier", "properties": { "value": { "type": "string", "description": "Resource identifier value" }, "identifierType": { "type": "string", "description": "Name of resource identifier type (e.g. ISBN, ISSN, LCCN, CODEN, Locally defined identifiers)" }, "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", "identifierType", "identifierTypeId" ] } }, "contributors": { "type": "array", "description": "List of contributors", "minItems": 0, "items": { "type": "object", "properties": { "name": { "type": "string", "description": "Contributor name" } }, "additionalProperties": false, "required": [ "name" ] } } }, "additionalProperties": false, "required": [ "id", "title" ] }, "feeFine": { "description": "Fee/fine info", "type": "object", "javaType": "org.folio.rest.jaxrs.model.ActualCostRecordFeeFine", "properties": { "accountId": { "description": "ID of the fee/fine (\"account\") instance", "type": "string", "$ref": "raml-util/schemas/uuid.schema" }, "billedAmount": { "description": "Initial amount of a fee/fine created upon billing", "type": "number", "minimum": 0.0 }, "ownerId": { "description": "Fee/fine owner ID", "type": "string", "$ref": "raml-util/schemas/uuid.schema" }, "owner": { "description": "Fee/fine owner name", "type": "string" }, "typeId": { "description": "Fee/fine type ID", "type": "string", "$ref": "raml-util/schemas/uuid.schema" }, "type": { "description": "Fee/fine type name", "type": "string" } }, "additionalProperties": false, "required": [ "ownerId", "owner", "typeId", "type" ] }, "status": { "description": "Status of the actual cost record", "type": "string", "enum": [ "Open", "Billed", "Cancelled", "Expired" ], "default": "Open" }, "additionalInfoForStaff": { "description": "Additional information for staff", "type": "string" }, "additionalInfoForPatron": { "description": "Additional information for a patron", "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": [ "lossType", "lossDate", "expirationDate", "user", "loan", "item", "instance", "feeFine", "status" ] }
- get_actualCostRecords(**kwargs)
Retrieve a list of actualCostRecord items.
GET /actual-cost-record-storage/actual-cost-records- Parameters
**kwargs (properties) – Keyword Arguments
- Keyword Arguments
offset (int) –
(default=0) Skip over a number of elements by specifying an offset value for the query
Example
0
limit (int) –
(default=10) Limit the number of elements returned in the response
Example
10
query (str) –
A query expressed as a CQL string (see [dev.folio.org/reference/glossary#cql](https://dev.folio.org/reference/glossary#cql)) using valid searchable fields. The first example below shows the general form of a full CQL query, but those fields might not be relevant in this context.
by using CQL
Example
(username==”ab*” or personal.firstName==”ab*” or personal.lastName==”ab*”) and active==”true” sortby personal.lastName personal.firstName barcode
lossType=”Aged to lost”
- Returns
See Schema below
- Return type
dict
- Raises
OkapiRequestError – Bad Request
OkapiRequestUnauthorized – Authentication is required
OkapiFatalError – Server Error
Schema
{ "$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" ] }
- modify_actualCostRecord(actualCostRecordsId: str, actualCostRecord: dict)
Update actual cost record
PUT /actual-cost-record-storage/actual-cost-records/{actualCostRecordsId}- Parameters
actualCostRecordsId (str) –
actualCostRecord (dict) – See Schema below
- Raises
OkapiRequestNotFound – Not Found
OkapiRequestError – Bad Request
OkapiRequestConflict – Conflict
OkapiFatalError – Server Error
OkapiRequestUnprocessableEntity – Unprocessable Entity
Schema
{ "$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" }, "lossType": { "description": "Type of the item loss", "type": "string", "enum": [ "Aged to lost", "Declared lost" ] }, "lossDate": { "description": "Date and time when the item was lost", "type": "string", "format": "date-time" }, "expirationDate": { "description": "Expiration date and time of actual cost record", "type": "string", "format": "date-time" }, "user": { "description": "User info", "type": "object", "javaType": "org.folio.rest.jaxrs.model.ActualCostRecordUser", "properties": { "id": { "description": "User ID", "type": "string", "$ref": "raml-util/schemas/uuid.schema" }, "barcode": { "description": "User barcode", "type": "string" }, "firstName": { "description": "User first name", "type": "string" }, "lastName": { "description": "User last name", "type": "string" }, "middleName": { "description": "User middle name", "type": "string" }, "patronGroupId": { "description": "Patron group ID", "type": "string", "$ref": "raml-util/schemas/uuid.schema" }, "patronGroup": { "description": "Patron group name", "type": "string" } }, "additionalProperties": false, "required": [ "id", "lastName" ] }, "loan": { "description": "Loan info", "type": "object", "javaType": "org.folio.rest.jaxrs.model.ActualCostRecordLoan", "properties": { "id": { "description": "Loan ID", "type": "string", "$ref": "raml-util/schemas/uuid.schema" } }, "additionalProperties": false, "required": [ "id" ] }, "item": { "description": "Item info", "type": "object", "javaType": "org.folio.rest.jaxrs.model.ActualCostRecordItem", "properties": { "id": { "description": "Item ID", "type": "string", "$ref": "raml-util/schemas/uuid.schema" }, "barcode": { "description": "Item barcode", "type": "string" }, "materialTypeId": { "description": "Material type ID", "type": "string", "$ref": "raml-util/schemas/uuid.schema" }, "materialType": { "description": "Material type name", "type": "string" }, "permanentLocationId": { "description": "Permanent location ID", "type": "string", "$ref": "raml-util/schemas/uuid.schema" }, "permanentLocation": { "description": "Permanent location name", "type": "string" }, "effectiveLocationId": { "description": "Effective location ID", "type": "string", "$ref": "raml-util/schemas/uuid.schema" }, "effectiveLocation": { "description": "Effective location name", "type": "string" }, "loanTypeId": { "description": "Loan type ID", "type": "string", "$ref": "raml-util/schemas/uuid.schema" }, "loanType": { "description": "Loan type name", "type": "string" }, "holdingsRecordId": { "description": "Holdings record ID", "type": "string", "$ref": "raml-util/schemas/uuid.schema" }, "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." }, "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." }, "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." } }, "additionalProperties": false }, "volume": { "type": "string", "description": "Volume is intended for monographs when a multipart monograph (e.g. a biography of George Bernard Shaw in three volumes)." }, "enumeration": { "type": "string", "description": "Enumeration is the descriptive information for the numbering scheme of a serial." }, "chronology": { "type": "string", "description": "Chronology is the descriptive information for the dating scheme of a serial." }, "copyNumber": { "type": "string", "description": "Copy number is the piece identifier. The copy number reflects if the library has a copy of a single-volume monograph; one copy of a multi-volume, (e.g. Copy 1, or C.7.)" } }, "additionalProperties": false, "required": [ "id", "materialTypeId", "materialType", "loanTypeId", "loanType", "holdingsRecordId" ] }, "instance": { "description": "Instance info", "type": "object", "javaType": "org.folio.rest.jaxrs.model.ActualCostRecordInstance", "properties": { "id": { "description": "Instance ID", "type": "string", "$ref": "raml-util/schemas/uuid.schema" }, "title": { "description": "Instance title", "type": "string" }, "identifiers": { "type": "array", "description": "An extensible set of name-value pairs of identifiers associated with the resource", "minItems": 0, "items": { "type": "object", "javaType": "org.folio.rest.jaxrs.model.ActualCostRecordIdentifier", "properties": { "value": { "type": "string", "description": "Resource identifier value" }, "identifierType": { "type": "string", "description": "Name of resource identifier type (e.g. ISBN, ISSN, LCCN, CODEN, Locally defined identifiers)" }, "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", "identifierType", "identifierTypeId" ] } }, "contributors": { "type": "array", "description": "List of contributors", "minItems": 0, "items": { "type": "object", "properties": { "name": { "type": "string", "description": "Contributor name" } }, "additionalProperties": false, "required": [ "name" ] } } }, "additionalProperties": false, "required": [ "id", "title" ] }, "feeFine": { "description": "Fee/fine info", "type": "object", "javaType": "org.folio.rest.jaxrs.model.ActualCostRecordFeeFine", "properties": { "accountId": { "description": "ID of the fee/fine (\"account\") instance", "type": "string", "$ref": "raml-util/schemas/uuid.schema" }, "billedAmount": { "description": "Initial amount of a fee/fine created upon billing", "type": "number", "minimum": 0.0 }, "ownerId": { "description": "Fee/fine owner ID", "type": "string", "$ref": "raml-util/schemas/uuid.schema" }, "owner": { "description": "Fee/fine owner name", "type": "string" }, "typeId": { "description": "Fee/fine type ID", "type": "string", "$ref": "raml-util/schemas/uuid.schema" }, "type": { "description": "Fee/fine type name", "type": "string" } }, "additionalProperties": false, "required": [ "ownerId", "owner", "typeId", "type" ] }, "status": { "description": "Status of the actual cost record", "type": "string", "enum": [ "Open", "Billed", "Cancelled", "Expired" ], "default": "Open" }, "additionalInfoForStaff": { "description": "Additional information for staff", "type": "string" }, "additionalInfoForPatron": { "description": "Additional information for a patron", "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": [ "lossType", "lossDate", "expirationDate", "user", "loan", "item", "instance", "feeFine", "status" ] }
- set_actualCostRecord(actualCostRecord: dict)
Create a new actualCostRecord item.
POST /actual-cost-record-storage/actual-cost-records- Parameters
actualCostRecord (dict) – See Schema below
- Raises
OkapiRequestError – Bad Request
OkapiRequestUnauthorized – Authentication is required
OkapiFatalError – Server Error
OkapiRequestUnprocessableEntity – Unprocessable Entity
Headers
Location - URI to the created actualCostRecord item
Schema
{ "$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" }, "lossType": { "description": "Type of the item loss", "type": "string", "enum": [ "Aged to lost", "Declared lost" ] }, "lossDate": { "description": "Date and time when the item was lost", "type": "string", "format": "date-time" }, "expirationDate": { "description": "Expiration date and time of actual cost record", "type": "string", "format": "date-time" }, "user": { "description": "User info", "type": "object", "javaType": "org.folio.rest.jaxrs.model.ActualCostRecordUser", "properties": { "id": { "description": "User ID", "type": "string", "$ref": "raml-util/schemas/uuid.schema" }, "barcode": { "description": "User barcode", "type": "string" }, "firstName": { "description": "User first name", "type": "string" }, "lastName": { "description": "User last name", "type": "string" }, "middleName": { "description": "User middle name", "type": "string" }, "patronGroupId": { "description": "Patron group ID", "type": "string", "$ref": "raml-util/schemas/uuid.schema" }, "patronGroup": { "description": "Patron group name", "type": "string" } }, "additionalProperties": false, "required": [ "id", "lastName" ] }, "loan": { "description": "Loan info", "type": "object", "javaType": "org.folio.rest.jaxrs.model.ActualCostRecordLoan", "properties": { "id": { "description": "Loan ID", "type": "string", "$ref": "raml-util/schemas/uuid.schema" } }, "additionalProperties": false, "required": [ "id" ] }, "item": { "description": "Item info", "type": "object", "javaType": "org.folio.rest.jaxrs.model.ActualCostRecordItem", "properties": { "id": { "description": "Item ID", "type": "string", "$ref": "raml-util/schemas/uuid.schema" }, "barcode": { "description": "Item barcode", "type": "string" }, "materialTypeId": { "description": "Material type ID", "type": "string", "$ref": "raml-util/schemas/uuid.schema" }, "materialType": { "description": "Material type name", "type": "string" }, "permanentLocationId": { "description": "Permanent location ID", "type": "string", "$ref": "raml-util/schemas/uuid.schema" }, "permanentLocation": { "description": "Permanent location name", "type": "string" }, "effectiveLocationId": { "description": "Effective location ID", "type": "string", "$ref": "raml-util/schemas/uuid.schema" }, "effectiveLocation": { "description": "Effective location name", "type": "string" }, "loanTypeId": { "description": "Loan type ID", "type": "string", "$ref": "raml-util/schemas/uuid.schema" }, "loanType": { "description": "Loan type name", "type": "string" }, "holdingsRecordId": { "description": "Holdings record ID", "type": "string", "$ref": "raml-util/schemas/uuid.schema" }, "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." }, "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." }, "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." } }, "additionalProperties": false }, "volume": { "type": "string", "description": "Volume is intended for monographs when a multipart monograph (e.g. a biography of George Bernard Shaw in three volumes)." }, "enumeration": { "type": "string", "description": "Enumeration is the descriptive information for the numbering scheme of a serial." }, "chronology": { "type": "string", "description": "Chronology is the descriptive information for the dating scheme of a serial." }, "copyNumber": { "type": "string", "description": "Copy number is the piece identifier. The copy number reflects if the library has a copy of a single-volume monograph; one copy of a multi-volume, (e.g. Copy 1, or C.7.)" } }, "additionalProperties": false, "required": [ "id", "materialTypeId", "materialType", "loanTypeId", "loanType", "holdingsRecordId" ] }, "instance": { "description": "Instance info", "type": "object", "javaType": "org.folio.rest.jaxrs.model.ActualCostRecordInstance", "properties": { "id": { "description": "Instance ID", "type": "string", "$ref": "raml-util/schemas/uuid.schema" }, "title": { "description": "Instance title", "type": "string" }, "identifiers": { "type": "array", "description": "An extensible set of name-value pairs of identifiers associated with the resource", "minItems": 0, "items": { "type": "object", "javaType": "org.folio.rest.jaxrs.model.ActualCostRecordIdentifier", "properties": { "value": { "type": "string", "description": "Resource identifier value" }, "identifierType": { "type": "string", "description": "Name of resource identifier type (e.g. ISBN, ISSN, LCCN, CODEN, Locally defined identifiers)" }, "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", "identifierType", "identifierTypeId" ] } }, "contributors": { "type": "array", "description": "List of contributors", "minItems": 0, "items": { "type": "object", "properties": { "name": { "type": "string", "description": "Contributor name" } }, "additionalProperties": false, "required": [ "name" ] } } }, "additionalProperties": false, "required": [ "id", "title" ] }, "feeFine": { "description": "Fee/fine info", "type": "object", "javaType": "org.folio.rest.jaxrs.model.ActualCostRecordFeeFine", "properties": { "accountId": { "description": "ID of the fee/fine (\"account\") instance", "type": "string", "$ref": "raml-util/schemas/uuid.schema" }, "billedAmount": { "description": "Initial amount of a fee/fine created upon billing", "type": "number", "minimum": 0.0 }, "ownerId": { "description": "Fee/fine owner ID", "type": "string", "$ref": "raml-util/schemas/uuid.schema" }, "owner": { "description": "Fee/fine owner name", "type": "string" }, "typeId": { "description": "Fee/fine type ID", "type": "string", "$ref": "raml-util/schemas/uuid.schema" }, "type": { "description": "Fee/fine type name", "type": "string" } }, "additionalProperties": false, "required": [ "ownerId", "owner", "typeId", "type" ] }, "status": { "description": "Status of the actual cost record", "type": "string", "enum": [ "Open", "Billed", "Cancelled", "Expired" ], "default": "Open" }, "additionalInfoForStaff": { "description": "Additional information for staff", "type": "string" }, "additionalInfoForPatron": { "description": "Additional information for a patron", "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": [ "lossType", "lossDate", "expirationDate", "user", "loan", "item", "instance", "feeFine", "status" ] }