ScotchLabs / scotch

Scotch'n'Soda's Theatrical Management Solution
http://snstheatre.org
1 stars 0 forks source link

Stevies Implementation #129

Open carlosdp opened 10 years ago

carlosdp commented 10 years ago

The "Stevies" are Scotch's version of achievements (a clever play on our good 'ol Stephen Schwartz's name).

These are achievements based on things like having directed a show or been on 5 consecutive production staffs / casts. There are several tasks involved here:

Discuss!

achivetta commented 10 years ago

One interesting thing to think about: the action that causes someone to get an award isn't likely to be taken by the person getting the award. So, you'll use some sort of persistent notification to tell the user about their new award. So, the process of detecting and granting awards can be totally asynchronous: delayed task, cron job, whatever.

So, two tables:

Awards

PersonAwards : many-to-many between your people and awards.

Then, there's no need to define the awards in your model, just write a function/class for each award that answers the question: has person X earned you?

If you want to use a cron job, you can run each award's detector across all members who haven't earned the award yet.

If you want to use deferred tasks, any time an action happens that could change a member's awards, queue up evaluating all awards for that members.

carlosdp commented 10 years ago

Right, I was thinking deferred tasks based on triggers at the group/show level. ie. when a show is archived, everyone in the show is checked for eligibility.