Skip to content
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: 3 additions & 3 deletions .config/mise/tasks/compose/restore-drill
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ from pathlib import Path
d = Path(sys.argv[1])
names = lambda p: sorted(n[0] for n in json.loads((d / f"scope.{p}.json").read_text())["namespaces"])
expect = {
"acme-agent": ["acme-customer-data-deletion", "acme-reviews", "acme-storefront"],
"acme-agent": ["acme", "acme-customer-data-deletion", "acme-fulfillment", "acme-reviews", "acme-storefront"],
"globex-agent": ["globex-orders", "ledger"],
"partner-reader": ["acme-reviews"],
}
Expand Down Expand Up @@ -249,8 +249,8 @@ touched="$src"
quiet dc "$src" up -d --wait --wait-timeout 300
use_stack "$src"

log "seeding acme fixtures as acme-agent (claims acme-* namespaces)"
trogon_atlas_as acme-agent apply -f "$manifests/acme-storefront" "$manifests/acme-reviews" "$manifests/acme-customer-data-deletion" >/dev/null
log "seeding acme fixtures as acme-agent (claims the acme and acme-* namespaces)"
trogon_atlas_as acme-agent apply -f "$manifests/acme" "$manifests/acme-storefront" "$manifests/acme-fulfillment" "$manifests/acme-reviews" "$manifests/acme-customer-data-deletion" >/dev/null

log "registering a minted namespace and seeding a second tenant as globex-agent"
drill call RegisterNamespace globex-agent '{"name":"ledger"}' >/dev/null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ spec:
doc: Owns the request-to-completion lifecycle of a customer data deletion, and dispatch to every downstream vendor.
realizes:
- id:
namespace: acme-customer-data-deletion
namespace: acme
slug: data-deletion
version: '1'
title: Acme Customer Data Deletion
13 changes: 0 additions & 13 deletions examples/manifests/acme-customer-data-deletion/domain.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ spec:
doc: Request-to-completion lifecycle of a customer data deletion across every downstream vendor.
members:
- id:
namespace: acme-customer-data-deletion
slug: customer-privacy
namespace: acme
slug: acme
version: '1'
kind: ENTITY_KIND_DOMAIN
- id:
namespace: acme-customer-data-deletion
namespace: acme
slug: data-deletion
version: '1'
kind: ENTITY_KIND_SUBDOMAIN
Expand Down
8 changes: 0 additions & 8 deletions examples/manifests/acme-customer-data-deletion/project.yaml

This file was deleted.

14 changes: 0 additions & 14 deletions examples/manifests/acme-customer-data-deletion/subdomain.yaml

This file was deleted.

43 changes: 43 additions & 0 deletions examples/manifests/acme-fulfillment/automation-slice.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
apiVersion: eventmodel.atlas.trogonstack.com/v1alpha1
kind: AutomationSlice
metadata:
name: mark-fulfilled-auto
namespace: acme-fulfillment
spec:
doc: Calls Acme Shipping Carrier to dispatch the order and records delivery confirmation.
emittedCommand:
command:
id:
namespace: acme-fulfillment
slug: mark-fulfilled
version: '1'
processor:
processor:
id:
namespace: acme-fulfillment
slug: carrier-dispatch-worker
version: '1'
scenarios:
- doc: Queue row.
given:
- readModel:
id:
namespace: acme-fulfillment
slug: fulfillment-queue
version: '1'
id: ok
then:
command:
id:
namespace: acme-fulfillment
slug: mark-fulfilled
version: '1'
title: Delivery confirmed
whenDoc: Acme Shipping Carrier confirms delivery.
sourceReadModels:
- readModel:
id:
namespace: acme-fulfillment
slug: fulfillment-queue
version: '1'
title: Dispatch to carrier
21 changes: 21 additions & 0 deletions examples/manifests/acme-fulfillment/bounded-context.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: eventmodel.atlas.trogonstack.com/v1alpha1
kind: BoundedContext
metadata:
name: acme-fulfillment
namespace: acme-fulfillment
spec:
doc: Owns dispatch of a paid order to the shipping carrier, delivery confirmation, and the shopper-facing order tracking.
realizes:
- id:
namespace: acme
slug: fulfillment
version: '1'
relationships:
- doc: Fulfillment needs the order.placed and order.paid facts shaped for dispatch and tracking, so it has a voice when Acme Storefront plans a change to them.
intent: INTENT_CUSTOMER_SUPPLIER
upstream:
id:
namespace: acme-storefront
slug: acme-storefront
version: '1'
title: Acme Fulfillment
37 changes: 37 additions & 0 deletions examples/manifests/acme-fulfillment/command-slice.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
apiVersion: eventmodel.atlas.trogonstack.com/v1alpha1
kind: CommandSlice
metadata:
name: mark-fulfilled-slice
namespace: acme-fulfillment
spec:
command:
command:
id:
namespace: acme-fulfillment
slug: mark-fulfilled
version: '1'
doc: Acme Shipping Carrier confirmed delivery.
emittedEvents:
- event:
id:
namespace: acme-fulfillment
slug: order.fulfilled
version: '1'
scenarios:
- doc: Delivery confirmed for a paid order from the fulfillment queue.
emit:
events:
- event:
id:
namespace: acme-fulfillment
slug: order.fulfilled
version: '1'
id: delivered
title: Delivery confirmed
when:
command:
id:
namespace: acme-fulfillment
slug: mark-fulfilled
version: '1'
title: Mark fulfilled
32 changes: 32 additions & 0 deletions examples/manifests/acme-fulfillment/command.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
apiVersion: eventmodel.atlas.trogonstack.com/v1alpha1
kind: Command
metadata:
name: mark-fulfilled
namespace: acme-fulfillment
spec:
doc: Worker-issued. Records that Acme Shipping Carrier confirmed delivery.
schema:
'@type': type.googleapis.com/trogonatlas.eventmodel.v1alpha1.Schema
fields:
- name: order_id
type:
uuid: {}
- name: buyer_id
type:
uuid: {}
- name: seller_id
type:
uuid: {}
- metadata:
- '@type': type.googleapis.com/trogonatlas.eventmodel.v1alpha1.DerivedFieldAnnotation
doc: now() when the worker records the outcome
kind: KIND_TIMESTAMP
name: fulfilled_at
type:
timestamp: {}
swimlane:
id:
namespace: acme-fulfillment
slug: fulfillment
version: '1'
title: Mark fulfilled
11 changes: 11 additions & 0 deletions examples/manifests/acme-fulfillment/component.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: eventmodel.atlas.trogonstack.com/v1alpha1
kind: Component
metadata:
name: carrier-dispatch-module
namespace: acme-fulfillment
spec:
doc: Code module housing the carrier-dispatch-worker's retry and backoff logic.
tech:
- worker
- queue
title: Carrier Dispatch Module
99 changes: 99 additions & 0 deletions examples/manifests/acme-fulfillment/event-model.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
apiVersion: eventmodel.atlas.trogonstack.com/v1alpha1
kind: EventModel
metadata:
name: acme-fulfillment-model
namespace: acme-fulfillment
spec:
doc: 'Carrier fulfillment: dispatching a paid order, confirming delivery, and showing the shopper where the order stands.'
members:
- id:
namespace: acme
slug: acme
version: '1'
kind: ENTITY_KIND_DOMAIN
- id:
namespace: acme
slug: fulfillment
version: '1'
kind: ENTITY_KIND_SUBDOMAIN
- id:
namespace: acme-fulfillment
slug: acme-fulfillment
version: '1'
kind: ENTITY_KIND_BOUNDED_CONTEXT
- id:
namespace: acme-fulfillment
slug: acme-shipping-carrier
version: '1'
kind: ENTITY_KIND_EXTERNAL_SYSTEM
- id:
namespace: acme-fulfillment
slug: carrier-dispatch-module
version: '1'
kind: ENTITY_KIND_COMPONENT
- id:
namespace: acme-fulfillment
slug: shopper
version: '1'
kind: ENTITY_KIND_PERSONA
- id:
namespace: acme-fulfillment
slug: fulfillment
version: '1'
kind: ENTITY_KIND_SWIMLANE
- id:
namespace: acme-fulfillment
slug: order.fulfilled
version: '1'
kind: ENTITY_KIND_EVENT
- id:
namespace: acme-fulfillment
slug: mark-fulfilled
version: '1'
kind: ENTITY_KIND_COMMAND
- id:
namespace: acme-fulfillment
slug: fulfillment-queue
version: '1'
kind: ENTITY_KIND_READ_MODEL
- id:
namespace: acme-fulfillment
slug: order-status
version: '1'
kind: ENTITY_KIND_READ_MODEL
- id:
namespace: acme-fulfillment
slug: carrier-dispatch-worker
version: '1'
kind: ENTITY_KIND_PROCESSOR
- id:
namespace: acme-fulfillment
slug: order-tracking
version: '1'
kind: ENTITY_KIND_UI
- id:
namespace: acme-fulfillment
slug: mark-fulfilled-slice
version: '1'
kind: ENTITY_KIND_COMMAND_SLICE
- id:
namespace: acme-fulfillment
slug: order-status-fulfilled-rms
version: '1'
kind: ENTITY_KIND_READ_MODEL_SLICE
- id:
namespace: acme-fulfillment
slug: mark-fulfilled-auto
version: '1'
kind: ENTITY_KIND_AUTOMATION_SLICE
- id:
namespace: acme-fulfillment
slug: order-tracking-ui-slice
version: '1'
kind: ENTITY_KIND_UI_SLICE
- id:
namespace: acme-fulfillment
slug: fulfillment-flow
version: '1'
kind: ENTITY_KIND_STORYBOARD
title: Acme Fulfillment
28 changes: 28 additions & 0 deletions examples/manifests/acme-fulfillment/event.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
apiVersion: eventmodel.atlas.trogonstack.com/v1alpha1
kind: Event
metadata:
name: order.fulfilled
namespace: acme-fulfillment
spec:
doc: Acme Shipping Carrier confirmed the order was delivered.
schema:
'@type': type.googleapis.com/trogonatlas.eventmodel.v1alpha1.Schema
fields:
- name: order_id
type:
uuid: {}
- name: buyer_id
type:
uuid: {}
- name: seller_id
type:
uuid: {}
- name: fulfilled_at
type:
timestamp: {}
swimlane:
id:
namespace: acme-fulfillment
slug: fulfillment
version: '1'
title: Order fulfilled
10 changes: 10 additions & 0 deletions examples/manifests/acme-fulfillment/external-system.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: eventmodel.atlas.trogonstack.com/v1alpha1
kind: ExternalSystem
metadata:
name: acme-shipping-carrier
namespace: acme-fulfillment
spec:
doc: Acme Shipping Carrier. Dispatches parcels and confirms delivery over a polled tracking API.
tech:
- carrier-api
title: Acme Shipping Carrier
9 changes: 9 additions & 0 deletions examples/manifests/acme-fulfillment/persona.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: eventmodel.atlas.trogonstack.com/v1alpha1
kind: Persona
metadata:
name: shopper
namespace: acme-fulfillment
spec:
doc: The customer following their paid order from dispatch to delivery.
role: customer
title: Shopper
14 changes: 14 additions & 0 deletions examples/manifests/acme-fulfillment/processor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: eventmodel.atlas.trogonstack.com/v1alpha1
kind: Processor
metadata:
name: carrier-dispatch-worker
namespace: acme-fulfillment
spec:
calls:
- id:
namespace: acme-fulfillment
slug: acme-shipping-carrier
version: '1'
doc: Dispatches the order to the carrier and records delivery confirmation.
docTrigger: A fulfillment queue row appears.
title: Carrier dispatch worker
Loading
Loading