rhyzue / KettleLog

Simple inventory management tool
2 stars 3 forks source link

How notifications work #35

Closed rhyzue closed 5 years ago

rhyzue commented 5 years ago

NOTIFICATION CREATION -String message, int readStatus, String itemId, int type -don't need unique id for each notification

ON APPLICATION START

  1. load in all notifications by reading from the table -get info from a row; use notifStage's method to set each item -also get number of rows in the db = number of notifs, use for loop and pass in the index too

DELETING NOTIFS -what happens to notifs when user deletes an item/clears the table? -the user will probably have to manually delete their notifs (ie. in games, just because you trash an inventory item doesn't mean its notification automatically disappears)

rhyzue commented 5 years ago

NOTE: On the day of reorder needed, the kettlelog will generate a notification on start. If the user deletes this notification on the same day, then closes and reopens the app, kettlelog will generate the notification again. Should we keep it this way or make kettle "remember" this?

If we want to make it remember:

  1. On delete, if today = reorder day, set read status to -3, don't delete from db
  2. On load app, if today = reorder day and read status = -3, skip over this item and don't add it to notifList
  3. On load app, if today != reorder day and read status = -3, delete it
  4. If the user deletes an item, also delete all notifications associated with it