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 maintenance code to projectType #493

Merged
merged 3 commits into from
Sep 26, 2024
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
6 changes: 6 additions & 0 deletions docs/reference/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@
* [#475](https://github.com/open-contracting/infrastructure/pull/475) - conservationMeasure:
* 'airManagement'
* 'waterManagement'
* [#493](https://github.com/open-contracting/infrastructure/pull/493) - projectType:
* 'maintenance'
* Update code definitions:
* [#493](https://github.com/open-contracting/infrastructure/pull/493) - projectType:
* 'rehabilitation'
* 'expansion'

### Other

Expand Down
2 changes: 1 addition & 1 deletion docs/reference/schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The top-level object in OC4IDS is a project.

A project is defined as:

> The development of a set of infrastructure assets in a specified location, generally the responsibility of a single procuring entity and budget authority: for example, a highway overpass or a university campus.
> The development, maintenance, rehabilitation, expansion, replacement and/or decommissioning of a set of infrastructure assets in a specified location, generally the responsibility of a single procuring entity and budget authority: for example, a highway overpass or a university campus. Development covers project identification, preparation, implementation and completion.

A project's fields include:

Expand Down
12 changes: 8 additions & 4 deletions manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def _get_definition_references(schema, defn, parents=None, project_schema=None,
defn,
[*parents, key, "0"],
project_schema,
include_nested,
include_nested=include_nested,
)
)
elif "$ref" in value:
Expand All @@ -168,17 +168,21 @@ def _get_definition_references(schema, defn, parents=None, project_schema=None,
defn,
[*parents, key],
project_schema,
include_nested,
include_nested=include_nested,
)
)
elif "properties" in value:
references.extend(
_get_definition_references(value, defn, [*parents, key], project_schema, include_nested)
_get_definition_references(
value, defn, [*parents, key], project_schema, include_nested=include_nested
)
)

if "definitions" in schema:
for key, value in schema["definitions"].items():
references.extend(_get_definition_references(value, defn, [key], project_schema, include_nested))
references.extend(
_get_definition_references(value, defn, [key], project_schema, include_nested=include_nested)
)

return references

Expand Down
5 changes: 3 additions & 2 deletions schema/project-level/codelists/projectType.csv
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Code,Title,Description
construction,Construction,The primary focus of this project is the construction of a new asset.
rehabilitation,Rehabilitation,The primary focus of this project is the rehabilitation of an existing asset.
maintenance,Maintenance,The primary focus of this project is proactively identifying and addressing deficiencies in an existing asset to slow the deterioration of the asset.
rehabilitation,Rehabilitation,The primary focus of this project is reactively addressing significant deficiencies in an existing asset to stop the deterioration of the asset.
replacement,Replacement,The primary focus of this project is the replacement of an existing asset.
expansion,Expansion,The primary focus of this project is the expansion of an existing asset.
expansion,Expansion,The primary focus of this project is the expansion or upgrade of an existing asset.
decommissioning,Decommissioning,The primary focus of this project is the decommissioning of an existing asset.
3 changes: 2 additions & 1 deletion schema/project-level/project-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "https://standard.open-contracting.org/infrastructure/schema/0__9__5/project-schema.json",
"title": "Open Contracting for Infrastructure Data Standard Schema",
"description": "The Open Contracting for Infrastructure Data Standard (OC4IDS) schema sets out a data structure for capturing and exchanging information about infrastructure projects in line with the disclosure requirements of the [CoST Infrastructure Data Standard](https://infrastructuretransparency.org/resource/977/). OC4IDS defines an \"infrastructure project\" as: \"the development, maintenance and decommissioning of a set of infrastructure assets in a specified location, generally the responsibility of a single procuring entity and budget authority: for example, a highway overpass or a university campus. Development covers project identification, preparation, implementation and completion.\"",
"description": "The Open Contracting for Infrastructure Data Standard (OC4IDS) schema sets out a data structure for capturing and exchanging information about infrastructure projects in line with the disclosure requirements of the [CoST Infrastructure Data Standard](https://infrastructuretransparency.org/resource/977/). OC4IDS defines an \"infrastructure project\" as: \"the development, maintenance, rehabilitation, expansion, replacement and/or decommissioning of a set of infrastructure assets in a specified location, generally the responsibility of a single procuring entity and budget authority: for example, a highway overpass or a university campus. Development covers project identification, preparation, implementation and completion.\"",
"type": "object",
"required": [
"id"
Expand Down Expand Up @@ -145,6 +145,7 @@
"type": "string",
"enum": [
"construction",
"maintenance",
"rehabilitation",
"replacement",
"expansion",
Expand Down