foliolib.folio.api.feesfines.Comments

class foliolib.folio.api.feesfines.Comments(tenant: str, okapi: Optional[foliolib.okapi.okapiClient.OkapiClient] = None)

Bases: foliolib.folio.FolioApi

Comments API

This documents the API calls that can be made to query and manage feefine of the system

Parameters
  • tenant (str) – Tenant id

  • okapi (OkapiClient, optional) – Instance of OkapiClient. Defaults to None.

Methods

delete_comment(commentId)

Delete comment item with given {commentId}

get_comment(commentId)

Get a single comment

get_comments(**kwargs)

Return a list of comments

modify_comment(commentId, comment)

Update comment item with given {commentId}

set_comment(comment)

Create a comment

delete_comment(commentId: str)

Delete comment item with given {commentId}

DELETE /comments/{commentId}

Parameters

commentId (str) –

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestError – Bad Request

  • OkapiFatalError – Server Error

get_comment(commentId: str)

Get a single comment

GET /comments/{commentId}

Parameters

commentId (str) –

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Comment required Settings schema",
  "description": "Comment required for additional information on fees/fine transactions",
  "type": "object",
  "properties": {
    "paid": {
      "description": "A flag to determine when paying if it is mandatory to add additional information",
      "type": "boolean"
    },
    "waived": {
      "description": "A flag to determine when waiving if it is mandatory to add additional information",
      "type": "boolean"
    },
    "refunded": {
      "description": "A flag to determine when refunding if it is mandatory to add additional information",
      "type": "boolean"
    },
    "transferredManually": {
      "description": "A flag to determine when transferring if it is mandatory to add additional information",
      "type": "boolean"
    },
    "metadata": {
      "description": "Metadata about creation to comment required, provided by the server",
      "type": "object",
      "$ref": "raml-util/schemas/metadata.schema"
    },
    "id": {
      "description": "Comment required id, UUID",
      "$ref": "raml-util/schemas/uuid.schema"
    }
  },
  "additionalProperties": false
}
get_comments(**kwargs)

Return a list of comments

GET /comments

Parameters

**kwargs (properties) – Keyword Arguments

Keyword Arguments
  • 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.

    with valid searchable fields

    Example

    • (username==”ab*” or personal.firstName==”ab*” or personal.lastName==”ab*”) and active==”true” sortby personal.lastName personal.firstName barcode

    • active=true

  • orderBy (str) – Order by field: field A, field B

  • order (str (desc|asc) – ): (default=desc) Order

  • 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

  • facets (list) – facets to return in the collection result set, can be suffixed by a count of facet values to return, for example, patronGroup:10 default to top 5 facet values

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 comments",
  "type": "object",
  "properties": {
    "comments": {
      "description": "List of comment items",
      "type": "array",
      "id": "commentsData",
      "items": {
        "type": "object",
        "$ref": "commentdata.json"
      }
    },
    "totalRecords": {
      "type": "integer"
    },
    "resultInfo": {
      "$ref": "raml-util/schemas/resultInfo.schema",
      "readonly": true
    }
  },
  "required": [
    "comments",
    "totalRecords"
  ]
}
modify_comment(commentId: str, comment: dict)

Update comment item with given {commentId}

PUT /comments/{commentId}

Parameters
  • commentId (str) –

  • comment (dict) – See Schema below

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestError – Bad Request

  • OkapiRequestConflict – Conflict

  • OkapiFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Comment required Settings schema",
  "description": "Comment required for additional information on fees/fine transactions",
  "type": "object",
  "properties": {
    "paid": {
      "description": "A flag to determine when paying if it is mandatory to add additional information",
      "type": "boolean"
    },
    "waived": {
      "description": "A flag to determine when waiving if it is mandatory to add additional information",
      "type": "boolean"
    },
    "refunded": {
      "description": "A flag to determine when refunding if it is mandatory to add additional information",
      "type": "boolean"
    },
    "transferredManually": {
      "description": "A flag to determine when transferring if it is mandatory to add additional information",
      "type": "boolean"
    },
    "metadata": {
      "description": "Metadata about creation to comment required, provided by the server",
      "type": "object",
      "$ref": "raml-util/schemas/metadata.schema"
    },
    "id": {
      "description": "Comment required id, UUID",
      "$ref": "raml-util/schemas/uuid.schema"
    }
  },
  "additionalProperties": false
}
set_comment(comment: dict)

Create a comment

POST /comments

Parameters

comment (dict) – See Schema below

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestUnauthorized – Authentication is required

  • OkapiFatalError – Server Error

  • OkapiRequestUnprocessableEntity – Unprocessable Entity

Headers

  • Location - URI to the created comment item

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Comment required Settings schema",
  "description": "Comment required for additional information on fees/fine transactions",
  "type": "object",
  "properties": {
    "paid": {
      "description": "A flag to determine when paying if it is mandatory to add additional information",
      "type": "boolean"
    },
    "waived": {
      "description": "A flag to determine when waiving if it is mandatory to add additional information",
      "type": "boolean"
    },
    "refunded": {
      "description": "A flag to determine when refunding if it is mandatory to add additional information",
      "type": "boolean"
    },
    "transferredManually": {
      "description": "A flag to determine when transferring if it is mandatory to add additional information",
      "type": "boolean"
    },
    "metadata": {
      "description": "Metadata about creation to comment required, provided by the server",
      "type": "object",
      "$ref": "raml-util/schemas/metadata.schema"
    },
    "id": {
      "description": "Comment required id, UUID",
      "$ref": "raml-util/schemas/uuid.schema"
    }
  },
  "additionalProperties": false
}