Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add project-level transactions and add milestones to projects and contracting processes #426

Merged
merged 13 commits into from
Nov 12, 2023
Merged
Show file tree
Hide file tree
Changes from 12 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
52 changes: 50 additions & 2 deletions docs/_static/i18n.csv
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,18 @@ budget/budgetBreakdown/amount,Amount,False,
budget/budgetBreakdown/amount,Value,False,
budget/budgetBreakdown/amount/amount,Amount,False,
budget/budgetBreakdown/amount/currency,Currency,False,
budget/budgetBreakdown/approvalDate,Approval date,False,
budget/budgetBreakdown/uri,Linked budget information,False,
budget/budgetBreakdown/period,Budget period,False,
budget/budgetBreakdown/period,Period,False,
budget/budgetBreakdown/period/startDate,Start date,False,
budget/budgetBreakdown/period/endDate,End date,False,
budget/budgetBreakdown/period/maxExtentDate,Maximum extent,False,
budget/budgetBreakdown/period/durationInDays,Duration (days),False,
budget/budgetBreakdown/sourceParty,Source party,False,
budget/budgetBreakdown/sourceParty,Source organization,False,
budget/budgetBreakdown/sourceParty,Organization reference,False,
budget/budgetBreakdown/sourceParty/name,Organization name,True,
budget/budgetBreakdown/sourceParty/id,Organization ID,True,
budget/budgetBreakdown/approvalDate,Approval date,False,
forecasts,Forecasts,False,
forecasts,Metric,False,
forecasts/id,Identifier,False,
Expand Down Expand Up @@ -275,6 +275,21 @@ contractingProcesses/summary/transactions/payee,Organization reference,False,
contractingProcesses/summary/transactions/payee/name,Organization name,True,
contractingProcesses/summary/transactions/payee/id,Organization ID,True,
contractingProcesses/summary/transactions/uri,Linked spending information,False,
contractingProcesses/summary/transactions/relatedImplementationMilestone,Related implementation milestone,False,
contractingProcesses/summary/transactions/relatedImplementationMilestone,Milestone Reference,False,
contractingProcesses/summary/transactions/relatedImplementationMilestone/id,Milestone ID,True,
contractingProcesses/summary/transactions/relatedImplementationMilestone/title,Milestone title,True,
contractingProcesses/summary/milestones,Milestones,False,
contractingProcesses/summary/milestones,Milestone,False,
contractingProcesses/summary/milestones/id,ID,True,
contractingProcesses/summary/milestones/title,Title,True,
contractingProcesses/summary/milestones/type,Milestone type,False,
contractingProcesses/summary/milestones/description,Description,True,
contractingProcesses/summary/milestones/code,Milestone code,False,
contractingProcesses/summary/milestones/dueDate,Due date,False,
contractingProcesses/summary/milestones/dateMet,Date met,False,
contractingProcesses/summary/milestones/dateModified,Date modified,False,
contractingProcesses/summary/milestones/status,Status,False,
contractingProcesses/releases,Linked releases,False,
contractingProcesses/releases,Release,False,
contractingProcesses/releases/id,ID,True,
Expand Down Expand Up @@ -307,6 +322,39 @@ metrics/observations/unit/id,ID,True,
metrics/observations/unit/uri,URI,False,
metrics/observations/dimensions,Dimensions,False,
metrics/observations/notes,Notes,True,
transactions,Transactions,False,
transactions,Transaction information,False,
transactions/id,ID,True,
transactions/source,Data source,False,
transactions/date,Date,False,
transactions/value,Value,False,
transactions/value,Value,False,
transactions/value/amount,Amount,False,
transactions/value/currency,Currency,False,
transactions/payer,Payer,False,
transactions/payer,Organization reference,False,
transactions/payer/name,Organization name,True,
transactions/payer/id,Organization ID,True,
transactions/payee,Payee,False,
transactions/payee,Organization reference,False,
transactions/payee/name,Organization name,True,
transactions/payee/id,Organization ID,True,
transactions/uri,Linked spending information,False,
transactions/relatedImplementationMilestone,Related implementation milestone,False,
transactions/relatedImplementationMilestone,Milestone Reference,False,
transactions/relatedImplementationMilestone/id,Milestone ID,True,
transactions/relatedImplementationMilestone/title,Milestone title,True,
milestones,Milestones,False,
milestones,Milestone,False,
milestones/id,ID,True,
milestones/title,Title,True,
milestones/type,Milestone type,False,
milestones/description,Description,True,
milestones/code,Milestone code,False,
milestones/dueDate,Due date,False,
milestones/dateMet,Date met,False,
milestones/dateModified,Date modified,False,
milestones/status,Status,False,
completion,Completion,False,
completion/endDate,End date,False,
completion/endDateDetails,End date details,True,
Expand Down
5 changes: 5 additions & 0 deletions docs/cost/common.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,8 @@ Add a `Document` object to the `contractingProcesses.summary.documents` array an
* Set its `.id` incrementally
* Set its `.url` to a direct link to the document
* Set its `.title` to the title of the document

## Add an organization

* Add an `Organization` object to the `.parties` array and set its `.name` to the name of the organization.
* If you collect organization identifiers, set `.identifier` according to the [identifier reference](../reference/schema.md#identifier) and set `.id` to {identifier.scheme}-{identifier.id}(-{department-identifier}). Otherwise, set `.id` incrementally.
68 changes: 66 additions & 2 deletions docs/cost/ids/sustainability.md
Original file line number Diff line number Diff line change
Expand Up @@ -1464,9 +1464,73 @@ Disbursements dates according to financial agreement versus actual disbursements
:columns: 8
OC4IDS mapping
^^^

For each planned disbursement:

* If the disbursement relates to a contracting processes, for example a payment from a funder to a supplier or subcontractor of a supplier, get the `ContractingProcess` in the `.contractingProcesses` array to which the disbursement relates and add a `Milestone` object to its `.summary.milestones` array. Otherwise, if the disbursement relates to the project, for example a payment from a funder to the public authority, add a `Milestone` object to the project-level `.milestones` array.
* Set the milestone's:
* `.id` incrementally
* `.status` to 'scheduled'
* `.dueDate` to the date on which the disbursement is planned to occur
* `.type` to 'payment'
* `.value` to the amount and currency of the planned disbursement

For each actual disbursement:

* If the disbursement relates to a contracting processes, for example a payment from a funder to a supplier or subcontractor of a supplier, get the `ContractingProcess` in the `.contractingProcesses` array to which the disbursement relates and add a `Transaction` object to its `.summary.transactions` array. Otherwise, if the disbursement relates to the project, for example a payment from a funder to the public authority, add a `Transaction` object to the project-level `.transactions` array.
* Set the transaction's:
* `.id` incrementally
* `.date` to the date of the disbursement
* `.value` to the amount and currency of the disbursement

* Get the `Organization` in `.parties` that represents the payer. If none exists yet, [add an organization](../common.md#add-an-organization) for the payer:
* Add 'payer' to the organization's `.roles` array
* Set the transaction's `.payer` to the `.id` and `.name` of the organization
* Get the `Organization` in `.parties` that represents the payee. If none exists yet, [add an organization](../common.md#add-an-organization) for the payee:
* Add 'payee' to the organization's `.roles` array.
* Set the transaction's `.payee` to the `.id` and `.name` of the organization
* Get the `Milestone` in `.milestones` that represents that planned disbursement:
* Set its `.status` to 'met'
* Set its `.dateMet` to the date of the disbursement
* Set the transaction's `.relatedImplementationMilestone` to the `.id` and `.title` of the milestone
```json

{
"milestones": [
{
"id": "1",
"title": "Grant disbursement"
"status": "met",
"dueDate": "2023-07-01T00:00:00Z",
"dateMet": "2023-08-01T00:00:00Z",
"type": "payment",
"value": {
"amount": 5000000,
"currency": "USD"
}
}
],
"transactions": [
{
"id": "1",
"date": "2023-08-01T00:00:00Z",
"value": {
"amount": 5000000,
"currency": "USD"
},
"payer": {
"id": "1",
"name": "United Nations Development Programme"
},
"payee": {
"id": "2",
"name": "Ministry of works"
},
"relatedImplementationMilestone": {
"id": "1",
"title": "Grant disbursement"
}
}
]
}
```
````

Expand Down
54 changes: 54 additions & 0 deletions docs/examples/blank.json
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,23 @@
},
"uri": "string"
}
],
"milestones": [
{
"id": "string",
"title": "string",
"type": "string from milestoneType codelist",
"description": "string",
"code": "string from milestoneCode codelist",
"dueDate": "string",
"dateMet": "string",
"dateModified": "string",
"status": "string from milestoneStatus codelist",
"relatedImplementationMilestone": {
"id": "string",
"title": "title"
}
}
]
},
"releases": [
Expand Down Expand Up @@ -352,6 +369,43 @@
]
}
],
"transactions": [
{
"id": "",
"source": "string",
"date": "string",
"value": {
"amount": "number",
"currency": "string from currency codelist"
},
"payer": {
"name": "string",
"id": ""
},
"payee": {
"name": "string",
"id": ""
},
"uri": "string"
}
],
"milestones": [
{
"id": "string",
"title": "string",
"type": "string from milestoneType codelist",
"description": "string",
"code": "string from milestoneCode codelist",
"dueDate": "string",
"dateMet": "string",
"dateModified": "string",
"status": "string from milestoneStatus codelist",
"relatedImplementationMilestone": {
"id": "string",
"title": "title"
}
}
],
"completion": {
"endDate": "",
"endDateDetails": "",
Expand Down
64 changes: 62 additions & 2 deletions docs/examples/example.json
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,8 @@
"procuringEntity",
"buyer",
"publicAuthority",
"funder"
"funder",
"payee"
],
"people": [
{
Expand Down Expand Up @@ -344,6 +345,11 @@
"jobTitle": "Commercial Contract Officer"
}
]
},
{
"id": "1",
"name": "United Nations Development Programme",
"roles": "payer"
}
],
"publicAuthority": {
Expand Down Expand Up @@ -549,6 +555,20 @@
"amount": 35250000,
"currency": "GBP"
},
"milestones": [
{
"id": "1",
"title": "Construction payment",
"status": "met",
"dueDate": "2017-08-07T00:00:00Z",
"dateMet": "2017-08-07T00:00:00Z",
"type": "payment",
"value": {
"amount": 1950000,
"currency": "GBP"
}
}
],
"transactions": [
{
"id": "ocds-a1b1c1-c9b14c18-adc8-11e6-9901-0019b9f3037b-00001-1",
Expand All @@ -566,7 +586,11 @@
"name": "Concrete Motorways Construction",
"id": "GB-COH-33333333"
},
"uri": "https://openspending.org/motorways-uk-spending/transaction/xyz123"
"uri": "https://openspending.org/motorways-uk-spending/transaction/xyz123",
"relatedImplementationMilestone": {
"id": "1",
"title": "Construction payment"
}
}
],
"documents": [
Expand Down Expand Up @@ -889,6 +913,42 @@
]
}
],
"milestones": [
{
"id": "1",
"title": "Grant disbursement",
"status": "met",
"dueDate": "2016-01-01T00:00:00Z",
"dateMet": "2016-01-01T00:00:00Z",
"type": "payment",
"value": {
"amount": 5000000,
"currency": "GBP"
}
}
],
"transactions": [
{
"id": "1",
"date": "2016-01-01T00:00:00Z",
"value": {
"amount": 5000000,
"currency": "GBP"
},
"payer": {
"id": "1",
"name": "United Nations Development Programme"
},
"payee": {
"id": "GB-GOR-XX1234",
"name": "Motorways UK"
},
"relatedImplementationMilestone": {
"id": "1",
"title": "Grant disbursement"
}
}
],
"completion": {
"endDate": "2018-12-10T00:00:00Z",
"endDateDetails": "Construction was delayed due to excavation problems when a watercourse was damaged.",
Expand Down
8 changes: 8 additions & 0 deletions docs/reference/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,20 @@
* [#379](https://github.com/open-contracting/infrastructure/pull/379) - add `contractingProcesses.summary.tender.datePublished`.
* [#378](https://github.com/open-contracting/infrastructure/pull/378) - clarify semantics of `additionalClassifications`.
* [#390](https://github.com/open-contracting/infrastructure/pull/390) - add `identifiers`.
* [#426](https://github.com/open-contracting/infrastructure/pull/426) - add fields:
* `.transactions`
* `.milestones`
* `ContractingProcesses.milestones`

### Codelists

* [#355](https://github.com/open-contracting/infrastructure/pull/355) - use correct normative and non-normative keywords codelist descriptions.
* [#369](https://github.com/open-contracting/infrastructure/pull/369) - add classification scheme codelist.
* [#377](https://github.com/open-contracting/infrastructure/pull/377) - clarify business logic in contractingProcessStatus codelist.
* [#426](https://github.com/open-contracting/infrastructure/pull/426) - add codelists:
* milestoneType
* milestoneStatus
* milestoneCode

### Other

Expand Down
9 changes: 9 additions & 0 deletions docs/reference/codelists.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ OC4IDS reuses some codelists from the Open Contracting Data Standard and its ext
* [Organization identifier scheme](https://standard.open-contracting.org/1.1/en/schema/codelists/#organization-identifier-scheme)
* [Release tag](https://standard.open-contracting.org/1.1/en/schema/codelists/#release-tag)
* [Unit classification scheme](https://standard.open-contracting.org/1.1/en/schema/codelists/#unit-classification-scheme)
* [Milestone status](https://standard.open-contracting.org/1.1/en/schema/codelists/#milestone-status)
* [Milestone code](https://standard.open-contracting.org/profiles/ppp/latest/en/reference/codelists/#milestonecode)

## Closed codelists

Expand Down Expand Up @@ -58,6 +60,13 @@ Projects with a `status` of 'completed' may be displayed in a list of archived p
:file: ../../build/current_lang/codelists/projectType.csv
```

### MilestoneType

```{csv-table-no-translate}
:header-rows: 1
:file: ../../build/current_lang/codelists/milestoneType.csv
```

## Open codelists

### DocumentType
Expand Down
Loading