This content originally appeared on DEV Community and was authored by Andrzej Krzywda
When you work on a non-trivial e-commerce application the complexity is usually, well non-trivial too.
E-commerce is one of this kind of apps, where just following a CRUD approach may not be enough.
Here is a list of modules (definitely not a full list) that might be worth having as separate, in order to avoid coupling.
Ordering
This is a classic one. If you have no modules in your e-commerce code then you can call it Ordering anyway, because that's the most important.
Some possible operations (commands) here:
- initiate an order (usually with some items from the cart)
- confirm the order (so that other modules are aware)
Ecommerce
I recently like to call this Ecommerce - a module which contains the logic around the cart concept.
Catalog
This module allows adding products to the offer visible to the clients.
Inventory
Keep track of how many items are left. Sometimes booking too.
Pricing
Pricing is usually not as trivial as just assigning a price to one product. USually we have a whole range of pricing strategies that change over time. It's nice to encapsulate them and keep it separate from other modules.
Payments
Keep track of what was paid for. Sometimes your order will be paid in multiple payments, sometimes it's not fully paid. Sometimes you pay for multiple orders with one payment - hadle this logic here.
Sample application with ecommerce modules
I'm working on sample application which shows some of those concepts. It started as a ordering system, but now it's in a process of becoming an e-commerce app too.
https://github.com/RailsEventStore/cqrs-es-sample-with-res
Are there any other modules that you like to extract in ecommerce apps? Share them in the comments :)
This content originally appeared on DEV Community and was authored by Andrzej Krzywda
Andrzej Krzywda | Sciencx (2021-04-21T11:58:36+00:00) E-commerce modules worth extracting in the code. Retrieved from https://www.scien.cx/2021/04/21/e-commerce-modules-worth-extracting-in-the-code/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.