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
172 changes: 169 additions & 3 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1075,6 +1075,13 @@ paths:
in the Organisation starts with. Existing projects keep their own level, and each project's level
can still be changed on its Preferences page. Only settings sent are changed. Only an
Organisation Admin may do this; other colleagues get 403. Returns the Organisation.

It also sets the Organisation's **Region** and **Industry** (`region_factor_option_id`,
`industry_factor_option_id`), as on Edit organisation profile. Localised Financial Values, such
as the TOM System's local employment and local spend Measures, are worked out from them for
every project that doesn't set its own. Take the ids from `GET /factor_options`; send null to
clear one, so national amounts apply. An Industry sent as the Region, or the other way round,
gets 422. Contribution figures update in the background a few minutes later.
operationId: updateCharity
security: [{tokenAuth: []}]
parameters:
Expand All @@ -1092,8 +1099,17 @@ paths:
description: >-
"Enable contacts to sign in using a participant pass". When false, a Contact's profile
hides the Participating As tab unless the Contact is already linked to a user.
region_factor_option_id:
type: integer
nullable: true
description: The Organisation's Region, a `dimension` region option from `GET /factor_options`
industry_factor_option_id:
type: integer
nullable: true
description: The Organisation's Industry, a `dimension` industry option from `GET /factor_options`
example:
default_project_story_privacy: only_project_colleagues
region_factor_option_id: 7
industry_factor_option_id: 102
responses:
"200":
description: The Organisation, with the setting changed
Expand Down Expand Up @@ -4103,8 +4119,9 @@ paths:
What the Project's Project Preferences page shows: which Contact Forms create and edit
Contacts, which Contact statuses (Waiting List, Enrolled, Alumni, Declined) are switched on
with each one's form and baseline Surveys, editorial control, Case, Event and timesheet
settings, the Case Form, Event Formats, the default privacy of new Stories and the Mailchimp
list. Requires rights to change the Project's preferences (a Manager or an Organisation Admin).
settings, the Case Form, Event Formats, the default privacy of new Stories, the Mailchimp
list, and the Region and Industry its localised Financial Values use. Requires rights to change
the Project's preferences (a Manager or an Organisation Admin).
operationId: getProjectPreferences
security: [{tokenAuth: []}]
parameters:
Expand Down Expand Up @@ -6900,6 +6917,68 @@ paths:
"422":
$ref: '#/components/responses/UnprocessableEntity'

/factor_options:
get:
tags: [Financial Values]
summary: List the Regions and Industries
description: |
The Regions and Industries an Organisation or Project can choose for localised Financial
Values, each with the factors it holds, in the order the tables list them. Makerble publishes
these tables, e.g. the TOM System 2024 "Location" sheet (each Region's median annual wage,
Regional GVA and National GVA) and "Industry" sheet (each Industry's GVA multiplier).

A localised Financial Value's formula names a factor as `dimension.key`, e.g.
`region.median_wage`. Pass an option's id as `region_factor_option_id` or
`industry_factor_option_id` to `PATCH /charities/{id}` or `PATCH /projects/{id}/preferences`.
operationId: listFactorOptions
security: [{tokenAuth: []}]
parameters:
- name: dimension
in: query
required: false
schema: { type: string, example: region }
description: Only this table's options, by its key (region or industry)
- $ref: '#/components/parameters/Page'
- $ref: '#/components/parameters/PerPage'
- $ref: '#/components/parameters/LastSyncDatetime'
responses:
"200":
description: A page of Regions and Industries
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/PaginationEnvelope'
- type: object
properties:
data:
type: array
items: { $ref: '#/components/schemas/FactorOption' }
example:
page: 1
page_size: 1
page_count: 12
total_count: 12
data:
- id: 7
name: North East
dimension: region
dimension_name: Region
edition: TOM System 2024 Location
year: 2024
position: 0
factors:
- { key: median_wage, name: Median annual wage, value: '37666.5' }
- { key: national_gva, name: National GVA, value: '0.8' }
- { key: regional_gva, name: Regional GVA, value: '1.5718765958' }
updated_at: '2026-11-29T17:00:00Z'
"401":
$ref: '#/components/responses/Unauthorized'
"404":
$ref: '#/components/responses/NotFound'
"422":
$ref: '#/components/responses/UnprocessableEntity'

/financial_values:
get:
tags: [Financial Values]
Expand Down Expand Up @@ -27489,6 +27568,55 @@ components:
"Enable contacts to sign in using a participant pass" (Charity Preferences, Contacts). Off
by default.
example: false
region:
$ref: '#/components/schemas/FactorChoice'
industry:
$ref: '#/components/schemas/FactorChoice'

FactorChoice:
type: object
nullable: true
description: >-
A Region or Industry chosen for localised Financial Values: an id from `GET /factor_options`
and its name. Null when none is chosen.
properties:
id: { type: integer, example: 7 }
name: { type: string, example: North East }

FactorChoiceInEffect:
type: object
nullable: true
description: >-
The Region or Industry a project's localised Financial Values use: its own, or else its
organisation's (`source`). Null when neither is set, so national amounts apply.
properties:
id: { type: integer, example: 7 }
name: { type: string, example: North East }
source: { type: string, enum: [project, organisation] }

FactorOption:
type: object
description: >-
One option of a factor table Makerble publishes, e.g. the Region "North East" or the Industry
"Construction", with the factors it holds. A localised Financial Value's formula names a factor
as `dimension.key`, e.g. `region.median_wage`.
properties:
id: { type: integer, example: 7 }
name: { type: string, example: North East }
dimension: { type: string, example: region, description: The table's key, as a formula names it }
dimension_name: { type: string, example: Region }
edition: { type: string, nullable: true, example: TOM System 2024 Location }
year: { type: integer, nullable: true, example: 2024 }
position: { type: integer, description: Its place in the table's order }
factors:
type: array
items:
type: object
properties:
key: { type: string, example: regional_gva }
name: { type: string, example: Regional GVA }
value: { type: string, description: A decimal string, example: '1.5718765958' }
updated_at: { type: string, format: date-time }

DefaultProjectStoryPrivacy:
type: string
Expand Down Expand Up @@ -28119,6 +28247,24 @@ components:
project_id:
type: integer
readOnly: true
region_factor_option_id:
type: integer
nullable: true
description: >-
The Project's own Region for localised Financial Values, from `GET /factor_options`. Null to
use its organisation's.
industry_factor_option_id:
type: integer
nullable: true
description: >-
The Project's own Industry for localised Financial Values, from `GET /factor_options`. Null
to use its organisation's.
region:
allOf: [{ $ref: '#/components/schemas/FactorChoiceInEffect' }]
readOnly: true
industry:
allOf: [{ $ref: '#/components/schemas/FactorChoiceInEffect' }]
readOnly: true
add_enrolled_contacts_to_upcoming_events:
type: boolean
nullable: true
Expand Down Expand Up @@ -28867,6 +29013,20 @@ components:
enum: [only_project_colleagues, only_charity_colleagues, charity_plus_network, everyone]
description: Who may use it
project_ids: { type: array, items: { type: integer }, description: The projects it may be used in, for only_project_colleagues }
formula:
type: string
nullable: true
description: >-
For a localised Financial Value, whose amount depends on where the work happens or the
industry: arithmetic over factors from `GET /factor_options`, e.g.
`(industry.gva_multiplier - 1) * region.regional_gva`. Each project values it with its own
Region and Industry. Null for a fixed Financial Value.
localised: { type: boolean, description: Whether it has a formula }
national_amount:
type: string
nullable: true
description: For a localised Financial Value, the amount used where no Region or Industry is set (the same as amount). Null for a fixed one.
example: '0.8'
created_at: { type: string, format: date-time }
updated_at: { type: string, format: date-time }
FinancialValueInput:
Expand All @@ -28888,6 +29048,12 @@ components:
publisher: { type: string }
short_description: { type: string }
calculation_description: { type: string }
formula:
type: string
description: >-
Makes it localised: arithmetic (numbers, + - * / and brackets) over factors named
`dimension.key`, e.g. `region.median_wage`. amount is then the national amount. A formula
naming a factor that doesn't exist, or using anything but arithmetic, gets 422.
ProjectFinancialValue:
type: object
description: One Financial Value put against one of a project's Metrics on its Financial Value calculator
Expand Down
Loading
Loading