Open megh-k opened 2 years ago
Merging #235 (c7a4f04) into upgrade-prk-casepro-to-v1.9.2 (dfe1f3f) will not change coverage. The diff coverage is
100.00%
.
@@ Coverage Diff @@
## upgrade-prk-casepro-to-v1.9.2 #235 +/- ##
===============================================================
Coverage 100.00% 100.00%
===============================================================
Files 72 72
Lines 4670 4731 +61
===============================================================
+ Hits 4670 4731 +61
Impacted Files | Coverage Δ | |
---|---|---|
casepro/backend/__init__.py | 100.00% <100.00%> (ø) |
|
casepro/backend/rapidpro.py | 100.00% <100.00%> (ø) |
|
casepro/cases/views.py | 100.00% <100.00%> (ø) |
|
casepro/contacts/models.py | 100.00% <100.00%> (ø) |
|
casepro/contacts/views.py | 100.00% <100.00%> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update dfe1f3f...c7a4f04. Read the comment docs.
The files that need to be checked are
casepro/backend/rapidpro.py
specifically the push_contacts function Adding urls to sync here and here Function to push contacts to rapidpro here Calling push contact and setting the UUID for the new contact from rapidpro herecasepro/backend/tests/test_rapidpro.py
Testing needs work herecasepro/contacts/models.py
In the models the uuid is retrieved from rapidpro and set to the casepro contact hereDescription for the RapidPro devs: The
push_contact
function was necessary for the Open Case button functionality. For this to work a few things are necessary, as summarised below:urn.path
from the frontend but left the placeholder.push_contact
checks for the contact in RapidPro by the URN, if it doesn't exist, the contact is created in RapidPro and the RapidProuuid
is returned.get_or_create_from_urn
looks for the contact in CasePro by the URN, if it does not exist, it gets the contact from RapidPro and itsuuid
, it then looks for the CasePro contact by theuuid
to avoid duplicated, if it still doesn't exist, a new CasePro contact is made and theuuid
is set to match the RapidProuuid
.