I'm not sure what is the best approach for my problem. I need a model for notification (or alerts) in my application. Notifications are based on services, have multiple fields to define conditions and are associated with a user. Here's an example for a reddit notification:
user_id: 1 type: post_karma condition: above value: 100
And here's a weather notification:
user_id: 2 type: temperature city: Seattle condition: above value: 70
So both entries are notifications but they have different condition fields. Should I:
- Create different models for each type of notification?
- Create a base notification model and other models for each type that extend the base one?
- Only have 1 model (notification) and then some sort of condition table. A notification has multiple conditions.