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
Usercannot reserve items by putting them in theShoppingCart: The Inventory containsProductItems as instances of aProductVariant. TheseProductItems do not know about existingShoppingCarts orShoppingCartItems. Thus, when the user wants to finish the order, the system must check whether theProductItemis still in stock, since it could have been ordered by another user in the meantime. - A
Usercan have exactly oneShoppingCartat a time, independent of the client device used.
What Invoices and Payments mean
- An
Invoiceis associated with exactly oneOrder. Split invoices for parts of the order are not supported. - A
Paymentis only created after the associatedInvoicehas been paid. - The store supports only payment methods where the payment is completed before the shipping of any ordered items.
How Discount work
- A
Couponis a promotional offer. It allows aUserto apply aDiscountto aProduct. EachCouponis associated with a specificDiscount. - The store only offers
Discounts in percentages. The store does not have gift cards. - The
Discountcan have whitelist filters byProduct,ProductVariant, andCategory. If filters are present, theDiscountcan be applied toProducts matching any filter. If no filters are present, theDiscountcan be applied to all products.
International shops and business accounts
- Each
ProductVariantVersionhas itsTaxRatespecified. Thus, the store cannot easily operate in multiple tax rate regions. - Tax deduction for business accounts are not supported by the system, since the
TaxRateis fixed for allUsers.
Notifications
- A
Notificationis 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
Notificationis 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
Userneeds anAccount. 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
Addresscannot be related to multipleUserinstances. - A user's
Wishlists are private and cannot be seen by other users.
Regarding Category
The store has no Category hierarchy.