sendPushNotification() (services/notificationService.ts) already called the real OneSignal API correctly, but two things made it unreachable: no endpoint ever set User.pushToken, and no job existed for the two push-based requirements beyond rent dunning — cleaning check-in reminders and the trash-calendar evening push. Both CleaningTask and TrashSchedule already had an unused `reminderSentAt` column, so the schema anticipated this and was just never wired up. - PUT /v1/auth/push-token: registers the current device's OneSignal Player ID. - jobs/cleaningReminderJob.ts, jobs/trashReminderJob.ts: same find-due/send-once/mark-reminderSentAt pattern as the existing dailyDunningJob.ts. Safe to run without OneSignal credentials configured — sendPushNotification degrades to an in-app Notification log when ONESIGNAL_APP_ID/API_KEY or a user's pushToken are absent. Not done here (needs real third-party setup from the user, same as the Cloudflare tunnel token pattern): ONESIGNAL_APP_ID/API_KEY in .env, and a frontend OneSignal Web SDK integration (service worker, VAPID keys) to actually populate pushToken from a real browser. |
||
|---|---|---|
| .. | ||
| prisma | ||
| scripts | ||
| src | ||
| Dockerfile | ||
| package-lock.json | ||
| package.json | ||
| tsconfig.json | ||