foliolib.folio.api.patronBlocks.UserSummary

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

Bases: foliolib.folio.FolioApi

Diagnostic API for retreiving internal UserSummary objects

User summary API

Parameters
  • tenant (str) – Tenant id

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

Methods

get_userSummary(userId)

GET /user-summary/{userId}

get_userSummary(userId: str)

GET /user-summary/{userId}

Parameters

userId (str) –

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestNotFound – Not Found

  • OkapiFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "description": "Stores patron data used to calculate patron blocks",
  "properties": {
    "id": {
      "description": "Unique ID of the user summary",
      "type": "string",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "_version": {
      "type": "integer",
      "description": "Record version for optimistic locking"
    },
    "userId": {
      "description": "Unique ID of the user",
      "type": "string",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "openLoans": {
      "description": "User's open loans",
      "type": "array",
      "items": {
        "description": "Collection of user's open loans",
        "type": "object",
        "properties": {
          "loanId": {
            "description": "Unique ID of the loan",
            "type": "string",
            "$ref": "raml-util/schemas/uuid.schema"
          },
          "dueDate": {
            "description": "Due date of the loan",
            "type": "string",
            "format": "date-time"
          },
          "recall": {
            "description": "Indicates if the item was recalled",
            "type": "boolean",
            "default": false
          },
          "itemLost": {
            "description": "Indicates if the item associated with the loan is in status 'Aged to lost' or 'Declared lost'",
            "type": "boolean",
            "default": false
          },
          "itemClaimedReturned": {
            "description": "Indicates if the item associated with the loan is in status 'Claimed returned'",
            "type": "boolean",
            "default": false
          },
          "gracePeriod": {
            "description": "The time after the due date during which penalties are deferred.",
            "$ref": "period.json"
          }
        },
        "additionalProperties": false,
        "required": [
          "loanId",
          "dueDate",
          "recall"
        ]
      }
    },
    "openFeesFines": {
      "description": "User's open fees/fines",
      "type": "array",
      "items": {
        "description": "Collection of user's open fees/fines",
        "type": "object",
        "javaName": "openFeeFine",
        "properties": {
          "feeFineId": {
            "description": "Unique ID of the fee/fine",
            "type": "string",
            "$ref": "raml-util/schemas/uuid.schema"
          },
          "feeFineTypeId": {
            "description": "Unique ID of the fee/fine type",
            "type": "string",
            "$ref": "raml-util/schemas/uuid.schema"
          },
          "loanId": {
            "description": "Unique ID of the loan the fee/fine was created for",
            "type": "string",
            "$ref": "raml-util/schemas/uuid.schema"
          },
          "balance": {
            "description": "Balance",
            "type": "number",
            "javaType": "java.math.BigDecimal"
          }
        },
        "additionalProperties": false,
        "required": [
          "feeFineId",
          "feeFineTypeId",
          "balance"
        ]
      }
    },
    "metadata": {
      "description": "Metadata about object's creation and changes. Is provided by server, not by client.",
      "type": "object",
      "$ref": "raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "id",
    "userId",
    "openLoans",
    "openFeesFines"
  ]
}