Skip to main content

openIMIS Backend Contract reference module

This repository holds the files of the openIMIS Backend Contract reference module. It is dedicated to be deployed as a module of openimis-be_py.

ORM mapping:

  • tblContract > Contract
  • tblContractDetails > ContractDetails
  • tblContractContributionPlanDetails > ContractContributionPlanDetails

Listened Django Signals

  • post_save - Payment: handles service activate_contracted_policies - only when payment is related to the contract/contracts. (it is verified by this post save) Another payments are omitted in processing.

GraphQl Queries

  • contract
  • contractDetails
  • contractContributionPlanDetails

GraphQL Mutations - each mutation emits default signals and return standard error lists (cfr. openimis-be-core_py)

  • createContract
  • updateContract
  • deleteContract
  • submitContract
  • approveContract
  • approveBulkContract (works with Celery)
  • counterContract
  • amendContract
  • renewContract
  • createContractDetails
  • updateContractDetails
  • deleteContractDetails
  • createContractDetailsByPhInsuree

Additional mutation log helper in Create graphQl mutations - ObjectMutation from core

  • "ObjectMutation" from openimis-be-core_py - models.py
  • "object_mutated" method allows the creation of an object to update the xxxMutation easily.
  • dedicated for createContract and createContractDetails graphQl mutations
  • more info about it and how it was implemented here in Contract module in models.py in class ObjectMutation in docs string

Services

  • Contract
    • create
    • update
    • submit
    • approve
    • amend
    • renew
    • delete
    • get_negative_amount_amendment
    • terminate_contract
  • ContractDetails
    • get_details_from_ph_insuree
    • ph_insuree_to_contract_details
  • ContractContributionPlanDetails - CRUD services, replace
    • create_ccpd (ccpd - acronym of contract contribution plan details)
    • contract_valuation
    • create_contribution
  • PaymentService
    • create (with creating payment details for that newly created payment)
    • collect_payment_details (collect data from all contributions to assign it to the payment details)

Row security

Contract declares ParentScope("policy_holder"), ContractDetails ParentScope("contract") and ContractContributionPlanDetails ParentScope("contract_details"): every row is as visible as its policy holder (see the policyholder module). With only the policy holder portal right (gql_query_contract_policyholder_portal_perms), the contract queries are further restricted to the policy holders the user is attached to.

Configuration options (can be changed via core.ModuleConfiguration)

  • gql_query_contract_perms: required rights to call createContract GraphQL Query (default: ["152101"])

  • gql_query_contract_admins_perms: required rights to call contribution_plan_bundle_admin GraphQL Query (default: [])

  • gql_mutation_create_contract_perms: required rights to call createContract, createContractDetails GraphQL Mutations (default: ["152102"])

  • gql_mutation_update_contract_perms: required rights to call updateContract, updateContractDetails GraphQL Mutations (default: ["152103"])

  • gql_mutation_delete_contract_perms: required rights to call deleteContract, deleteContractDetails GraphQL Mutations (default: ["152104"])

  • gql_mutation_renew_contract_perms: required rights to call renewContract GraphQL Mutation (default: ["152106"])

  • gql_mutation_submit_contract_perms: required rights to call submitContract GraphQL Mutation (default: ["152107"])

  • gql_mutation_approve_ask_for_change_contract_perms: required rights to call approveContract, approveBulkContract and counterContract GraphQL Mutations (default: ["152108"])

  • gql_mutation_amend_contract_perms: required rights to call amendContract GraphQL Mutation (default: ["152109"])

openIMIS Modules Dependencies

  • core.models.HistoryModel
  • core.models.HistoryBusinessModel
  • core.models.ObjectMutation
  • policyholder.models.PolicyHolder
  • policyholder.models.PolicyHolderInsuree
  • contribution_plan.models.ContributionPlan
  • contribution_plan.models.ContributionPlanBundleDetails
  • insuree.models.Insuree
  • insuree.models.InsureePolicy
  • contribution.models.Premium
  • payment.models.Payment
  • payment.models.PaymentDetail
  • policy.models.Policy
  • calculation module

bulk operations - required configuration

  • for 'bulk approve contract' and 'bulk counter contract' graphQL mutations
  • running rabbitmq docker image
  • running celery within "{imis_directory}/openimis-be_py/venv/bin/celery": -A openIMIS worker --loglevel=DEBUG --without-gossip --without-mingle --without-heartbeat -Ofair
  • without this required steps you won't be able to bulk counter/approve contract

Metadata

Release files for openimis-be-contract 1.12.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for openimis-be-contract 1.12.1
File Size Uploaded Provenance Actions
openimis_be_contract-1.12.1.tar.gz 48.0 kB Without provenance Details for openimis_be_contract-1.12.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for openimis-be-contract 1.12.1
File Interpreter ABI Platform Actions
openimis_be_contract-1.12.1-py3-none-any.whl Python 3 none any Details for openimis_be_contract-1.12.1-py3-none-any.whl

Total release size: 113.3 kB

Release files / openimis_be_contract-1.12.1.tar.gz

Download URL openimis_be_contract-1.12.1.tar.gz
Size 48.0 kB
Tags Source
SHA-256 checksum
How to use checksums
0043ed1625694f63795d54e3b49bda675916b4cb7c09302af82ff4622a830cb7
BLAKE2b-256 checksum
How to use checksums
0bd3e8338d90a66233b5497469043c5f87ffad842ee348229decc79ed5f8aa1e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.2

Release files / openimis_be_contract-1.12.1-py3-none-any.whl

Download URL openimis_be_contract-1.12.1-py3-none-any.whl
Size 65.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
58ad83274db69b2c486702b1b80fe45cb8e276a6e83abb1e74310611c5b620a7
BLAKE2b-256 checksum
How to use checksums
4785642d7a9498ca273bc78a318ae67f6c147cc0d84322ca763f074d6f86b0a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.2

Security for openimis-be-contract 1.12.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page