SQLTeam.com | Weblogs | Forums

Business logic for a monthly billing system


i am trying to create a billing system for an ISP company where I m confused to create teh logic for billing system
I have created three tables called Account, Status and Billing. Accounts contain the registration information of each user and status stores the account status like active or inactive and date also
and the billing tables save the monthly billing information for the active users
Now when a user is inactive state the billing will not be applied to it and when it activated the billing for the activation month will start and continue untill the status become again inactive

my probelm is that my database diagram is also accepting the billing of inactive users
please help me inthis or give me better way to solv this logic
I am using sql server 2013 and VS pro 2013


A billing system is usually quite a large undertaking. Far more than can be answered in a post to a forum.

You should start by defining the outputs. What does your business want the system to produce? (Well, bills, of course, but won't you need some way to record bills paid (even partially), overdue accounts, etc?)

From the outputs (even if incompletely defined) you can begin to map out how to get there. That process will result in (at least high level) business logic. Taking that, refine it to cover all the various cases. Get buy-in (and maybe sign-off) from the business that the logic is complete and correct. THEN you can begin to design the database and applications to support it.

You can do this iteratively in an Agile environment. it's a nice way to proceed.

To me this makes no sense:

database diagram is also accepting the billing of inactive users

how can a diagram accept (or reject) anything?

Also, there is no SQL Server 2013. We have (early versions), 2008r2, 2012, 2014 and soon 2016.