From 33f480d1a5ffc48fafd707c260f61d91ef809eab Mon Sep 17 00:00:00 2001 From: odscjen Date: Tue, 14 Nov 2023 16:58:59 +0000 Subject: [PATCH 1/6] add environment.goals and environmentalGoal.csv --- docs/_static/i18n.csv | 3 + docs/cost/ids/sustainability.md | 61 +++++++++++-------- docs/examples/blank.json | 5 ++ docs/examples/example.json | 5 ++ docs/reference/schema.md | 35 +++++++++++ mapping/sustainability.yaml | 6 +- .../codelists/environmentalGoal.csv | 3 + schema/project-level/project-schema.json | 25 ++++++++ 8 files changed, 113 insertions(+), 30 deletions(-) create mode 100644 schema/project-level/codelists/environmentalGoal.csv diff --git a/docs/_static/i18n.csv b/docs/_static/i18n.csv index 45a581b6..12a875d1 100644 --- a/docs/_static/i18n.csv +++ b/docs/_static/i18n.csv @@ -366,3 +366,6 @@ completion/finalValueDetails,Final value details,True, completion/finalScope,Final scope,True, completion/finalScopeDetails,Final scope details,True, language,Language,True, +environment,Environment,False, +environment,Environment,False, +environment/goals,Environmental goals,False, diff --git a/docs/cost/ids/sustainability.md b/docs/cost/ids/sustainability.md index d89df18e..70e9ea90 100644 --- a/docs/cost/ids/sustainability.md +++ b/docs/cost/ids/sustainability.md @@ -837,12 +837,12 @@ Eg: :columns: 8 OC4IDS mapping ^^^ -Project level: Add the relevant code from the climateChangeGoal codelist to the `environment.climateChangeGoal` array +Project level: Add the relevant code from the environmentalGoal codelist to the `environment.goals` array ```json { "environment": { - "climateChangeGoals": [ - "mitigation" + "goals": [ + "climateChangeMitigation" ] } } @@ -1466,38 +1466,45 @@ 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 +- 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 +- 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" + "title": "Grant disbursement", "status": "met", "dueDate": "2023-07-01T00:00:00Z", "dateMet": "2023-08-01T00:00:00Z", diff --git a/docs/examples/blank.json b/docs/examples/blank.json index 488b17a2..c60936e5 100644 --- a/docs/examples/blank.json +++ b/docs/examples/blank.json @@ -416,5 +416,10 @@ "finalValueDetails": "", "finalScope": "", "finalScopeDetails": "" + }, + "environment": { + "goals": [ + "string" + ] } } diff --git a/docs/examples/example.json b/docs/examples/example.json index 0e501ca7..a3f16984 100644 --- a/docs/examples/example.json +++ b/docs/examples/example.json @@ -959,6 +959,11 @@ "finalValueDetails": "Budget increase due to construction delay.", "finalScope": "Upgrade of Junctions 4 and 5 and repairs to the watercourse at Junction 5.", "finalScopeDetails": "Scope was expanded to include repairs to a watercourse damaged during construction excavation." + }, + "environment": { + "goals": [ + "climateChangeMitigation" + ] } } ] diff --git a/docs/reference/schema.md b/docs/reference/schema.md index 23e72b19..6d681c45 100644 --- a/docs/reference/schema.md +++ b/docs/reference/schema.md @@ -1076,3 +1076,38 @@ Each `MilestoneReference` has the following fields: ```` ````` + +### Environment + +`Environment` is defined as: + +```{field-description} ../../build/current_lang/project-schema.json /definitions/Environment +``` + +This sub-schema is referenced by the following properties: +* [`environment`](project-schema.json,,environment) + +Each `Environment` has the following fields: + +`````{tab-set} + +````{tab-item} Schema + +```{jsonschema} ../../build/current_lang/project-schema.json +:pointer: /definitions/Environment +:collapse: goals +:addtargets: +``` + +```` + +````{tab-item} Examples + +```{jsoninclude} ../../docs/examples/example.json +:jsonpointer: /projects/0/environment +:title: environment +``` + +```` + +````` diff --git a/mapping/sustainability.yaml b/mapping/sustainability.yaml index f11e6f83..bb83295e 100644 --- a/mapping/sustainability.yaml +++ b/mapping/sustainability.yaml @@ -486,12 +486,12 @@ - mitigation - adaptation - cross-cutting - mapping: 'Project level: Add the relevant code from the climateChangeGoal codelist to the `environment.climateChangeGoal` array' + mapping: 'Project level: Add the relevant code from the environmentalGoal codelist to the `environment.goals` array' example: |- { "environment": { - "climateChangeGoals": [ - "mitigation" + "goals": [ + "climateChangeMitigation" ] } } diff --git a/schema/project-level/codelists/environmentalGoal.csv b/schema/project-level/codelists/environmentalGoal.csv new file mode 100644 index 00000000..609e1bc4 --- /dev/null +++ b/schema/project-level/codelists/environmentalGoal.csv @@ -0,0 +1,3 @@ +Code,Title,Description,Source +climateChangeAdaptation,Climate change adaptation,"Adjustment to actual or expected climate and its effects, in order to moderate harm or exploit beneficial opportunities.",OC4IDS +climateChangeMitigation,Climate change mitigation,Reduction of emissions or enhancement of the sinks of greenhouse gases.,OC4IDS diff --git a/schema/project-level/project-schema.json b/schema/project-level/project-schema.json index 31606722..55a9972c 100644 --- a/schema/project-level/project-schema.json +++ b/schema/project-level/project-schema.json @@ -296,6 +296,31 @@ ], "default": "en", "minLength": 1 + }, + "environment": { + "title": "Environment", + "description": "Information about the environmental and climate impact of the project and actions the project will take to mitigate potentially negative impacts on adjacent populations and habitats.", + "type": "object", + "properties": { + "goals": { + "title": "Environmental goals", + "description": "The environmental goals pursued, using the closed environmentalGoal codelist.", + "type": [ + "array" + ], + "items": { + "type": "string", + "enum": [ + "climateChangeAdaptation", + "climateChangeMitigation" + ] + }, + "codelist": "environmentalGoal.csv", + "openCodelist": false, + "minItems": 1 + } + }, + "minProperties": 1 } }, "definitions": { From df8bee916bded66a6c72927550a2a356658480b2 Mon Sep 17 00:00:00 2001 From: odscjen Date: Tue, 14 Nov 2023 17:01:23 +0000 Subject: [PATCH 2/6] update codelists.md --- docs/reference/codelists.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/reference/codelists.md b/docs/reference/codelists.md index f1246301..3c603e67 100644 --- a/docs/reference/codelists.md +++ b/docs/reference/codelists.md @@ -67,6 +67,13 @@ Projects with a `status` of 'completed' may be displayed in a list of archived p :file: ../../build/current_lang/codelists/milestoneType.csv ``` +### EnvironmentalGoal + +```{csv-table-no-translate} +:header-rows: 1 +:file: ../../build/current_lang/codelists/environmentalGoal.csv +``` + ## Open codelists ### DocumentType From 2c84fc83179767b922645b8f594da78b9694a520 Mon Sep 17 00:00:00 2001 From: odscjen Date: Tue, 14 Nov 2023 17:03:34 +0000 Subject: [PATCH 3/6] update changelog.md --- docs/reference/changelog.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/reference/changelog.md b/docs/reference/changelog.md index ff4f09f9..94b45c87 100644 --- a/docs/reference/changelog.md +++ b/docs/reference/changelog.md @@ -28,6 +28,7 @@ * `.transactions` * `.milestones` * `ContractingProcesses.milestones` +* [#431](https://github.com/open-contracting/infrastructure/pull/431) - add `environment.goals`. ### Codelists @@ -38,6 +39,7 @@ * milestoneType * milestoneStatus * milestoneCode +* [#431](https://github.com/open-contracting/infrastructure/pull/431) - add environmentalGoal codelist. ### Other From ca29b77d8b34d0a0c4dccfd14a1204ce946961e7 Mon Sep 17 00:00:00 2001 From: odscjen Date: Tue, 14 Nov 2023 17:06:24 +0000 Subject: [PATCH 4/6] run pre-commit --- docs/_static/i18n.csv | 1 - docs/reference/schema.md | 35 ----------------------------------- 2 files changed, 36 deletions(-) diff --git a/docs/_static/i18n.csv b/docs/_static/i18n.csv index 12a875d1..5b11b123 100644 --- a/docs/_static/i18n.csv +++ b/docs/_static/i18n.csv @@ -367,5 +367,4 @@ completion/finalScope,Final scope,True, completion/finalScopeDetails,Final scope details,True, language,Language,True, environment,Environment,False, -environment,Environment,False, environment/goals,Environmental goals,False, diff --git a/docs/reference/schema.md b/docs/reference/schema.md index 6d681c45..23e72b19 100644 --- a/docs/reference/schema.md +++ b/docs/reference/schema.md @@ -1076,38 +1076,3 @@ Each `MilestoneReference` has the following fields: ```` ````` - -### Environment - -`Environment` is defined as: - -```{field-description} ../../build/current_lang/project-schema.json /definitions/Environment -``` - -This sub-schema is referenced by the following properties: -* [`environment`](project-schema.json,,environment) - -Each `Environment` has the following fields: - -`````{tab-set} - -````{tab-item} Schema - -```{jsonschema} ../../build/current_lang/project-schema.json -:pointer: /definitions/Environment -:collapse: goals -:addtargets: -``` - -```` - -````{tab-item} Examples - -```{jsoninclude} ../../docs/examples/example.json -:jsonpointer: /projects/0/environment -:title: environment -``` - -```` - -````` From 840a29a1ecd9d2da66b19cb3750244651997be51 Mon Sep 17 00:00:00 2001 From: odscjen <95221058+odscjen@users.noreply.github.com> Date: Thu, 16 Nov 2023 09:17:01 +0000 Subject: [PATCH 5/6] Apply suggestions from code review Co-authored-by: Duncan Dewhurst --- mapping/sustainability.yaml | 2 +- schema/project-level/project-schema.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mapping/sustainability.yaml b/mapping/sustainability.yaml index bb83295e..f7697338 100644 --- a/mapping/sustainability.yaml +++ b/mapping/sustainability.yaml @@ -486,7 +486,7 @@ - mitigation - adaptation - cross-cutting - mapping: 'Project level: Add the relevant code from the environmentalGoal codelist to the `environment.goals` array' + mapping: 'Project level: Add the relevant codes from the environmentalGoal codelist to the `environment.goals` array' example: |- { "environment": { diff --git a/schema/project-level/project-schema.json b/schema/project-level/project-schema.json index 55a9972c..07b73b5c 100644 --- a/schema/project-level/project-schema.json +++ b/schema/project-level/project-schema.json @@ -304,7 +304,7 @@ "properties": { "goals": { "title": "Environmental goals", - "description": "The environmental goals pursued, using the closed environmentalGoal codelist.", + "description": "The environmental goals pursued, using the closed [environmentalGoal codelist](https://standard.open-contracting.org/infrastructure/{{version}}/{{lang}}/reference/codelists/#environmentalgoal).", "type": [ "array" ], From c763a4bae3047af1ab65d9bf4acea45346dc332d Mon Sep 17 00:00:00 2001 From: odscjen <95221058+odscjen@users.noreply.github.com> Date: Tue, 21 Nov 2023 09:30:06 +0000 Subject: [PATCH 6/6] Apply suggestions from code review Co-authored-by: James McKinney <26463+jpmckinney@users.noreply.github.com> --- schema/project-level/project-schema.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/schema/project-level/project-schema.json b/schema/project-level/project-schema.json index 35251e48..a685fbda 100644 --- a/schema/project-level/project-schema.json +++ b/schema/project-level/project-schema.json @@ -299,12 +299,12 @@ }, "environment": { "title": "Environment", - "description": "Information about the environmental and climate impact of the project and actions the project will take to mitigate potentially negative impacts on adjacent populations and habitats.", + "description": "Information about the environmental and climate impacts of the project and the actions the project will take to mitigate potentially negative impacts on adjacent populations and habitats.", "type": "object", "properties": { "goals": { "title": "Environmental goals", - "description": "The environmental goals pursued, using the closed [environmentalGoal codelist](https://standard.open-contracting.org/infrastructure/{{version}}/{{lang}}/reference/codelists/#environmentalgoal).", + "description": "The environmental goals pursued, using the closed [environmentalGoal](https://standard.open-contracting.org/infrastructure/{{version}}/{{lang}}/reference/codelists/#environmentalgoal) codelist.", "type": [ "array" ],