openimis-be-contract 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- openimis_be_contract-1.0.0/LICENSE.md +12 -0
- openimis_be_contract-1.0.0/PKG-INFO +128 -0
- openimis_be_contract-1.0.0/README.md +97 -0
- openimis_be_contract-1.0.0/contract/__init__.py +1 -0
- openimis_be_contract-1.0.0/contract/admin.py +2 -0
- openimis_be_contract-1.0.0/contract/apps.py +63 -0
- openimis_be_contract-1.0.0/contract/config.py +69 -0
- openimis_be_contract-1.0.0/contract/exceptions.py +2 -0
- openimis_be_contract-1.0.0/contract/gql/__init__.py +1 -0
- openimis_be_contract-1.0.0/contract/gql/gql_mutations/__init__.py +0 -0
- openimis_be_contract-1.0.0/contract/gql/gql_mutations/contract_details_mutations.py +70 -0
- openimis_be_contract-1.0.0/contract/gql/gql_mutations/contract_mutations.py +230 -0
- openimis_be_contract-1.0.0/contract/gql/gql_mutations/input_types.py +107 -0
- openimis_be_contract-1.0.0/contract/gql/gql_mutations/mutations.py +424 -0
- openimis_be_contract-1.0.0/contract/gql/gql_types.py +114 -0
- openimis_be_contract-1.0.0/contract/migrations/0001_initial.py +189 -0
- openimis_be_contract-1.0.0/contract/migrations/0002_auto_20201221_1547.py +106 -0
- openimis_be_contract-1.0.0/contract/migrations/0003_auto_20201222_1044.py +23 -0
- openimis_be_contract-1.0.0/contract/migrations/0004_auto_20201222_1424.py +37 -0
- openimis_be_contract-1.0.0/contract/migrations/0005_auto_20201228_1151.py +44 -0
- openimis_be_contract-1.0.0/contract/migrations/0006_auto_20201228_1218.py +37 -0
- openimis_be_contract-1.0.0/contract/migrations/0007_auto_20201228_1310.py +25 -0
- openimis_be_contract-1.0.0/contract/migrations/0008_auto_20201230_1052.py +20 -0
- openimis_be_contract-1.0.0/contract/migrations/0009_auto_20210118_1427.py +95 -0
- openimis_be_contract-1.0.0/contract/migrations/0010_auto_20210119_1204.py +24 -0
- openimis_be_contract-1.0.0/contract/migrations/0011_contractmutation.py +30 -0
- openimis_be_contract-1.0.0/contract/migrations/0012_contractdetailsmutation.py +30 -0
- openimis_be_contract-1.0.0/contract/migrations/0013_auto_20210202_0815.py +45 -0
- openimis_be_contract-1.0.0/contract/migrations/0014_auto_20210208_1236.py +20 -0
- openimis_be_contract-1.0.0/contract/migrations/0015_auto_20210208_1506.py +20 -0
- openimis_be_contract-1.0.0/contract/migrations/0016_auto_20210208_1508.py +20 -0
- openimis_be_contract-1.0.0/contract/migrations/0017_contract_roles_for_admin.py +27 -0
- openimis_be_contract-1.0.0/contract/migrations/0018_approve_ask_for_change_perms.py +21 -0
- openimis_be_contract-1.0.0/contract/migrations/0019_amend_perms.py +21 -0
- openimis_be_contract-1.0.0/contract/migrations/0020_auto_20230126_0903.py +40 -0
- openimis_be_contract-1.0.0/contract/migrations/0021_alter_contract_date_created_and_more.py +128 -0
- openimis_be_contract-1.0.0/contract/migrations/0022_add_admin_rights.py +26 -0
- openimis_be_contract-1.0.0/contract/migrations/0023_contractcontributionplandetails_amount_and_more.py +48 -0
- openimis_be_contract-1.0.0/contract/migrations/__init__.py +0 -0
- openimis_be_contract-1.0.0/contract/models.py +221 -0
- openimis_be_contract-1.0.0/contract/schema.py +192 -0
- openimis_be_contract-1.0.0/contract/services.py +1093 -0
- openimis_be_contract-1.0.0/contract/signals.py +315 -0
- openimis_be_contract-1.0.0/contract/tasks.py +49 -0
- openimis_be_contract-1.0.0/contract/tests/__init__.py +0 -0
- openimis_be_contract-1.0.0/contract/tests/helpers.py +127 -0
- openimis_be_contract-1.0.0/contract/tests/test_helpers.py +158 -0
- openimis_be_contract-1.0.0/contract/tests/test_mutation_create_tests.py +431 -0
- openimis_be_contract-1.0.0/contract/tests/test_services.py +514 -0
- openimis_be_contract-1.0.0/contract/tests/tests_gql_query.py +733 -0
- openimis_be_contract-1.0.0/contract/urls.py +1 -0
- openimis_be_contract-1.0.0/contract/utils.py +46 -0
- openimis_be_contract-1.0.0/contract/views.py +3 -0
- openimis_be_contract-1.0.0/openimis_be_contract.egg-info/PKG-INFO +128 -0
- openimis_be_contract-1.0.0/openimis_be_contract.egg-info/SOURCES.txt +58 -0
- openimis_be_contract-1.0.0/openimis_be_contract.egg-info/dependency_links.txt +1 -0
- openimis_be_contract-1.0.0/openimis_be_contract.egg-info/requires.txt +11 -0
- openimis_be_contract-1.0.0/openimis_be_contract.egg-info/top_level.txt +1 -0
- openimis_be_contract-1.0.0/setup.cfg +4 -0
- openimis_be_contract-1.0.0/setup.py +47 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
The program users must agree to the following terms:
|
|
4
|
+
|
|
5
|
+
License notices This program is free software: you can redistribute it and/or modify it under the terms of the GNU AGPL v3 License as published by the Free Software Foundation, version 3 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL v3 License for more details www.gnu.org.
|
|
6
|
+
|
|
7
|
+
Disclaimer of Warranty There is no warranty for the program, to the extent permitted by applicable law; except when otherwise stated in writing the copyright holders and/or other parties provide the program "as is" without warranty of any kind, either expressed or implied, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. The entire risk as to the quality and performance of the program is with you. Should the program prove defective, you assume the cost of all necessary servicing, repair or correction.
|
|
8
|
+
|
|
9
|
+
Limitation of Liability In no event unless required by applicable law or agreed to in writing will any copyright holder, or any other party who modifies and/or conveys the program as permitted above, be liable to you for damages, including any general, special, incidental or consequential damages arising out of the use or inability to use the program (including but not limited to loss of data or data being rendered inaccurate or losses sustained by you or third parties or a failure of the program to operate with any other programs), even if such holder or other party has been advised of the possibility of such damages.
|
|
10
|
+
|
|
11
|
+
In case of dispute arising out or in relation to the use of the program, it is subject to the public law of Switzerland. The place of jurisdiction is Berne.
|
|
12
|
+
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: openimis-be-contract
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: The openIMIS Backend Contract reference module.
|
|
5
|
+
Home-page: https://openimis.org/
|
|
6
|
+
Author: Damian Borowiecki
|
|
7
|
+
Author-email: dborowiecki@soldevelo.com
|
|
8
|
+
License: GNU AGPL v3
|
|
9
|
+
Classifier: Environment :: Web Environment
|
|
10
|
+
Classifier: Framework :: Django
|
|
11
|
+
Classifier: Framework :: Django :: 2.1
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Classifier: Programming Language :: Python
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.6
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
License-File: LICENSE.md
|
|
20
|
+
Requires-Dist: django
|
|
21
|
+
Requires-Dist: django-db-signals
|
|
22
|
+
Requires-Dist: djangorestframework
|
|
23
|
+
Requires-Dist: openimis-be-core
|
|
24
|
+
Requires-Dist: openimis-be-policyholder
|
|
25
|
+
Requires-Dist: openimis-be-contribution_plan
|
|
26
|
+
Requires-Dist: openimis-be-payment
|
|
27
|
+
Requires-Dist: openimis-be-contribution
|
|
28
|
+
Requires-Dist: openimis-be-insuree
|
|
29
|
+
Requires-Dist: openimis-be-policy
|
|
30
|
+
Requires-Dist: openimis-be-calculation
|
|
31
|
+
|
|
32
|
+
# openIMIS Backend Contract reference module
|
|
33
|
+
This repository holds the files of the openIMIS Backend Contract reference module.
|
|
34
|
+
It is dedicated to be deployed as a module of [openimis-be_py](https://github.com/openimis/openimis-be_py).
|
|
35
|
+
|
|
36
|
+
## ORM mapping:
|
|
37
|
+
* tblContract > Contract
|
|
38
|
+
* tblContractDetails > ContractDetails
|
|
39
|
+
* tblContractContributionPlanDetails > ContractContributionPlanDetails
|
|
40
|
+
|
|
41
|
+
## Listened Django Signals
|
|
42
|
+
- post_save - Payment: handles service activate_contracted_policies - only when payment
|
|
43
|
+
is related to the contract/contracts. (it is verified by this post save)
|
|
44
|
+
Another payments are omitted in processing.
|
|
45
|
+
|
|
46
|
+
## GraphQl Queries
|
|
47
|
+
* contract
|
|
48
|
+
* contractDetails
|
|
49
|
+
* contractContributionPlanDetails
|
|
50
|
+
|
|
51
|
+
## GraphQL Mutations - each mutation emits default signals and return standard error lists (cfr. openimis-be-core_py)
|
|
52
|
+
* createContract
|
|
53
|
+
* updateContract
|
|
54
|
+
* deleteContract
|
|
55
|
+
* submitContract
|
|
56
|
+
* approveContract
|
|
57
|
+
* approveBulkContract (works with Celery)
|
|
58
|
+
* counterContract
|
|
59
|
+
* amendContract
|
|
60
|
+
* renewContract
|
|
61
|
+
* createContractDetails
|
|
62
|
+
* updateContractDetails
|
|
63
|
+
* deleteContractDetails
|
|
64
|
+
* createContractDetailsByPhInsuree
|
|
65
|
+
|
|
66
|
+
## Additional mutation log helper in Create graphQl mutations - ObjectMutation from core
|
|
67
|
+
- "ObjectMutation" from openimis-be-core_py - models.py
|
|
68
|
+
- "object_mutated" method allows the creation of an object to update the xxxMutation easily.
|
|
69
|
+
- dedicated for createContract and createContractDetails graphQl mutations
|
|
70
|
+
- more info about it and how it was implemented here in Contract module in models.py in class ObjectMutation in docs string
|
|
71
|
+
|
|
72
|
+
## Services
|
|
73
|
+
- Contract
|
|
74
|
+
- create
|
|
75
|
+
- update
|
|
76
|
+
- submit
|
|
77
|
+
- approve
|
|
78
|
+
- amend
|
|
79
|
+
- renew
|
|
80
|
+
- delete
|
|
81
|
+
- get_negative_amount_amendment
|
|
82
|
+
- terminate_contract
|
|
83
|
+
- ContractDetails
|
|
84
|
+
- get_details_from_ph_insuree
|
|
85
|
+
- ph_insuree_to_contract_details
|
|
86
|
+
- ContractContributionPlanDetails - CRUD services, replace
|
|
87
|
+
- create_ccpd (ccpd - acronym of contract contribution plan details)
|
|
88
|
+
- contract_valuation
|
|
89
|
+
- create_contribution
|
|
90
|
+
- PaymentService
|
|
91
|
+
- create (with creating payment details for that newly created payment)
|
|
92
|
+
- collect_payment_details (collect data from all contributions to assign it to the payment details)
|
|
93
|
+
|
|
94
|
+
## Configuration options (can be changed via core.ModuleConfiguration)
|
|
95
|
+
* gql_query_contract_perms: required rights to call createContract GraphQL Query (default: ["152101"])
|
|
96
|
+
* gql_query_contract_admins_perms: required rights to call contribution_plan_bundle_admin GraphQL Query (default: [])
|
|
97
|
+
|
|
98
|
+
* gql_mutation_create_contract_perms: required rights to call createContract, createContractDetails GraphQL Mutations (default: ["152102"])
|
|
99
|
+
* gql_mutation_update_contract_perms: required rights to call updateContract, updateContractDetails GraphQL Mutations (default: ["152103"])
|
|
100
|
+
* gql_mutation_delete_contract_perms: required rights to call deleteContract, deleteContractDetails GraphQL Mutations (default: ["152104"])
|
|
101
|
+
* gql_mutation_renew_contract_perms: required rights to call renewContract GraphQL Mutation (default: ["152106"])
|
|
102
|
+
* gql_mutation_submit_contract_perms: required rights to call submitContract GraphQL Mutation (default: ["152107"])
|
|
103
|
+
* gql_mutation_approve_ask_for_change_contract_perms: required rights to call approveContract, approveBulkContract and counterContract GraphQL Mutations (default: ["152108"])
|
|
104
|
+
* gql_mutation_amend_contract_perms: required rights to call amendContract GraphQL Mutation (default: ["152109"])
|
|
105
|
+
|
|
106
|
+
## openIMIS Modules Dependencies
|
|
107
|
+
- core.models.HistoryModel
|
|
108
|
+
- core.models.HistoryBusinessModel
|
|
109
|
+
- core.models.ObjectMutation
|
|
110
|
+
- policyholder.models.PolicyHolder
|
|
111
|
+
- policyholder.models.PolicyHolderInsuree
|
|
112
|
+
- contribution_plan.models.ContributionPlan
|
|
113
|
+
- contribution_plan.models.ContributionPlanBundleDetails
|
|
114
|
+
- insuree.models.Insuree
|
|
115
|
+
- insuree.models.InsureePolicy
|
|
116
|
+
- contribution.models.Premium
|
|
117
|
+
- payment.models.Payment
|
|
118
|
+
- payment.models.PaymentDetail
|
|
119
|
+
- policy.models.Policy
|
|
120
|
+
- calculation module
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
## bulk operations - required configuration
|
|
124
|
+
- for 'bulk approve contract' and 'bulk counter contract' graphQL mutations
|
|
125
|
+
- running rabbitmq docker image
|
|
126
|
+
- running celery within "{imis_directory}/openimis-be_py/venv/bin/celery":
|
|
127
|
+
`-A openIMIS worker --loglevel=DEBUG --without-gossip --without-mingle --without-heartbeat -Ofair`
|
|
128
|
+
- without this required steps you won't be able to bulk counter/approve contract
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# openIMIS Backend Contract reference module
|
|
2
|
+
This repository holds the files of the openIMIS Backend Contract reference module.
|
|
3
|
+
It is dedicated to be deployed as a module of [openimis-be_py](https://github.com/openimis/openimis-be_py).
|
|
4
|
+
|
|
5
|
+
## ORM mapping:
|
|
6
|
+
* tblContract > Contract
|
|
7
|
+
* tblContractDetails > ContractDetails
|
|
8
|
+
* tblContractContributionPlanDetails > ContractContributionPlanDetails
|
|
9
|
+
|
|
10
|
+
## Listened Django Signals
|
|
11
|
+
- post_save - Payment: handles service activate_contracted_policies - only when payment
|
|
12
|
+
is related to the contract/contracts. (it is verified by this post save)
|
|
13
|
+
Another payments are omitted in processing.
|
|
14
|
+
|
|
15
|
+
## GraphQl Queries
|
|
16
|
+
* contract
|
|
17
|
+
* contractDetails
|
|
18
|
+
* contractContributionPlanDetails
|
|
19
|
+
|
|
20
|
+
## GraphQL Mutations - each mutation emits default signals and return standard error lists (cfr. openimis-be-core_py)
|
|
21
|
+
* createContract
|
|
22
|
+
* updateContract
|
|
23
|
+
* deleteContract
|
|
24
|
+
* submitContract
|
|
25
|
+
* approveContract
|
|
26
|
+
* approveBulkContract (works with Celery)
|
|
27
|
+
* counterContract
|
|
28
|
+
* amendContract
|
|
29
|
+
* renewContract
|
|
30
|
+
* createContractDetails
|
|
31
|
+
* updateContractDetails
|
|
32
|
+
* deleteContractDetails
|
|
33
|
+
* createContractDetailsByPhInsuree
|
|
34
|
+
|
|
35
|
+
## Additional mutation log helper in Create graphQl mutations - ObjectMutation from core
|
|
36
|
+
- "ObjectMutation" from openimis-be-core_py - models.py
|
|
37
|
+
- "object_mutated" method allows the creation of an object to update the xxxMutation easily.
|
|
38
|
+
- dedicated for createContract and createContractDetails graphQl mutations
|
|
39
|
+
- more info about it and how it was implemented here in Contract module in models.py in class ObjectMutation in docs string
|
|
40
|
+
|
|
41
|
+
## Services
|
|
42
|
+
- Contract
|
|
43
|
+
- create
|
|
44
|
+
- update
|
|
45
|
+
- submit
|
|
46
|
+
- approve
|
|
47
|
+
- amend
|
|
48
|
+
- renew
|
|
49
|
+
- delete
|
|
50
|
+
- get_negative_amount_amendment
|
|
51
|
+
- terminate_contract
|
|
52
|
+
- ContractDetails
|
|
53
|
+
- get_details_from_ph_insuree
|
|
54
|
+
- ph_insuree_to_contract_details
|
|
55
|
+
- ContractContributionPlanDetails - CRUD services, replace
|
|
56
|
+
- create_ccpd (ccpd - acronym of contract contribution plan details)
|
|
57
|
+
- contract_valuation
|
|
58
|
+
- create_contribution
|
|
59
|
+
- PaymentService
|
|
60
|
+
- create (with creating payment details for that newly created payment)
|
|
61
|
+
- collect_payment_details (collect data from all contributions to assign it to the payment details)
|
|
62
|
+
|
|
63
|
+
## Configuration options (can be changed via core.ModuleConfiguration)
|
|
64
|
+
* gql_query_contract_perms: required rights to call createContract GraphQL Query (default: ["152101"])
|
|
65
|
+
* gql_query_contract_admins_perms: required rights to call contribution_plan_bundle_admin GraphQL Query (default: [])
|
|
66
|
+
|
|
67
|
+
* gql_mutation_create_contract_perms: required rights to call createContract, createContractDetails GraphQL Mutations (default: ["152102"])
|
|
68
|
+
* gql_mutation_update_contract_perms: required rights to call updateContract, updateContractDetails GraphQL Mutations (default: ["152103"])
|
|
69
|
+
* gql_mutation_delete_contract_perms: required rights to call deleteContract, deleteContractDetails GraphQL Mutations (default: ["152104"])
|
|
70
|
+
* gql_mutation_renew_contract_perms: required rights to call renewContract GraphQL Mutation (default: ["152106"])
|
|
71
|
+
* gql_mutation_submit_contract_perms: required rights to call submitContract GraphQL Mutation (default: ["152107"])
|
|
72
|
+
* gql_mutation_approve_ask_for_change_contract_perms: required rights to call approveContract, approveBulkContract and counterContract GraphQL Mutations (default: ["152108"])
|
|
73
|
+
* gql_mutation_amend_contract_perms: required rights to call amendContract GraphQL Mutation (default: ["152109"])
|
|
74
|
+
|
|
75
|
+
## openIMIS Modules Dependencies
|
|
76
|
+
- core.models.HistoryModel
|
|
77
|
+
- core.models.HistoryBusinessModel
|
|
78
|
+
- core.models.ObjectMutation
|
|
79
|
+
- policyholder.models.PolicyHolder
|
|
80
|
+
- policyholder.models.PolicyHolderInsuree
|
|
81
|
+
- contribution_plan.models.ContributionPlan
|
|
82
|
+
- contribution_plan.models.ContributionPlanBundleDetails
|
|
83
|
+
- insuree.models.Insuree
|
|
84
|
+
- insuree.models.InsureePolicy
|
|
85
|
+
- contribution.models.Premium
|
|
86
|
+
- payment.models.Payment
|
|
87
|
+
- payment.models.PaymentDetail
|
|
88
|
+
- policy.models.Policy
|
|
89
|
+
- calculation module
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
## bulk operations - required configuration
|
|
93
|
+
- for 'bulk approve contract' and 'bulk counter contract' graphQL mutations
|
|
94
|
+
- running rabbitmq docker image
|
|
95
|
+
- running celery within "{imis_directory}/openimis-be_py/venv/bin/celery":
|
|
96
|
+
`-A openIMIS worker --loglevel=DEBUG --without-gossip --without-mingle --without-heartbeat -Ofair`
|
|
97
|
+
- without this required steps you won't be able to bulk counter/approve contract
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
default_app_config = "contract.apps.ContractConfig"
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
from django.apps import AppConfig
|
|
2
|
+
|
|
3
|
+
MODULE_NAME = "contract"
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
DEFAULT_CFG = {
|
|
7
|
+
"gql_query_contract_perms": ["152101"],
|
|
8
|
+
"gql_query_contract_admins_perms": [],
|
|
9
|
+
"gql_mutation_create_contract_perms": ["152102"],
|
|
10
|
+
"gql_mutation_update_contract_perms": ["152103"],
|
|
11
|
+
"gql_mutation_delete_contract_perms": ["152104"],
|
|
12
|
+
"gql_mutation_renew_contract_perms": ["152106"],
|
|
13
|
+
"gql_mutation_submit_contract_perms": ["152107"],
|
|
14
|
+
"gql_mutation_approve_ask_for_change_contract_perms": ["152108"],
|
|
15
|
+
"gql_mutation_amend_contract_perms": ["152109"],
|
|
16
|
+
"gql_query_payment_perms": ["101401"],
|
|
17
|
+
"gql_mutation_create_payments_perms": ["101402"],
|
|
18
|
+
"gql_mutation_update_payments_perms": ["101403"],
|
|
19
|
+
"gql_mutation_delete_payments_perms": ["101404"],
|
|
20
|
+
"gql_mutation_approve_payments_perms": ["101408"],
|
|
21
|
+
# OFS-259: Support the policyholder portal perms on Contract
|
|
22
|
+
"gql_query_contract_policyholder_portal_perms": ["154201"],
|
|
23
|
+
"gql_mutation_create_contract_policyholder_portal_perms": ["154202"],
|
|
24
|
+
"gql_mutation_update_contract_policyholder_portal_perms": ["154203"],
|
|
25
|
+
"gql_mutation_submit_contract_policyholder_portal_perms": ["154207"],
|
|
26
|
+
"gql_mutation_amend_contract_policyholder_portal_perms": ["154209"],
|
|
27
|
+
"gql_invoice_create_perms": ["155102"],
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class ContractConfig(AppConfig):
|
|
32
|
+
name = MODULE_NAME
|
|
33
|
+
gql_query_contract_perms = []
|
|
34
|
+
gql_query_contract_admins_perms = []
|
|
35
|
+
gql_mutation_create_contract_perms = []
|
|
36
|
+
gql_mutation_update_contract_perms = []
|
|
37
|
+
gql_mutation_delete_contract_perms = []
|
|
38
|
+
gql_mutation_renew_contract_perms = []
|
|
39
|
+
gql_mutation_submit_contract_perms = []
|
|
40
|
+
gql_mutation_approve_ask_for_change_contract_perms = []
|
|
41
|
+
gql_mutation_amend_contract_perms = []
|
|
42
|
+
gql_mutation_create_payments_perms = []
|
|
43
|
+
gql_mutation_update_payments_perms = []
|
|
44
|
+
gql_mutation_delete_payments_perms = []
|
|
45
|
+
gql_mutation_approve_payments_perms = []
|
|
46
|
+
# OFS-259: Support the policyholder portal perms on Contract
|
|
47
|
+
gql_query_contract_policyholder_portal_perms = []
|
|
48
|
+
gql_mutation_create_contract_policyholder_portal_perms = []
|
|
49
|
+
gql_mutation_update_contract_policyholder_portal_perms = []
|
|
50
|
+
gql_mutation_submit_contract_policyholder_portal_perms = []
|
|
51
|
+
gql_mutation_amend_contract_policyholder_portal_perms = []
|
|
52
|
+
gql_invoice_create_perms = []
|
|
53
|
+
|
|
54
|
+
def __load_config(self, cfg):
|
|
55
|
+
for field in cfg:
|
|
56
|
+
if hasattr(ContractConfig, field):
|
|
57
|
+
setattr(ContractConfig, field, cfg[field])
|
|
58
|
+
|
|
59
|
+
def ready(self):
|
|
60
|
+
from core.models import ModuleConfiguration
|
|
61
|
+
|
|
62
|
+
cfg = ModuleConfiguration.get_or_default(MODULE_NAME, DEFAULT_CFG)
|
|
63
|
+
self.__load_config(cfg)
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
CONTRACT_STATE = {
|
|
2
|
+
"ContractState": [
|
|
3
|
+
{
|
|
4
|
+
"value": "1",
|
|
5
|
+
"label": {"fr": "Demande d'information", "en": "Request for information"},
|
|
6
|
+
},
|
|
7
|
+
{"value": "2", "label": {"fr": "Brouillon", "en": "Draft"}},
|
|
8
|
+
{"value": "3", "label": {"fr": "Offre", "en": "offer"}},
|
|
9
|
+
{"value": "4", "label": {"fr": "En negociation", "en": "Negotiable"}},
|
|
10
|
+
{"value": "5", "label": {"fr": "Apprové", "en": "executable"}},
|
|
11
|
+
{"value": "6", "label": {"fr": "addendum", "en": "addendum"}},
|
|
12
|
+
{"value": "7", "label": {"fr": "En cours", "en": "effective"}},
|
|
13
|
+
{"value": "8", "label": {"fr": "Appliqué", "en": "executed"}},
|
|
14
|
+
{"value": "9", "label": {"fr": "Suspendu", "en": "Disputed"}},
|
|
15
|
+
{"value": "10", "label": {"fr": "Terminé", "en": "terminated"}},
|
|
16
|
+
{"value": "11", "label": {"fr": "révision demandé", "en": "counter"}},
|
|
17
|
+
]
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def get_message_approved_contract(
|
|
22
|
+
code, name, contact_name, due_amount, payment_reference, language="en"
|
|
23
|
+
):
|
|
24
|
+
message_payment_notification = {
|
|
25
|
+
"payment_notification": {
|
|
26
|
+
"en": f"""
|
|
27
|
+
Dear {contact_name}
|
|
28
|
+
|
|
29
|
+
The contract {code} - {name} was approved.
|
|
30
|
+
Please proceed to the payment of {due_amount} with the reference {payment_reference}.
|
|
31
|
+
|
|
32
|
+
Best regards,
|
|
33
|
+
""",
|
|
34
|
+
"fr": f"""
|
|
35
|
+
Monsieur, Madame {contact_name}
|
|
36
|
+
|
|
37
|
+
le contract {code} - {name} à été apprové.
|
|
38
|
+
Veuillez faire un paiement de < CONTRACT - DUEAMOUNT > avec la référence {payment_reference}.
|
|
39
|
+
|
|
40
|
+
Meilleurs Salutations
|
|
41
|
+
""",
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return message_payment_notification["payment_notification"][language]
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def get_message_counter_contract(code, name, contact_name, language="en"):
|
|
48
|
+
message_payment_notification = {
|
|
49
|
+
"payment_notification": {
|
|
50
|
+
"en": f"""
|
|
51
|
+
Dear {contact_name}
|
|
52
|
+
|
|
53
|
+
The contract {code} - {name} was counter.
|
|
54
|
+
Please proceed recheck the information and correct the issues,
|
|
55
|
+
in case of questions please check contact us.
|
|
56
|
+
|
|
57
|
+
Best regards,
|
|
58
|
+
""",
|
|
59
|
+
"fr": f"""
|
|
60
|
+
Monsieur, Madame {contact_name}
|
|
61
|
+
|
|
62
|
+
le contract {code} - {name} à été contré.
|
|
63
|
+
Veuillez verifier les information saisie, en cas de question veuillez nous contacter.
|
|
64
|
+
|
|
65
|
+
Meilleurs Salutations
|
|
66
|
+
""",
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return message_payment_notification["payment_notification"][language]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# from .gql_types import *
|
|
File without changes
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
from core.gql.gql_mutations import DeleteInputType
|
|
2
|
+
from core.gql.gql_mutations.base_mutation import (
|
|
3
|
+
BaseDeleteMutation,
|
|
4
|
+
BaseHistoryModelCreateMutationMixin,
|
|
5
|
+
BaseHistoryModelDeleteMutationMixin,
|
|
6
|
+
BaseHistoryModelUpdateMutationMixin,
|
|
7
|
+
BaseMutation,
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
from contract.gql.gql_mutations.input_types import (
|
|
11
|
+
ContractDetailsCreateFromInsureeInputType,
|
|
12
|
+
ContractDetailsCreateInputType,
|
|
13
|
+
ContractDetailsUpdateInputType,
|
|
14
|
+
)
|
|
15
|
+
from contract.models import ContractDetails, ContractDetailsMutation
|
|
16
|
+
|
|
17
|
+
from .mutations import ContractDetailsFromPHInsureeMutationMixin
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class CreateContractDetailsMutation(BaseHistoryModelCreateMutationMixin, BaseMutation):
|
|
21
|
+
_mutation_class = "ContractDetailsMutation"
|
|
22
|
+
_mutation_module = "contract"
|
|
23
|
+
_model = ContractDetails
|
|
24
|
+
|
|
25
|
+
@classmethod
|
|
26
|
+
def _mutate(cls, user, **data):
|
|
27
|
+
client_mutation_id = data.get("client_mutation_id")
|
|
28
|
+
if "client_mutation_id" in data:
|
|
29
|
+
data.pop("client_mutation_id")
|
|
30
|
+
if "client_mutation_label" in data:
|
|
31
|
+
data.pop("client_mutation_label")
|
|
32
|
+
contract_detail = cls.create_object(user=user, object_data=data)
|
|
33
|
+
ContractDetailsMutation.object_mutated(
|
|
34
|
+
user, client_mutation_id=client_mutation_id, contract_detail=contract_detail
|
|
35
|
+
)
|
|
36
|
+
return None
|
|
37
|
+
|
|
38
|
+
class Input(ContractDetailsCreateInputType):
|
|
39
|
+
pass
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
class UpdateContractDetailsMutation(BaseHistoryModelUpdateMutationMixin, BaseMutation):
|
|
43
|
+
_mutation_class = "ContractDetailsMutation"
|
|
44
|
+
_mutation_module = "contract"
|
|
45
|
+
_model = ContractDetails
|
|
46
|
+
|
|
47
|
+
class Input(ContractDetailsUpdateInputType):
|
|
48
|
+
pass
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
class DeleteContractDetailsMutation(
|
|
52
|
+
BaseHistoryModelDeleteMutationMixin, BaseDeleteMutation
|
|
53
|
+
):
|
|
54
|
+
_mutation_class = "ContractDetailsMutation"
|
|
55
|
+
_mutation_module = "contract"
|
|
56
|
+
_model = ContractDetails
|
|
57
|
+
|
|
58
|
+
class Input(DeleteInputType):
|
|
59
|
+
pass
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
class CreateContractDetailByPolicyHolderInsureeMutation(
|
|
63
|
+
ContractDetailsFromPHInsureeMutationMixin, BaseMutation
|
|
64
|
+
):
|
|
65
|
+
_mutation_class = "CreateContractDetailByPolicyHolderInsureetMutation"
|
|
66
|
+
_mutation_module = "contract"
|
|
67
|
+
_model = ContractDetails
|
|
68
|
+
|
|
69
|
+
class Input(ContractDetailsCreateFromInsureeInputType):
|
|
70
|
+
pass
|