Compare commits

...
5 Commits
Author SHA1 Message Date
mats 5237c8ab85 notes
Build and Publish / BuildAndDeploy (push) Failing after 37s
2026-07-03 19:29:14 +02:00
mats f3e3269b7a agents md
Build and Publish / BuildAndDeploy (push) Failing after 7s
2026-07-03 18:13:21 +02:00
mats a31ce71b08 ignore
Build and Publish / BuildAndDeploy (push) Failing after 34s
2026-06-21 12:39:47 +02:00
matsandClaude Opus 4.8 eb2c02f0a9 deploy: registry.knatofs.se → registry.k6n.net image ref
Build and Publish / BuildAndDeploy (push) Failing after 7s
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-17 22:11:41 +02:00
matsandClaude Opus 4.8 ec072621bf Migrate module path to git.k6n.net/mats + go 1.26
Build and Publish / BuildAndDeploy (push) Failing after 37s
Integrates the module-path migration (previously on a diverged detached
HEAD) onto main, which already carries the registry fix and later work.
No internal imports referenced the old path, so go.mod is the only change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-17 22:09:15 +02:00
5 changed files with 73 additions and 3 deletions
+2
View File
@@ -0,0 +1,2 @@
.DS_Store
data/*.dbz
+57
View File
@@ -0,0 +1,57 @@
# go-order-manager — agents map
Thin, small service: persists the side of order events that the cart-actor
publishes. Reads from RabbitMQ; writes orders to disk. Almost all of the
business logic lives in `go-cart-actor`; this is the durable, simple shadow.
## Where to start
- `main.go` — wiring (HTTP server + RabbitMQ client + persistence).
- `order.go` — the `Order` struct + related types.
- `order_client.go``RabbitTransportClient` (the AMQP consumer) +
`UpdateHandler` interface.
- `capture.go` — payment/fulfilment capture payload.
- `README.md` — intent.
- `deployment/order-manager.yaml` — k8s deployment (uses `AMQP_URL`).
## Architecture
- **Single binary, single role**: consumer of the order event stream
(`order-queue` on a RabbitMQ exchange).
- **Durable record**: persists orders received via the queue; the HTTP
surface is mostly read/admin.
- **No opinions on cart logic** — that's `go-cart-actor`'s domain. This
service is the keeper of the resulting artefacts.
## Important files by area
| Area | File |
| ------------------- | ------------------------------------------ |
| Wiring | `main.go` |
| Domain model | `order.go` |
| Capture payload | `capture.go` |
| AMQP consumer | `order_client.go` |
| Deploy | `deployment/order-manager.yaml` |
## Cross-project seams
- **`go-cart-actor`**: emits order events; this service consumes them. Per
`docs/checkout-order-handoff.md`, the ownership split is "cart-actor
orchestrates active checkout, order-manager owns the persisted record."
- **RabbitMQ**: exchanges per `docs/platform-event-messaging-sketch.md`.
## Improvement suggestions
- **Too small to deserve its own service?** Five files, one queue consumer,
one model. Ask the deletion test: deleting this service would re-spread
"what's an order?" across two repos. Currently earns its keep. Keep it,
but periodically re-evaluate: if persistence moves into an outbox inside
cart-actor, this service dilutes into a read API and may collapse.
- **`capture.go` is its own file but isn't clearly used** —if it's only
consumed by tests or an old webhook path, fold it into `order.go`.
- **No tests.** The `OrderPlaced` and `UpdateHandler` interfaces are the
test surface; a 50-line test with a fake `UpdateHandler` would lock in
the contract that `go-cart-actor` depends on.
- **Single `deployment/order-manager.yaml`** has no corollaries — if you're
adding a second env (staging), copy it explicitly into a `deploy/k8s/`
folder rather than hand-editing replicas later.
+11
View File
@@ -1,3 +1,14 @@
// File capture.go holds CaptureData — the wire payload used when an order
// claims a payment authorisation or records fulfilment capture.
//
// Consumers:
// - PersistingOrderHandler in main.go on the OrderPlaced path.
// - A small backoffice admin route kicks capture.
//
// It is NOT a public HTTP surface; its JSON field names mirror the UCP
// capture.v1 schema that go-cart-actor publishes on the se_* RabbitMQ
// exchange. If you change a field here, you almost certainly have to
// change go-cart-actor's emit site at the same time.
package main package main
type CaptureData struct { type CaptureData struct {
+1 -1
View File
@@ -47,7 +47,7 @@ spec:
imagePullSecrets: imagePullSecrets:
- name: regcred - name: regcred
containers: containers:
- image: registry.knatofs.se/go-order-manager:latest - image: registry.k6n.net/go-order-manager:latest
name: order-manager-arm64 name: order-manager-arm64
imagePullPolicy: Always imagePullPolicy: Always
lifecycle: lifecycle:
+2 -2
View File
@@ -1,5 +1,5 @@
module git.tornberg.me/go-order-manager module git.k6n.net/mats/go-order-manager
go 1.24.0 go 1.26.2
require github.com/rabbitmq/amqp091-go v1.10.0 require github.com/rabbitmq/amqp091-go v1.10.0