Transfers type (v1)

http://github.com/org/folio/mod-feesfines

Table of contents

Transfers type API

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

/transfertypes

Collection of transfertype items.

GET /transfertypes

Return a list of transfer-types

GET /transfertypes
Query Parameters
  • query: (string)

    A query expressed as a CQL string (see 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: (string)

    Order by field: field A, field B

  • order: (one of desc, asc - default: desc)

    Order

  • offset: (integer - default: 0 - minimum: 0 - maximum: 2147483647)

    Skip over a number of elements by specifying an offset value for the query

    Example:

    0
  • limit: (integer - default: 10 - minimum: 0 - maximum: 2147483647)

    Limit the number of elements returned in the response

    Example:

    10
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Response 200

Returns a list of transfertype items

Body

Media type: application/json

Type: json

Content:

{
  "$schema":"http://json-schema.org/draft-04/schema#",
  "type":"object",
  "properties":{
    "transfertypes":{
      "type":"array",
      "id":"transfer-typesData",
      "items":{
        "type":"object",
        "$ref":"transfer-typedata.json"
      }
    },
    "totalRecords":{
      "type":"integer"
    }
  },
  "required":[
    "transfertypes",
    "totalRecords"
  ]
}

Example:

{
  "transfertypes":[
    {
      "name":"Employee",
      "conditions":{
        "never":false,
        "inmediatly":false,
        "totalOwed":false,
        "feeFineOwed":false
      },
      "interval":{
        "minute": "minute(s)",
        "hour": "hour(s)",
        "day": "day(s)",
        "week": "week(s)",
        "month": "month(s)"
      },
      "id":"0bab56e5-1ab6-4ac2-afdf-8b2df0434341"
    },
    {
      "name":"STUDENT",
      "conditions":{
        "never": false,
        "inmediatly": false,
        "totalOwed": false,
        "feeFineOwed": false
      },
      "interval":{
        "minute": "minute(s)",
        "hour": "hour(s)",
        "day": "day(s)",
        "week": "week(s)",
        "month": "month(s)"
      },
      "id":"0bab56e5-1ab6-4ac2-afdf-8b2df0434342"
    }
  ],
  "totalRecords":2
}

Response 400

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

Media type: text/plain

Type: any

Example:

unable to list transfertypes -- malformed parameter 'query', syntax error at column 6

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

unable to list transfertypes -- unauthorized

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

POST /transfertypes

Create a transfer-type

POST /transfertypes
Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Body

Media type: application/json

Type: json

Content:

{
  "$schema":"http://json-schema.org/draft-04/schema#",
  "title":"Transfer-types Schema",
  "type":"object",
  "properties":{
    "name":{
      "type":"string"
    },
    "conditions":{
      "type":"object",
      "properties":{
        "never":{
          "type":"boolean"
        },
        "inmediatly":{
          "type":"boolean"
        },
        "totalOwed":{
          "type":"boolean"
        },
        "feeFineOwed":{
          "type":"boolean"
        }
      }
    },
    "interval":{
      "type":"object",
      "properties":{
        "minute":{
          "type":"string"
        },
        "hour":{
          "type":"string"
        },
        "day":{
          "type":"string"
        },
        "week":{
          "type":"string"
        },
        "month":{
          "type":"string"
        }
      }
    },
    "id":{
      "type":"string"
    }
  },
  "additionalProperties":false,
  "required":[
    "id"
  ]
}

Example:

{
  "name": "Employee",
  "conditions": {
    "never": false,
    "inmediatly": false,
    "totalOwed": false,
    "feeFineOwed": false
  },
  "interval": {
    "minute": "minute(s)",
    "hour": "hour(s)",
    "day": "day(s)",
    "week": "week(s)",
    "month": "month(s)"
  },
  "id": "0bab56e5-1ab6-4ac2-afdf-8b2df0434351"
}

Response 201

Returns a newly created item, with server-controlled fields like 'id' populated

Headers
  • Location: required (string)

    URI to the created transfertype item

Body

Media type: application/json

Type: any

Example:

{
  "name": "Employee",
  "conditions": {
    "never": false,
    "inmediatly": false,
    "totalOwed": false,
    "feeFineOwed": false
  },
  "interval": {
    "minute": "minute(s)",
    "hour": "hour(s)",
    "day": "day(s)",
    "week": "week(s)",
    "month": "month(s)"
  },
  "id": "0bab56e5-1ab6-4ac2-afdf-8b2df0434351"
}

Response 400

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

Media type: text/plain

Type: any

Example:

"unable to add transfertype -- malformed JSON at 13:3"

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

unable to create transfertypes -- unauthorized

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

GET /transfertypes/{transfertypeId}

Get a single transfer-type

GET /transfertypes/{transfertypeId}
URI Parameters
  • transfertypeId: required (string)
Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Response 200

Returns item with a given ID

Body

Media type: application/json

Type: json

Content:

{
  "$schema":"http://json-schema.org/draft-04/schema#",
  "title":"Transfer-types Schema",
  "type":"object",
  "properties":{
    "name":{
      "type":"string"
    },
    "conditions":{
      "type":"object",
      "properties":{
        "never":{
          "type":"boolean"
        },
        "inmediatly":{
          "type":"boolean"
        },
        "totalOwed":{
          "type":"boolean"
        },
        "feeFineOwed":{
          "type":"boolean"
        }
      }
    },
    "interval":{
      "type":"object",
      "properties":{
        "minute":{
          "type":"string"
        },
        "hour":{
          "type":"string"
        },
        "day":{
          "type":"string"
        },
        "week":{
          "type":"string"
        },
        "month":{
          "type":"string"
        }
      }
    },
    "id":{
      "type":"string"
    }
  },
  "additionalProperties":false,
  "required":[
    "id"
  ]
}

Example:

{
  "name": "Employee",
  "conditions": {
    "never": false,
    "inmediatly": false,
    "totalOwed": false,
    "feeFineOwed": false
  },
  "interval": {
    "minute": "minute(s)",
    "hour": "hour(s)",
    "day": "day(s)",
    "week": "week(s)",
    "month": "month(s)"
  },
  "id": "0bab56e5-1ab6-4ac2-afdf-8b2df0434351"
}

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"transfertype not found"

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

DELETE /transfertypes/{transfertypeId}

Delete transfertype item with given {transfertypeId}

DELETE /transfertypes/{transfertypeId}
URI Parameters
  • transfertypeId: required (string)
Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Response 204

Item deleted successfully

Response 400

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

Media type: text/plain

Type: any

Example:

"unable to delete transfertype -- constraint violation"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"transfertype not found"

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

PUT /transfertypes/{transfertypeId}

Update transfertype item with given {transfertypeId}

PUT /transfertypes/{transfertypeId}
URI Parameters
  • transfertypeId: required (string)
Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Body

Media type: application/json

Type: json

Content:

{
  "$schema":"http://json-schema.org/draft-04/schema#",
  "title":"Transfer-types Schema",
  "type":"object",
  "properties":{
    "name":{
      "type":"string"
    },
    "conditions":{
      "type":"object",
      "properties":{
        "never":{
          "type":"boolean"
        },
        "inmediatly":{
          "type":"boolean"
        },
        "totalOwed":{
          "type":"boolean"
        },
        "feeFineOwed":{
          "type":"boolean"
        }
      }
    },
    "interval":{
      "type":"object",
      "properties":{
        "minute":{
          "type":"string"
        },
        "hour":{
          "type":"string"
        },
        "day":{
          "type":"string"
        },
        "week":{
          "type":"string"
        },
        "month":{
          "type":"string"
        }
      }
    },
    "id":{
      "type":"string"
    }
  },
  "additionalProperties":false,
  "required":[
    "id"
  ]
}

Example:

{
  "name": "Employee",
  "conditions": {
    "never": false,
    "inmediatly": false,
    "totalOwed": false,
    "feeFineOwed": false
  },
  "interval": {
    "minute": "minute(s)",
    "hour": "hour(s)",
    "day": "day(s)",
    "week": "week(s)",
    "month": "month(s)"
  },
  "id": "0bab56e5-1ab6-4ac2-afdf-8b2df0434351"
}

Response 204

Item successfully updated

Response 400

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

Media type: text/plain

Type: any

Example:

"unable to update transfertype -- malformed JSON at 13:4"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"transfertype not found"

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator