Files
apskel-pos-backend/internal/service
efrilmandClaude Opus 5.5 bf9651e221 feat(loyalty): notify transfer recipients through FCM
The recipient of a transfer now gets a push through FCM instead of a
WhatsApp message (docs/prd-point-coin.md F5).

Customers had nowhere to keep FCM tokens: user_devices only holds staff
devices. Migration 000096 adds customer_devices, and the customer app
registers with PUT /customer/devices { device_id, fcm_token, platform,
app_version } after login and whenever FCM refreshes the token, and
unregisters with DELETE /customer/devices/:device_id on logout. A token
belongs to one customer only: registering it takes it away from whoever
had it on that phone before, so they stop getting this customer's
notifications.

The push goes to every device of the recipient after the commit, titled
"EnakPoint masuk" or "EnakCoin masuk", with type WALLET_TRANSFER_IN, the
TRANSFER_IN transaction id, the group id, the currency and the amount in
its data so the app can open it. A retried transfer sends nothing again. It
stays best effort: no device, FCM not configured or FCM failing is logged
and never undoes the transfer.

The app builds one FCM client and shares it between staff notifications
and customer pushes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 12:30:14 +07:00
..
2026-06-08 12:30:39 +07:00
2026-08-11 22:41:10 +07:00
2026-08-11 22:41:10 +07:00
2026-05-10 10:42:09 +07:00
2026-08-13 14:38:28 +07:00
2025-09-12 16:37:16 +07:00
2025-09-18 01:32:01 +07:00
2025-07-18 20:10:29 +07:00
2026-06-03 14:56:27 +07:00
2025-07-18 20:10:29 +07:00
2026-04-27 21:17:12 +07:00
2026-04-27 21:17:12 +07:00
2025-08-14 01:35:19 +07:00
2026-05-10 10:57:38 +07:00
2025-07-18 20:10:29 +07:00
2025-08-07 22:45:02 +07:00
2025-07-18 20:10:29 +07:00
2026-06-08 12:30:39 +07:00
2025-07-18 20:10:29 +07:00
2026-08-11 22:41:10 +07:00
2025-08-10 20:41:34 +07:00
2025-09-17 23:55:11 +07:00
2025-08-03 23:55:51 +07:00
2025-08-03 23:55:51 +07:00
2026-05-10 10:42:09 +07:00
2025-07-30 23:18:20 +07:00
2025-08-08 00:32:05 +07:00
2025-09-12 01:12:11 +07:00