Closed SaadMu7ammad closed 3 months ago
i hope any one respond https://web.facebook.com/groups/nodejs.egypt/permalink/6571677816287501/?mibextid=oMANbw
notification table needs to be created
GetAllNotifications :heavy_check_mark: : :
[x] adding pagination
[x] sorting by date
[x] filter by X (read - !read)
[x] DeleteNotification
SendNotification :hourglass: :
[x] Implementing the Dao
[x] the automatic createdAt & updatedAt attributes
[x] linking the notification with a case/blood request / fundraising request ..
[x] fix filtering by read
[x] fix findOneAndDelete
[x] fix the timestamp issue with typescript
[ ] fix the population problem
Adding An Expiry date for documents to be deleted after is easily done using TTL index , but if the expiry date differs between documents , it may be a challenge ..
Further Reading : Cron Jobs :heavy_check_mark: - Node-cron : seams easy and interesting ✔️
Update : Did that using setTimeInterval , but is this a good approach ?
Adding global notifications : this could be done by adding a new attribute in the Notifications schema "isGlobal" .. but what about the required "receiver" attribute ?
Notifications should have a title only (notifications don't have a body)
Notifications should have a title only (notifications don't have a body)
also i think must be a ref id to both case id so when the normal user click on the notification it goes him to the case he clicked
or as a charity also go to the usedItem user contribute and the same with blood donation
dont forget the fundraising needs a notification request
user also want to be notified with cases with type campiagns and that differ from the fundraising
try to brain storm to full the whole corner cases about that
we should add 2 more properties to the notification schema
Added : deleteOutdatedNotifications function that is fired every time user fetches the notifications
GetAllNotifications ✔️ : :
[x] adding pagination
[x] sorting by date
[x] filter by X (read - !read)
[x] DeleteNotification
[x] MarkNotificationAsRead
SendNotification ⌛ :
[x] check if the charity or the user are stored in the DB
[x] Delete Old Notifications
[ ] Adding Global Notifications 🤔
[x] Adding Types Following the Pattern
[x] Implementing the Dao
[x] the automatic createdAt & updatedAt attributes
[x] linking the notification with a case/blood request / fundraising request ..
[x] fix filtering by read
[x] fix findOneAndDelete
[x] fix the timestamp issue with typescript
[ ] fix the population problem
TODO :
New Structure : Global Notifications : make only one instance in the DB then link the it to the user by making an attribute : notifications { notificationId , read }
is this better than the current structure ? will this joins reduce the performance ? will the notifications array explode the user document ? what to do if all the users deleted their link to the notification ? will it require a complex query to delete unused notifications ?
does notification needs a table ?