Skip to content

Commit 751db1a

Browse files
committed
refactor: terminology and schema consistency pass
Signed-off-by: Jeremy Ho <jujaga@gmail.com>
1 parent 1288e1d commit 751db1a

7 files changed

Lines changed: 25 additions & 22 deletions

File tree

docs/spec/code_system/asset_kind.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Official URL: `https://bcgov.github.io/nr-pies/docs/spec/code_system/asset_kind`
1313

1414
This Code System is used or referenced by:
1515

16+
- Element Definition: [Asset](/docs/spec/element/data/asset)
1617
- Value Set: [TBD](.)
1718

1819
## Definition

docs/spec/code_system/message_kind.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ Not Applicable
2727

2828
### Concepts
2929

30-
| Code | Display | Description |
31-
| --------- | ------- | ---------------------------------------------------------------------------------------------------------- |
32-
| `GROUP` | Group | The message represents a grouping or collection of related records. |
33-
| `LINKAGE` | Linkage | The message represents a linkage between records. |
34-
| `RECORD` | Record | The message represents a record resource, containing on hold period information and process event history. |
30+
| Code | Display | Description |
31+
| --------- | ------- | ------------------------------------------------------------------ |
32+
| `GROUP` | Group | The message represents a grouping or collection of related assets. |
33+
| `LINKAGE` | Linkage | The message represents a linkage between assets. |
34+
| `RECORD` | Record | The message represents information pertaining to the asset itself. |
3535

3636
## Errata

docs/spec/element/data/asset.schema.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,6 @@
2929
"enum": ["Anchor", "Permit"]
3030
}
3131
},
32+
"anyOf": [{ "required": ["asset_id", "asset_kind"] }, { "required": ["record_id", "record_kind"] }],
3233
"required": ["system_id"]
3334
}

docs/spec/element/data/collection.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$id": "https://raw.githubusercontent.com/bcgov/nr-pies/refs/heads/main/docs/spec/element/resource/collection.schema.json",
2+
"$id": "https://raw.githubusercontent.com/bcgov/nr-pies/refs/heads/main/docs/spec/element/data/collection.schema.json",
33
"$schema": "http://json-schema.org/draft-07/schema#",
44
"title": "Collection",
55
"description": "Represents a collection.",

docs/spec/element/message/record.mdx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@ Represents a message envelope for transmitting asset records.
3030
This message type serves as a transport envelope for transmitting records between systems. A Record message combines
3131
Header metadata (transaction tracking, asset identification) with a resource payload selected via `asset_kind`.
3232

33-
The Record message can be composed of either an [Anchor](/docs/spec/element/resource/anchor) or
34-
[Permit](/docs/spec/element/resource/permit) resource type defined in the specification. Refer to the
35-
[Type Hierarchy](/docs/spec#hierarchy) for how messages, resources and data types compose together.
33+
The Record message can be composed of either an [Anchor](/docs/spec/element/resource/anchor),
34+
[Permit](/docs/spec/element/resource/permit), or [Project](/docs/spec/element/resource/project) resource type defined in
35+
the specification. Refer to the [Type Hierarchy](/docs/spec#hierarchy) for how messages, resources and data types
36+
compose together.
3637

3738
## Structure
3839

@@ -52,9 +53,9 @@ Records shall declare an `asset_kind` property value as defined in
5253

5354
The `asset_kind` field acts as a type selector, binding and identifying which resource type this message contains:
5455

55-
-- **asset_kind: `ANCHOR`** - Message payload conforms to [Anchor](/docs/spec/element/resource/anchor) resource schema
56-
-- **asset_kind: `PERMIT`** - Message payload conforms to [Permit](/docs/spec/element/resource/permit) resource schema
57-
-- **asset_kind: `PROJECT`** - Message payload conforms to [Project](/docs/spec/element/resource/project) resource schema
56+
- **asset_kind: `ANCHOR`** - Message payload conforms to [Anchor](/docs/spec/element/resource/anchor) resource schema
57+
- **asset_kind: `PERMIT`** - Message payload conforms to [Permit](/docs/spec/element/resource/permit) resource schema
58+
- **asset_kind: `PROJECT`** - Message payload conforms to [Project](/docs/spec/element/resource/project) resource schema
5859

5960
This selection is enforced at the schema level via conditional `if/then` logic.
6061

docs/spec/element/message/record.schema.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,6 @@
88
{
99
"$ref": "https://raw.githubusercontent.com/bcgov/nr-pies/refs/heads/main/docs/spec/element/data/header.schema.json"
1010
},
11-
{
12-
"title": "Anchor",
13-
"description": "Represents an anchor via asset_kind.",
14-
"type": "object",
15-
"if": { "properties": { "asset_kind": { "const": "ANCHOR" } } },
16-
"then": {
17-
"$ref": "https://raw.githubusercontent.com/bcgov/nr-pies/refs/heads/main/docs/spec/element/resource/anchor.schema.json"
18-
}
19-
},
2011
{
2112
"title": "Permit",
2213
"description": "Represents a permit via asset_kind.",
@@ -35,6 +26,15 @@
3526
"$ref": "https://raw.githubusercontent.com/bcgov/nr-pies/refs/heads/main/docs/spec/element/resource/permit.schema.json"
3627
}
3728
},
29+
{
30+
"title": "Anchor",
31+
"description": "Represents an anchor via asset_kind.",
32+
"type": "object",
33+
"if": { "properties": { "asset_kind": { "const": "ANCHOR" } } },
34+
"then": {
35+
"$ref": "https://raw.githubusercontent.com/bcgov/nr-pies/refs/heads/main/docs/spec/element/resource/anchor.schema.json"
36+
}
37+
},
3838
{
3939
"title": "Project",
4040
"description": "Represents a project via asset_kind.",

docs/spec/element/resource/project.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ are selected.
3434

3535
## Structure
3636

37-
A header shall contain every [Collection](/docs/spec/element/data/collection#structure) data property.
37+
A project shall contain every [Collection](/docs/spec/element/data/collection#structure) data property.
3838

3939
This structure contains no properties and is functionally equivalent to an empty object.
4040

0 commit comments

Comments
 (0)