Koha/api/v1/swagger/paths/erm_custom_reports.yaml
Matt Blenkinsop 8987ff1591
Bug 34587: Abstract reports backend to allow new data types
Now that harvesting is possible for platforms, databases and items we need to be able to generate reports for all of these data types. Currently the reporting backend structure is very geared towards titles. Rather than copying this for each different data type, this patch abstracts the code to accept the data type as a url parameter and use that to generate a report based on a given data type

Signed-off-by: Jessica Zairo <jzairo@bywatersolutions.com>
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-31 16:46:07 -03:00

243 lines
No EOL
7.7 KiB
YAML

"/erm/eUsage/monthly_report/{data_type}":
get:
x-mojo-to: ERM::CustomReports#monthly_report
operationId: getERMUsageMonthlyReport
tags:
- usage_report
summary: get usage monthly report
produces:
- application/json
parameters:
- name: x-koha-embed
in: header
required: false
description: Embed list sent as a request header
type: array
items:
type: string
enum:
- erm_usage_muses
collectionFormat: csv
- $ref: "../swagger.yaml#/parameters/data_type_pp"
- $ref: "../swagger.yaml#/parameters/match"
- $ref: "../swagger.yaml#/parameters/order_by"
- $ref: "../swagger.yaml#/parameters/page"
- $ref: "../swagger.yaml#/parameters/per_page"
- $ref: "../swagger.yaml#/parameters/q_param"
- $ref: "../swagger.yaml#/parameters/q_body"
- $ref: "../swagger.yaml#/parameters/q_header"
- $ref: "../swagger.yaml#/parameters/request_id_header"
responses:
200:
description: custom_report
schema:
items:
$ref: "../swagger.yaml#/definitions/erm_custom_report"
401:
description: authentication required
schema:
$ref: "../swagger.yaml#/definitions/error"
403:
description: access forbidden
schema:
$ref: "../swagger.yaml#/definitions/error"
404:
description: ressource not found
schema:
$ref: "../swagger.yaml#/definitions/error"
500:
description: |-
internal server error. possible `error_code` attribute values:
* `internal_server_error`
schema:
$ref: "../swagger.yaml#/definitions/error"
503:
description: under maintenance
schema:
$ref: "../swagger.yaml#/definitions/error"
x-koha-authorization:
permissions:
erm: 1
"/erm/eUsage/yearly_report/{data_type}":
get:
x-mojo-to: ERM::CustomReports#yearly_report
operationId: getERMUsageYearlyReport
tags:
- usage_report
summary: get usage yearly report
produces:
- application/json
parameters:
- name: x-koha-embed
in: header
required: false
description: Embed list sent as a request header
type: array
items:
type: string
enum:
- erm_usage_yuses
collectionFormat: csv
- $ref: "../swagger.yaml#/parameters/data_type_pp"
- $ref: "../swagger.yaml#/parameters/match"
- $ref: "../swagger.yaml#/parameters/order_by"
- $ref: "../swagger.yaml#/parameters/page"
- $ref: "../swagger.yaml#/parameters/per_page"
- $ref: "../swagger.yaml#/parameters/q_param"
- $ref: "../swagger.yaml#/parameters/q_body"
- $ref: "../swagger.yaml#/parameters/q_header"
- $ref: "../swagger.yaml#/parameters/request_id_header"
responses:
200:
description: custom_report
schema:
items:
$ref: "../swagger.yaml#/definitions/erm_custom_report"
401:
description: authentication required
schema:
$ref: "../swagger.yaml#/definitions/error"
403:
description: access forbidden
schema:
$ref: "../swagger.yaml#/definitions/error"
404:
description: ressource not found
schema:
$ref: "../swagger.yaml#/definitions/error"
500:
description: |-
internal server error. possible `error_code` attribute values:
* `internal_server_error`
schema:
$ref: "../swagger.yaml#/definitions/error"
503:
description: under maintenance
schema:
$ref: "../swagger.yaml#/definitions/error"
x-koha-authorization:
permissions:
erm: 1
"/erm/eUsage/metric_types_report/{data_type}":
get:
x-mojo-to: ERM::CustomReports#metric_types_report
operationId: getERMUsageMetricTypesReport
tags:
- usage_report
summary: get usage metric_types report
produces:
- application/json
parameters:
- name: x-koha-embed
in: header
required: false
description: Embed list sent as a request header
type: array
items:
type: string
enum:
- erm_usage_muses
collectionFormat: csv
- $ref: "../swagger.yaml#/parameters/data_type_pp"
- $ref: "../swagger.yaml#/parameters/match"
- $ref: "../swagger.yaml#/parameters/order_by"
- $ref: "../swagger.yaml#/parameters/page"
- $ref: "../swagger.yaml#/parameters/per_page"
- $ref: "../swagger.yaml#/parameters/q_param"
- $ref: "../swagger.yaml#/parameters/q_body"
- $ref: "../swagger.yaml#/parameters/q_header"
- $ref: "../swagger.yaml#/parameters/request_id_header"
responses:
200:
description: custom_report
schema:
items:
$ref: "../swagger.yaml#/definitions/erm_custom_report"
401:
description: authentication required
schema:
$ref: "../swagger.yaml#/definitions/error"
403:
description: access forbidden
schema:
$ref: "../swagger.yaml#/definitions/error"
404:
description: ressource not found
schema:
$ref: "../swagger.yaml#/definitions/error"
500:
description: |-
internal server error. possible `error_code` attribute values:
* `internal_server_error`
schema:
$ref: "../swagger.yaml#/definitions/error"
503:
description: under maintenance
schema:
$ref: "../swagger.yaml#/definitions/error"
x-koha-authorization:
permissions:
erm: 1
"/erm/eUsage/provider_rollup_report/{data_type}":
get:
x-mojo-to: ERM::CustomReports#provider_rollup_report
operationId: getERMUsageProviderRollupReport
tags:
- usage_report
summary: get usage provider rollup report
produces:
- application/json
parameters:
- name: x-koha-embed
in: header
required: false
description: Embed list sent as a request header
type: array
items:
type: string
enum:
- erm_usage_titles.erm_usage_muses
- erm_usage_platforms.erm_usage_muses
- erm_usage_databases.erm_usage_muses
- erm_usage_items.erm_usage_muses
collectionFormat: csv
- $ref: "../swagger.yaml#/parameters/data_type_pp"
- $ref: "../swagger.yaml#/parameters/match"
- $ref: "../swagger.yaml#/parameters/order_by"
- $ref: "../swagger.yaml#/parameters/page"
- $ref: "../swagger.yaml#/parameters/per_page"
- $ref: "../swagger.yaml#/parameters/q_param"
- $ref: "../swagger.yaml#/parameters/q_body"
- $ref: "../swagger.yaml#/parameters/q_header"
- $ref: "../swagger.yaml#/parameters/request_id_header"
responses:
200:
description: custom_report
schema:
items:
$ref: "../swagger.yaml#/definitions/erm_custom_report"
401:
description: authentication required
schema:
$ref: "../swagger.yaml#/definitions/error"
403:
description: access forbidden
schema:
$ref: "../swagger.yaml#/definitions/error"
404:
description: ressource not found
schema:
$ref: "../swagger.yaml#/definitions/error"
500:
description: |-
internal server error. possible `error_code` attribute values:
* `internal_server_error`
schema:
$ref: "../swagger.yaml#/definitions/error"
503:
description: under maintenance
schema:
$ref: "../swagger.yaml#/definitions/error"
x-koha-authorization:
permissions:
erm: 1