Platform Module

Order Management Lifecycle & Fulfillment

From shopping cart to running infrastructure. A deterministic state machine manages every order through payment, validation, provisioning, and delivery — with automatic compensation when things go wrong.

State Machine

9 states, deterministic flow

Every order follows a strict state machine. No ambiguity, no undefined transitions. Each state change publishes a Kafka event and creates an audit record.

Happy Path

Draft

Order created, items configured — not yet submitted

Pending Payment

Submitted for payment, awaiting confirmation

Payment Confirmed

Payment received, ready for validation

Validating

Configuration and resource availability checks in progress

Provisioning

Infrastructure being created across cloud providers

Fulfilled

All services deployed and delivered to customer

Error & Edge States

Partially Fulfilled

Some items active, others still provisioning

Cancelled

Order cancelled with automatic refund (if paid)

Failed

Unrecoverable error — resources rolled back, payment refunded

Order-to-Delivery

From selection to running infrastructure

The complete customer journey — each step validated, logged, and recoverable. No manual intervention required for the happy path.

1

Create Order

Customer selects products, configures specifications — region, plan, storage, OS image — and submits the order. Each item's product details are snapshotted at order time. Future price changes never affect existing orders, ensuring billing integrity from the moment of submission.

2

Payment

Order enters payment processing. On confirmation, the transaction reference, amount, and timestamp are recorded permanently. Payment can be reverted for manual corrections before provisioning starts — giving operators a safety window without disrupting the customer experience.

3

Validation

The platform validates every item's configuration against real infrastructure constraints: region availability, resource quotas, OS image compatibility, billing cycle alignment. Invalid configurations are rejected with clear, actionable error messages before any resources are allocated.

4

Provisioning

The fulfillment saga orchestrates infrastructure deployment across cloud providers. Each item is provisioned independently — if a VPS completes before a database, the order transitions to Partially Fulfilled. Customers see real-time progress for every item in their portal.

5

Delivery

When provisioning completes, the platform stores access credentials — IP addresses, hostnames, connection strings, API endpoints — and sends an encrypted delivery email. Credentials are never exposed via the REST API. Customers can request re-delivery at any time through their portal.

Validation Rules by Product Type

VPS

Region (lj-1, mb-1, hetzner-fsn1), plan tier, OS image, billing cycle

Kubernetes

Worker count (3–50), storage class, region, auto-scaling policy

Database

Engine (PostgreSQL 16), storage (20–2000 GB), high availability mode

AI/ML GPU

GPU type (A100/H100), node count (1–8), storage, framework

Private Cloud

Cluster size, node count (3–20), storage (5–500 TB)

Storage

Tier (standard/archive), capacity (1–1000 TB), replication

Distributed Saga

Automatic compensation

Order fulfillment uses a saga pattern for distributed transaction consistency across services. The saga coordinates provisioning, billing, and notification — ensuring that every order either fully succeeds or fully rolls back. No partial failures. No orphaned resources. No mystery charges.

The saga maintains a complete audit trail of every step, transition, and compensation action — full observability into what happened, when it happened, and why.

compensation pipeline
1
Compensation stack built in reverse — last provisioned resource rolled back first
2
Cancel provisioning — deprovision any already-created infrastructure
3
Refund payment — automatic refund request to billing service
4
Retry with exponential backoff — 2s → 4s → 8s → 16s → 30s cap, max 5 retries
5
Dead letter queue — failed steps sent to DLQ for manual investigation

Exponential Backoff

2s

4s

8s

16s

30s

Pricing Engine

Smart configuration, automatic pricing

Each product type has its own validation rules and pricing formula. Annual billing applies a 20% discount automatically. A ±€1 tolerance handles floating-point rounding across currencies.

VPS

Fixed per plan

Core: €10/mo · Business: €20.10/mo · Enterprise: €56.60/mo

Private Cloud

Nodes + storage

nodes × €450 + storage × €80/TB

Kubernetes

Workers + storage

workers × €150 + storage × €0.50/GB

AI/ML GPU

GPU type + nodes

A100: €1,200/node · H100: €2,400/node + storage

Managed DB

Plan + storage + HA

Starter: €40 · Production: €120 (×2 for HA)

Object Storage

Tier × capacity

Standard: €20/TB · Archive: €10/TB

Data Integrity

Consistency guaranteed

Idempotent Operations

All write endpoints accept Idempotency-Key headers. Duplicate requests return cached responses within 24 hours — safe retries guaranteed.

Optimistic Locking

Version column prevents concurrent modification conflicts. HTTP 409 on mismatch — no silent overwrites, no lost updates.

Pessimistic Locking

Database-level write locks prevent race conditions when multiple provisioning items complete simultaneously on the same order.

Soft Deletes

Cancelled orders are soft-deleted and recoverable. Full audit trail preserved — nothing is ever truly lost.

Row-Level Security

PostgreSQL RLS enforces tenant isolation at the database level. Cross-tenant access is architecturally impossible.

Real-Time Analytics

Orders today/week/month, status breakdown, average value, total revenue, conversion rate — cached per-tenant with 5-min TTL.

Event Architecture & API

Every state change, an event

State transitions publish Kafka events consumed by downstream services. A routing matrix shows exactly which services react to each event.

Event Topicsorder-events
Notify
Billing
Audit
Provision
Portal
order.created
order.payment-confirmed
order.provisioning-started
order.fulfilled
order.cancelled
order.failed
order.service-delivered
billing.refund-requested
streaming
exactly-once deliveryasync decoupledtenant-scoped

Automate order-to-delivery

From product selection to running infrastructure — fully automated, fully observable, fully recoverable.

FAQ

Common Questions

The order transitions to Partially Fulfilled — completed items remain active. The failed item retries with exponential backoff (up to 5 attempts). If unrecoverable, only the failed item is rolled back and refunded. Successfully provisioned items are not affected.

Each step in the fulfillment saga builds a compensation stack. If any step fails, the saga walks the stack in reverse — deprovisioning resources, refunding payments, and notifying affected parties. Every step and compensation is logged for full audit traceability.

Yes. All write endpoints support Idempotency-Key headers. If you submit the same key twice within 24 hours, the second request returns the cached response from the first — no duplicate orders, no double charges, no side effects.

Each product type has its own pricing formula. VPS uses fixed plan pricing, while Kubernetes multiplies worker count by a per-worker rate plus storage. Annual billing applies a 20% discount automatically. A ±€1 tolerance handles floating-point rounding.