openimis-be-social_protection_py

The OpenIMIS Backend Social Protection Reference Module is an integral part of the OpenIMIS system. This module is dedicated to handling social protection-related information, including benefit plans, beneficiaries, and group beneficiaries. It is designed to be deployed as a module of openimis-be_py, the OpenIMIS backend application.

This documentation aims to provide a comprehensive guide on how to utilize, configure, and interact with the Social Protection Reference Module effectively.

ORM Mapping

The module uses Object-Relational Mapping (ORM) to map data from the database to Python objects. The following ORM mappings are used:

  • social_protection_benefitplan, social_protection_historicalbenefitplan -> BenefitPlan: Represents a social protection benefit plan entity.

  • social_protection_beneficiary, social_protection_historicalbeneficiary -> Beneficiary: Represents a social protection beneficiary entity.

  • social_protection_benefitplandatauploadsrecords, social_protection_historicalbenefitplandatauploadsrecords -> BenefitPlanDataUploadRecords: Represents data upload records associated with a benefit plan.

  • social_protection_groupbeneficiary, social_protection_historicalgroupbeneficiary -> GroupBeneficiary: Represents a group beneficiary entity.

Developers can access and manipulate social protection data using these mapped objects, which abstract away the underlying database complexities.

social_protection.png

GraphQL Queries

The module provides several GraphQL queries to retrieve social protection-related information:

  • benefitPlan: Retrieves benefit plan data based on specified criteria.

  • beneficiary: Retrieves beneficiary data based on specified criteria.

  • groupBeneficiary: Retrieves group beneficiary data based on specified criteria.

  • beneficiaryDataUploadHistory: Retrieves the data upload history of beneficiaries.

  • bfCodeValidity: Validates the beneficiary code.

  • bfNameValidity: Validates the beneficiary name.

  • bfSchemaValidity: Validates the beneficiary schema.

  • beneficiaryExport: Exports beneficiary data.

  • groupBeneficiaryExport: Exports group beneficiary data.

These GraphQL queries provide a flexible and efficient way to retrieve relevant social protection data.

GraphQL Mutations

The Social Protection Reference Module offers GraphQL mutations to manage social protection data. Each mutation emits default signals and returns standard error lists following the conventions of openimis-be-core_py.

List of available mutations:

  • createBenefitPlan: Creates a new benefit plan record.

  • updateBenefitPlan: Updates an existing benefit plan record.

  • deleteBenefitPlan: Deletes a benefit plan record.

  • createBeneficiary: Creates a new beneficiary record.

  • updateBeneficiary: Updates an existing beneficiary record.

  • deleteBeneficiary: Deletes a beneficiary record.

  • createGroupBeneficiary: Creates a new group beneficiary record.

  • updateGroupBeneficiary: Updates an existing group beneficiary record.

  • deleteGroupBeneficiary: Deletes a group beneficiary record.

These mutations enable seamless management of social protection data within the OpenIMIS system.

Services

The module provides the following services:

  • BenefitPlanService: Offers methods to create, update, and delete benefit plan records.

  • BeneficiaryService: Provides methods to create, update, and delete beneficiary records.

  • GroupBeneficiaryService: Offers methods to create, update, and delete group beneficiary records.

  • BeneficiaryImportService: Provides methods to import beneficiaries.

Developers can interact with these services to perform CRUD (Create, Read, Update, Delete) operations and handle beneficiary imports.

Configuration Options

The behavior of the Social Protection Reference Module can be customized through configuration options, which can be modified via core.ModuleConfiguration. The available configuration options are:

  • gql_benefit_plan_search_perms: Specifies the required rights to call the benefitPlan GraphQL query. (Default: ["160001"])

  • gql_benefit_plan_create_perms: Specifies the required rights to call the createBenefitPlan GraphQL mutation. (Default: ["160002"])

  • gql_benefit_plan_update_perms: Specifies the required rights to call the updateBenefitPlan GraphQL mutation. (Default: ["160003"])

  • gql_benefit_plan_delete_perms: Specifies the required rights to call the deleteBenefitPlan GraphQL mutation. (Default: ["160004"])

  • gql_beneficiary_search_perms: Specifies the required rights to call the beneficiary and groupBeneficiary GraphQL queries. (Default: ["170001"])

  • gql_beneficiary_create_perms: Specifies the required rights to call the createBeneficiary and createGroupBeneficiary GraphQL mutations. (Default: ["160002"])

  • gql_beneficiary_update_perms: Specifies the required rights to call the updateBeneficiary and updateGroupBeneficiary GraphQL mutations. (Default: ["160003"])

  • gql_beneficiary_delete_perms: Specifies the required rights to call the deleteBeneficiary and deleteGroupBeneficiary GraphQL mutations. (Default: ["170004"])

  • check_benefit_plan_update: Specifies whether the update of a Benefit Plan should be approved. (Default: True)

Developers can adjust these options to control access, permissions, and behavior related to social protection data.

OpenIMIS Modules Dependencies

The Social Protection Reference Module relies on the following modules:

  • core: Provides core functionality and utilities for the OpenIMIS system.

  • policyholder: Handles policyholder-related information.

  • individual: Manages individual references within the OpenIMIS system.

Ensure that these modules are correctly installed and configured for the Social Protection Reference Module to function properly.

Did you encounter a problem or do you have a suggestion?

Please contact our Service Desk



This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. https://creativecommons.org/licenses/by-sa/4.0/