Skip to main content

Inventory Service

The inventory service consists of the context ProductItem. It is responsible for managing the inventory - consisting of ProductItems of a ProductVariant. It is part of the order and return saga, where it reserves and releases the required ProductItems.

Domain Model​

info

Imported entities from other bounded contexts are marked with a dashed border.

Technology Stack​

  • Language: TypeScript
  • Framework: NestJS
  • GraphQL Library: @nestjs/graphql with @nestjs/apollo (code first)
  • Database: MongoDB
  • Entity Management: Mongoose

Events​

This section lists events that are defined or used by the inventory service.

Published Events​

inventory/product/created​

This event is published when a new product is created.

{
id: string,
internalName: string,
isPubliclyVisible: boolean,
defaultVariantId: string,
categoryIds: string[]
}

inventory/product-item/reservation-succeeded​

This event is published when all ProductItems for the ProductVariants of an Orders OrderItems were reserved successfully.

{
order: Order;
}

inventory/product-item/reservation-failed​

This event is published when at least one ProductItem for the ProductVariants of an Orders OrderItems could not be reserved.

{
order: Order,
failedProductVariantIds: string[]
}

Subscribed Events​

Important ADRs​