avniproject / avni-server

Backend APIs for Avni
https://avniproject.org
GNU Affero General Public License v3.0
6 stars 25 forks source link

[Sync] - Looking up form mappings when none exist #567

Closed vinayvenu closed 1 year ago

vinayvenu commented 1 year ago

Issue

Form mappings are voided whenever we delete a subject type, program or encounter type.

However, voided subject types, programs and encounter types, as well as their transactional data are synced to the client.

When syncing, we need to find the sync scope (catchment, direct assignment etc) of an encounter. This requires us to look up the form mapping, find the subject type and then look up the sync scope from it. We need a non-voided form mapping in order to do this.

If we ever delete an existing program or encounter type, the client still expects sync to happen, and we try to look up form mappings. If these are unavailable, then the sync fails because it is hard to figure out the subject type that the form mapping is associated to.

Solution

Acceptance criteria

1t5j0y commented 1 year ago

Added entity approval to list of syncs in the story description. Checklist sync API uses checklistuuid and does not refer to form mappings.