feat(notifications): complete notification delivery system with email, push, and in-app support

Add 5 new event listeners (listing.approved, listing.rejected, payment.confirmed,
subscription.expiring, inquiry.received), 3 new Handlebars templates, readAt field
for in-app read/unread tracking, unread/mark-as-read API endpoints, and unit tests.

All 57 notification tests pass, lint clean, typecheck clean.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
Ho Ngoc Hai
2026-04-09 00:11:34 +07:00
parent 47d9c94539
commit 6f3e6998ac
19 changed files with 695 additions and 3 deletions

View File

@@ -531,12 +531,14 @@ model NotificationLog {
status NotificationStatus @default(PENDING)
errorDetail String?
sentAt DateTime?
readAt DateTime?
createdAt DateTime @default(now())
@@index([userId])
@@index([channel, status])
@@index([templateKey])
@@index([createdAt])
@@index([userId, readAt])
}
model NotificationPreference {