---
id: Orders
name: Orders
summary: Handles all operations related to customer orders, from creation to fulfillment
version: 0.0.3
owners:
  - dboyne
  - full-stack
services:
  - id: InventoryService
  - id: OrdersService
  - id: NotificationService
  - id: ShippingService
entities:
  - id: Order
  - id: OrderItem
  - id: Customer
  - id: ShoppingCart
  - id: CartItem
badges:
  - content: Subdomain
    backgroundColor: blue
    textColor: blue
    icon: RectangleGroupIcon

resourceGroups:
  - id: related-resources
    title: Core resources
    items:
      - id: InventoryService
        type: service
      - id: OrdersService
        type: service
      - id: NotificationService
        type: service
      - id: ShippingService
        type: service
---

import Footer from '@catalog/components/footer.astro';

:::warning

Please ensure all services are **updated** to the latest version for compatibility and performance improvements.
:::

The Orders domain handles all operations related to customer orders, from creation to fulfillment. This documentation provides an overview of the events and services involved in the Orders domain, helping developers and stakeholders understand the event-driven architecture

<Tiles>
  <Tile
    icon="UserGroupIcon"
    href="/docs/teams/full-stack"
    title="Contact the team"
    description="Any questions? Feel free to contact the owners"
  />
  <Tile
    icon="RectangleGroupIcon"
    href={`/visualiser/domains/${frontmatter.id}/${frontmatter.version}`}
    title={`${frontmatter.services.length} services`}
    description="This domain contains the following services."
  />
</Tiles>

### Architecture for the Orders domain

<NodeGraph />

### Entity Map

A visualization of the entities in the Orders domain. Here you can see the relationships between the entities and how they are used in the domain.

<EntityMap id="Orders" />

<MessageTable format="all" limit={4} showChannels={true} title="Messages in/out of the domain" />

### Order example (sequence diagram)

```mermaid
sequenceDiagram
    participant Customer
    participant OrdersService
    participant InventoryService
    participant NotificationService

    Customer->>OrdersService: Place Order
    OrdersService->>InventoryService: Check Inventory
    InventoryService-->>OrdersService: Inventory Available
    OrdersService->>InventoryService: Reserve Inventory
    OrdersService->>NotificationService: Send Order Confirmation
    NotificationService-->>Customer: Order Confirmation
    OrdersService->>Customer: Order Placed Successfully
    OrdersService->>InventoryService: Update Inventory
```

## Flows

### Cancel Subscription flow

Documented flow when a user cancels their subscription.

<Flow id="CancelSubscription" version="latest" includeKey={false} />

### Payment processing flow

Documented flow when a user makes a payment within the order domain

<Flow id="PaymentFlow" version="latest" includeKey={false} />

<ResourceGroupTable
  id="related-resources"
  limit={4}
  showOwners={true}
  title="Core resources for the Orders domain"
  description="Resources that are related to the Orders domain, you may find them useful"
/>

<Footer />
