I am working on a billing and accounting application from scratch in which I have created two different apps as:
- billing: this app stores all the billing related logic for example; subscription plans, products, coupons and similar stuff.
- accounts: this app keeps the accounting data for example: Customer account, transactions etc.
Now I have a issue I need to relate both of them in the following situations:
- Plans(In billing app) subscribed by the Customer (In accounts app)
- Product(In billing app) purchased by the Customer (In accounts app)
- Customer(In accounts app) Invoices (In billing app)
- Coupons(In billing app) applied/redeemed by the Customer(In billing app)
I have tried using the foreign keys in the models among these apps but it just looks very crude and bad.
I am not sure wether I should put all the models in the same or so; I would like to have a review on my design by someone insightful so that I can know what are the better ways of doing this.