hi all:
i'm working on a spoof website for my friends wherein we have our own little congress/parliamentary body.
i want to create a flexible legislation system that allows members to create motions and/or bills, open them up for debate, and then vote on them. I'm having a bit of a time trying to figure out what kind of database structures and procedures I'll need to manage this sort of thing.
i'm guessing i'll need these tables:
members - names, passwords, and ids of members
debate - statements issued by members in debates. these will be connected to a particular motion or bill.
bills - complex statements/assertions/rules that members can create, debate, and vote yea or nay.
gulag - listing of persons banished to gulag...not related to members. prime candidates might be Tom Delay or Posh Spice.
As an example, congressman X might want to initiate a bill that says Jessica Simpson should be sent to the Gulag. Aside from gulag banishment, i expect perhaps a couple of other types of bill: New Rules, New Members, Assertions of Fact. When these bills pass, database structures will be adjusted accordingly.
What's mostly confusing to me is the similiarity between motions and bills. to pass a bill, you must have a vote. to even get a vote, you need a motion to vote on it. given the asynchronous nature of the whole thing, i'm a bit confused about ways of tracking motions versus bills. Does anyone have suggestions about this?
i'm thinking i'll do something like this.
1) have a form to create bills
2) store a 'state' variable for each bill which tells where it stands: debate, vote, killed, law
3) when a bill gets created, its immediately put into debate mode. any member may also file a motion to put the bill to a vote. filing such a motion will create a record in 'motions'. somebody must second the motion before it's officially voted on. should motions expire?
4) once a motion to vote on a bill is seconded, the bill will be put in 'vote' mode where it stays until enough members have voted to determine win, loss, or tie.
5) once vote is complete, bill is moved to appropriate state:
win -> law
loss -> killed
* tie -> debate
and database structures are adjusted accordingly. i.e., we add J. Simpson to the gulag.
Obviously, I'm a bit worried about how to structure motions. Motion to vote on a bill is one type. we'd need to know which bill is being voted on and what to do if the vote succeeded. If anyone has advice or tips about this, i would greatly appreciate it.