The openIMIS Backend PolicyNotification reference module.
Project description
openIMIS Backend Policy Notification reference module
This repository holds the files of the openIMIS Backend Policy Notification reference module. It is dedicated to be deployed as a module of openimis-be_py.
ORM mapping:
- FamilyNotification > tblFamilySMS
Listened Django Signals:
- After Family mutation
- CreateFamilyMutation - create FamilyNotification object connected with created family
- UpdateFamilyMutation - update FamilyNotification object connected with updated family
- DeleteFamiliesMutation - delete FamilyNotification object connected with deleted family
- Family additional filter
- Use mode from additional_filter.PolicyNotification to additionally query families by notification eligibility
Services
Family notification
Create FamilyNotification object connected with family with given uuid.
create_family_notification_policy(uuid, notification_data)
Update FamilyNotification object connected with family with given uuid.
update_family_notification_policy(uuid, notification_data)
Delete FamilyNotification object connected with family with given uuid.
delete_family_notification_policy(uuid, notification_data)
notification_data
is dict structured as follows:
{
'approvalOfNotification': True, # boolean informing whether family allows notification comunication, default False
'languageOfNotification': 'en', # language code determining in which language messages will be sent, default en
}
Reports
Family Policy Notification Report
Report summarizing notification eligibility.
Available in endpoint: policy_notification/communication_by_notification_report
Payload:
{
"districtUuid": "districtUUID",
"regionUuid": "regionUUID",
"officerUuid": "enrollmentOfficerUUID",
"mode": 1
}
Modes:
- 0: 'All',
- 1: 'Approval and phone number',
- 2: 'Approval only',
- 3: 'Phone number only',
- 4: 'No approval and phone number'
Configuration
-
Providers
This configuration key allows to configure currently used notification provider gateways. For provider to be used it has to be included in notification_gateways submodule with class name same as provider config (case-insensitive). When notifications are being send only first provider is used. Module tries to use another provider only when notifying with previous one has failed."providers": { "eGASMSGateway": { "GateUrl": "http://127.0.0.1:8000", "SmsResource": "/api/policy_notification/test_sms/", "PrivateKey": "", "UserId": "", "SenderId": "", "ServiceId": "", "RequestType": "", "HeaderKeys": "X-Auth-Request-Hash,X-Auth-Request-Id,X-Auth-Request-Type", "HeaderValues": "PrivateKey,UserId,RequestType" }, "TextNotificationProvider": { "DestinationFolder": "sent_notification" } }
-
EligibleNotificationTypes
Determines which types of notifications are to be sent."eligibleNotificationTypes": { "activation_of_policy": False, "starting_of_policy": False, "need_for_renewal": False, "expiration_of_policy": False, "reminder_after_expiration": False, "renewal_of_policy": False }
-
family_policy_notification_report_perms
- List of role right required for generating report, default["131224"]
-
trigger_time_interval_hours
- Interval between event detector calls, default 4 -
trigger_first_call_hour
- Hour of first task execution in given day, default 8 -
trigger_last_call_hour
- Hour of last task execution in given day, default 20
Note: trigger_*
settings are only used if scheduled task policy_notification.tasks.send_notification_messages
in the openimis settings.py SCHEDULED_TASK
is not active. Task included in SCHEDULED_TASK
should use hour param for
execution. Either provided as list of hours at which given task is executed (e.g. hour="8, 12, 16"),
single hour (e.g. hour=8), or the time interval when the task is executed every hour (e.g. hour='8-16').
reminder_before_expiry_days
- Days before the expiry of un-renewed policy to send notifications, default 5reminder_after_expiry_days
- Days after the expiry of un-renewed policy to send notifications, default 5
openIMIS Modules Dependencies
- openIMIS.policy
- openIMIS.insuree
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file openimis-be-policy_notification-1.5.0.tar.gz
.
File metadata
- Download URL: openimis-be-policy_notification-1.5.0.tar.gz
- Upload date:
- Size: 52.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 666ef874b6f57c0e53972591ef6eb0335d63b16ee3d2c0f5e19afe273796a9cc |
|
MD5 | 1fa0083ce559e2fd5f697f8a262b2458 |
|
BLAKE2b-256 | ae93d84ca030f1382d5a7c17c384523857a887f946b5e5cd8ac07d5cbd0124cd |
File details
Details for the file openimis_be_policy_notification-1.5.0-py3-none-any.whl
.
File metadata
- Download URL: openimis_be_policy_notification-1.5.0-py3-none-any.whl
- Upload date:
- Size: 75.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e528ba8ba8da303207a58f81efb4446612e578ec10d1604e8a5f68525d595f3 |
|
MD5 | d7e36e482f6039a8ed273ad066e9ac4f |
|
BLAKE2b-256 | 1107e33820bea192463a7773985d0d822daa58c856735da2c40866edd2954e1d |