Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
382 changes: 382 additions & 0 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13298,6 +13298,177 @@ paths:
$ref: '#/components/responses/NotFound'
"422":
$ref: '#/components/responses/UnprocessableEntity'
/reporting_cycles:
get:
tags: [Reports]
summary: List Reporting Cycles
operationId: listReportingCycles
description: |
Reporting Cycles in ReportMaker. A Reporting Cycle is a series of reports owed to one
recipient (e.g. quarterly to Comic Relief), each Deadline saying which Report Template, which
projects and albums, which timeframe and when it is due. An Organisation Admin sees every cycle
of the organisation; anyone else sees only the cycles they are an Editor or Reporter of.
security: [{tokenAuth: []}]
parameters:
- name: charity_id
in: query
required: false
schema:
type: integer
example: 42
description: Only this organisation's cycles; leave out for every organisation you belong to
- name: q
in: query
required: false
schema:
type: string
example: Comic Relief
description: Words in the name or the recipient
- $ref: '#/components/parameters/Page'
- $ref: '#/components/parameters/PerPage'
- $ref: '#/components/parameters/LastSyncDatetime'
responses:
"200":
description: The Reporting Cycles you can see
content:
application/json:
schema:
$ref: '#/components/schemas/PaginatedReportingCycles'
"401":
$ref: '#/components/responses/Unauthorized'
"404":
$ref: '#/components/responses/NotFound'
post:
tags: [Reports]
summary: Create a Reporting Cycle
operationId: createReportingCycle
description: |
Creates a Reporting Cycle with its Deadlines, as **Create a Reporting Cycle** does. Give
every Deadline explicit dates (`YYYY-MM-DD`). Every id must belong to the organisation:
`editor_ids` and `reporter_ids` are its users, `project_ids` its projects you can view,
`album_ids` its albums and `report_template_id` a Report Template it can use. Errors name the
Deadline, e.g. `Deadline "Q1": Timeframe from must be on or before timeframe to`. Requires an
Organisation Admin; another organisation is a 404.
security: [{tokenAuth: []}]
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ReportingCycleInput'
example:
charity_id: 42
name: Comic Relief 2027
recipient: Comic Relief
reporter_ids: [118]
deadlines:
- name: Q1 2027 report
report_template_id: 7
timeframe_from: "2027-01-01"
timeframe_to: "2027-03-31"
submission_deadline: "2027-04-30"
project_ids: [301, 302]
album_ids: [12]
- name: Q2 2027 report
report_template_id: 7
timeframe_from: "2027-04-01"
timeframe_to: "2027-06-30"
submission_deadline: "2027-07-31"
project_ids: [301, 302]
album_ids: [12]
responses:
"201":
description: The new Reporting Cycle
content:
application/json:
schema:
type: object
properties:
data:
$ref: '#/components/schemas/ReportingCycle'
"401":
$ref: '#/components/responses/Unauthorized'
"404":
$ref: '#/components/responses/NotFound'
"422":
$ref: '#/components/responses/UnprocessableEntity'
/reporting_cycles/{id}:
get:
tags: [Reports]
summary: Get a Reporting Cycle
operationId: getReportingCycle
description: One Reporting Cycle with its Deadlines in due order. A cycle you can't see is a 404.
security: [{tokenAuth: []}]
parameters:
- name: id
in: path
required: true
schema:
type: integer
example: 15
responses:
"200":
description: The Reporting Cycle
content:
application/json:
schema:
type: object
properties:
data:
$ref: '#/components/schemas/ReportingCycle'
"401":
$ref: '#/components/responses/Unauthorized'
"404":
$ref: '#/components/responses/NotFound'
patch:
tags: [Reports]
summary: Change a Reporting Cycle
operationId: updateReportingCycle
description: |
Changes a Reporting Cycle, as **Edit Reporting Cycle** does. Fields left out stay as they are;
`editor_ids` and `reporter_ids`, when given, replace the list. In `deadlines`, give an existing
Deadline's `id` to change it (Deadlines without one are added), and `{id, _destroy: true}` to
remove one; Deadlines not listed are kept. Requires an Organisation Admin or an Editor of the
cycle; a Reporter of it gets 403. Deleting a cycle is only on its page.
security: [{tokenAuth: []}]
parameters:
- name: id
in: path
required: true
schema:
type: integer
example: 15
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ReportingCycleInput'
example:
deadlines:
- id: 51
timeframe_from: "2027-01-01"
timeframe_to: "2027-03-31"
- id: 52
_destroy: true
responses:
"200":
description: The changed Reporting Cycle
content:
application/json:
schema:
type: object
properties:
data:
$ref: '#/components/schemas/ReportingCycle'
"401":
$ref: '#/components/responses/Unauthorized'
"403":
$ref: '#/components/responses/Forbidden'
"404":
$ref: '#/components/responses/NotFound'
"422":
$ref: '#/components/responses/UnprocessableEntity'
/requirement_sets:
get:
tags: [Reports]
Expand Down Expand Up @@ -26993,6 +27164,217 @@ components:
type: array
items:
$ref: '#/components/schemas/ReportTemplate'
NamedRecord:
type: object
properties:
id:
type: integer
name:
type: string
ReportingCycleSummary:
type: object
properties:
id:
type: integer
charity_id:
type: integer
name:
type: string
recipient:
type: string
nullable: true
editor_ids:
type: array
items:
type: integer
reporter_ids:
type: array
items:
type: integer
deadline_count:
type: integer
next_deadline:
type: object
nullable: true
description: The earliest Deadline due today or later
properties:
id:
type: integer
name:
type: string
submission_deadline:
type: string
format: date
updated_at:
type: string
format: date-time
PaginatedReportingCycles:
type: object
properties:
page:
type: integer
page_size:
type: integer
page_count:
type: integer
total_count:
type: integer
data:
type: array
items:
$ref: '#/components/schemas/ReportingCycleSummary'
Deadline:
type: object
description: One report owed in a Reporting Cycle
properties:
id:
type: integer
name:
type: string
report_template:
allOf:
- $ref: '#/components/schemas/NamedRecord'
nullable: true
timeframe_from:
type: string
format: date
nullable: true
timeframe_to:
type: string
format: date
nullable: true
submission_deadline:
type: string
format: date
nullable: true
projects:
type: array
description: Work to include
items:
$ref: '#/components/schemas/NamedRecord'
albums:
type: array
description: Work to include
items:
$ref: '#/components/schemas/NamedRecord'
exclusive_focus_filter_data:
type: object
description: Exclusive Focus, the Contact filters the report is limited to
reporting_guidance:
type: string
nullable: true
nuance:
type: string
nullable: true
editors:
type: array
items:
$ref: '#/components/schemas/NamedRecord'
reporters:
type: array
items:
$ref: '#/components/schemas/NamedRecord'
ReportingCycle:
type: object
description: A series of reports owed to one recipient
properties:
id:
type: integer
charity_id:
type: integer
name:
type: string
recipient:
type: string
nullable: true
reporting_guidance:
type: string
nullable: true
nuance:
type: string
nullable: true
editors:
type: array
items:
$ref: '#/components/schemas/NamedRecord'
reporters:
type: array
items:
$ref: '#/components/schemas/NamedRecord'
deadlines:
type: array
items:
$ref: '#/components/schemas/Deadline'
updated_at:
type: string
format: date-time
ReportingCycleInput:
type: object
properties:
charity_id:
type: integer
description: The organisation, when creating
name:
type: string
recipient:
type: string
reporting_guidance:
type: string
nuance:
type: string
editor_ids:
type: array
items:
type: integer
reporter_ids:
type: array
items:
type: integer
deadlines:
type: array
items:
type: object
properties:
id:
type: integer
description: An existing Deadline, to change or remove it
_destroy:
type: boolean
name:
type: string
report_template_id:
type: integer
timeframe_from:
type: string
format: date
timeframe_to:
type: string
format: date
submission_deadline:
type: string
format: date
project_ids:
type: array
items:
type: integer
album_ids:
type: array
items:
type: integer
exclusive_focus_filter_data:
type: object
reporting_guidance:
type: string
nuance:
type: string
editor_ids:
type: array
items:
type: integer
reporter_ids:
type: array
items:
type: integer
RequirementSet:
type: object
description: A funder's reporting requirements for a programme, and the metrics that answer each
Expand Down
Loading
Loading