mod-finance-storage (v1)

https://github.com/folio-org/mod-finance-storage

Table of contents

Group/fund/fiscal year records relations CRUD APIs

CRUD APIs used to manage group/fund/fiscal year records relations

/finance-storage/group-fund-fiscal-years

Collection of group-fund-fiscal-year items.

GET /finance-storage/group-fund-fiscal-years

Get list of group/fund/fiscal year records relations

GET /finance-storage/group-fund-fiscal-years
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: e.g.

    Example:

    (username=="ab*" or personal.firstName=="ab*" or personal.lastName=="ab*") and active=="true" sortby personal.lastName personal.firstName barcode
    
    group.name == History and and fund.fundStatus == Active and fiscalYear.periodEnd < 2020-01-01 and fundType.name == Monographs and ledger.name == One-time
    
  • 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 group-fund-fiscal-year items

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A collection of fund/group relationship records on a per fiscal year basis",
  "type": "object",
  "properties": {
    "groupFundFiscalYears": {
      "description": "The list of fund/group relationship records on a per fiscal year basis",
      "type": "array",
      "items": {
        "$ref": "group_fund_fiscal_year.json"
      }
    },
    "totalRecords": {
      "description": "The number of records contained in this collection",
      "type": "integer",
      "minimum": 0
    }
  },
  "additionalProperties": false,
  "required": [
    "groupFundFiscalYears",
    "totalRecords"
  ]
}

Example:

{
  "groupFundFiscalYears": [
    {
      "id": "44cebc14-3061-4608-897a-e63c90a2fa60",
      "budgetId": "47ac60b4-159d-4e1c-9acb-8293df67d16d",
      "groupId": "f33ed99b-852a-4f90-9891-5efe0feab165",
      "fiscalYearId": "ac2164c7-ba3d-1bc2-a12c-e35ceccbfaf2",
      "fundId": "6e2fbba3-d557-4480-bca3-b6f5c645de04"
    },
    {
      "id": "8a6743b2-6936-4a1e-b30b-ebc3994a339b",
      "groupId": "66f84ff8-68e1-4f10-8814-35bcd34c32a0",
      "fiscalYearId": "a4ee40d4-5176-4b76-aa46-2e17e9161795",
      "fundId": "6e2fbba3-d557-4480-bca3-b6f5c645de04"
    }
  ],
  "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 group-fund-fiscal-years -- 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 group-fund-fiscal-years -- unauthorized

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "error.schema"
      }
    },
    "total_records": {
      "description": "Total number of errors",
      "type": "integer"
    }
  }
}

Example:

{
  "errors": [
    {
      "message": "may not be null",
      "type": "1",
      "code": "-1",
      "parameters": [
        {
          "key": "moduleTo",
          "value": "null"
        }
      ]
    }
  ]
}

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

POST /finance-storage/group-fund-fiscal-years

Create a new group-fund-fiscal-year item.

POST /finance-storage/group-fund-fiscal-years
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#",
  "description": "A relationship between group and fund on a per fiscal year basis",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of the record",
      "$ref": "../../common/schemas/uuid.json"
    },
    "budgetId": {
      "description": "UUID of the budget record",
      "$ref": "../../common/schemas/uuid.json"
    },
    "groupId": {
      "description": "UUID of the group record",
      "$ref": "../../common/schemas/uuid.json"
    },
    "fiscalYearId": {
      "description": "UUID of the fiscal year record",
      "$ref": "../../common/schemas/uuid.json"
    },
    "fundId": {
      "description": "UUID of the fund record",
      "$ref": "../../common/schemas/uuid.json"
    }
  },
  "additionalProperties": false,
  "required": [
    "groupId",
    "fiscalYearId",
    "fundId"
  ]
}

Example:

{
  "id": "44cebc14-3061-4608-897a-e63c90a2fa60",
  "budgetId": "47ac60b4-159d-4e1c-9acb-8293df67d16d",
  "groupId": "f33ed99b-852a-4f90-9891-5efe0feab165",
  "fiscalYearId": "ac2164c7-ba3d-1bc2-a12c-e35ceccbfaf2",
  "fundId": "6e2fbba3-d557-4480-bca3-b6f5c645de04"
}

Response 201

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

Headers
  • Location: required (string)

    URI to the created group-fund-fiscal-year item

Body

Media type: application/json

Type: any

Example:

{
  "id": "44cebc14-3061-4608-897a-e63c90a2fa60",
  "budgetId": "47ac60b4-159d-4e1c-9acb-8293df67d16d",
  "groupId": "f33ed99b-852a-4f90-9891-5efe0feab165",
  "fiscalYearId": "ac2164c7-ba3d-1bc2-a12c-e35ceccbfaf2",
  "fundId": "6e2fbba3-d557-4480-bca3-b6f5c645de04"
}

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 group-fund-fiscal-year -- malformed JSON at 13:3"

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

unable to create group-fund-fiscal-years -- unauthorized

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "error.schema"
      }
    },
    "total_records": {
      "description": "Total number of errors",
      "type": "integer"
    }
  }
}

Example:

{
  "errors": [
    {
      "message": "may not be null",
      "type": "1",
      "code": "-1",
      "parameters": [
        {
          "key": "moduleTo",
          "value": "null"
        }
      ]
    }
  ]
}

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

GET /finance-storage/group-fund-fiscal-years/{id}

Retrieve group-fund-fiscal-year item with given {group-fund-fiscal-yearId}

GET /finance-storage/group-fund-fiscal-years/{id}
URI Parameters
  • id: required (string - pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$)

    The UUID of a group/fund/fiscal year records relation

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#",
  "description": "A relationship between group and fund on a per fiscal year basis",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of the record",
      "$ref": "../../common/schemas/uuid.json"
    },
    "budgetId": {
      "description": "UUID of the budget record",
      "$ref": "../../common/schemas/uuid.json"
    },
    "groupId": {
      "description": "UUID of the group record",
      "$ref": "../../common/schemas/uuid.json"
    },
    "fiscalYearId": {
      "description": "UUID of the fiscal year record",
      "$ref": "../../common/schemas/uuid.json"
    },
    "fundId": {
      "description": "UUID of the fund record",
      "$ref": "../../common/schemas/uuid.json"
    }
  },
  "additionalProperties": false,
  "required": [
    "groupId",
    "fiscalYearId",
    "fundId"
  ]
}

Example:

{
  "id": "44cebc14-3061-4608-897a-e63c90a2fa60",
  "budgetId": "47ac60b4-159d-4e1c-9acb-8293df67d16d",
  "groupId": "f33ed99b-852a-4f90-9891-5efe0feab165",
  "fiscalYearId": "ac2164c7-ba3d-1bc2-a12c-e35ceccbfaf2",
  "fundId": "6e2fbba3-d557-4480-bca3-b6f5c645de04"
}

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"group-fund-fiscal-year not found"

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "error.schema"
      }
    },
    "total_records": {
      "description": "Total number of errors",
      "type": "integer"
    }
  }
}

Example:

{
  "errors": [
    {
      "message": "may not be null",
      "type": "1",
      "code": "-1",
      "parameters": [
        {
          "key": "moduleTo",
          "value": "null"
        }
      ]
    }
  ]
}

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

DELETE /finance-storage/group-fund-fiscal-years/{id}

Delete group-fund-fiscal-year item with given {group-fund-fiscal-yearId}

DELETE /finance-storage/group-fund-fiscal-years/{id}
URI Parameters
  • id: required (string - pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$)

    The UUID of a group/fund/fiscal year records relation

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 group-fund-fiscal-year -- constraint violation"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"group-fund-fiscal-year not found"

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "error.schema"
      }
    },
    "total_records": {
      "description": "Total number of errors",
      "type": "integer"
    }
  }
}

Example:

{
  "errors": [
    {
      "message": "may not be null",
      "type": "1",
      "code": "-1",
      "parameters": [
        {
          "key": "moduleTo",
          "value": "null"
        }
      ]
    }
  ]
}

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

PUT /finance-storage/group-fund-fiscal-years/{id}

Update group-fund-fiscal-year item with given {group-fund-fiscal-yearId}

PUT /finance-storage/group-fund-fiscal-years/{id}
URI Parameters
  • id: required (string - pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$)

    The UUID of a group/fund/fiscal year records relation

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#",
  "description": "A relationship between group and fund on a per fiscal year basis",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of the record",
      "$ref": "../../common/schemas/uuid.json"
    },
    "budgetId": {
      "description": "UUID of the budget record",
      "$ref": "../../common/schemas/uuid.json"
    },
    "groupId": {
      "description": "UUID of the group record",
      "$ref": "../../common/schemas/uuid.json"
    },
    "fiscalYearId": {
      "description": "UUID of the fiscal year record",
      "$ref": "../../common/schemas/uuid.json"
    },
    "fundId": {
      "description": "UUID of the fund record",
      "$ref": "../../common/schemas/uuid.json"
    }
  },
  "additionalProperties": false,
  "required": [
    "groupId",
    "fiscalYearId",
    "fundId"
  ]
}

Example:

{
  "id": "44cebc14-3061-4608-897a-e63c90a2fa60",
  "budgetId": "47ac60b4-159d-4e1c-9acb-8293df67d16d",
  "groupId": "f33ed99b-852a-4f90-9891-5efe0feab165",
  "fiscalYearId": "ac2164c7-ba3d-1bc2-a12c-e35ceccbfaf2",
  "fundId": "6e2fbba3-d557-4480-bca3-b6f5c645de04"
}

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 group-fund-fiscal-year -- malformed JSON at 13:4"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"group-fund-fiscal-year not found"

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "error.schema"
      }
    },
    "total_records": {
      "description": "Total number of errors",
      "type": "integer"
    }
  }
}

Example:

{
  "errors": [
    {
      "message": "may not be null",
      "type": "1",
      "code": "-1",
      "parameters": [
        {
          "key": "moduleTo",
          "value": "null"
        }
      ]
    }
  ]
}

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator