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
320 changes: 320 additions & 0 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,8 @@ tags:
description: Join table linking Outcomes to Indicators
- name: Framework Sets
description: Groups of Impact Frameworks (e.g. the SDGs) that organisations report their contribution towards
- name: Financial Values
description: Published money values for outcomes, and the project Metrics they are put against on a project's Financial Value calculator
- name: Explore
description: The Makerble® ImpactStore™'s Explore pages, with the same search, filters and counts as the app
- name: Library
Expand Down Expand Up @@ -6881,6 +6883,247 @@ paths:
"422":
$ref: '#/components/responses/UnprocessableEntity'

/financial_values:
get:
tags: [Financial Values]
summary: Search the Financial Values you may use
description: |
The Financial Values you may choose on a project's Financial Value calculator, by name: your own, your
organisations', those shared with you and those shared with everyone. A Financial Value is a published
money value per person for an outcome, e.g. "Moving into work: £1,234 a year", in the currency of its country.
operationId: listFinancialValues
security: [{tokenAuth: []}]
parameters:
- name: search
in: query
required: false
schema: { type: string }
description: Part of the name or code, case-insensitive
- name: category_id
in: query
required: false
schema: { type: integer }
description: Only this Methodology (Financial Value Category)
- name: source_id
in: query
required: false
schema: { type: integer }
description: Only those from this Source
- name: country_id
in: query
required: false
schema: { type: integer }
description: Only those for this country
- name: verified
in: query
required: false
schema: { type: boolean }
description: true for only those Makerble has checked, false for only unchecked ones
- $ref: '#/components/parameters/Page'
- $ref: '#/components/parameters/PerPage'
- $ref: '#/components/parameters/LastSyncDatetime'
responses:
"200":
description: A page of Financial Values, by name
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/PaginationEnvelope'
- type: object
properties:
data:
type: array
items: { $ref: '#/components/schemas/FinancialValue' }
"401":
$ref: '#/components/responses/Unauthorized'
"422":
$ref: '#/components/responses/UnprocessableEntity'
post:
tags: [Financial Values]
summary: Create a Financial Value
description: |
Creates a Financial Value, as the Create Financial Value form does. It belongs to the organisation you name,
which you must be an Organisation Admin of, or to you if you name none. category, sources and country are
names that already exist in Makerble.
operationId: createFinancialValue
security: [{tokenAuth: []}]
requestBody:
required: true
content:
application/json:
schema: { $ref: '#/components/schemas/FinancialValueInput' }
example:
name: Moving into work
amount: 1234.5
year: 2023
country: United Kingdom
privacy: Organisation colleagues only
organisation_id: 913
category: Wellbeing valuation
sources: [HACT]
responses:
"201":
description: The new Financial Value
content:
application/json:
schema: { $ref: '#/components/schemas/FinancialValue' }
"401":
$ref: '#/components/responses/Unauthorized'
"403":
$ref: '#/components/responses/ForbiddenError'
"422":
description: Something was wrong, e.g. a country that doesn't exist. existing_id is given when the owner already has a Financial Value with this name.
content:
application/json:
schema:
type: object
properties:
errors: { type: array, items: { type: string } }
existing_id: { type: integer }
example:
errors: ["Country 'Atlantis' not found"]
/financial_values/{id}:
get:
tags: [Financial Values]
summary: Get a Financial Value
description: One Financial Value you may use. Any other reads as not found.
operationId: getFinancialValue
security: [{tokenAuth: []}]
parameters:
- name: id
in: path
required: true
schema: { type: integer }
responses:
"200":
description: The Financial Value
content:
application/json:
schema: { $ref: '#/components/schemas/FinancialValue' }
"401":
$ref: '#/components/responses/Unauthorized'
"404":
$ref: '#/components/responses/NotFound'
/projects/{project_id}/financial_values:
get:
tags: [Financial Values]
summary: List a project's Financial Values
description: |
Which Financial Values a project puts against which of its Metrics on its Financial Value calculator, each
with the Metric's result (quantity) and sub_total, and the totals they come to for each currency, as on the
project's Financial Calculator tile. For Project Managers and Organisation Admins of the project.
operationId: listProjectFinancialValues
security: [{tokenAuth: []}]
parameters:
- name: project_id
in: path
required: true
schema: { type: integer }
- $ref: '#/components/parameters/Page'
- $ref: '#/components/parameters/PerPage'
responses:
"200":
description: The project's totals and a page of its attachments
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/PaginationEnvelope'
- type: object
properties:
project_id: { type: integer }
financial_calculator_enabled: { type: boolean, description: Whether the project's Financial Calculator is turned on in its Preferences }
totals:
type: array
items:
type: object
properties:
currency: { type: string, example: GBP }
symbol: { type: string, example: '£' }
amount: { type: string, example: '3702.0' }
data:
type: array
items: { $ref: '#/components/schemas/ProjectFinancialValue' }
"401":
$ref: '#/components/responses/Unauthorized'
"403":
$ref: '#/components/responses/ForbiddenError'
"404":
$ref: '#/components/responses/NotFound'
"422":
$ref: '#/components/responses/UnprocessableEntity'
post:
tags: [Financial Values]
summary: Put a Financial Value against a project's Metric
description: |
Puts a Financial Value against one of the project's Metrics (a Change or an Indicator the project tracks or
records in its Stories), as the Financial Value calculator page does, and turns on the project's Financial
Calculator if it is off. Attaching one that is already there only changes its colour. A Financial Value shared
with Project colleagues only can only be used in its projects. For Project Managers and Organisation Admins.
operationId: attachProjectFinancialValue
security: [{tokenAuth: []}]
parameters:
- name: project_id
in: path
required: true
schema: { type: integer }
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [metric_type, metric_id, financial_value_id]
properties:
metric_type: { type: string, enum: [Change, Indicator] }
metric_id: { type: integer }
financial_value_id: { type: integer }
color: { type: string, pattern: '^#[0-9a-fA-F]{6}$', description: "The Metric's colour on the calculator. Default the Metric's current colour, or #3595d5" }
example:
metric_type: Indicator
metric_id: 5521
financial_value_id: 88
responses:
"201":
description: The attachment
content:
application/json:
schema: { $ref: '#/components/schemas/ProjectFinancialValue' }
"401":
$ref: '#/components/responses/Unauthorized'
"403":
$ref: '#/components/responses/ForbiddenError'
"404":
$ref: '#/components/responses/NotFound'
"422":
$ref: '#/components/responses/UnprocessableEntityList'
/projects/{project_id}/financial_values/{id}:
delete:
tags: [Financial Values]
summary: Take a Financial Value off a project's Metric
description: Removes one attachment, by its id from the list. For Project Managers and Organisation Admins.
operationId: detachProjectFinancialValue
security: [{tokenAuth: []}]
parameters:
- name: project_id
in: path
required: true
schema: { type: integer }
- name: id
in: path
required: true
schema: { type: integer }
description: The attachment id
responses:
"204":
description: Removed
"401":
$ref: '#/components/responses/Unauthorized'
"403":
$ref: '#/components/responses/ForbiddenError'
"404":
$ref: '#/components/responses/NotFound'
/labels:
get:
tags: [Labels]
Expand Down Expand Up @@ -28405,6 +28648,83 @@ components:
type: string
enum: [Person, Organisation, Animal, Object]

FinancialValue:
type: object
description: A published money value per person for an outcome, in the currency of its country
properties:
id: { type: integer, example: 88 }
name: { type: string, example: Moving into work }
code: { type: string, nullable: true, example: MIW }
amount: { type: string, description: The value per person, as a decimal string, example: '1234.5' }
currency: { type: string, example: GBP }
year: { type: integer, example: 2023 }
country: { type: string, nullable: true, example: United Kingdom }
category:
type: object
nullable: true
description: Its Methodology (Financial Value Category)
properties:
id: { type: integer }
name: { type: string }
sources:
type: array
items:
type: object
properties:
id: { type: integer }
name: { type: string }
publisher: { type: string, nullable: true, description: The web address of the source }
short_description: { type: string, nullable: true }
calculation_description: { type: string, nullable: true, description: Simple HTML }
verified: { type: boolean, description: Whether Makerble has checked it }
owner_type: { type: string, enum: [Organisation, User] }
owner_id: { type: integer }
privacy:
type: string
nullable: true
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 }
created_at: { type: string, format: date-time }
updated_at: { type: string, format: date-time }
FinancialValueInput:
type: object
required: [name, amount, year, country, privacy]
properties:
name: { type: string }
amount: { type: number, description: The value per person, with no currency symbol }
year: { type: integer }
country: { type: string, description: The country's name. Sets its currency. }
privacy:
type: string
enum: [Project colleagues only, Organisation colleagues only, Network & organisation colleagues only, Everyone]
organisation_id: { type: integer, description: The organisation that will own it. Leave out to make it your own. }
project_ids: { type: array, items: { type: integer }, description: For Project colleagues only }
code: { type: string, description: Letters and numbers only }
category: { type: string, description: The name of its Methodology }
sources: { type: array, items: { type: string }, description: Names of its Sources }
publisher: { type: string }
short_description: { type: string }
calculation_description: { type: string }
ProjectFinancialValue:
type: object
description: One Financial Value put against one of a project's Metrics on its Financial Value calculator
properties:
id: { type: integer, description: The attachment id }
metric_type: { type: string, enum: [Change, Indicator] }
metric_id: { type: integer }
metric_name: { type: string }
color: { type: string, example: '#3595d5' }
financial_value:
type: object
properties:
id: { type: integer }
name: { type: string }
amount: { type: string }
currency: { type: string }
quantity: { type: integer, description: "The Metric's result in the project" }
sub_total: { type: string, description: quantity times the amount }
created_at: { type: string, format: date-time }
Label:
type: object
description: A Label (Story Label), one of an organisation's themes for coding Stories and survey responses
Expand Down
Loading
Loading