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
| Screen | What it does | Source |
|---|---|---|
| Notifications | Tabs 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.
| When | Then |
|---|---|
| The MIS tab is selected | Show notifications of type MIS. |
| The System tab is selected | Show notifications of type SYS. |
| A row linked to a farmer is tapped | Open that farmer's hub. |
| There are no notifications | Show "no notifications to display". |
| The user pulls to refresh | Fetch notifications again. |
| A push arrives on topic urvi_endorsement_status or urvi_endorsement_comment, or a generic title/body message | Save 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.
| Today: call | Use | Replaced by |
|---|---|---|
GET /gateway/asset-service/api/v1/endorsementComment/postedby?page&size&postedBy | Poll for new comments to show as in-app notifications. | |
SDK FCM topic subscribe: urvi_endorsement_status, urvi_endorsement_comment, NOTIFICATION | Receive endorsement and broadcast push messages. |
| App Service v2: operation | Use |
|---|---|
GET /farmers/{farmerId} | One hydrated farmer (get-or-create) |
GET /notifications | MIS and system notifications since a time |
PUT /devices/{deviceId}/push-token | Store 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.