Features / Home & navigation

Notifications

A list of MIS and system notifications about farmers, mainly endorsement comments and status changes. Tapping a farmer notification opens that farmer's hub.

FactsheetHome & navigation
Who uses it
Cadre
How you get here
The bell on the farmer list, or a push notification.
Tables
notifications, endorsement_comment_entity
APIs
2 calls today, 3 App Service operations
Offline
Shows stored notifications offline; refresh needs internet.

Screens

ScreenWhat it doesSource
NotificationsTabs All, MIS and System with pull-to-refresh.app/src/main/java/org/platformcommons/urvi/view/notification/NotificationNewFragment.kt

Rules

Conditions from the code, rewritten as plain decision rules.

WhenThen
The MIS tab is selectedShow notifications of type MIS.
The System tab is selectedShow notifications of type SYS.
A row linked to a farmer is tappedOpen that farmer's hub.
There are no notificationsShow "no notifications to display".
The user pulls to refreshFetch notifications again.
A push arrives on topic urvi_endorsement_status or urvi_endorsement_comment, or a generic title/body messageSave it to the local database and show an OS notification.

API contracts

Each call opens to its use case, headers, request and response bodies, and errors.

App Service v2: operationUse
GET /farmers/{farmerId}One hydrated farmer (get-or-create)
GET /notificationsMIS and system notifications since a time
PUT /devices/{deviceId}/push-tokenStore or rotate the FCM push token

Behaviour notes

  • Filled hourly by a background worker and by push messages.
  • Each row shows farmer name, IE id, message and timestamp.
  • The bell lives on the farmer list, so Unit users (VO tabs home) do not see it there.

Improve in the rewrite

  • Add read/unread state and a badge count on the bell.