-
Notifications
You must be signed in to change notification settings - Fork 13
feat: add alternative combined anonymous instance identifier (#54) #62
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
.../gts.x.core.events.type_combined_id.v1~x.commerce.orders.order_placed.v1.0~.examples.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| [ | ||
| { | ||
| "id": "gts.x.core.events.type_combined.v1~x.commerce.orders.order_placed.v1.0~7a1d2f34-5678-49ab-9012-abcdef123456", | ||
| "tenantId": "11111111-2222-3333-4444-555555555555", | ||
| "userId": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", | ||
| "clientId": "12345678-90ab-cdef-1234-567890abcdef", | ||
| "source": "orders-service@1.2.3", | ||
| "occurredAt": "2025-09-20T18:35:00Z", | ||
| "ingestedAt": "2025-09-20T18:35:01Z", | ||
| "sequenceNumber": 1, | ||
| "previousSequenceNumber": 0, | ||
| "subject": "af0e3c1b-8f1e-4a27-9a9b-b7b9b70c1f01", | ||
| "subjectType": "gts.x.commerce.orders.order.v1.0~", | ||
| "payload": { | ||
| "orderId": "af0e3c1b-8f1e-4a27-9a9b-b7b9b70c1f01", | ||
| "customerId": "0f2e4a9b-1c3d-4e5f-8a9b-0c1d2e3f4a5b", | ||
| "totalAmount": 149.99, | ||
| "items": [ | ||
| { "sku": "SKU-ABC-001", "name": "Wireless Mouse", "qty": 1, "price": 49.99 }, | ||
| { "sku": "SKU-XYZ-002", "name": "Mechanical Keyboard", "qty": 1, "price": 100.0 } | ||
| ] | ||
| } | ||
| } | ||
| ] | ||
|
mattgarmon marked this conversation as resolved.
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
85 changes: 85 additions & 0 deletions
85
examples/events/schemas/gts.x.core.events.type_combined.v1~.schema.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| { | ||
| "$id": "gts://gts.x.core.events.type_combined.v1~", | ||
| "$schema": "http://json-schema.org/draft-07/schema#", | ||
| "title": "Event Envelope (Combined Anonymous Instance ID)", | ||
| "type": "object", | ||
| "description": "Base event type definition (combined anonymous instance id)", | ||
| "required": [ | ||
| "id", | ||
| "tenantId", | ||
| "occurredAt" | ||
| ], | ||
| "x-event-type-settings": { | ||
| "additionalProperties": false, | ||
| "topicRef": { | ||
| "description": "ID of the topic where events of this type are stored.", | ||
| "type": "string", | ||
| "x-gts-ref":"gts.x.core.events.topic.v1~" | ||
| } | ||
| }, | ||
| "properties": { | ||
| "$schema": { | ||
| "description": "Link to the event type schema.", | ||
| "type": "string" | ||
| }, | ||
| "id": { | ||
| "description": "GTS instance identifier including the type chain and instance UUID.", | ||
| "type": "string", | ||
| "x-gts-ref": "gts.x.core.events.type_combined.v1~*" | ||
| }, | ||
| "tenantId": { | ||
| "type": "string", | ||
| "format": "uuid", | ||
| "description": "The id of the tenant that produced the event. Mandatory" | ||
| }, | ||
| "userId": { | ||
| "type": "string", | ||
| "format": "uuid", | ||
| "description": "The id of the user that produced the event. Optional" | ||
| }, | ||
| "clientId": { | ||
| "type": "string", | ||
| "format": "uuid", | ||
| "description": "The id of the API client that produced the event. Optional" | ||
| }, | ||
| "source": { | ||
| "description": "Full SemVer of the event type schema used to produce this event.", | ||
| "type": "string", | ||
| "maxLength": 256 | ||
| }, | ||
| "occurredAt": { | ||
| "type": "string", | ||
| "format": "date-time", | ||
| "description": "The time the event occurred. Fully controlled by the producer" | ||
| }, | ||
| "ingestedAt": { | ||
| "type": "string", | ||
| "format": "date-time", | ||
| "description": "The time the event was ingested into the event store.", | ||
| "readOnly": true | ||
| }, | ||
|
mattgarmon marked this conversation as resolved.
|
||
| "sequenceNumber": { | ||
| "type": "number", | ||
| "description": "The sequence number of the event in the stream." | ||
| }, | ||
| "previousSequenceNumber": { | ||
| "type": "number", | ||
| "description": "The sequence number of the previous event in the same stream." | ||
| }, | ||
| "payload": { | ||
| "description": "Type-specific body; see event type schema.", | ||
| "type": "object" | ||
| }, | ||
| "subject": { | ||
| "description": "The subject of the event.", | ||
| "type": "string" | ||
| }, | ||
| "subjectType": { | ||
| "description": "GTS type of the subject of the event.", | ||
| "type": "string", | ||
| "x-gts-ref": "gts.*", | ||
| "$comment": "The value is mandatory if subject is present" | ||
| } | ||
| }, | ||
| "additionalProperties": false | ||
| } | ||
33 changes: 33 additions & 0 deletions
33
...hemas/gts.x.core.events.type_combined.v1~x.commerce.orders.order_placed.v1.0~.schema.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| { | ||
| "$id": "gts://gts.x.core.events.type_combined.v1~x.commerce.orders.order_placed.v1.0~", | ||
| "$schema": "http://json-schema.org/draft-07/schema#", | ||
| "title": "Event Instance Schema (Combined Anonymous Instance ID): order.placed", | ||
| "type": "object", | ||
| "allOf": [ | ||
| { "$ref": "gts://gts.x.core.events.type_combined.v1~" }, | ||
| { | ||
| "type": "object", | ||
| "required": ["payload", "subjectType"], | ||
| "properties": { | ||
| "id": { | ||
| "type": "string", | ||
| "x-gts-ref": "gts.x.core.events.type_combined.v1~x.commerce.orders.order_placed.v1.0~*" | ||
| }, | ||
| "payload": { | ||
| "type": "object", | ||
| "required": ["orderId", "customerId", "totalAmount", "items"], | ||
| "properties": { | ||
| "orderId": { "type": "string", "format": "uuid" }, | ||
| "customerId": { "type": "string", "format": "uuid" }, | ||
| "totalAmount": { "type": "number" }, | ||
| "items": { "type": "array", "items": { "type": "object" } } | ||
| } | ||
| }, | ||
| "subjectType": { | ||
| "type": "string", | ||
| "x-gts-ref": "gts.x.commerce.orders.order.v1.0~" | ||
| } | ||
| } | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.