Skip to main content

Domain Model

Domain Model with Bounded Contexts​

Design Choices in the Domain Model​

In the following, an Entity of the domain model is formatted verbatim, and a Bounded Context is formatted italic.

How the Inventory handles Returns​

The domain model does not automatically add returned items back to the Inventory. They need to be added manually, similar to a shipment from the manufacturer, or thrown away.

How ShoppingCart work​

  • A User cannot reserve items by putting them in the ShoppingCart: The Inventory contains ProductItems as instances of a ProductVariant. These ProductItems do not know about existing ShoppingCarts or ShoppingCartItems. Thus, when the user wants to finish the order, the system must check whether the ProductItem is still in stock, since it could have been ordered by another user in the meantime.
  • A User can have exactly one ShoppingCart at a time, independent of the client device used.

What Invoices and Payments mean​

  • An Invoice is associated with exactly one Order. Split invoices for parts of the order are not supported.
  • A Payment is only created after the associated Invoice has been paid.
  • The store supports only payment methods where the payment is completed before the shipping of any ordered items.

How Discount work​

  • A Coupon is a promotional offer. It allows a User to apply a Discount to a Product. Each Coupon is associated with a specific Discount.
  • The store only offers Discounts in percentages. The store does not have gift cards.
  • The Discount can have whitelist filters by Product, ProductVariant, and Category. If filters are present, the Discount can be applied to Products matching any filter. If no filters are present, the Discount can be applied to all products.

International shops and business accounts​

  • Each ProductVariantVersion has its TaxRate specified. Thus, the store cannot easily operate in multiple tax rate regions.
  • Tax deduction for business accounts are not supported by the system, since the TaxRate is fixed for all Users.

Notifications​

  • A Notification is within-the-system; they are not forwarded to emails, text messages, or anything else.
  • Notifications are read-only. Users can only receive notifications, they cannot reply to them.
  • Each Notification is sent to exactly one user. There are no broadcasts.

How Users relate to their Account, Wishlists, and Addresses​

  • To be able to order something from the store, a User needs an Account. This implies that the store does not support something like "checkout as guest".
  • Addresses stored by the system do not have to be unique physical addresses. The system may store multiple instances of the same physical address. One Address cannot be related to multiple User instances.
  • A user's Wishlists are private and cannot be seen by other users.

Regarding Category​

The store has no Category hierarchy.