seatshare / seatshare-rails

🎟 Primary SeatShare application in Ruby on Rails.
https://www.myseatshare.com
MIT License
2 stars 1 forks source link

Notifications model and index view #121

Open bval opened 9 years ago

bval commented 9 years ago

Currently ticket requests and other types of notifications are not modeled or stored anywhere. This will make doing true push notifications tricky. We need some way to model and store these, and acknowledge them / delete them when they have been viewed.

It would also be nice to have an index view of read / unread notifications that link to the relevant ticket or whatever they concern so you can login to the app and see what requires your attention.

stephenyeargin commented 9 years ago

Heavily related to #100 ... shame @jfryman isn't accepting his invite :scream:

stephenyeargin commented 9 years ago

This also would help accomplish a few other things:

May need to whiteboard this a bit.

stephenyeargin commented 9 years ago

Some thoughts. The idea of splitting it out into a separate model would make notification triggers a bit easier (such as traversing all upcoming events with unfulfilled TicketRequests). It would also make the accounting aspect clearer, as these would become the actual ledger entries.


TicketRequest model

key id
int ticket_id
int transfer_to
int transfer_from
decimal cost
text  transfer_method
text  transfer_details
time  transfer_completed
text  payment_method
text  payment_details
text  notes
timestamps

Initiated by a ticket requestor

Initiated by a ticket owner

bval commented 9 years ago

Like this. Suggest we use a state machine gem to implement this as it'll model the state transitions appropriately and give us places to hook in for emitting events to the relevant parties when a request changes state. Have used the pluginaweek/state_machine gem before but there are others we could look into.

bval commented 9 years ago

Looking at implementing this to power the notification system: https://github.com/mailboxer/mailboxer

Would appreciate a quick gut check from others before I do. Biggest pros appear to be:

Cons appear to be: