We are building a SaaS e-commerce multi-tenant platform.
But recently we made a pivot to provide external cloud services by integrating their API’s. As our project is getting bigger and bigger with feature-rich apps, we need to separate portions of our platform according to the needs of our tenants by activate or deactivate modules.
Meaning… we need to isolate portions of the code into modules that we can add or remove on the fly. Each module needs to be aware of the available module and change their behaviors according to what is available (a bit like the "state" pattern).
EX: Change behaviors and adding options according to the available modules.
[E-commerce CSM] + [Payment Gateway]+ [Inventory]
[E-commerce CSM] => [Payment Gateway] [color="#000080"]Have access to a list of payment options[/color] OR [color="#FF0000"]No payment is available[/color] + [Inventory] [color="#000080"]have access to the catalog quantity[/color] OR [color="#FF0000"]All items are infinit[/color]
[Payment Gateway] => [Inventory] [color="#000080"]Verify if the items ordered exists in the quantity requested.[/color] OR [color="#FF0000"]Accept all payment regardless of the quantity[/color]
[Inventory] => [E-commerce CSM] [color="#000080"]Link to the front end where it present the Item[/color] + [Payment Gateway] [color="#000080"]Some Item can be paid by credit card only other by Interac[/color]
[color="#FF0000"][Point Of Sale](Not activated for this tenant)[/color]
[color="#FF0000"][Billing App](Not activated for this tenant)[/color]
[color="#006400"]What "design pattern" can I use to accomplish this division?[/color]
Thank you for your time