diff --git a/backend/hct_mis_api/apps/account/export_users_xlsx.py b/backend/hct_mis_api/apps/account/export_users_xlsx.py index 9c6eb9cf51..8517876e99 100644 --- a/backend/hct_mis_api/apps/account/export_users_xlsx.py +++ b/backend/hct_mis_api/apps/account/export_users_xlsx.py @@ -55,7 +55,7 @@ def _add_headers(self) -> None: for i in range(1, len(self.FIELDS_TO_COLUMNS_MAPPING) + 1): self.ws.column_dimensions[get_column_letter(i)].width = 20 - @transaction.atomic(using="default") + @transaction.atomic() def get_exported_users_file(self) -> Optional[Workbook]: fields = self.FIELDS_TO_COLUMNS_MAPPING.values() users = ( diff --git a/backend/hct_mis_api/apps/administration/tests/test_admin.py b/backend/hct_mis_api/apps/administration/tests/test_admin.py index 728bfd6072..be0af32f30 100644 --- a/backend/hct_mis_api/apps/administration/tests/test_admin.py +++ b/backend/hct_mis_api/apps/administration/tests/test_admin.py @@ -54,7 +54,6 @@ class TestAdminSite(WebTest): "cash_assist_datahub_ca", "cash_assist_datahub_erp", "cash_assist_datahub_mis", - "registration_datahub", ] @classmethod diff --git a/backend/hct_mis_api/apps/cash_assist_datahub/admin.py b/backend/hct_mis_api/apps/cash_assist_datahub/admin.py index d9a884a51f..9997ec7d5f 100644 --- a/backend/hct_mis_api/apps/cash_assist_datahub/admin.py +++ b/backend/hct_mis_api/apps/cash_assist_datahub/admin.py @@ -101,7 +101,7 @@ def simulate_import(self, request: "HttpRequest", pk: "UUID") -> Optional[Templa runner = PullFromDatahubTask() try: - with transaction.atomic(using="default"), transaction.atomic(using="cash_assist_datahub_ca"): + with transaction.atomic(), transaction.atomic(using="cash_assist_datahub_ca"): runner.copy_session(session) raise RollbackException() except RollbackException: diff --git a/backend/hct_mis_api/apps/cash_assist_datahub/tasks/pull_from_datahub.py b/backend/hct_mis_api/apps/cash_assist_datahub/tasks/pull_from_datahub.py index 5f7180a716..0bbb5ea481 100644 --- a/backend/hct_mis_api/apps/cash_assist_datahub/tasks/pull_from_datahub.py +++ b/backend/hct_mis_api/apps/cash_assist_datahub/tasks/pull_from_datahub.py @@ -139,7 +139,7 @@ def copy_session(self, session: "AbstractSession") -> None: session.save(update_fields=("status",)) self.clear_cache(session) try: - with transaction.atomic(using="default"), transaction.atomic(using="cash_assist_datahub_ca"): + with transaction.atomic(), transaction.atomic(using="cash_assist_datahub_ca"): self.copy_service_providers(session) self.copy_programs(session) self.copy_target_population(session) diff --git a/backend/hct_mis_api/apps/core/celery_tasks.py b/backend/hct_mis_api/apps/core/celery_tasks.py index 22b5d06e47..27044bf646 100644 --- a/backend/hct_mis_api/apps/core/celery_tasks.py +++ b/backend/hct_mis_api/apps/core/celery_tasks.py @@ -112,7 +112,7 @@ def create_target_population_task(self: Any, storage_id: str, program_id: str, t set_sentry_business_area_tag(program.business_area.name) try: - with transaction.atomic(), transaction.atomic("registration_datahub"): + with transaction.atomic(): registration_data_import = RegistrationDataImport.objects.create( name=f"{storage_obj.file.name}_{program.name}", number_of_individuals=0, diff --git a/backend/hct_mis_api/apps/core/field_attributes/core_fields_attributes.py b/backend/hct_mis_api/apps/core/field_attributes/core_fields_attributes.py index fe838924fa..d17f7a084c 100644 --- a/backend/hct_mis_api/apps/core/field_attributes/core_fields_attributes.py +++ b/backend/hct_mis_api/apps/core/field_attributes/core_fields_attributes.py @@ -92,8 +92,10 @@ SEX_CHOICE, WORK_STATUS_CHOICE, ) -from hct_mis_api.apps.registration_data.models import RegistrationDataImport -from hct_mis_api.apps.registration_datahub.models import COLLECT_TYPES +from hct_mis_api.apps.registration_data.models import ( + COLLECT_TYPES, + RegistrationDataImport, +) logger = logging.getLogger(__name__) diff --git a/backend/hct_mis_api/apps/core/kobo/common.py b/backend/hct_mis_api/apps/core/kobo/common.py index 09e13780a5..77d8e76c3b 100644 --- a/backend/hct_mis_api/apps/core/kobo/common.py +++ b/backend/hct_mis_api/apps/core/kobo/common.py @@ -71,9 +71,6 @@ def count_population(results: list, business_area: BusinessArea) -> tuple[int, i from hct_mis_api.apps.core.utils import rename_dict_keys from hct_mis_api.apps.registration_data.models import KoboImportedSubmission - from hct_mis_api.apps.registration_datahub.tasks.utils import ( - get_submission_metadata, - ) total_households_count = 0 total_individuals_count = 0 @@ -119,3 +116,16 @@ def filter_by_owner(data: List, business_area: BusinessArea) -> List: if data: return [element for element in data if element["owner__username"] == kobo_username] return [] + + +def get_submission_metadata(household_data_dict: Dict) -> Dict: + meta_fields_mapping = { + "_uuid": "kobo_submission_uuid", + "_xform_id_string": "kobo_asset_id", + "_submission_time": "kobo_submission_time", + } + submission_meta_data = {} + for meta_field, model_field_name in meta_fields_mapping.items(): + submission_meta_data[model_field_name] = household_data_dict.get(meta_field) + + return submission_meta_data diff --git a/backend/hct_mis_api/apps/core/management/commands/createadminpermissiongroups.py b/backend/hct_mis_api/apps/core/management/commands/createadminpermissiongroups.py index 1c6ca83b2b..9e7b7a5dbe 100644 --- a/backend/hct_mis_api/apps/core/management/commands/createadminpermissiongroups.py +++ b/backend/hct_mis_api/apps/core/management/commands/createadminpermissiongroups.py @@ -76,18 +76,6 @@ def handle(self, *args: Any, **options: Any) -> Any: "targetpopulation", ], "erp_datahub": ["downpayment", "fundscommitment"], - "registration_datahub": [ - "importdata", - "importedindividualidentity", - "importeddocumenttype", - "importeddocument", - "importedhousehold", - "importedindividualroleinhousehold", - "importedindividual", - "koboimportedsubmission", - "record", - "registrationdataimportdatahub", - ], "mis_datahub": [ "document", "downpayment", diff --git a/backend/hct_mis_api/apps/core/management/commands/generatedocumenttypes.py b/backend/hct_mis_api/apps/core/management/commands/generatedocumenttypes.py index 881597a34f..c54686bc79 100644 --- a/backend/hct_mis_api/apps/core/management/commands/generatedocumenttypes.py +++ b/backend/hct_mis_api/apps/core/management/commands/generatedocumenttypes.py @@ -5,9 +5,6 @@ from hct_mis_api.apps.core.utils import IDENTIFICATION_TYPE_TO_KEY_MAPPING from hct_mis_api.apps.household.models import IDENTIFICATION_TYPE_CHOICE, DocumentType -from hct_mis_api.apps.registration_datahub.models import ( - ImportedDocumentType as RDHDocumentType, -) class Command(BaseCommand): @@ -17,9 +14,6 @@ class Command(BaseCommand): def handle(self, *args: Any, **options: Any) -> None: identification_type_choice = tuple((doc_type, label) for doc_type, label in IDENTIFICATION_TYPE_CHOICE) document_types = [] - rdh_document_types = [] for doc_type, label in identification_type_choice: document_types.append(DocumentType(label=label, key=IDENTIFICATION_TYPE_TO_KEY_MAPPING[doc_type])) - rdh_document_types.append(RDHDocumentType(label=label, key=IDENTIFICATION_TYPE_TO_KEY_MAPPING[doc_type])) DocumentType.objects.bulk_create(document_types, ignore_conflicts=True) - RDHDocumentType.objects.bulk_create(rdh_document_types, ignore_conflicts=True) diff --git a/backend/hct_mis_api/apps/core/management/commands/generatefixtures.py b/backend/hct_mis_api/apps/core/management/commands/generatefixtures.py index 1eeeb8795a..5b156863f5 100644 --- a/backend/hct_mis_api/apps/core/management/commands/generatefixtures.py +++ b/backend/hct_mis_api/apps/core/management/commands/generatefixtures.py @@ -37,12 +37,7 @@ ) from hct_mis_api.apps.program.fixtures import ProgramFactory from hct_mis_api.apps.program.models import Program -from hct_mis_api.apps.registration_data.fixtures import ( - RegistrationDataImportDatahubFactory, - RegistrationDataImportFactory, -) -from hct_mis_api.apps.registration_data.models import RegistrationDataImport -from hct_mis_api.apps.registration_datahub.fixtures import create_imported_household +from hct_mis_api.apps.registration_data.fixtures import RegistrationDataImportFactory from hct_mis_api.apps.targeting.fixtures import ( TargetingCriteriaFactory, TargetingCriteriaRuleFactory, @@ -209,7 +204,6 @@ def handle(self, *args: Any, **options: Any) -> None: call_command("flush", "--noinput", database="cash_assist_datahub_mis") call_command("flush", "--noinput", database="cash_assist_datahub_ca") call_command("flush", "--noinput", database="cash_assist_datahub_erp") - call_command("flush", "--noinput", database="registration_datahub") call_command( "loaddata", "hct_mis_api/apps/account/fixtures/superuser.json", @@ -251,19 +245,6 @@ def handle(self, *args: Any, **options: Any) -> None: for _ in range(programs_amount): self._generate_program_with_dependencies(options, index) - # Data imports generation - - for rdi in RegistrationDataImport.objects.all(): - rdi_datahub = RegistrationDataImportDatahubFactory( - name=rdi.name, hct_id=rdi.id, business_area_slug=rdi.business_area.slug - ) - rdi.datahub_id = rdi_datahub.id - rdi.save() - for _ in range(10): - create_imported_household( - {"registration_data_import": rdi_datahub}, - {"registration_data_import": rdi_datahub}, - ) session = Session(source=Session.SOURCE_CA, status=Session.STATUS_READY) session.save() cash_assist_datahub_fixtures.ServiceProviderFactory.create_batch(10, session=session) diff --git a/backend/hct_mis_api/apps/core/management/commands/initcypress.py b/backend/hct_mis_api/apps/core/management/commands/initcypress.py index 48e928385a..b274dbcea2 100644 --- a/backend/hct_mis_api/apps/core/management/commands/initcypress.py +++ b/backend/hct_mis_api/apps/core/management/commands/initcypress.py @@ -30,18 +30,12 @@ def handle(self, *args: Any, **options: Any) -> None: call_command("flush", "--noinput", database="cash_assist_datahub_mis") call_command("flush", "--noinput", database="cash_assist_datahub_ca") call_command("flush", "--noinput", database="cash_assist_datahub_erp") - call_command("flush", "--noinput", database="registration_datahub") call_command("loaddata", f"{settings.PROJECT_ROOT}/apps/geo/fixtures/data.json") call_command("loaddata", f"{settings.PROJECT_ROOT}/apps/core/fixtures/data.json") call_command("loaddata", f"{settings.PROJECT_ROOT}/apps/account/fixtures/data.json") call_command("loaddata", f"{settings.PROJECT_ROOT}/apps/program/fixtures/data-cypress.json") call_command("loaddata", f"{settings.PROJECT_ROOT}/apps/registration_data/fixtures/data-cypress.json") - call_command( - "loaddata", - f"{settings.PROJECT_ROOT}/apps/registration_datahub/fixtures/data-cypress.json", - database="registration_datahub", - ) call_command("loaddata", f"{settings.PROJECT_ROOT}/apps/household/fixtures/documenttype.json") call_command("loaddata", f"{settings.PROJECT_ROOT}/apps/household/fixtures/data-cypress.json") call_command("loaddata", f"{settings.PROJECT_ROOT}/apps/targeting/fixtures/data-cypress.json") diff --git a/backend/hct_mis_api/apps/core/management/commands/initdemo.py b/backend/hct_mis_api/apps/core/management/commands/initdemo.py index 49bbccf6d7..6d72be2bf0 100644 --- a/backend/hct_mis_api/apps/core/management/commands/initdemo.py +++ b/backend/hct_mis_api/apps/core/management/commands/initdemo.py @@ -54,7 +54,6 @@ def handle(self, *args: Any, **options: Any) -> None: call_command("flush", "--noinput", database="cash_assist_datahub_mis") call_command("flush", "--noinput", database="cash_assist_datahub_ca") call_command("flush", "--noinput", database="cash_assist_datahub_erp") - call_command("flush", "--noinput", database="registration_datahub") call_command("loaddata", f"{settings.PROJECT_ROOT}/apps/geo/fixtures/data.json") call_command("loaddata", f"{settings.PROJECT_ROOT}/apps/core/fixtures/data.json") @@ -65,12 +64,6 @@ def handle(self, *args: Any, **options: Any) -> None: call_command("loaddata", f"{settings.PROJECT_ROOT}/apps/household/fixtures/documenttype.json") call_command("loaddata", f"{settings.PROJECT_ROOT}/apps/household/fixtures/data.json") call_command("loaddata", f"{settings.PROJECT_ROOT}/apps/accountability/fixtures/data.json") - - call_command( - "loaddata", - f"{settings.PROJECT_ROOT}/apps/registration_datahub/fixtures/data.json", - database="registration_datahub", - ) call_command("loaddata", f"{settings.PROJECT_ROOT}/apps/steficon/fixtures/data.json") call_command("loaddata", f"{settings.PROJECT_ROOT}/aurora/fixtures/data.json") diff --git a/backend/hct_mis_api/apps/core/tasks_schedules.py b/backend/hct_mis_api/apps/core/tasks_schedules.py index e11724151f..3a819d914e 100644 --- a/backend/hct_mis_api/apps/core/tasks_schedules.py +++ b/backend/hct_mis_api/apps/core/tasks_schedules.py @@ -41,10 +41,6 @@ "task": "hct_mis_api.apps.registration_datahub.celery_tasks.check_rdi_import_periodic_task", "schedule": crontab(minute="*/15"), }, - # "remove_old_rdi_links_task": { - # "task": "hct_mis_api.apps.registration_datahub.celery_tasks.remove_old_rdi_links_task", - # "schedule": crontab(0, 0, day_of_month="1,15"), - # }, "clean_old_record_files_task": { "task": "hct_mis_api.aurora.celery_tasks.clean_old_record_files_task", "schedule": crontab(month_of_year="2-12/2"), diff --git a/backend/hct_mis_api/apps/core/tests/test_edopomoga_tp_creation.py b/backend/hct_mis_api/apps/core/tests/test_edopomoga_tp_creation.py index fb81632481..2e259e79ad 100644 --- a/backend/hct_mis_api/apps/core/tests/test_edopomoga_tp_creation.py +++ b/backend/hct_mis_api/apps/core/tests/test_edopomoga_tp_creation.py @@ -19,7 +19,7 @@ class TestEdopomogaCreation(APITestCase): - databases = ("default", "registration_datahub", "cash_assist_datahub_mis") + databases = ("default", "cash_assist_datahub_mis") @classmethod def setUpTestData(cls) -> None: diff --git a/backend/hct_mis_api/apps/erp_datahub/admin.py b/backend/hct_mis_api/apps/erp_datahub/admin.py index 4fb63f9094..6e7ba8e8ed 100644 --- a/backend/hct_mis_api/apps/erp_datahub/admin.py +++ b/backend/hct_mis_api/apps/erp_datahub/admin.py @@ -128,7 +128,7 @@ class FundsCommitmentAdmin(HOPEModelAdminBase): search_fields = ("rec_serial_number", "vendor_id", "wbs_element", "funds_commitment_number") @atomic(using="cash_assist_datahub_erp") - @atomic(using="default") + @atomic() @button(permission=should_show_assign_business_office) def assign_business_office( self, request: "HttpRequest", pk: "UUID" @@ -224,7 +224,7 @@ class DownPaymentAdmin(HOPEModelAdminBase): date_hierarchy = "create_date" @atomic(using="cash_assist_datahub_erp") - @atomic(using="default") + @atomic() @button(permission=should_show_assign_business_office) def assign_business_office( self, request: "HttpRequest", pk: "UUID" diff --git a/backend/hct_mis_api/apps/erp_datahub/tasks/sync_to_mis_datahub.py b/backend/hct_mis_api/apps/erp_datahub/tasks/sync_to_mis_datahub.py index 6fc711f535..ae003a93f1 100644 --- a/backend/hct_mis_api/apps/erp_datahub/tasks/sync_to_mis_datahub.py +++ b/backend/hct_mis_api/apps/erp_datahub/tasks/sync_to_mis_datahub.py @@ -21,7 +21,7 @@ def get_model_dict(model: Model) -> Dict: return model_dict @atomic(using="cash_assist_datahub_erp") - @atomic(using="default") + @atomic() def execute(self) -> None: # have to be list because it used in another database diff --git a/backend/hct_mis_api/apps/grievance/schema.py b/backend/hct_mis_api/apps/grievance/schema.py index 8e769dedbc..1087254cdb 100644 --- a/backend/hct_mis_api/apps/grievance/schema.py +++ b/backend/hct_mis_api/apps/grievance/schema.py @@ -75,7 +75,7 @@ from hct_mis_api.apps.payment.schema import PaymentRecordAndPaymentNode from hct_mis_api.apps.program.models import Program from hct_mis_api.apps.program.schema import ProgramNode -from hct_mis_api.apps.registration_datahub.schema import DeduplicationResultNode +from hct_mis_api.apps.registration_data.nodes import DeduplicationResultNode from hct_mis_api.apps.utils.exceptions import log_and_raise from hct_mis_api.apps.utils.schema import Arg, ChartDatasetNode diff --git a/backend/hct_mis_api/apps/grievance/tasks/deduplicate_and_check_sanctions.py b/backend/hct_mis_api/apps/grievance/tasks/deduplicate_and_check_sanctions.py index b1888ed872..df3d89ad15 100644 --- a/backend/hct_mis_api/apps/grievance/tasks/deduplicate_and_check_sanctions.py +++ b/backend/hct_mis_api/apps/grievance/tasks/deduplicate_and_check_sanctions.py @@ -26,7 +26,7 @@ class DeduplicateAndCheckAgainstSanctionsListTask: - @transaction.atomic(using="default") + @transaction.atomic() def execute(self, should_populate_index: bool, individuals_ids: List[str]) -> None: individuals = Individual.objects.filter(id__in=individuals_ids) business_area = individuals.first().business_area diff --git a/backend/hct_mis_api/apps/grievance/tests/services/data_change/test_add_individual_service.py b/backend/hct_mis_api/apps/grievance/tests/services/data_change/test_add_individual_service.py index 7730303b65..e85c3020d7 100644 --- a/backend/hct_mis_api/apps/grievance/tests/services/data_change/test_add_individual_service.py +++ b/backend/hct_mis_api/apps/grievance/tests/services/data_change/test_add_individual_service.py @@ -22,8 +22,6 @@ class TestAddIndividualService(BaseElasticSearchTestCase, TestCase): - databases = {"default", "registration_datahub"} - @classmethod def setUpTestData(cls) -> None: create_afghanistan() diff --git a/backend/hct_mis_api/apps/grievance/tests/services/data_change/test_change_individual_role.py b/backend/hct_mis_api/apps/grievance/tests/services/data_change/test_change_individual_role.py index 61c9d82090..98eb35babc 100644 --- a/backend/hct_mis_api/apps/grievance/tests/services/data_change/test_change_individual_role.py +++ b/backend/hct_mis_api/apps/grievance/tests/services/data_change/test_change_individual_role.py @@ -23,8 +23,6 @@ class TestChangeIndividualRole(BaseElasticSearchTestCase, TestCase): - databases = {"default", "registration_datahub"} - @classmethod def setUpTestData(cls) -> None: business_area = BusinessAreaFactory() diff --git a/backend/hct_mis_api/apps/grievance/tests/services/data_change/test_update_individual_data_service.py b/backend/hct_mis_api/apps/grievance/tests/services/data_change/test_update_individual_data_service.py index b1cf39547a..b3217a3d0f 100644 --- a/backend/hct_mis_api/apps/grievance/tests/services/data_change/test_update_individual_data_service.py +++ b/backend/hct_mis_api/apps/grievance/tests/services/data_change/test_update_individual_data_service.py @@ -20,8 +20,6 @@ class TestUpdateIndividualDataService(BaseElasticSearchTestCase, TestCase): - databases = {"default", "registration_datahub"} - @classmethod def setUpTestData(cls) -> None: cls.business_area = BusinessAreaFactory() diff --git a/backend/hct_mis_api/apps/grievance/tests/test_change_head_of_household.py b/backend/hct_mis_api/apps/grievance/tests/test_change_head_of_household.py index 5bad75d547..1902cf9c21 100644 --- a/backend/hct_mis_api/apps/grievance/tests/test_change_head_of_household.py +++ b/backend/hct_mis_api/apps/grievance/tests/test_change_head_of_household.py @@ -22,8 +22,6 @@ class TestChangeHeadOfHousehold(BaseElasticSearchTestCase, APITestCase): - databases = {"default", "registration_datahub"} - STATUS_CHANGE_MUTATION = """ mutation GrievanceStatusChange($grievanceTicketId: ID!, $status: Int) { grievanceStatusChange(grievanceTicketId: $grievanceTicketId, status: $status) { diff --git a/backend/hct_mis_api/apps/grievance/tests/test_close_data_change_tickets.py b/backend/hct_mis_api/apps/grievance/tests/test_close_data_change_tickets.py index 8a87820d95..40af9b755c 100644 --- a/backend/hct_mis_api/apps/grievance/tests/test_close_data_change_tickets.py +++ b/backend/hct_mis_api/apps/grievance/tests/test_close_data_change_tickets.py @@ -54,8 +54,6 @@ @flaky class TestCloseDataChangeTickets(BaseElasticSearchTestCase, APITestCase): - databases = {"default", "registration_datahub"} - STATUS_CHANGE_MUTATION = """ mutation GrievanceStatusChange($grievanceTicketId: ID!, $status: Int) { grievanceStatusChange(grievanceTicketId: $grievanceTicketId, status: $status) { diff --git a/backend/hct_mis_api/apps/grievance/tests/test_close_grievance_ticket_and_disable_decuplication.py b/backend/hct_mis_api/apps/grievance/tests/test_close_grievance_ticket_and_disable_decuplication.py index f51f3a57c1..c16308c944 100644 --- a/backend/hct_mis_api/apps/grievance/tests/test_close_grievance_ticket_and_disable_decuplication.py +++ b/backend/hct_mis_api/apps/grievance/tests/test_close_grievance_ticket_and_disable_decuplication.py @@ -34,7 +34,6 @@ class TestCloseGrievanceTicketAndDisableDeduplication(BaseElasticSearchTestCase, APITestCase): - databases = {"default", "registration_datahub"} fixtures = (f"{settings.PROJECT_ROOT}/apps/geo/fixtures/data.json",) UPDATE_GRIEVANCE_TICKET_STATUS_CHANGE_MUTATION = """ diff --git a/backend/hct_mis_api/apps/grievance/tests/test_grievance_data_change_mutations.py b/backend/hct_mis_api/apps/grievance/tests/test_grievance_data_change_mutations.py index f7af1054a7..8ec86abd75 100644 --- a/backend/hct_mis_api/apps/grievance/tests/test_grievance_data_change_mutations.py +++ b/backend/hct_mis_api/apps/grievance/tests/test_grievance_data_change_mutations.py @@ -40,8 +40,6 @@ class TestGrievanceCreateDataChangeMutation(BaseElasticSearchTestCase, APITestCase): - databases = {"default", "registration_datahub"} - CREATE_DATA_CHANGE_GRIEVANCE_MUTATION = """ mutation createGrievanceTicket($input:CreateGrievanceTicketInput!){ createGrievanceTicket(input:$input){ diff --git a/backend/hct_mis_api/apps/household/models.py b/backend/hct_mis_api/apps/household/models.py index b78253e07e..4378279ef6 100644 --- a/backend/hct_mis_api/apps/household/models.py +++ b/backend/hct_mis_api/apps/household/models.py @@ -53,7 +53,7 @@ ) if TYPE_CHECKING: - from hct_mis_api.apps.registration_datahub.models import Record + from hct_mis_api.aurora.models import Record BLANK = "" IDP = "IDP" @@ -658,7 +658,7 @@ def alternate_collector(self) -> Optional["Individual"]: @property def flex_registrations_record(self) -> Optional["Record"]: - from hct_mis_api.apps.registration_datahub.models import Record + from hct_mis_api.aurora.models import Record return Record.objects.filter(id=self.flex_registrations_record_id).first() diff --git a/backend/hct_mis_api/apps/household/schema.py b/backend/hct_mis_api/apps/household/schema.py index 92dc510a81..ba0d921a0e 100644 --- a/backend/hct_mis_api/apps/household/schema.py +++ b/backend/hct_mis_api/apps/household/schema.py @@ -84,7 +84,7 @@ ) from hct_mis_api.apps.payment.utils import get_payment_items_for_dashboard from hct_mis_api.apps.program.models import Program -from hct_mis_api.apps.registration_datahub.schema import DeduplicationResultNode +from hct_mis_api.apps.registration_data.nodes import DeduplicationResultNode from hct_mis_api.apps.targeting.models import HouseholdSelection from hct_mis_api.apps.utils.graphql import does_path_exist_in_query from hct_mis_api.apps.utils.schema import ( diff --git a/backend/hct_mis_api/apps/household/serializers.py b/backend/hct_mis_api/apps/household/serializers.py index c409a21436..50d6e5165a 100644 --- a/backend/hct_mis_api/apps/household/serializers.py +++ b/backend/hct_mis_api/apps/household/serializers.py @@ -10,22 +10,21 @@ def get_household_status(household: Household) -> Tuple[str, datetime]: - if isinstance(household, Household): - payment_records = PaymentRecord.objects.filter(household=household) - if payment_records.exists(): - return "paid", payment_records.first().updated_at - - selections = HouseholdSelection.objects.filter(household=household) - if selections.exists(): - selection = selections.order_by("updated_at").first() - if selection.target_population.status == TargetPopulation.STATUS_PROCESSING: - return "sent to cash assist", selection.updated_at - return "targeted", selection.updated_at - - return "merged to population", household.created_at - - # if is not Household, then must be ImportedHousehold, so it was imported - return "imported", household.updated_at + if household.rdi_merge_status == Household.PENDING: + return "imported", household.updated_at + + payment_records = PaymentRecord.objects.filter(household=household) + if payment_records.exists(): + return "paid", payment_records.first().updated_at + + selections = HouseholdSelection.objects.filter(household=household) + if selections.exists(): + selection = selections.order_by("updated_at").first() + if selection.target_population.status == TargetPopulation.STATUS_PROCESSING: + return "sent to cash assist", selection.updated_at + return "targeted", selection.updated_at + + return "merged to population", household.created_at def get_individual_info(individual: "Individual", tax_id: Optional[str]) -> Dict: diff --git a/backend/hct_mis_api/apps/household/tests/services/test_household_withdraw.py b/backend/hct_mis_api/apps/household/tests/services/test_household_withdraw.py index 825d264035..f1ef65a16d 100644 --- a/backend/hct_mis_api/apps/household/tests/services/test_household_withdraw.py +++ b/backend/hct_mis_api/apps/household/tests/services/test_household_withdraw.py @@ -12,7 +12,6 @@ class TestHouseholdWithdraw(TestCase): - databases = {"registration_datahub", "default"} fixtures = (f"{settings.PROJECT_ROOT}/apps/geo/fixtures/data.json",) @classmethod diff --git a/backend/hct_mis_api/apps/household/tests/test_fixdocumentsstatus.py b/backend/hct_mis_api/apps/household/tests/test_fixdocumentsstatus.py index d297f3ec29..2262e280db 100644 --- a/backend/hct_mis_api/apps/household/tests/test_fixdocumentsstatus.py +++ b/backend/hct_mis_api/apps/household/tests/test_fixdocumentsstatus.py @@ -13,8 +13,6 @@ class TestDocumentStatusFixer(TestCase): - databases = {"registration_datahub", "default"} - @classmethod def setUpTestData(cls) -> None: create_afghanistan() diff --git a/backend/hct_mis_api/apps/household/tests/test_household_status_endpoint.py b/backend/hct_mis_api/apps/household/tests/test_household_status_endpoint.py index c019c207d5..6251d8afb2 100644 --- a/backend/hct_mis_api/apps/household/tests/test_household_status_endpoint.py +++ b/backend/hct_mis_api/apps/household/tests/test_household_status_endpoint.py @@ -11,24 +11,19 @@ from hct_mis_api.apps.household.fixtures import ( DocumentFactory, DocumentTypeFactory, + PendingDocumentFactory, + PendingHouseholdFactory, + PendingIndividualFactory, create_household, ) from hct_mis_api.apps.household.models import ( HEAD, IDENTIFICATION_TYPE_TAX_ID, ROLE_NO_ROLE, + PendingIndividualRoleInHousehold, ) from hct_mis_api.apps.payment.fixtures import PaymentRecordFactory -from hct_mis_api.apps.registration_datahub.fixtures import ( - ImportedDocumentFactory, - ImportedDocumentTypeFactory, - ImportedHouseholdFactory, - ImportedIndividualFactory, - RegistrationDataImportDatahubFactory, -) -from hct_mis_api.apps.registration_datahub.models import ( - ImportedIndividualRoleInHousehold, -) +from hct_mis_api.apps.registration_data.fixtures import RegistrationDataImportFactory from hct_mis_api.apps.targeting.fixtures import TargetPopulationFactory from hct_mis_api.apps.targeting.models import HouseholdSelection, TargetPopulation @@ -39,7 +34,6 @@ def _time(some_time: datetime.date) -> str: class TestDetails(TestCase): - databases = "__all__" fixtures = (f"{settings.PROJECT_ROOT}/apps/geo/fixtures/data.json",) @classmethod @@ -73,19 +67,19 @@ def test_filtering_business_area_code_with_tax_id(self) -> None: self.assertEqual(response_nok.status_code, 404) def test_filtering_business_area_code_with_registration_id(self) -> None: - rdi_datahub = RegistrationDataImportDatahubFactory(business_area_slug=self.business_area.slug) - imported_household = ImportedHouseholdFactory(registration_data_import=rdi_datahub) - imported_individual = ImportedIndividualFactory(household=imported_household, relationship=HEAD) - imported_household.head_of_household = imported_individual - imported_household.detail_id = "HOPE-2022530111222" - imported_household.save() - ImportedIndividualRoleInHousehold.objects.create( - individual=imported_individual, + rdi = RegistrationDataImportFactory(business_area=self.business_area) + pending_household = PendingHouseholdFactory(registration_data_import=rdi) + pending_individual = PendingIndividualFactory(household=pending_household, relationship=HEAD) + pending_household.head_of_household = pending_individual + pending_household.detail_id = "HOPE-2022530111222" + pending_household.save() + PendingIndividualRoleInHousehold.objects.create( + individual=pending_individual, role=ROLE_NO_ROLE, - household=imported_household, + household=pending_household, ) - registration_id = imported_household.detail_id + registration_id = pending_household.detail_id response_ok = self.api_client.get( f"/api/hh-status?registration_id={registration_id}&business_area_code={self.business_area.code}" @@ -103,28 +97,26 @@ def test_getting_non_existent_individual(self) -> None: self.assertEqual(response.json()["status"], "not found") def test_getting_individual_with_status_imported(self) -> None: - imported_household = ImportedHouseholdFactory() - imported_individual = ImportedIndividualFactory(household=imported_household, relationship=HEAD) - imported_household.head_of_household = imported_individual - imported_household.save() - ImportedIndividualRoleInHousehold.objects.create( - individual=imported_individual, + pending_household = PendingHouseholdFactory() + pending_individual = PendingIndividualFactory(household=pending_household, relationship=HEAD) + pending_household.head_of_household = pending_individual + pending_household.save() + PendingIndividualRoleInHousehold.objects.create( + individual=pending_individual, role=ROLE_NO_ROLE, - household=imported_household, + household=pending_household, ) - imported_document_type = ImportedDocumentTypeFactory( - key=IDENTIFICATION_TYPE_TO_KEY_MAPPING[IDENTIFICATION_TYPE_TAX_ID] - ) - imported_document = ImportedDocumentFactory(individual=imported_individual, type=imported_document_type) - tax_id = imported_document.document_number + document_type = DocumentTypeFactory(key=IDENTIFICATION_TYPE_TO_KEY_MAPPING[IDENTIFICATION_TYPE_TAX_ID]) + pending_document = PendingDocumentFactory(individual=pending_individual, type=document_type) + tax_id = pending_document.document_number response = self.api_client.get(f"/api/hh-status?tax_id={tax_id}") self.assertEqual(response.status_code, 200) data = response.json() info = data["info"] self.assertEqual(info["status"], "imported") - self.assertEqual(info["date"], _time(imported_household.updated_at)) + self.assertEqual(info["date"], _time(pending_household.updated_at)) individual = info["individual"] self.assertIsNotNone(individual) @@ -209,23 +201,23 @@ def test_getting_non_existent_household(self) -> None: self.assertEqual(response.json()["status"], "not found") def test_getting_household_with_status_imported(self) -> None: - imported_household = ImportedHouseholdFactory() - imported_individual = ImportedIndividualFactory(household=imported_household, relationship=HEAD) - imported_household.head_of_household = imported_individual - imported_household.detail_id = "HOPE-2022530111222" - imported_household.save() - ImportedIndividualRoleInHousehold.objects.create( - individual=imported_individual, + pending_household = PendingHouseholdFactory() + pending_individual = PendingIndividualFactory(household=pending_household, relationship=HEAD) + pending_household.head_of_household = pending_individual + pending_household.detail_id = "HOPE-2022530111222" + pending_household.save() + PendingIndividualRoleInHousehold.objects.create( + individual=pending_individual, role=ROLE_NO_ROLE, - household=imported_household, + household=pending_household, ) - registration_id = imported_household.detail_id + registration_id = pending_household.detail_id response = self.api_client.get(f"/api/hh-status?registration_id={registration_id}") self.assertEqual(response.status_code, 200) data = response.json() info = data["info"] self.assertEqual(info["status"], "imported") - self.assertEqual(info["date"], _time(imported_household.updated_at)) + self.assertEqual(info["date"], _time(pending_household.updated_at)) self.assertTrue("individual" not in info) diff --git a/backend/hct_mis_api/apps/household/views.py b/backend/hct_mis_api/apps/household/views.py index 76cb194aa7..dea344f282 100644 --- a/backend/hct_mis_api/apps/household/views.py +++ b/backend/hct_mis_api/apps/household/views.py @@ -12,19 +12,18 @@ IDENTIFICATION_TYPE_TAX_ID, Document, Household, + PendingDocument, + PendingHousehold, + PendingIndividual, ) from hct_mis_api.apps.household.serializers import ( serialize_by_household, serialize_by_individual, ) -from hct_mis_api.apps.registration_datahub.models import ( - ImportedDocument, - ImportedHousehold, -) from hct_mis_api.apps.utils.profiling import profiling -def get_individual(tax_id: str, business_area_code: Optional[str]) -> Document: +def get_individual(tax_id: str, business_area_code: Optional[str]) -> PendingIndividual: documents = ( Document.objects.all() if not business_area_code @@ -36,9 +35,9 @@ def get_individual(tax_id: str, business_area_code: Optional[str]) -> Document: return documents.first().individual imported_documents = ( - ImportedDocument.objects.all() + PendingDocument.objects.all() if not business_area_code - else ImportedDocument.objects.filter( + else PendingDocument.objects.filter( individual__household__registration_data_import__business_area__code=business_area_code ) ).filter(type__key=IDENTIFICATION_TYPE_TO_KEY_MAPPING[IDENTIFICATION_TYPE_TAX_ID], document_number=tax_id) @@ -49,7 +48,7 @@ def get_individual(tax_id: str, business_area_code: Optional[str]) -> Document: raise Exception("Document with given tax_id not found") -def get_household(registration_id: str, business_area_code: Optional[str]) -> ImportedHousehold: +def get_household(registration_id: str, business_area_code: Optional[str]) -> PendingHousehold: kobo_asset_value = _prepare_kobo_asset_id_value(registration_id) households = ( Household.objects.all() @@ -62,14 +61,14 @@ def get_household(registration_id: str, business_area_code: Optional[str]) -> Im return households.first() # type: ignore if business_area_code is None: - imported_households_by_business_area = ImportedHousehold.objects.all() + imported_households_by_business_area = PendingHousehold.objects.all() else: business_areas = BusinessArea.objects.filter(code=business_area_code) if not business_areas: raise Exception(f"Business area with code {business_area_code} not found") business_area = business_areas.first() # code is unique, so no need to worry here - imported_households_by_business_area = ImportedHousehold.objects.filter( - registration_data_import__business_area_slug=business_area.slug + imported_households_by_business_area = PendingHousehold.objects.filter( + registration_data_import__business_area__slug=business_area.slug ) imported_households = imported_households_by_business_area.filter(detail_id__endswith=kobo_asset_value) diff --git a/backend/hct_mis_api/apps/mis_datahub/tasks/send_tp_to_datahub.py b/backend/hct_mis_api/apps/mis_datahub/tasks/send_tp_to_datahub.py index eec4b21798..151f4a6885 100644 --- a/backend/hct_mis_api/apps/mis_datahub/tasks/send_tp_to_datahub.py +++ b/backend/hct_mis_api/apps/mis_datahub/tasks/send_tp_to_datahub.py @@ -88,7 +88,7 @@ def execute(self, target_population: "TargetPopulation") -> Dict: target_population.save(update_fields=["status"]) return self.send_target_population(target_population) - @transaction.atomic(using="default") + @transaction.atomic() @transaction.atomic(using="cash_assist_datahub_mis") def send_target_population(self, target_population: "TargetPopulation") -> Dict: households_to_bulk_create = [] diff --git a/backend/hct_mis_api/apps/mis_datahub/tests/test_data_send_tp_to_datahub.py b/backend/hct_mis_api/apps/mis_datahub/tests/test_data_send_tp_to_datahub.py index 561e5c5dd2..bbd7cdae2b 100644 --- a/backend/hct_mis_api/apps/mis_datahub/tests/test_data_send_tp_to_datahub.py +++ b/backend/hct_mis_api/apps/mis_datahub/tests/test_data_send_tp_to_datahub.py @@ -30,7 +30,7 @@ class TestDataSendTpToDatahub(TestCase): - databases = {"default", "registration_datahub", "cash_assist_datahub_mis"} + databases = {"default", "cash_assist_datahub_mis"} @staticmethod def _pre_test_commands() -> None: diff --git a/backend/hct_mis_api/apps/mis_datahub/tests/test_external_collector_send_tp_to_datahub.py b/backend/hct_mis_api/apps/mis_datahub/tests/test_external_collector_send_tp_to_datahub.py index 42b1e2a864..f3f6d08ef2 100644 --- a/backend/hct_mis_api/apps/mis_datahub/tests/test_external_collector_send_tp_to_datahub.py +++ b/backend/hct_mis_api/apps/mis_datahub/tests/test_external_collector_send_tp_to_datahub.py @@ -23,7 +23,7 @@ class TestExternalCollectorSendTpToDatahub(TestCase): - databases = {"default", "registration_datahub", "cash_assist_datahub_mis"} + databases = {"default", "cash_assist_datahub_mis"} @staticmethod def _pre_test_commands() -> None: diff --git a/backend/hct_mis_api/apps/mis_datahub/tests/test_send_tp_to_datahub.py b/backend/hct_mis_api/apps/mis_datahub/tests/test_send_tp_to_datahub.py index 28af2fc59a..17b5edeed1 100644 --- a/backend/hct_mis_api/apps/mis_datahub/tests/test_send_tp_to_datahub.py +++ b/backend/hct_mis_api/apps/mis_datahub/tests/test_send_tp_to_datahub.py @@ -41,7 +41,7 @@ class TestSendTpToDatahub(TestCase): - databases = {"default", "registration_datahub", "cash_assist_datahub_mis"} + databases = {"default", "cash_assist_datahub_mis"} @staticmethod def _pre_test_commands() -> None: diff --git a/backend/hct_mis_api/apps/payment/tests/test_models.py b/backend/hct_mis_api/apps/payment/tests/test_models.py index cfd43b9025..bdf16da0f0 100644 --- a/backend/hct_mis_api/apps/payment/tests/test_models.py +++ b/backend/hct_mis_api/apps/payment/tests/test_models.py @@ -459,7 +459,7 @@ def test_choices(self) -> None: self.assertIsInstance(form_field, DynamicChoiceField) -class TestForm(forms.ModelForm): +class FinancialServiceProviderXlsxTemplateForm(forms.ModelForm): class Meta: model = FinancialServiceProviderXlsxTemplate fields = ["core_fields"] @@ -467,12 +467,14 @@ class Meta: class TestFinancialServiceProviderXlsxTemplate(TestCase): def test_model_form_integration(self) -> None: - form = TestForm(data={"core_fields": ["age", "residence_status"]}) # real existing core fields + form = FinancialServiceProviderXlsxTemplateForm( + data={"core_fields": ["age", "residence_status"]} + ) # real existing core fields self.assertTrue(form.is_valid()) template = form.save() self.assertEqual(template.core_fields, ["age", "residence_status"]) - form = TestForm(data={"core_fields": ["field1"]}) # fake core fields + form = FinancialServiceProviderXlsxTemplateForm(data={"core_fields": ["field1"]}) # fake core fields self.assertFalse(form.is_valid()) self.assertEqual( form.errors, diff --git a/backend/hct_mis_api/apps/registration_data/nodes.py b/backend/hct_mis_api/apps/registration_data/nodes.py new file mode 100644 index 0000000000..0a1db4a04a --- /dev/null +++ b/backend/hct_mis_api/apps/registration_data/nodes.py @@ -0,0 +1,33 @@ +from datetime import date +from typing import Any, Optional + +import graphene +from dateutil.parser import parse +from dateutil.relativedelta import relativedelta + + +class DeduplicationResultNode(graphene.ObjectType): + hit_id = graphene.ID() + full_name = graphene.String() + score = graphene.Float() + proximity_to_score = graphene.Float() + location = graphene.String() + age = graphene.Int() + duplicate = graphene.Boolean() + distinct = graphene.Boolean() + + def resolve_age(self, info: Any) -> Optional[int]: + date_of_birth = self.get("dob") + if date_of_birth: + today = date.today() + return relativedelta(today, parse(date_of_birth)).years + return None + + def resolve_location(self, info: Any) -> str: + return self.get("location", "Not provided") + + def resolve_duplicate(self, info: Any) -> bool: + return self.get("duplicate", False) + + def resolve_distinct(self, info: Any) -> bool: + return self.get("distinct", False) diff --git a/backend/hct_mis_api/apps/registration_datahub/admin.py b/backend/hct_mis_api/apps/registration_datahub/admin.py index 0359f4f627..85c5d05e58 100644 --- a/backend/hct_mis_api/apps/registration_datahub/admin.py +++ b/backend/hct_mis_api/apps/registration_datahub/admin.py @@ -1,11 +1,9 @@ import logging -from typing import Any, Dict, Generator, Iterable, List, Optional, Tuple, Union +from typing import Any, Generator, Iterable, List, Optional, Tuple, Union from uuid import UUID -from django import forms from django.contrib import admin, messages from django.contrib.admin import ModelAdmin, SimpleListFilter -from django.core.signing import BadSignature, Signer from django.db.models import F, QuerySet from django.http import HttpRequest, HttpResponse, HttpResponseRedirect from django.template.response import TemplateResponse @@ -107,44 +105,6 @@ class KoboImportedSubmissionAdmin(AdminAdvancedFiltersMixin, HOPEModelAdminBase) raw_id_fields = ("registration_data_import", "imported_household") -class RemeberDataForm(forms.Form): - SYNC_COOKIE = "fetch" - remember = forms.BooleanField(label="Remember me", required=False) - - def get_signed_cookie(self, request: HttpRequest) -> Any: - signer = Signer(str(request.user.password)) - return signer.sign_object(self.cleaned_data) - - @classmethod - def get_saved_config(cls, request: HttpRequest) -> Dict: - try: - signer = Signer(str(request.user.password)) - obj: Dict = signer.unsign_object(request.COOKIES.get(cls.SYNC_COOKIE, "")) - return obj - except BadSignature: - return {} - - -class FetchForm(RemeberDataForm): - SYNC_COOKIE = "fetch" - - host = forms.URLField() - username = forms.CharField() - password = forms.CharField(widget=forms.PasswordInput) - registration = forms.IntegerField() - start = forms.IntegerField() - end = forms.IntegerField() - - def clean(self) -> Optional[Dict[str, Any]]: - return super().clean() - - -class ValidateForm(RemeberDataForm): - SYNC_COOKIE = "ocr" - picture_field = forms.CharField() - number_field = forms.CharField() - - class AlexisFilter(SimpleListFilter): template = "adminfilters/alexis.html" title = "Alexis" diff --git a/backend/hct_mis_api/apps/registration_datahub/celery_tasks.py b/backend/hct_mis_api/apps/registration_datahub/celery_tasks.py index fa9ffdd629..4b525dfb35 100644 --- a/backend/hct_mis_api/apps/registration_datahub/celery_tasks.py +++ b/backend/hct_mis_api/apps/registration_datahub/celery_tasks.py @@ -296,7 +296,7 @@ def rdi_deduplication_task(self: Any, registration_data_import_id: str) -> None: rdi_obj = RegistrationDataImport.objects.get(id=registration_data_import_id) program_id = rdi_obj.program.id set_sentry_business_area_tag(rdi_obj.business_area.slug) - with transaction.atomic(using="default"), transaction.atomic(using="registration_datahub"): + with transaction.atomic(): DeduplicateTask(rdi_obj.business_area.slug, program_id).deduplicate_pending_individuals( registration_data_import=rdi_obj ) diff --git a/backend/hct_mis_api/apps/registration_datahub/documents.py b/backend/hct_mis_api/apps/registration_datahub/documents.py deleted file mode 100644 index cf5a49c019..0000000000 --- a/backend/hct_mis_api/apps/registration_datahub/documents.py +++ /dev/null @@ -1,128 +0,0 @@ -from typing import TYPE_CHECKING, Dict, Optional, Type - -from django.conf import settings -from django.db.models import Q, QuerySet - -from django_elasticsearch_dsl import Document, fields -from django_elasticsearch_dsl.registries import registry - -from hct_mis_api.apps.core.es_analyzers import name_synonym_analyzer, phonetic_analyzer -from hct_mis_api.apps.registration_datahub.models import ImportedIndividual -from hct_mis_api.apps.utils.elasticsearch_utils import DEFAULT_SCRIPT - -if TYPE_CHECKING: - from hct_mis_api.apps.geo.models import Area - - -index_settings = { - "number_of_shards": 1, - "number_of_replicas": 0, - "similarity": { - "default": { - "type": "scripted", - "script": { - "source": DEFAULT_SCRIPT, - }, - }, - }, -} - - -class ImportedIndividualDocument(Document): - id = fields.KeywordField() # The boost parameter on field mappings has been removed - given_name = fields.TextField( - analyzer=name_synonym_analyzer, fields={"phonetic": fields.TextField(analyzer=phonetic_analyzer)} - ) - middle_name = fields.TextField(analyzer=phonetic_analyzer) - family_name = fields.TextField(fields={"phonetic": fields.TextField(analyzer=phonetic_analyzer)}) - full_name = fields.TextField(analyzer=phonetic_analyzer) - birth_date = fields.DateField() # Before es 8, similarity parameter on DateField failed silently - phone_no = fields.KeywordField("phone_no.__str__", similarity="boolean") - phone_no_alternative = fields.KeywordField("phone_no_alternative.__str__", similarity="boolean") - business_area = fields.KeywordField(similarity="boolean", attr="business_area") - admin1 = fields.KeywordField() - admin2 = fields.KeywordField() - registration_data_import_id = fields.KeywordField( - "registration_data_import.id.__str__", - ) - documents = fields.ObjectField( - properties={ - "number": fields.KeywordField(attr="document_number", similarity="boolean"), - "key ": fields.KeywordField(attr="type.key", similarity="boolean"), - "country": fields.KeywordField(attr="country.alpha3", similarity="boolean"), - } - ) - identities = fields.ObjectField( - properties={ - "number": fields.KeywordField(attr="document_number", similarity="boolean"), - "partner": fields.KeywordField(attr="partner", similarity="boolean"), - } - ) - program_id = fields.KeywordField(attr="program_id") - - def prepare_admin1(self, instance: ImportedIndividual) -> Optional["Area"]: - household = instance.household - if household: - return instance.household.admin1 - return None - - def prepare_admin2(self, instance: ImportedIndividual) -> Optional["Area"]: - household = instance.household - if household: - return instance.household.admin2 - return None - - def prepare_hash_key(self, instance: ImportedIndividual) -> str: - return instance.get_hash_key - - def prepare_business_area(self, instance: ImportedIndividual) -> str: - return instance.registration_data_import.business_area_slug - - class Django: - model = ImportedIndividual - - fields = [ - "relationship", - "sex", - ] - - -@registry.register_document -class ImportedIndividualDocumentAfghanistan(ImportedIndividualDocument): - class Index: - name = f"{settings.ELASTICSEARCH_INDEX_PREFIX}importedindividuals_afghanistan" - settings = index_settings - - def get_queryset(self) -> QuerySet: - return ImportedIndividual.objects.filter(registration_data_import__business_area_slug="afghanistan") - - -@registry.register_document -class ImportedIndividualDocumentUkraine(ImportedIndividualDocument): - class Index: - name = f"{settings.ELASTICSEARCH_INDEX_PREFIX}importedindividuals_ukraine" - settings = index_settings - - def get_queryset(self) -> QuerySet: - return ImportedIndividual.objects.filter(registration_data_import__business_area_slug="ukraine") - - -@registry.register_document -class ImportedIndividualDocumentOthers(ImportedIndividualDocument): - class Index: - name = f"{settings.ELASTICSEARCH_INDEX_PREFIX}importedindividuals_others" - settings = index_settings - - def get_queryset(self) -> QuerySet: - return ImportedIndividual.objects.exclude( - Q(registration_data_import__business_area_slug="ukraine") - | Q(registration_data_import__business_area_slug="afghanistan") - ) - - -def get_imported_individual_doc(business_area_slug: str) -> Type[ImportedIndividualDocument]: - documents: Dict[str, Type[ImportedIndividualDocument]] = { - "afghanistan": ImportedIndividualDocumentAfghanistan, - "ukraine": ImportedIndividualDocumentUkraine, - } - return documents.get(business_area_slug, ImportedIndividualDocumentOthers) diff --git a/backend/hct_mis_api/apps/registration_datahub/fixtures.py b/backend/hct_mis_api/apps/registration_datahub/fixtures.py index 581ec25d25..38f1f0fb38 100644 --- a/backend/hct_mis_api/apps/registration_datahub/fixtures.py +++ b/backend/hct_mis_api/apps/registration_datahub/fixtures.py @@ -1,6 +1,4 @@ -import random import time -from typing import Dict, List, Optional, Tuple from django.contrib.gis.geos import Point @@ -12,20 +10,12 @@ from hct_mis_api.apps.geo.models import Country from hct_mis_api.apps.household.models import ( HUMANITARIAN_PARTNER, - MARITAL_STATUS_CHOICE, ORG_ENUMERATOR_CHOICES, RESIDENCE_STATUS_CHOICE, - SEX_CHOICE, UNICEF, ) from hct_mis_api.apps.registration_datahub.models import ( - ImportedBankAccountInfo, - ImportedDocument, - ImportedDocumentType, ImportedHousehold, - ImportedIndividual, - ImportedIndividualIdentity, - Record, RegistrationDataImportDatahub, ) @@ -106,103 +96,3 @@ class Meta: org_name_enumerator = "Partner Organization" village = factory.Faker("city") enumerator_rec_id = factory.fuzzy.FuzzyInteger(9999999, 99999999) - - -class ImportedIndividualFactory(DjangoModelFactory): - class Meta: - model = ImportedIndividual - - full_name = factory.LazyAttribute(lambda o: f"{o.given_name} {o.middle_name} {o.family_name}") - given_name = factory.Faker("first_name") - middle_name = factory.Faker("first_name") - family_name = factory.Faker("last_name") - sex = factory.fuzzy.FuzzyChoice( - SEX_CHOICE, - getter=lambda c: c[0], - ) - birth_date = factory.Faker("date_of_birth", tzinfo=utc, minimum_age=16, maximum_age=90) - estimated_birth_date = factory.fuzzy.FuzzyChoice((True, False)) - marital_status = factory.fuzzy.FuzzyChoice( - MARITAL_STATUS_CHOICE, - getter=lambda c: c[0], - ) - phone_no = factory.LazyFunction(faker.phone_number) - phone_no_alternative = "" - email = factory.Faker("email") - registration_data_import = factory.SubFactory(RegistrationDataImportDatahubFactory) - disability = False - household = factory.SubFactory(ImportedHouseholdFactory) - first_registration_date = factory.Faker("date_time_this_year", before_now=True, after_now=False, tzinfo=utc) - last_registration_date = factory.Faker("date_time_this_year", before_now=True, after_now=False, tzinfo=utc) - - -def create_imported_household( - household_args: Optional[Dict] = None, individual_args: Optional[Dict] = None -) -> Tuple[ImportedHousehold, ImportedIndividual]: - if household_args is None: - household_args = {} - if individual_args is None: - individual_args = {} - household = ImportedHouseholdFactory(**household_args) - individuals = ImportedIndividualFactory.create_batch(household.size, household=household, **individual_args) - individuals[0].relationship = "HEAD" - individuals[0].save() - household.head_of_household = individuals[0] - household.save() - return household, individuals - - -def create_imported_household_and_individuals( - household_data: Optional[Dict] = None, individuals_data: Optional[List[Dict]] = None -) -> Tuple[ImportedHousehold, List[ImportedIndividual]]: - if household_data is None: - household_data = {} - if individuals_data is None: - individuals_data = [] - household: ImportedHousehold = ImportedHouseholdFactory.build(**household_data, size=len(individuals_data)) - individuals: List[ImportedIndividual] = [ - ImportedIndividualFactory(household=household, **individual_data) for individual_data in individuals_data - ] - household.head_of_household = individuals[0] - household.save() - return household, individuals - - -class ImportedDocumentFactory(DjangoModelFactory): - class Meta: - model = ImportedDocument - - document_number = factory.Faker("pystr", min_chars=None, max_chars=20) - type = factory.LazyAttribute(lambda o: ImportedDocumentType.objects.order_by("?").first()) - individual = factory.SubFactory(ImportedIndividualFactory) - - -class ImportedDocumentTypeFactory(DjangoModelFactory): - class Meta: - model = ImportedDocumentType - - key = random.choice(["birth_certificate", "tax_id", "drivers_license"]) - - -class ImportedBankAccountInfoFactory(DjangoModelFactory): - class Meta: - model = ImportedBankAccountInfo - - individual = factory.SubFactory(ImportedIndividualFactory) - bank_name = random.choice(["CityBank", "Santander", "JPMorgan"]) - bank_account_number = random.randint(10**26, 10**27 - 1) - bank_branch_name = random.choice(["BranchCityBank", "BranchSantander", "BranchJPMorgan"]) - account_holder_name = factory.Faker("last_name") - - -class RecordFactory(DjangoModelFactory): - class Meta: - model = Record - - -class ImportedIndividualIdentityFactory(DjangoModelFactory): - class Meta: - model = ImportedIndividualIdentity - - individual = factory.SubFactory(ImportedIndividualFactory) - partner = "UNICEF" diff --git a/backend/hct_mis_api/apps/registration_datahub/fixtures/data-cypress.json b/backend/hct_mis_api/apps/registration_datahub/fixtures/data-cypress.json deleted file mode 100644 index 3240d1700d..0000000000 --- a/backend/hct_mis_api/apps/registration_datahub/fixtures/data-cypress.json +++ /dev/null @@ -1,856 +0,0 @@ -[ -{ - "model": "registration_datahub.importedhousehold", - "pk": "732c60be-0276-4054-a2e1-d425acdb821a", - "fields": { - "created_at": "2022-08-10T14:02:04.331Z", - "updated_at": "2022-08-10T14:30:11.870Z", - "consent_sign": "D3-2022-08-10_140204.3238310000.jpg", - "consent": true, - "consent_sharing": "HUMANITARIAN_PARTNER", - "residence_status": "REFUGEE", - "country_origin": "SM", - "size": 4, - "address": "938 Luna Cliffs Apt. 551\nJameschester, SC 24934", - "country": "IM", - "admin1": "AF11", - "admin1_title": "Ghazni", - "admin2": "AF1115", - "admin2_title": "Abband", - "geopoint": "SRID=4326;POINT (70.21020900000001 172.085021)", - "female_age_group_0_5_count": 0, - "female_age_group_6_11_count": 0, - "female_age_group_12_17_count": 0, - "female_age_group_18_59_count": null, - "female_age_group_60_count": null, - "pregnant_count": null, - "male_age_group_0_5_count": 0, - "male_age_group_6_11_count": 0, - "male_age_group_12_17_count": 0, - "male_age_group_18_59_count": null, - "male_age_group_60_count": null, - "female_age_group_0_5_disabled_count": 0, - "female_age_group_6_11_disabled_count": 0, - "female_age_group_12_17_disabled_count": 0, - "female_age_group_18_59_disabled_count": null, - "female_age_group_60_disabled_count": null, - "male_age_group_0_5_disabled_count": 0, - "male_age_group_6_11_disabled_count": 0, - "male_age_group_12_17_disabled_count": 0, - "male_age_group_18_59_disabled_count": null, - "male_age_group_60_disabled_count": null, - "head_of_household": "87201b6a-4d00-4ae2-ad1b-30dca2b83614", - "fchild_hoh": false, - "child_hoh": false, - "registration_data_import": "f814f78d-6f0d-49d9-961c-79322fa172b9", - "first_registration_date": "2020-08-22T00:00:00Z", - "last_registration_date": "2020-08-22T00:00:00Z", - "returnee": false, - "flex_fields": {}, - "start": null, - "deviceid": "", - "name_enumerator": "Harley Rawlings", - "org_enumerator": "UNICEF", - "org_name_enumerator": "UNICEF", - "village": "", - "registration_method": "", - "collect_individual_data": "", - "currency": "", - "unhcr_id": "", - "kobo_submission_uuid": null, - "kobo_submission_time": null, - "detail_id": "3", - "flex_registrations_record": null, - "mis_unicef_id": "HH-20-0000.0014" - } -}, -{ - "model": "registration_datahub.importedhousehold", - "pk": "cc46b6b9-4f2e-4ce4-a17e-e51747f68883", - "fields": { - "created_at": "2022-08-10T14:02:04.334Z", - "updated_at": "2022-08-10T14:30:11.839Z", - "consent_sign": "D4-2022-08-10_140204.3283380000.jpg", - "consent": true, - "consent_sharing": "HUMANITARIAN_PARTNER,PRIVATE_PARTNER,GOVERNMENT_PARTNER,UNICEF,", - "residence_status": "REFUGEE", - "country_origin": "SM", - "size": 4, - "address": "938 Luna Cliffs Apt. 551\nJameschester, SC 24934", - "country": "IM", - "admin1": "AF06", - "admin1_title": "Nangarhar", - "admin2": "AF0617", - "admin2_title": "Achin", - "geopoint": "SRID=4326;POINT (70.21020900000001 172.085021)", - "female_age_group_0_5_count": 0, - "female_age_group_6_11_count": 0, - "female_age_group_12_17_count": 0, - "female_age_group_18_59_count": null, - "female_age_group_60_count": null, - "pregnant_count": null, - "male_age_group_0_5_count": 0, - "male_age_group_6_11_count": 0, - "male_age_group_12_17_count": 0, - "male_age_group_18_59_count": null, - "male_age_group_60_count": null, - "female_age_group_0_5_disabled_count": 0, - "female_age_group_6_11_disabled_count": 0, - "female_age_group_12_17_disabled_count": 0, - "female_age_group_18_59_disabled_count": null, - "female_age_group_60_disabled_count": null, - "male_age_group_0_5_disabled_count": 0, - "male_age_group_6_11_disabled_count": 0, - "male_age_group_12_17_disabled_count": 0, - "male_age_group_18_59_disabled_count": null, - "male_age_group_60_disabled_count": null, - "head_of_household": "6c8d9be4-3bce-4a87-952a-e6abab468086", - "fchild_hoh": false, - "child_hoh": false, - "registration_data_import": "f814f78d-6f0d-49d9-961c-79322fa172b9", - "first_registration_date": "2020-08-22T00:00:00Z", - "last_registration_date": "2020-08-22T00:00:00Z", - "returnee": false, - "flex_fields": {}, - "start": null, - "deviceid": "", - "name_enumerator": "Harley Rawlings", - "org_enumerator": "UNICEF", - "org_name_enumerator": "UNICEF", - "village": "", - "registration_method": "", - "collect_individual_data": "", - "currency": "", - "unhcr_id": "", - "kobo_submission_uuid": null, - "kobo_submission_time": null, - "detail_id": "4", - "flex_registrations_record": null, - "mis_unicef_id": "HH-20-0000.0013" - } -}, -{ - "model": "registration_datahub.importedindividual", - "pk": "27a7a17b-4a3d-4643-a332-d177f0425f84", - "fields": { - "created_at": "2022-08-10T14:02:04.454Z", - "updated_at": "2022-08-10T14:30:11.816Z", - "individual_id": "", - "photo": "", - "full_name": "Angela Kowalska", - "given_name": "Angela", - "middle_name": "", - "family_name": "Kowalska", - "relationship": "BROTHER_SISTER", - "sex": "FEMALE", - "birth_date": "2000-01-10", - "estimated_birth_date": false, - "marital_status": "SINGLE", - "phone_no": "0048724467321", - "phone_no_alternative": "", - "email": "fake111test@email.com", - "household": "cc46b6b9-4f2e-4ce4-a17e-e51747f68883", - "registration_data_import": "f814f78d-6f0d-49d9-961c-79322fa172b9", - "disability": "not disabled", - "work_status": "NOT_PROVIDED", - "first_registration_date": "1988-06-15", - "last_registration_date": "1988-06-15", - "deduplication_batch_status": "UNIQUE_IN_BATCH", - "deduplication_golden_record_status": "UNIQUE", - "deduplication_batch_results": { - "score": { - "max": 0, - "min": 9223372036854775807, - "qty": 0 - }, - "duplicates": [], - "possible_duplicates": [] - }, - "deduplication_golden_record_results": { - "duplicates": [], - "possible_duplicates": [] - }, - "flex_fields": {}, - "pregnant": true, - "observed_disability": "", - "seeing_disability": "", - "hearing_disability": "", - "physical_disability": "", - "memory_disability": "", - "selfcare_disability": "", - "comms_disability": "", - "who_answers_phone": "", - "who_answers_alt_phone": "", - "detail_id": 7, - "disability_certificate_picture": "", - "mis_unicef_id": "IND-88-0000.0041" - } -}, -{ - "model": "registration_datahub.importedindividual", - "pk": "6c8d9be4-3bce-4a87-952a-e6abab468086", - "fields": { - "created_at": "2022-08-10T14:02:04.454Z", - "updated_at": "2022-08-10T14:30:11.830Z", - "individual_id": "", - "photo": "", - "full_name": "Agata Kowalska", - "given_name": "Agata", - "middle_name": "", - "family_name": "Kowalska", - "relationship": "HEAD", - "sex": "FEMALE", - "birth_date": "1964-01-10", - "estimated_birth_date": false, - "marital_status": "SINGLE", - "phone_no": "0048875012932", - "phone_no_alternative": "", - "email": "fake222test@email.com", - "household": "cc46b6b9-4f2e-4ce4-a17e-e51747f68883", - "registration_data_import": "f814f78d-6f0d-49d9-961c-79322fa172b9", - "disability": "not disabled", - "work_status": "NOT_PROVIDED", - "first_registration_date": "1988-06-15", - "last_registration_date": "1988-06-15", - "deduplication_batch_status": "UNIQUE_IN_BATCH", - "deduplication_golden_record_status": "UNIQUE", - "deduplication_batch_results": { - "score": { - "max": 0, - "min": 9223372036854775807, - "qty": 0 - }, - "duplicates": [], - "possible_duplicates": [] - }, - "deduplication_golden_record_results": { - "duplicates": [], - "possible_duplicates": [] - }, - "flex_fields": {}, - "pregnant": true, - "observed_disability": "", - "seeing_disability": "", - "hearing_disability": "", - "physical_disability": "", - "memory_disability": "", - "selfcare_disability": "", - "comms_disability": "", - "who_answers_phone": "", - "who_answers_alt_phone": "", - "detail_id": 6, - "disability_certificate_picture": "", - "mis_unicef_id": "IND-88-0000.0042" - } -}, -{ - "model": "registration_datahub.importedindividual", - "pk": "6ef3b767-5be6-4bbd-a598-6a5cc2960faf", - "fields": { - "created_at": "2022-08-10T14:02:04.454Z", - "updated_at": "2022-08-10T14:30:11.795Z", - "individual_id": "", - "photo": "", - "full_name": "Alicja Kowalska", - "given_name": "Alicja", - "middle_name": "", - "family_name": "Kowalska", - "relationship": "NON_BENEFICIARY", - "sex": "FEMALE", - "birth_date": "1941-08-26", - "estimated_birth_date": false, - "marital_status": "MARRIED", - "phone_no": "0048503123555", - "phone_no_alternative": "", - "email": "fake333test@email.com", - "household": null, - "registration_data_import": "f814f78d-6f0d-49d9-961c-79322fa172b9", - "disability": "not disabled", - "work_status": "NOT_PROVIDED", - "first_registration_date": "1942-12-12", - "last_registration_date": "1942-12-12", - "deduplication_batch_status": "UNIQUE_IN_BATCH", - "deduplication_golden_record_status": "UNIQUE", - "deduplication_batch_results": { - "score": { - "max": 0, - "min": 9223372036854775807, - "qty": 0 - }, - "duplicates": [], - "possible_duplicates": [] - }, - "deduplication_golden_record_results": { - "duplicates": [], - "possible_duplicates": [] - }, - "flex_fields": {}, - "pregnant": true, - "observed_disability": "", - "seeing_disability": "", - "hearing_disability": "", - "physical_disability": "", - "memory_disability": "", - "selfcare_disability": "", - "comms_disability": "", - "who_answers_phone": "", - "who_answers_alt_phone": "", - "detail_id": 8, - "disability_certificate_picture": "", - "mis_unicef_id": "IND-42-0000.0037" - } -}, -{ - "model": "registration_datahub.importedindividual", - "pk": "6f116cf6-04ca-4d98-b275-638acae21108", - "fields": { - "created_at": "2022-08-10T14:02:04.454Z", - "updated_at": "2022-08-10T14:30:11.861Z", - "individual_id": "", - "photo": "", - "full_name": "Jan Romaniak", - "given_name": "Jan", - "middle_name": "", - "family_name": "Romaniak", - "relationship": "BROTHER_SISTER", - "sex": "MALE", - "birth_date": "1923-01-01", - "estimated_birth_date": true, - "marital_status": "MARRIED", - "phone_no": "0048734123423", - "phone_no_alternative": "", - "email": "fake444test@email.com", - "household": "732c60be-0276-4054-a2e1-d425acdb821a", - "registration_data_import": "f814f78d-6f0d-49d9-961c-79322fa172b9", - "disability": "not disabled", - "work_status": "NOT_PROVIDED", - "first_registration_date": "1988-06-15", - "last_registration_date": "1988-06-15", - "deduplication_batch_status": "DUPLICATE_IN_BATCH", - "deduplication_golden_record_status": "UNIQUE", - "deduplication_batch_results": { - "score": { - "max": 9.0, - "min": 9.0, - "qty": 1 - }, - "duplicates": [ - { - "dob": "1991-11-18", - "score": 9.0, - "hit_id": "87201b6a-4d00-4ae2-ad1b-30dca2b83614", - "location": "AF1115", - "full_name": "Jan Romaniak", - "proximity_to_score": 3.0 - } - ], - "possible_duplicates": [] - }, - "deduplication_golden_record_results": { - "duplicates": [], - "possible_duplicates": [] - }, - "flex_fields": {}, - "pregnant": false, - "observed_disability": "", - "seeing_disability": "", - "hearing_disability": "", - "physical_disability": "", - "memory_disability": "", - "selfcare_disability": "", - "comms_disability": "", - "who_answers_phone": "", - "who_answers_alt_phone": "", - "detail_id": 5, - "disability_certificate_picture": "", - "mis_unicef_id": "IND-88-0000.0040" - } -}, -{ - "model": "registration_datahub.importedindividual", - "pk": "86f8a870-360c-432d-af46-7426f7070c90", - "fields": { - "created_at": "2022-08-10T14:02:04.453Z", - "updated_at": "2022-08-10T14:30:11.799Z", - "individual_id": "", - "photo": "", - "full_name": "Alicja Romaniak", - "given_name": "Alicja", - "middle_name": "", - "family_name": "Romaniak", - "relationship": "WIFE_HUSBAND", - "sex": "FEMALE", - "birth_date": "1996-06-21", - "estimated_birth_date": false, - "marital_status": "MARRIED", - "phone_no": "0048601123432", - "phone_no_alternative": "", - "email": "fake555test@email.com", - "household": "732c60be-0276-4054-a2e1-d425acdb821a", - "registration_data_import": "f814f78d-6f0d-49d9-961c-79322fa172b9", - "disability": "not disabled", - "work_status": "NOT_PROVIDED", - "first_registration_date": "1969-06-22", - "last_registration_date": "1969-06-22", - "deduplication_batch_status": "UNIQUE_IN_BATCH", - "deduplication_golden_record_status": "UNIQUE", - "deduplication_batch_results": { - "score": { - "max": 0, - "min": 9223372036854775807, - "qty": 0 - }, - "duplicates": [], - "possible_duplicates": [] - }, - "deduplication_golden_record_results": { - "duplicates": [], - "possible_duplicates": [] - }, - "flex_fields": {}, - "pregnant": false, - "observed_disability": "", - "seeing_disability": "", - "hearing_disability": "", - "physical_disability": "", - "memory_disability": "", - "selfcare_disability": "", - "comms_disability": "", - "who_answers_phone": "", - "who_answers_alt_phone": "", - "detail_id": 4, - "disability_certificate_picture": "", - "mis_unicef_id": "IND-69-0000.0038" - } -}, -{ - "model": "registration_datahub.importedindividual", - "pk": "87201b6a-4d00-4ae2-ad1b-30dca2b83614", - "fields": { - "created_at": "2022-08-10T14:02:04.437Z", - "updated_at": "2022-08-10T14:30:11.845Z", - "individual_id": "", - "photo": "", - "full_name": "Jan Romaniak", - "given_name": "Jan", - "middle_name": "Roman", - "family_name": "Romaniak", - "relationship": "HEAD", - "sex": "MALE", - "birth_date": "1991-11-18", - "estimated_birth_date": false, - "marital_status": "MARRIED", - "phone_no": "0048605899014", - "phone_no_alternative": "", - "email": "fake111test@email.com", - "household": "732c60be-0276-4054-a2e1-d425acdb821a", - "registration_data_import": "f814f78d-6f0d-49d9-961c-79322fa172b9", - "disability": "not disabled", - "work_status": "NOT_PROVIDED", - "first_registration_date": "1974-12-15", - "last_registration_date": "1974-12-15", - "deduplication_batch_status": "DUPLICATE_IN_BATCH", - "deduplication_golden_record_status": "UNIQUE", - "deduplication_batch_results": { - "score": { - "max": 9.0, - "min": 9.0, - "qty": 1 - }, - "duplicates": [ - { - "dob": "1923-01-01", - "score": 9.0, - "hit_id": "6f116cf6-04ca-4d98-b275-638acae21108", - "location": "AF1115", - "full_name": "Jan Romaniak", - "proximity_to_score": 3.0 - } - ], - "possible_duplicates": [] - }, - "deduplication_golden_record_results": { - "duplicates": [], - "possible_duplicates": [] - }, - "flex_fields": {}, - "pregnant": false, - "observed_disability": "", - "seeing_disability": "", - "hearing_disability": "", - "physical_disability": "", - "memory_disability": "", - "selfcare_disability": "", - "comms_disability": "", - "who_answers_phone": "", - "who_answers_alt_phone": "", - "detail_id": 3, - "disability_certificate_picture": "", - "mis_unicef_id": "IND-74-0000.0039" - } -}, -{ - "model": "registration_datahub.importedindividualroleinhousehold", - "pk": "6dfe900c-c39e-474b-bfbf-2d56b57cb8fb", - "fields": { - "created_at": "2022-08-10T14:02:04.473Z", - "updated_at": "2022-08-10T14:02:04.473Z", - "individual": "6c8d9be4-3bce-4a87-952a-e6abab468086", - "household": "cc46b6b9-4f2e-4ce4-a17e-e51747f68883", - "role": "PRIMARY" - } -}, -{ - "model": "registration_datahub.importedindividualroleinhousehold", - "pk": "bfafa49c-3251-4f58-a754-98e9973458bc", - "fields": { - "created_at": "2022-08-10T14:02:04.473Z", - "updated_at": "2022-08-10T14:02:04.473Z", - "individual": "86f8a870-360c-432d-af46-7426f7070c90", - "household": "732c60be-0276-4054-a2e1-d425acdb821a", - "role": "ALTERNATE" - } -}, -{ - "model": "registration_datahub.importedindividualroleinhousehold", - "pk": "c87168f2-ac2f-4220-866f-42a5bb32e381", - "fields": { - "created_at": "2022-08-10T14:02:04.473Z", - "updated_at": "2022-08-10T14:02:04.473Z", - "individual": "87201b6a-4d00-4ae2-ad1b-30dca2b83614", - "household": "732c60be-0276-4054-a2e1-d425acdb821a", - "role": "PRIMARY" - } -}, -{ - "model": "registration_datahub.importedindividualroleinhousehold", - "pk": "d346ccbd-2910-4bb5-b236-7c6d8a99f8f5", - "fields": { - "created_at": "2022-08-10T14:02:04.473Z", - "updated_at": "2022-08-10T14:02:04.473Z", - "individual": "6ef3b767-5be6-4bbd-a598-6a5cc2960faf", - "household": "cc46b6b9-4f2e-4ce4-a17e-e51747f68883", - "role": "ALTERNATE" - } -}, -{ - "model": "registration_datahub.registrationdataimportdatahub", - "pk": "c57848bf-a5df-154b-4938-f30b6b29aaab", - "fields": { - "created_at": "2022-03-30T09:22:14.856Z", - "updated_at": "2022-03-30T09:22:16.791Z", - "name": "Test Diia", - "import_date": "2022-03-30T09:22:14.856Z", - "hct_id": "04992dce-8e47-154b-4938-743415412dce", - "import_data": "e38f6f0c-36e9-a1f0-4b73-84742f7d025d", - "import_done": "NOT_STARTED", - "business_area_slug": "ukraine" - } -}, -{ - "model": "registration_datahub.registrationdataimportdatahub", - "pk": "f814f78d-6f0d-49d9-961c-79322fa172b9", - "fields": { - "created_at": "2022-08-10T14:02:02.454Z", - "updated_at": "2022-08-10T14:02:04.474Z", - "name": "test", - "import_date": "2022-08-10T14:02:02.454Z", - "hct_id": "c749ab01-16dc-48af-a764-5f3a873f0a7d", - "import_data": "f87474eb-8db9-409a-b42e-7b30f4af41f9", - "import_done": "DONE", - "business_area_slug": "afghanistan" - } -}, -{ - "model": "registration_datahub.importdata", - "pk": "e38f6f0c-36e9-a1f0-4b73-84742f7d025d", - "fields": { - "created_at": "2022-05-29T09:21:29.900Z", - "updated_at": "2022-04-29T09:21:34.214Z", - "status": "PENDING", - "business_area_slug": "ukraine", - "file": "", - "data_type": "DIIA", - "number_of_households": 0, - "number_of_individuals": 0, - "error": "", - "validation_errors": "", - "created_by_id": null - } -}, -{ - "model": "registration_datahub.importdata", - "pk": "f87474eb-8db9-409a-b42e-7b30f4af41f9", - "fields": { - "created_at": "2022-08-10T14:01:53.990Z", - "updated_at": "2022-08-10T14:01:57.509Z", - "status": "FINISHED", - "business_area_slug": "afghanistan", - "file": "romaniak_with_admins_12.xlsx", - "data_type": "XLSX", - "number_of_households": 2, - "number_of_individuals": 6, - "error": "", - "validation_errors": "", - "created_by_id": "4196c2c5-c2dd-48d2-887f-3a9d39e78916" - } -}, -{ - "model": "registration_datahub.importeddocumenttype", - "pk": "185d0037-a1bc-4eef-a679-749b5964c1f6", - "fields": { - "created_at": "2022-08-10T14:00:37.565Z", - "updated_at": "2022-08-10T14:00:37.565Z", - "label": "Electoral Card", - "key": "electoral_card" - } -}, -{ - "model": "registration_datahub.importeddocumenttype", - "pk": "218fa71b-0d15-4f4b-85fe-86a9b9f59f0d", - "fields": { - "created_at": "2022-08-10T14:00:37.565Z", - "updated_at": "2022-08-10T14:00:37.565Z", - "label": "National ID", - "key": "national_id" - } -}, -{ - "model": "registration_datahub.importeddocumenttype", - "pk": "6087e502-defa-44e2-9865-63f45a71471e", - "fields": { - "created_at": "2022-08-10T14:00:37.565Z", - "updated_at": "2022-08-10T14:00:37.565Z", - "label": "Other", - "key": "other" - } -}, -{ - "model": "registration_datahub.importeddocumenttype", - "pk": "89481e2a-3ef1-40fb-8021-6b92bcb03db4", - "fields": { - "created_at": "2022-08-10T14:00:37.565Z", - "updated_at": "2022-08-10T14:00:37.565Z", - "label": "Driver's License", - "key": "drivers_license" - } -}, -{ - "model": "registration_datahub.importeddocumenttype", - "pk": "92fbe664-66f1-42ea-9c9c-8c093db16f3b", - "fields": { - "created_at": "2022-08-10T14:00:37.565Z", - "updated_at": "2022-08-10T14:00:37.565Z", - "label": "Tax Number Identification", - "key": "tax_id" - } -}, -{ - "model": "registration_datahub.importeddocumenttype", - "pk": "d2c54476-0a45-4f0a-aca1-e78e78f1e2cc", - "fields": { - "created_at": "2022-08-10T14:00:37.565Z", - "updated_at": "2022-08-10T14:00:37.565Z", - "label": "National Passport", - "key": "national_passport" - } -}, -{ - "model": "registration_datahub.importeddocumenttype", - "pk": "db4b73d0-3a53-48b5-9d2b-bdf0de29ccbf", - "fields": { - "created_at": "2022-08-10T14:00:37.565Z", - "updated_at": "2022-08-10T14:00:37.565Z", - "label": "Birth Certificate", - "key": "birth_certificate" - } -}, -{ - "model": "registration_datahub.importeddocumenttype", - "pk": "ee41c19e-63d2-473b-9e6f-65eb8ff2cbe5", - "fields": { - "created_at": "2022-08-10T14:00:37.565Z", - "updated_at": "2022-08-10T14:00:37.565Z", - "label": "Foreigner's Residence Permit", - "key": "residence_permit_no" - } -}, -{ - "model": "registration_datahub.importeddocumenttype", - "pk": "afd33528-f377-4494-80be-89f5ab8c2d3b", - "fields": { - "created_at": "2022-08-10T14:00:37.565Z", - "updated_at": "2022-08-10T14:00:37.565Z", - "label": "Disability Certificate", - "key": "disability_certificate" - } -}, -{ - "model": "registration_datahub.importeddocumenttype", - "pk": "b37fbf40-bc38-4a86-9e87-e2f420fd0754", - "fields": { - "created_at": "2022-08-10T14:00:37.565Z", - "updated_at": "2022-08-10T14:00:37.565Z", - "label": "Foster child", - "key": "foster_child" - } -}, -{ - "model": "registration_datahub.importeddocumenttype", - "pk": "6782d559-c2f2-4d89-b8f8-37447c179233", - "fields": { - "created_at": "2022-08-10T14:00:37.565Z", - "updated_at": "2022-08-10T14:00:37.565Z", - "label": "Bank Statement", - "key": "bank_statement" - } -}, -{ - "model": "registration_datahub.importeddocumenttype", - "pk": "5cc56283-6f85-4572-861a-e85c43bb9873", - "fields": { - "created_at": "2023-05-25T12:38:42.348Z", - "updated_at": "2023-05-25T12:39:06.054Z", - "label": "Disability Card", - "key": "disability_card" - } -}, -{ - "model": "registration_datahub.importeddocumenttype", - "pk": "aa5b57f7-d848-4240-8738-96e8a53ca3f0", - "fields": { - "created_at": "2023-05-25T12:39:27.898Z", - "updated_at": "2023-05-25T12:39:27.898Z", - "label": "Medical Certificate", - "key": "medical_certificate" - } -}, -{ - "model": "registration_datahub.importeddocumenttype", - "pk": "b2a5bab4-1641-4585-9184-a0f844da6af3", - "fields": { - "created_at": "2023-05-25T12:38:17.892Z", - "updated_at": "2023-05-25T12:38:57.496Z", - "label": "Proof of Legal Guardianship", - "key": "proof_legal_guardianship" - } -}, -{ - "model": "registration_datahub.importeddocumenttype", - "pk": "fb85dd2a-f73e-403b-8241-677789558605", - "fields": { - "created_at": "2023-05-25T12:39:46.671Z", - "updated_at": "2023-05-25T12:39:46.671Z", - "label": "Temporary Protection Visa", - "key": "temporary_protection_visa" - } -}, -{ - "model": "registration_datahub.importeddocument", - "pk": "1f1a5a3b-461f-4da3-9e98-09437ed91b08", - "fields": { - "created_at": "2022-08-10T14:02:04.469Z", - "updated_at": "2022-08-10T14:02:04.469Z", - "document_number": "ASH221345", - "photo": "", - "individual": "86f8a870-360c-432d-af46-7426f7070c90", - "type": "218fa71b-0d15-4f4b-85fe-86a9b9f59f0d", - "country": "PL", - "doc_date": null - } -}, -{ - "model": "registration_datahub.importeddocument", - "pk": "255397d7-8a0e-437e-98f7-be2bf9368e1f", - "fields": { - "created_at": "2022-08-10T14:02:04.469Z", - "updated_at": "2022-08-10T14:02:04.469Z", - "document_number": "JA123123", - "photo": "", - "individual": "86f8a870-360c-432d-af46-7426f7070c90", - "type": "d2c54476-0a45-4f0a-aca1-e78e78f1e2cc", - "country": "PL", - "doc_date": null - } -}, -{ - "model": "registration_datahub.importeddocument", - "pk": "4df58da4-a632-43ca-be7e-07b54d89fd30", - "fields": { - "created_at": "2022-08-10T14:02:04.469Z", - "updated_at": "2022-08-10T14:02:04.469Z", - "document_number": "BSH221315", - "photo": "", - "individual": "6ef3b767-5be6-4bbd-a598-6a5cc2960faf", - "type": "218fa71b-0d15-4f4b-85fe-86a9b9f59f0d", - "country": "PL", - "doc_date": null - } -}, -{ - "model": "registration_datahub.importeddocument", - "pk": "58e3d2c2-7224-4f8b-8424-403635963ee5", - "fields": { - "created_at": "2022-08-10T14:02:04.469Z", - "updated_at": "2022-08-10T14:02:04.469Z", - "document_number": "DAZ132964", - "photo": "", - "individual": "87201b6a-4d00-4ae2-ad1b-30dca2b83614", - "type": "218fa71b-0d15-4f4b-85fe-86a9b9f59f0d", - "country": "PL", - "doc_date": null - } -}, -{ - "model": "registration_datahub.importeddocument", - "pk": "7d234914-7b51-43f0-9302-33b44f8411b9", - "fields": { - "created_at": "2022-08-10T14:02:04.469Z", - "updated_at": "2022-08-10T14:02:04.469Z", - "document_number": "CSH221395", - "photo": "", - "individual": "27a7a17b-4a3d-4643-a332-d177f0425f84", - "type": "218fa71b-0d15-4f4b-85fe-86a9b9f59f0d", - "country": "PL", - "doc_date": null - } -}, -{ - "model": "registration_datahub.importeddocument", - "pk": "b4a5c74b-4266-44ed-9c8c-e8c236ff688f", - "fields": { - "created_at": "2022-08-10T14:02:04.469Z", - "updated_at": "2022-08-10T14:02:04.469Z", - "document_number": "WSH221365", - "photo": "", - "individual": "6f116cf6-04ca-4d98-b275-638acae21108", - "type": "218fa71b-0d15-4f4b-85fe-86a9b9f59f0d", - "country": "PL", - "doc_date": null - } -}, -{ - "model": "registration_datahub.importeddocument", - "pk": "bb3d7187-6572-4f21-9492-ddc531d0b182", - "fields": { - "created_at": "2022-08-10T14:02:04.469Z", - "updated_at": "2022-08-10T14:02:04.469Z", - "document_number": "TSH221375", - "photo": "", - "individual": "6c8d9be4-3bce-4a87-952a-e6abab468086", - "type": "218fa71b-0d15-4f4b-85fe-86a9b9f59f0d", - "country": "PL", - "doc_date": null - } -}, -{ - "model": "registration_datahub.importedindividualidentity", - "pk": 1, - "fields": { - "individual": "87201b6a-4d00-4ae2-ad1b-30dca2b83614", - "document_number": "johniak pany", - "partner": "UNHCR", - "country": "PL" - } -} -] diff --git a/backend/hct_mis_api/apps/registration_datahub/fixtures/data.json b/backend/hct_mis_api/apps/registration_datahub/fixtures/data.json deleted file mode 100644 index 0ca5f8897c..0000000000 --- a/backend/hct_mis_api/apps/registration_datahub/fixtures/data.json +++ /dev/null @@ -1,3812 +0,0 @@ -[ -{ - "model": "registration_datahub.importedhousehold", - "pk": "732c60be-0276-4054-a2e1-d425acdb821a", - "fields": { - "created_at": "2022-08-10T14:02:04.331Z", - "updated_at": "2022-08-10T14:30:11.870Z", - "consent_sign": "D3-2022-08-10_140204.3238310000.jpg", - "consent": true, - "consent_sharing": "HUMANITARIAN_PARTNER", - "residence_status": "REFUGEE", - "country_origin": "SM", - "size": 4, - "address": "938 Luna Cliffs Apt. 551\nJameschester, SC 24934", - "country": "IM", - "admin1": "AF11", - "admin1_title": "Ghazni", - "admin2": "AF1115", - "admin2_title": "Abband", - "geopoint": "SRID=4326;POINT (70.21020900000001 172.085021)", - "female_age_group_0_5_count": 0, - "female_age_group_6_11_count": 0, - "female_age_group_12_17_count": 0, - "female_age_group_18_59_count": null, - "female_age_group_60_count": null, - "pregnant_count": null, - "male_age_group_0_5_count": 0, - "male_age_group_6_11_count": 0, - "male_age_group_12_17_count": 0, - "male_age_group_18_59_count": null, - "male_age_group_60_count": null, - "female_age_group_0_5_disabled_count": 0, - "female_age_group_6_11_disabled_count": 0, - "female_age_group_12_17_disabled_count": 0, - "female_age_group_18_59_disabled_count": null, - "female_age_group_60_disabled_count": null, - "male_age_group_0_5_disabled_count": 0, - "male_age_group_6_11_disabled_count": 0, - "male_age_group_12_17_disabled_count": 0, - "male_age_group_18_59_disabled_count": null, - "male_age_group_60_disabled_count": null, - "head_of_household": "87201b6a-4d00-4ae2-ad1b-30dca2b83614", - "fchild_hoh": false, - "child_hoh": false, - "registration_data_import": "f814f78d-6f0d-49d9-961c-79322fa172b9", - "first_registration_date": "2020-08-22T00:00:00Z", - "last_registration_date": "2020-08-22T00:00:00Z", - "returnee": false, - "flex_fields": {}, - "start": null, - "deviceid": "", - "name_enumerator": "Harley Rawlings", - "org_enumerator": "UNICEF", - "org_name_enumerator": "UNICEF", - "village": "", - "registration_method": "", - "collect_individual_data": "", - "currency": "", - "unhcr_id": "", - "kobo_submission_uuid": null, - "kobo_submission_time": null, - "detail_id": "3", - "flex_registrations_record": null, - "mis_unicef_id": "HH-20-0000.0014" - } -}, -{ - "model": "registration_datahub.importedhousehold", - "pk": "cc46b6b9-4f2e-4ce4-a17e-e51747f68883", - "fields": { - "created_at": "2022-08-10T14:02:04.334Z", - "updated_at": "2022-08-10T14:30:11.839Z", - "consent_sign": "D4-2022-08-10_140204.3283380000.jpg", - "consent": true, - "consent_sharing": "HUMANITARIAN_PARTNER,PRIVATE_PARTNER,GOVERNMENT_PARTNER,UNICEF,", - "residence_status": "REFUGEE", - "country_origin": "SM", - "size": 4, - "address": "938 Luna Cliffs Apt. 551\nJameschester, SC 24934", - "country": "IM", - "admin1": "AF06", - "admin1_title": "Nangarhar", - "admin2": "AF0617", - "admin2_title": "Achin", - "geopoint": "SRID=4326;POINT (70.21020900000001 172.085021)", - "female_age_group_0_5_count": 0, - "female_age_group_6_11_count": 0, - "female_age_group_12_17_count": 0, - "female_age_group_18_59_count": null, - "female_age_group_60_count": null, - "pregnant_count": null, - "male_age_group_0_5_count": 0, - "male_age_group_6_11_count": 0, - "male_age_group_12_17_count": 0, - "male_age_group_18_59_count": null, - "male_age_group_60_count": null, - "female_age_group_0_5_disabled_count": 0, - "female_age_group_6_11_disabled_count": 0, - "female_age_group_12_17_disabled_count": 0, - "female_age_group_18_59_disabled_count": null, - "female_age_group_60_disabled_count": null, - "male_age_group_0_5_disabled_count": 0, - "male_age_group_6_11_disabled_count": 0, - "male_age_group_12_17_disabled_count": 0, - "male_age_group_18_59_disabled_count": null, - "male_age_group_60_disabled_count": null, - "head_of_household": "6c8d9be4-3bce-4a87-952a-e6abab468086", - "fchild_hoh": false, - "child_hoh": false, - "registration_data_import": "f814f78d-6f0d-49d9-961c-79322fa172b9", - "first_registration_date": "2020-08-22T00:00:00Z", - "last_registration_date": "2020-08-22T00:00:00Z", - "returnee": false, - "flex_fields": {}, - "start": null, - "deviceid": "", - "name_enumerator": "Harley Rawlings", - "org_enumerator": "UNICEF", - "org_name_enumerator": "UNICEF", - "village": "", - "registration_method": "", - "collect_individual_data": "", - "currency": "", - "unhcr_id": "", - "kobo_submission_uuid": null, - "kobo_submission_time": null, - "detail_id": "4", - "flex_registrations_record": null, - "mis_unicef_id": "HH-20-0000.0013" - } -}, -{ - "model": "registration_datahub.importedindividual", - "pk": "27a7a17b-4a3d-4643-a332-d177f0425f84", - "fields": { - "created_at": "2022-08-10T14:02:04.454Z", - "updated_at": "2022-08-10T14:30:11.816Z", - "individual_id": "", - "photo": "", - "full_name": "Angela Kowalska", - "given_name": "Angela", - "middle_name": "", - "family_name": "Kowalska", - "relationship": "BROTHER_SISTER", - "sex": "FEMALE", - "birth_date": "2000-01-10", - "estimated_birth_date": false, - "marital_status": "SINGLE", - "phone_no": "0048724467321", - "phone_no_alternative": "", - "email": "fake111test@email.com", - "household": "cc46b6b9-4f2e-4ce4-a17e-e51747f68883", - "registration_data_import": "f814f78d-6f0d-49d9-961c-79322fa172b9", - "disability": "not disabled", - "work_status": "NOT_PROVIDED", - "first_registration_date": "1988-06-15", - "last_registration_date": "1988-06-15", - "deduplication_batch_status": "UNIQUE_IN_BATCH", - "deduplication_golden_record_status": "UNIQUE", - "deduplication_batch_results": { - "score": { - "max": 0, - "min": 9223372036854775807, - "qty": 0 - }, - "duplicates": [], - "possible_duplicates": [] - }, - "deduplication_golden_record_results": { - "duplicates": [], - "possible_duplicates": [] - }, - "flex_fields": {}, - "pregnant": true, - "observed_disability": "", - "seeing_disability": "", - "hearing_disability": "", - "physical_disability": "", - "memory_disability": "", - "selfcare_disability": "", - "comms_disability": "", - "who_answers_phone": "", - "who_answers_alt_phone": "", - "detail_id": 7, - "disability_certificate_picture": "", - "mis_unicef_id": "IND-88-0000.0041" - } -}, -{ - "model": "registration_datahub.importedindividual", - "pk": "6c8d9be4-3bce-4a87-952a-e6abab468086", - "fields": { - "created_at": "2022-08-10T14:02:04.454Z", - "updated_at": "2022-08-10T14:30:11.830Z", - "individual_id": "", - "photo": "", - "full_name": "Agata Kowalska", - "given_name": "Agata", - "middle_name": "", - "family_name": "Kowalska", - "relationship": "HEAD", - "sex": "FEMALE", - "birth_date": "1964-01-10", - "estimated_birth_date": false, - "marital_status": "SINGLE", - "phone_no": "0048875012932", - "phone_no_alternative": "", - "email": "fake222test@email.com", - "household": "cc46b6b9-4f2e-4ce4-a17e-e51747f68883", - "registration_data_import": "f814f78d-6f0d-49d9-961c-79322fa172b9", - "disability": "not disabled", - "work_status": "NOT_PROVIDED", - "first_registration_date": "1988-06-15", - "last_registration_date": "1988-06-15", - "deduplication_batch_status": "UNIQUE_IN_BATCH", - "deduplication_golden_record_status": "UNIQUE", - "deduplication_batch_results": { - "score": { - "max": 0, - "min": 9223372036854775807, - "qty": 0 - }, - "duplicates": [], - "possible_duplicates": [] - }, - "deduplication_golden_record_results": { - "duplicates": [], - "possible_duplicates": [] - }, - "flex_fields": {}, - "pregnant": true, - "observed_disability": "", - "seeing_disability": "", - "hearing_disability": "", - "physical_disability": "", - "memory_disability": "", - "selfcare_disability": "", - "comms_disability": "", - "who_answers_phone": "", - "who_answers_alt_phone": "", - "detail_id": 6, - "disability_certificate_picture": "", - "mis_unicef_id": "IND-88-0000.0042" - } -}, -{ - "model": "registration_datahub.importedindividual", - "pk": "6ef3b767-5be6-4bbd-a598-6a5cc2960faf", - "fields": { - "created_at": "2022-08-10T14:02:04.454Z", - "updated_at": "2022-08-10T14:30:11.795Z", - "individual_id": "", - "photo": "", - "full_name": "Alicja Kowalska", - "given_name": "Alicja", - "middle_name": "", - "family_name": "Kowalska", - "relationship": "NON_BENEFICIARY", - "sex": "FEMALE", - "birth_date": "1941-08-26", - "estimated_birth_date": false, - "marital_status": "MARRIED", - "phone_no": "0048503123555", - "phone_no_alternative": "", - "email": "fake333test@email.com", - "household": null, - "registration_data_import": "f814f78d-6f0d-49d9-961c-79322fa172b9", - "disability": "not disabled", - "work_status": "NOT_PROVIDED", - "first_registration_date": "1942-12-12", - "last_registration_date": "1942-12-12", - "deduplication_batch_status": "UNIQUE_IN_BATCH", - "deduplication_golden_record_status": "UNIQUE", - "deduplication_batch_results": { - "score": { - "max": 0, - "min": 9223372036854775807, - "qty": 0 - }, - "duplicates": [], - "possible_duplicates": [] - }, - "deduplication_golden_record_results": { - "duplicates": [], - "possible_duplicates": [] - }, - "flex_fields": {}, - "pregnant": true, - "observed_disability": "", - "seeing_disability": "", - "hearing_disability": "", - "physical_disability": "", - "memory_disability": "", - "selfcare_disability": "", - "comms_disability": "", - "who_answers_phone": "", - "who_answers_alt_phone": "", - "detail_id": 8, - "disability_certificate_picture": "", - "mis_unicef_id": "IND-42-0000.0037" - } -}, -{ - "model": "registration_datahub.importedindividual", - "pk": "6f116cf6-04ca-4d98-b275-638acae21108", - "fields": { - "created_at": "2022-08-10T14:02:04.454Z", - "updated_at": "2022-08-10T14:30:11.861Z", - "individual_id": "", - "photo": "", - "full_name": "Jan Romaniak", - "given_name": "Jan", - "middle_name": "", - "family_name": "Romaniak", - "relationship": "BROTHER_SISTER", - "sex": "MALE", - "birth_date": "1923-01-01", - "estimated_birth_date": true, - "marital_status": "MARRIED", - "phone_no": "0048734123423", - "phone_no_alternative": "", - "email": "fake444test@email.com", - "household": "732c60be-0276-4054-a2e1-d425acdb821a", - "registration_data_import": "f814f78d-6f0d-49d9-961c-79322fa172b9", - "disability": "not disabled", - "work_status": "NOT_PROVIDED", - "first_registration_date": "1988-06-15", - "last_registration_date": "1988-06-15", - "deduplication_batch_status": "DUPLICATE_IN_BATCH", - "deduplication_golden_record_status": "UNIQUE", - "deduplication_batch_results": { - "score": { - "max": 9.0, - "min": 9.0, - "qty": 1 - }, - "duplicates": [ - { - "dob": "1991-11-18", - "score": 9.0, - "hit_id": "87201b6a-4d00-4ae2-ad1b-30dca2b83614", - "location": "AF1115", - "full_name": "Jan Romaniak", - "proximity_to_score": 3.0 - } - ], - "possible_duplicates": [] - }, - "deduplication_golden_record_results": { - "duplicates": [], - "possible_duplicates": [] - }, - "flex_fields": {}, - "pregnant": false, - "observed_disability": "", - "seeing_disability": "", - "hearing_disability": "", - "physical_disability": "", - "memory_disability": "", - "selfcare_disability": "", - "comms_disability": "", - "who_answers_phone": "", - "who_answers_alt_phone": "", - "detail_id": 5, - "disability_certificate_picture": "", - "mis_unicef_id": "IND-88-0000.0040" - } -}, -{ - "model": "registration_datahub.importedindividual", - "pk": "86f8a870-360c-432d-af46-7426f7070c90", - "fields": { - "created_at": "2022-08-10T14:02:04.453Z", - "updated_at": "2022-08-10T14:30:11.799Z", - "individual_id": "", - "photo": "", - "full_name": "Alicja Romaniak", - "given_name": "Alicja", - "middle_name": "", - "family_name": "Romaniak", - "relationship": "WIFE_HUSBAND", - "sex": "FEMALE", - "birth_date": "1996-06-21", - "estimated_birth_date": false, - "marital_status": "MARRIED", - "phone_no": "0048601123432", - "phone_no_alternative": "", - "email": "fake555test@email.com", - "household": "732c60be-0276-4054-a2e1-d425acdb821a", - "registration_data_import": "f814f78d-6f0d-49d9-961c-79322fa172b9", - "disability": "not disabled", - "work_status": "NOT_PROVIDED", - "first_registration_date": "1969-06-22", - "last_registration_date": "1969-06-22", - "deduplication_batch_status": "UNIQUE_IN_BATCH", - "deduplication_golden_record_status": "UNIQUE", - "deduplication_batch_results": { - "score": { - "max": 0, - "min": 9223372036854775807, - "qty": 0 - }, - "duplicates": [], - "possible_duplicates": [] - }, - "deduplication_golden_record_results": { - "duplicates": [], - "possible_duplicates": [] - }, - "flex_fields": {}, - "pregnant": false, - "observed_disability": "", - "seeing_disability": "", - "hearing_disability": "", - "physical_disability": "", - "memory_disability": "", - "selfcare_disability": "", - "comms_disability": "", - "who_answers_phone": "", - "who_answers_alt_phone": "", - "detail_id": 4, - "disability_certificate_picture": "", - "mis_unicef_id": "IND-69-0000.0038" - } -}, -{ - "model": "registration_datahub.importedindividual", - "pk": "87201b6a-4d00-4ae2-ad1b-30dca2b83614", - "fields": { - "created_at": "2022-08-10T14:02:04.437Z", - "updated_at": "2022-08-10T14:30:11.845Z", - "individual_id": "", - "photo": "", - "full_name": "Jan Romaniak", - "given_name": "Jan", - "middle_name": "Roman", - "family_name": "Romaniak", - "relationship": "HEAD", - "sex": "MALE", - "birth_date": "1991-11-18", - "estimated_birth_date": false, - "marital_status": "MARRIED", - "phone_no": "0048605899014", - "phone_no_alternative": "", - "email": "fake111test@email.com", - "household": "732c60be-0276-4054-a2e1-d425acdb821a", - "registration_data_import": "f814f78d-6f0d-49d9-961c-79322fa172b9", - "disability": "not disabled", - "work_status": "NOT_PROVIDED", - "first_registration_date": "1974-12-15", - "last_registration_date": "1974-12-15", - "deduplication_batch_status": "DUPLICATE_IN_BATCH", - "deduplication_golden_record_status": "UNIQUE", - "deduplication_batch_results": { - "score": { - "max": 9.0, - "min": 9.0, - "qty": 1 - }, - "duplicates": [ - { - "dob": "1923-01-01", - "score": 9.0, - "hit_id": "6f116cf6-04ca-4d98-b275-638acae21108", - "location": "AF1115", - "full_name": "Jan Romaniak", - "proximity_to_score": 3.0 - } - ], - "possible_duplicates": [] - }, - "deduplication_golden_record_results": { - "duplicates": [], - "possible_duplicates": [] - }, - "flex_fields": {}, - "pregnant": false, - "observed_disability": "", - "seeing_disability": "", - "hearing_disability": "", - "physical_disability": "", - "memory_disability": "", - "selfcare_disability": "", - "comms_disability": "", - "who_answers_phone": "", - "who_answers_alt_phone": "", - "detail_id": 3, - "disability_certificate_picture": "", - "mis_unicef_id": "IND-74-0000.0039" - } -}, -{ - "model": "registration_datahub.importedindividualroleinhousehold", - "pk": "6dfe900c-c39e-474b-bfbf-2d56b57cb8fb", - "fields": { - "created_at": "2022-08-10T14:02:04.473Z", - "updated_at": "2022-08-10T14:02:04.473Z", - "individual": "6c8d9be4-3bce-4a87-952a-e6abab468086", - "household": "cc46b6b9-4f2e-4ce4-a17e-e51747f68883", - "role": "PRIMARY" - } -}, -{ - "model": "registration_datahub.importedindividualroleinhousehold", - "pk": "bfafa49c-3251-4f58-a754-98e9973458bc", - "fields": { - "created_at": "2022-08-10T14:02:04.473Z", - "updated_at": "2022-08-10T14:02:04.473Z", - "individual": "86f8a870-360c-432d-af46-7426f7070c90", - "household": "732c60be-0276-4054-a2e1-d425acdb821a", - "role": "ALTERNATE" - } -}, -{ - "model": "registration_datahub.importedindividualroleinhousehold", - "pk": "c87168f2-ac2f-4220-866f-42a5bb32e381", - "fields": { - "created_at": "2022-08-10T14:02:04.473Z", - "updated_at": "2022-08-10T14:02:04.473Z", - "individual": "87201b6a-4d00-4ae2-ad1b-30dca2b83614", - "household": "732c60be-0276-4054-a2e1-d425acdb821a", - "role": "PRIMARY" - } -}, -{ - "model": "registration_datahub.importedindividualroleinhousehold", - "pk": "d346ccbd-2910-4bb5-b236-7c6d8a99f8f5", - "fields": { - "created_at": "2022-08-10T14:02:04.473Z", - "updated_at": "2022-08-10T14:02:04.473Z", - "individual": "6ef3b767-5be6-4bbd-a598-6a5cc2960faf", - "household": "cc46b6b9-4f2e-4ce4-a17e-e51747f68883", - "role": "ALTERNATE" - } -}, -{ - "model": "registration_datahub.registrationdataimportdatahub", - "pk": "c57848bf-a5df-154b-4938-f30b6b29aaab", - "fields": { - "created_at": "2022-03-30T09:22:14.856Z", - "updated_at": "2022-03-30T09:22:16.791Z", - "name": "Test Diia", - "import_date": "2022-03-30T09:22:14.856Z", - "hct_id": "04992dce-8e47-154b-4938-743415412dce", - "import_data": "e38f6f0c-36e9-a1f0-4b73-84742f7d025d", - "import_done": "NOT_STARTED", - "business_area_slug": "ukraine" - } -}, -{ - "model": "registration_datahub.registrationdataimportdatahub", - "pk": "f814f78d-6f0d-49d9-961c-79322fa172b9", - "fields": { - "created_at": "2022-08-10T14:02:02.454Z", - "updated_at": "2022-08-10T14:02:04.474Z", - "name": "test", - "import_date": "2022-08-10T14:02:02.454Z", - "hct_id": "c749ab01-16dc-48af-a764-5f3a873f0a7d", - "import_data": "f87474eb-8db9-409a-b42e-7b30f4af41f9", - "import_done": "DONE", - "business_area_slug": "afghanistan" - } -}, -{ - "model":"registration_datahub.registrationdataimportdatahub", - "pk":"fdacfb7c-8d8a-467d-acdb-eba1b4bfe291", - "fields":{ - "created_at":"2024-06-04T13:06:23.587Z", - "updated_at":"2024-06-04T13:06:24.484Z", - "name":"test_in_review", - "import_date":"2024-06-04T13:06:23.587Z", - "hct_id":"43016ff4-c10a-4068-af3f-b14e9319f187", - "import_data":"e04a2d90-8208-4b68-93aa-3da17a97f6ec", - "import_done":"DONE", - "business_area_slug":"afghanistan" - } -}, -{ - "model": "registration_datahub.importdata", - "pk": "e38f6f0c-36e9-a1f0-4b73-84742f7d025d", - "fields": { - "created_at": "2022-05-29T09:21:29.900Z", - "updated_at": "2022-04-29T09:21:34.214Z", - "status": "PENDING", - "business_area_slug": "ukraine", - "file": "", - "data_type": "DIIA", - "number_of_households": 0, - "number_of_individuals": 0, - "error": "", - "validation_errors": "", - "created_by_id": null - } -}, -{ - "model": "registration_datahub.importdata", - "pk": "f87474eb-8db9-409a-b42e-7b30f4af41f9", - "fields": { - "created_at": "2022-08-10T14:01:53.990Z", - "updated_at": "2022-08-10T14:01:57.509Z", - "status": "FINISHED", - "business_area_slug": "afghanistan", - "file": "romaniak_with_admins_12.xlsx", - "data_type": "XLSX", - "number_of_households": 2, - "number_of_individuals": 6, - "error": "", - "validation_errors": "", - "created_by_id": "4196c2c5-c2dd-48d2-887f-3a9d39e78916" - } -}, -{ - "model": "registration_datahub.importeddocumenttype", - "pk": "185d0037-a1bc-4eef-a679-749b5964c1f6", - "fields": { - "created_at": "2022-08-10T14:00:37.565Z", - "updated_at": "2022-08-10T14:00:37.565Z", - "label": "Electoral Card", - "key": "electoral_card" - } -}, -{ - "model": "registration_datahub.importeddocumenttype", - "pk": "218fa71b-0d15-4f4b-85fe-86a9b9f59f0d", - "fields": { - "created_at": "2022-08-10T14:00:37.565Z", - "updated_at": "2022-08-10T14:00:37.565Z", - "label": "National ID", - "key": "national_id" - } -}, -{ - "model": "registration_datahub.importeddocumenttype", - "pk": "6087e502-defa-44e2-9865-63f45a71471e", - "fields": { - "created_at": "2022-08-10T14:00:37.565Z", - "updated_at": "2022-08-10T14:00:37.565Z", - "label": "Other", - "key": "other" - } -}, -{ - "model": "registration_datahub.importeddocumenttype", - "pk": "89481e2a-3ef1-40fb-8021-6b92bcb03db4", - "fields": { - "created_at": "2022-08-10T14:00:37.565Z", - "updated_at": "2022-08-10T14:00:37.565Z", - "label": "Driver's License", - "key": "drivers_license" - } -}, -{ - "model": "registration_datahub.importeddocumenttype", - "pk": "92fbe664-66f1-42ea-9c9c-8c093db16f3b", - "fields": { - "created_at": "2022-08-10T14:00:37.565Z", - "updated_at": "2022-08-10T14:00:37.565Z", - "label": "Tax Number Identification", - "key": "tax_id" - } -}, -{ - "model": "registration_datahub.importeddocumenttype", - "pk": "d2c54476-0a45-4f0a-aca1-e78e78f1e2cc", - "fields": { - "created_at": "2022-08-10T14:00:37.565Z", - "updated_at": "2022-08-10T14:00:37.565Z", - "label": "National Passport", - "key": "national_passport" - } -}, -{ - "model": "registration_datahub.importeddocumenttype", - "pk": "db4b73d0-3a53-48b5-9d2b-bdf0de29ccbf", - "fields": { - "created_at": "2022-08-10T14:00:37.565Z", - "updated_at": "2022-08-10T14:00:37.565Z", - "label": "Birth Certificate", - "key": "birth_certificate" - } -}, -{ - "model": "registration_datahub.importeddocumenttype", - "pk": "ee41c19e-63d2-473b-9e6f-65eb8ff2cbe5", - "fields": { - "created_at": "2022-08-10T14:00:37.565Z", - "updated_at": "2022-08-10T14:00:37.565Z", - "label": "Foreigner's Residence Permit", - "key": "residence_permit_no" - } -}, -{ - "model": "registration_datahub.importeddocumenttype", - "pk": "afd33528-f377-4494-80be-89f5ab8c2d3b", - "fields": { - "created_at": "2022-08-10T14:00:37.565Z", - "updated_at": "2022-08-10T14:00:37.565Z", - "label": "Disability Certificate", - "key": "disability_certificate" - } -}, -{ - "model": "registration_datahub.importeddocumenttype", - "pk": "b37fbf40-bc38-4a86-9e87-e2f420fd0754", - "fields": { - "created_at": "2022-08-10T14:00:37.565Z", - "updated_at": "2022-08-10T14:00:37.565Z", - "label": "Foster child", - "key": "foster_child" - } -}, -{ - "model": "registration_datahub.importeddocumenttype", - "pk": "6782d559-c2f2-4d89-b8f8-37447c179233", - "fields": { - "created_at": "2022-08-10T14:00:37.565Z", - "updated_at": "2022-08-10T14:00:37.565Z", - "label": "Bank Statement", - "key": "bank_statement" - } -}, -{ - "model": "registration_datahub.importeddocumenttype", - "pk": "5cc56283-6f85-4572-861a-e85c43bb9873", - "fields": { - "created_at": "2023-05-25T12:38:42.348Z", - "updated_at": "2023-05-25T12:39:06.054Z", - "label": "Disability Card", - "key": "disability_card" - } -}, -{ - "model": "registration_datahub.importeddocumenttype", - "pk": "aa5b57f7-d848-4240-8738-96e8a53ca3f0", - "fields": { - "created_at": "2023-05-25T12:39:27.898Z", - "updated_at": "2023-05-25T12:39:27.898Z", - "label": "Medical Certificate", - "key": "medical_certificate" - } -}, -{ - "model": "registration_datahub.importeddocumenttype", - "pk": "b2a5bab4-1641-4585-9184-a0f844da6af3", - "fields": { - "created_at": "2023-05-25T12:38:17.892Z", - "updated_at": "2023-05-25T12:38:57.496Z", - "label": "Proof of Legal Guardianship", - "key": "proof_legal_guardianship" - } -}, -{ - "model": "registration_datahub.importeddocumenttype", - "pk": "fb85dd2a-f73e-403b-8241-677789558605", - "fields": { - "created_at": "2023-05-25T12:39:46.671Z", - "updated_at": "2023-05-25T12:39:46.671Z", - "label": "Temporary Protection Visa", - "key": "temporary_protection_visa" - } -}, -{ - "model": "registration_datahub.importeddocumenttype", - "pk": "c53f45e2-62ac-452c-bfa1-993837c79630", - "fields": { - "created_at": "2023-05-25T12:39:46.671Z", - "updated_at": "2023-05-25T12:39:46.671Z", - "label": "Receiver POI", - "key": "receiver_poi", - "is_identity_document": false - } -}, -{ - "model": "registration_datahub.importeddocument", - "pk": "1f1a5a3b-461f-4da3-9e98-09437ed91b08", - "fields": { - "created_at": "2022-08-10T14:02:04.469Z", - "updated_at": "2022-08-10T14:02:04.469Z", - "document_number": "ASH221345", - "photo": "", - "individual": "86f8a870-360c-432d-af46-7426f7070c90", - "type": "218fa71b-0d15-4f4b-85fe-86a9b9f59f0d", - "country": "PL", - "doc_date": null - } -}, -{ - "model": "registration_datahub.importeddocument", - "pk": "255397d7-8a0e-437e-98f7-be2bf9368e1f", - "fields": { - "created_at": "2022-08-10T14:02:04.469Z", - "updated_at": "2022-08-10T14:02:04.469Z", - "document_number": "JA123123", - "photo": "", - "individual": "86f8a870-360c-432d-af46-7426f7070c90", - "type": "d2c54476-0a45-4f0a-aca1-e78e78f1e2cc", - "country": "PL", - "doc_date": null - } -}, -{ - "model": "registration_datahub.importeddocument", - "pk": "4df58da4-a632-43ca-be7e-07b54d89fd30", - "fields": { - "created_at": "2022-08-10T14:02:04.469Z", - "updated_at": "2022-08-10T14:02:04.469Z", - "document_number": "BSH221315", - "photo": "", - "individual": "6ef3b767-5be6-4bbd-a598-6a5cc2960faf", - "type": "218fa71b-0d15-4f4b-85fe-86a9b9f59f0d", - "country": "PL", - "doc_date": null - } -}, -{ - "model": "registration_datahub.importeddocument", - "pk": "58e3d2c2-7224-4f8b-8424-403635963ee5", - "fields": { - "created_at": "2022-08-10T14:02:04.469Z", - "updated_at": "2022-08-10T14:02:04.469Z", - "document_number": "DAZ132964", - "photo": "", - "individual": "87201b6a-4d00-4ae2-ad1b-30dca2b83614", - "type": "218fa71b-0d15-4f4b-85fe-86a9b9f59f0d", - "country": "PL", - "doc_date": null - } -}, -{ - "model": "registration_datahub.importeddocument", - "pk": "7d234914-7b51-43f0-9302-33b44f8411b9", - "fields": { - "created_at": "2022-08-10T14:02:04.469Z", - "updated_at": "2022-08-10T14:02:04.469Z", - "document_number": "CSH221395", - "photo": "", - "individual": "27a7a17b-4a3d-4643-a332-d177f0425f84", - "type": "218fa71b-0d15-4f4b-85fe-86a9b9f59f0d", - "country": "PL", - "doc_date": null - } -}, -{ - "model": "registration_datahub.importeddocument", - "pk": "b4a5c74b-4266-44ed-9c8c-e8c236ff688f", - "fields": { - "created_at": "2022-08-10T14:02:04.469Z", - "updated_at": "2022-08-10T14:02:04.469Z", - "document_number": "WSH221365", - "photo": "", - "individual": "6f116cf6-04ca-4d98-b275-638acae21108", - "type": "218fa71b-0d15-4f4b-85fe-86a9b9f59f0d", - "country": "PL", - "doc_date": null - } -}, -{ - "model": "registration_datahub.importeddocument", - "pk": "bb3d7187-6572-4f21-9492-ddc531d0b182", - "fields": { - "created_at": "2022-08-10T14:02:04.469Z", - "updated_at": "2022-08-10T14:02:04.469Z", - "document_number": "TSH221375", - "photo": "", - "individual": "6c8d9be4-3bce-4a87-952a-e6abab468086", - "type": "218fa71b-0d15-4f4b-85fe-86a9b9f59f0d", - "country": "PL", - "doc_date": null - } -}, -{ - "model": "registration_datahub.importedindividualidentity", - "pk": 1, - "fields": { - "individual": "87201b6a-4d00-4ae2-ad1b-30dca2b83614", - "document_number": "johniak pany", - "partner": "UNHCR", - "country": "PL" - } -}, - { - "model": "registration_datahub.record", - "pk": 1, - "fields": { - "registration": 18, - "timestamp": "2023-05-01T00:00:00Z", - "storage": null, - "registration_data_import": null, - "ignored": false, - "source_id": 1, - "data": {}, - "error_message": null, - "status": null, - "unique_field": null, - "size": null, - "counters": null, - "fields": { - "consent": [ - { - "consent_h_c": "y", - "government_partner": "", - "consent_sharing_h_c": true, - "consent_sharing_h_c_1": "y", - "consent_sharing_h_c_2": "n" - } - ], - "needs-assessment": [ - { - "assistance_h_f": "y", - "adults_count_h_f": 2, - "receiving_mop_h_f": "n", - "school_enrolled_i_f": "no", - "children_below_18_h_f": 3, - "access_health_rate_h_f": "A little Difficult", - "additional_support_h_f": "y", - "access_education_rate_h_f": "Somewhat Easy", - "access_social_services_rate_h_f": "Very Easy", - "access_leisure_activities_rate_h_f": "Very Easy", - "in_state_provided_accommodation_h_f": "no" - } - ], - "household-address": [ - { - "admin1_h_c": "CZ010", - "admin2_h_c": "CZ0109", - "address_h_c": "Opočínská 375", - "village_h_c": "Praha", - "zip_code_h_c": "19017" - } - ], - "primary-carer-info": [ - { - "role_i_c": "primary", - "gender_i_c": "female", - "id_type_i_c": "national_passport", - "phone_no_i_c": "+420774844183", - "birth_date_i_c": "1995-08-01", - "given_name_i_c": "Tetiana", - "family_name_i_c": "Symkanych", - "work_status_i_c": "n", - "bank_account_h_f": "y", - "country_origin_h_c": "ukr", - "bank_account_number": "CZ6003000000000306979952", - "confirm_phone_number": "+420774844183", - "national_passport_no_i_c": "GB500567", - "preferred_language_i_c": "uk-ua", - "bank_account_number_h_f": "CZ6003000000000306979952", - "czech_formal_employment": "no", - "other_communication_language": [ - "ru-ru" - ], - "primary_carer_is_legal_guardian": "y" - } - ], - "children-information": [ - { - "gender_i_c": "male", - "birth_date_i_c": "2013-07-04", - "disability_i_c": "not disabled", - "given_name_i_c": "John", - "family_name_i_c": "Symkanych", - "other_id_no_i_c": "900541571", - "follow_up_needed": "n", - "relationship_i_c": "son_daughter", - "preregistration_case_id": "13277", - "birth_certificate_no_i_c": "262873", - "has_birth_certificate_i_c": "y", - "qualifies_for_programme_i_f": "y" - }, - { - "gender_i_c": "female", - "id_type_i_c": "national_id", - "birth_date_i_c": "2023-04-30", - "disability_i_c": "disabled", - "follow_up_flag": [ - "legal_guardianship_documents" - ], - "given_name_i_c": "TEST", - "family_name_i_c": "TEST", - "follow_up_needed": "y", - "relationship_i_c": "brother_sister", - "follow_up_comments": "No comments", - "national_id_no_i_c": "123214", - "disability_card_i_c": "y", - "disability_degree_i_c": "2", - "national_passport_no_i_c": "", - "disability_card_no_i_c": "1213", - "medical_certificate_i_c": "y", - "preregistration_case_id": "10937", - "has_birth_certificate_i_c": "n", - "medical_certificate_no_i_c": "2321", - "qualifies_for_programme_i_f": "y", - "disability_card_issuance_i_c": "2023-05-01", - "proof_legal_guardianship_no_i_c": "128dj", - "medical_certificate_issuance_i_c": "2023-05-01", - "medical_certificate_validity_i_c": "2023-05-17", - "has_disability_card_and_medical_cert": "Has Both" - } - ], - "legal-guardian-information": [ - { - "gender_i_c": "male", - "id_type_i_c": "national_passport", - "phone_no_i_c": "+420123123666", - "birth_date_i_c": "1988-12-27", - "given_name_i_c": "Ivan", - "family_name_i_c": "Drago", - "work_status_i_c": "y", - "relationship_i_c": "head", - "national_id_no_i_c": "", - "confirm_phone_number": "+420123123666", - "national_passport_no_i_c": "1234567890", - "legal_guardia_not_primary_carer": "y" - }, - { - "legal_guardia_not_primary_carer": "n" - } - ] - }, - "files": null, - "index1": null, - "index2": null, - "index3": null - } - }, - { - "model": "registration_datahub.record", - "pk": 2, - "fields": { - "registration": 17, - "timestamp": "2022-04-01T00:00:00Z", - "storage": null, - "registration_data_import": null, - "ignored": false, - "source_id": 1, - "data": {}, - "error_message": null, - "status": null, - "unique_field": null, - "size": null, - "counters": null, - "fields": { - "children-info": [ - { - "gender_i_c": "male", - "full_name_i_c": "Alexis", - "birth_date_i_c": "2022-01-04", - "relationship_i_c": "son_daughter" - } - ], - "id_enumerator": "1992", - "caretaker-info": [ - { - "gender_i_c": " female", - "full_name_i_c": "Alexis", - "birth_date_i_c": "1989-01-04", - "has_nic_number_i_c": "n", - "who_answers_phone_i_c": "mother/caretaker" - } - ], - "collector-info": [ - { - "email": "email999@mail.com", - "bank_name": "7472", - "gender_i_c": " male", - "phone_no_i_c": "+94788908046", - "full_name_i_c": "Dome", - "birth_date_i_c": "1980-01-04", - "bank_description": "Axis Bank", - "relationship_i_c": "brother_sister", - "confirm_nic_number": "123456789V", - "national_id_no_i_c": "123456789V", - "branch_or_branch_code": "7472_002", - "who_answers_this_phone": "alternate collector", - "confirm_bank_account_number": "0082785064", - "confirm_alternate_collector_phone_number": "+94788908046", - "does_the_mothercaretaker_have_her_own_active_bank_account_not_samurdhi": "n" - } - ], - "localization-info": [ - { - "admin2_h_c": "LK11", - "admin3_h_c": "LK1163", - "admin4_h_c": "LK1163020", - "address_h_c": "Alexis", - "moh_center_of_reference": "MOH279" - } - ], - "prefered_language_of_contact": "ta" - }, - "files": null, - "index1": null, - "index2": null, - "index3": null - } -}, -{ - "model": "registration_datahub.record", - "pk": 3, - "fields": { - "registration": 2, - "timestamp": "2022-04-01T00:00:00Z", - "storage": null, - "registration_data_import": null, - "ignored": false, - "source_id": 1, - "data": {}, - "error_message": null, - "status": null, - "unique_field": null, - "size": null, - "counters": null, - "fields": { - "household": [ - { - "size_h_c": 5, - "admin1_h_c": "UA07", - "admin2_h_c": "UA0702", - "admin3_h_c": "UA0702001", - "where_are_you_now": "", - "residence_status_h_c": "non_host" - } - ], - "individuals": [ - { - "email": "email123@mail.com", - "birth_date": "1991-11-18", - "gender_i_c": "male", - "patronymic": "Roman", - "phone_no_i_c": "0501706662", - "tax_id_no_i_c": "123123123", - "given_name_i_c": "Jan", - "family_name_i_c": "Romaniak", - "bank_account_h_f": "y", - "relationship_i_c": "head" - } - ] - }, - "files": null, - "index1": null, - "index2": null, - "index3": null - } -}, -{ - "model":"registration_datahub.importedhousehold", - "pk":"056ca352-7ee3-4e0b-978e-d57925f712b1", - "fields":{ - "created_at":"2024-06-04T13:06:24.336Z", - "updated_at":"2024-06-04T13:06:24.336Z", - "consent_sign":"", - "consent":null, - "consent_sharing":"", - "residence_status":"", - "country_origin":"", - "size":null, - "address":"", - "country":"ID", - "zip_code":null, - "admin_area":"AF2906", - "admin_area_title":"Balamurghab", - "admin1":"AF02", - "admin1_title":"Kapisa", - "admin2":"AF2906", - "admin2_title":"Balamurghab", - "admin3":"", - "admin3_title":"", - "admin4":"", - "admin4_title":"", - "geopoint":null, - "female_age_group_0_5_count":null, - "female_age_group_6_11_count":null, - "female_age_group_12_17_count":null, - "female_age_group_18_59_count":null, - "female_age_group_60_count":null, - "pregnant_count":null, - "male_age_group_0_5_count":null, - "male_age_group_6_11_count":null, - "male_age_group_12_17_count":null, - "male_age_group_18_59_count":null, - "male_age_group_60_count":null, - "female_age_group_0_5_disabled_count":null, - "female_age_group_6_11_disabled_count":null, - "female_age_group_12_17_disabled_count":null, - "female_age_group_18_59_disabled_count":null, - "female_age_group_60_disabled_count":null, - "male_age_group_0_5_disabled_count":null, - "male_age_group_6_11_disabled_count":null, - "male_age_group_12_17_disabled_count":null, - "male_age_group_18_59_disabled_count":null, - "male_age_group_60_disabled_count":null, - "head_of_household":"241d9b2e-d5be-4c70-b58c-d2ec0261c7d0", - "fchild_hoh":null, - "child_hoh":null, - "registration_data_import":"fdacfb7c-8d8a-467d-acdb-eba1b4bfe291", - "first_registration_date":"2009-10-09T00:00:00Z", - "last_registration_date":"2009-10-09T00:00:00Z", - "returnee":null, - "flex_fields":{ - - }, - "start":null, - "deviceid":"", - "name_enumerator":"", - "org_enumerator":"", - "org_name_enumerator":"", - "village":"", - "registration_method":"", - "collect_individual_data":"", - "currency":"", - "unhcr_id":"", - "kobo_submission_uuid":null, - "kobo_submission_time":null, - "detail_id":"9", - "program_registration_id":null, - "enumerator_rec_id":null, - "flex_registrations_record":null, - "mis_unicef_id":null, - "program_id":"939ff91b-7f89-4e3c-9519-26ed62f51718", - "collect_type":"SINGLE" - } -}, -{ - "model":"registration_datahub.importedhousehold", - "pk":"0aa989ae-0bea-499c-a6e5-78d9fa98569a", - "fields":{ - "created_at":"2024-06-04T13:06:24.300Z", - "updated_at":"2024-06-04T13:06:24.300Z", - "consent_sign":"", - "consent":null, - "consent_sharing":"", - "residence_status":"", - "country_origin":"", - "size":null, - "address":"", - "country":"AI", - "zip_code":null, - "admin_area":"AF3006", - "admin_area_title":"Pashtunzarghun", - "admin1":"AF25", - "admin1_title":"Paktika", - "admin2":"AF3006", - "admin2_title":"Pashtunzarghun", - "admin3":"", - "admin3_title":"", - "admin4":"", - "admin4_title":"", - "geopoint":null, - "female_age_group_0_5_count":null, - "female_age_group_6_11_count":null, - "female_age_group_12_17_count":null, - "female_age_group_18_59_count":null, - "female_age_group_60_count":null, - "pregnant_count":null, - "male_age_group_0_5_count":null, - "male_age_group_6_11_count":null, - "male_age_group_12_17_count":null, - "male_age_group_18_59_count":null, - "male_age_group_60_count":null, - "female_age_group_0_5_disabled_count":null, - "female_age_group_6_11_disabled_count":null, - "female_age_group_12_17_disabled_count":null, - "female_age_group_18_59_disabled_count":null, - "female_age_group_60_disabled_count":null, - "male_age_group_0_5_disabled_count":null, - "male_age_group_6_11_disabled_count":null, - "male_age_group_12_17_disabled_count":null, - "male_age_group_18_59_disabled_count":null, - "male_age_group_60_disabled_count":null, - "head_of_household":"a5aac76e-c630-4eb9-ab01-b192f2833105", - "fchild_hoh":null, - "child_hoh":null, - "registration_data_import":"fdacfb7c-8d8a-467d-acdb-eba1b4bfe291", - "first_registration_date":"2012-03-03T00:00:00Z", - "last_registration_date":"2012-03-03T00:00:00Z", - "returnee":null, - "flex_fields":{ - - }, - "start":null, - "deviceid":"", - "name_enumerator":"", - "org_enumerator":"", - "org_name_enumerator":"", - "village":"", - "registration_method":"", - "collect_individual_data":"", - "currency":"", - "unhcr_id":"", - "kobo_submission_uuid":null, - "kobo_submission_time":null, - "detail_id":"4", - "program_registration_id":null, - "enumerator_rec_id":null, - "flex_registrations_record":null, - "mis_unicef_id":null, - "program_id":"939ff91b-7f89-4e3c-9519-26ed62f51718", - "collect_type":"SINGLE" - } -}, -{ - "model":"registration_datahub.importedhousehold", - "pk":"10629102-0e9a-46b9-a17e-87548e623ea8", - "fields":{ - "created_at":"2024-06-04T13:06:24.358Z", - "updated_at":"2024-06-04T13:06:24.358Z", - "consent_sign":"", - "consent":null, - "consent_sharing":"", - "residence_status":"", - "country_origin":"", - "size":null, - "address":"", - "country":"IM", - "zip_code":null, - "admin_area":"AF3003", - "admin_area_title":"Kushk", - "admin1":"AF25", - "admin1_title":"Paktika", - "admin2":"AF3003", - "admin2_title":"Kushk", - "admin3":"", - "admin3_title":"", - "admin4":"", - "admin4_title":"", - "geopoint":null, - "female_age_group_0_5_count":null, - "female_age_group_6_11_count":null, - "female_age_group_12_17_count":null, - "female_age_group_18_59_count":null, - "female_age_group_60_count":null, - "pregnant_count":null, - "male_age_group_0_5_count":null, - "male_age_group_6_11_count":null, - "male_age_group_12_17_count":null, - "male_age_group_18_59_count":null, - "male_age_group_60_count":null, - "female_age_group_0_5_disabled_count":null, - "female_age_group_6_11_disabled_count":null, - "female_age_group_12_17_disabled_count":null, - "female_age_group_18_59_disabled_count":null, - "female_age_group_60_disabled_count":null, - "male_age_group_0_5_disabled_count":null, - "male_age_group_6_11_disabled_count":null, - "male_age_group_12_17_disabled_count":null, - "male_age_group_18_59_disabled_count":null, - "male_age_group_60_disabled_count":null, - "head_of_household":"1e854b23-eea5-4184-a779-a74cd40d0068", - "fchild_hoh":null, - "child_hoh":null, - "registration_data_import":"fdacfb7c-8d8a-467d-acdb-eba1b4bfe291", - "first_registration_date":"2008-10-21T00:00:00Z", - "last_registration_date":"2008-10-21T00:00:00Z", - "returnee":null, - "flex_fields":{ - - }, - "start":null, - "deviceid":"", - "name_enumerator":"", - "org_enumerator":"", - "org_name_enumerator":"", - "village":"", - "registration_method":"", - "collect_individual_data":"", - "currency":"", - "unhcr_id":"", - "kobo_submission_uuid":null, - "kobo_submission_time":null, - "detail_id":"12", - "program_registration_id":null, - "enumerator_rec_id":null, - "flex_registrations_record":null, - "mis_unicef_id":null, - "program_id":"939ff91b-7f89-4e3c-9519-26ed62f51718", - "collect_type":"SINGLE" - } -}, -{ - "model":"registration_datahub.importedhousehold", - "pk":"472f54df-76c6-4f26-8914-5a7e22683a75", - "fields":{ - "created_at":"2024-06-04T13:06:24.351Z", - "updated_at":"2024-06-04T13:06:24.351Z", - "consent_sign":"", - "consent":null, - "consent_sharing":"", - "residence_status":"", - "country_origin":"", - "size":null, - "address":"", - "country":"LC", - "zip_code":null, - "admin_area":"AF1107", - "admin_area_title":"Zanakhan", - "admin1":"AF34", - "admin1_title":"Nimroz", - "admin2":"AF1107", - "admin2_title":"Zanakhan", - "admin3":"", - "admin3_title":"", - "admin4":"", - "admin4_title":"", - "geopoint":null, - "female_age_group_0_5_count":null, - "female_age_group_6_11_count":null, - "female_age_group_12_17_count":null, - "female_age_group_18_59_count":null, - "female_age_group_60_count":null, - "pregnant_count":null, - "male_age_group_0_5_count":null, - "male_age_group_6_11_count":null, - "male_age_group_12_17_count":null, - "male_age_group_18_59_count":null, - "male_age_group_60_count":null, - "female_age_group_0_5_disabled_count":null, - "female_age_group_6_11_disabled_count":null, - "female_age_group_12_17_disabled_count":null, - "female_age_group_18_59_disabled_count":null, - "female_age_group_60_disabled_count":null, - "male_age_group_0_5_disabled_count":null, - "male_age_group_6_11_disabled_count":null, - "male_age_group_12_17_disabled_count":null, - "male_age_group_18_59_disabled_count":null, - "male_age_group_60_disabled_count":null, - "head_of_household":"7fdeb99d-b1bf-45e8-8866-d0a4521299e8", - "fchild_hoh":null, - "child_hoh":null, - "registration_data_import":"fdacfb7c-8d8a-467d-acdb-eba1b4bfe291", - "first_registration_date":"2020-03-07T00:00:00Z", - "last_registration_date":"2020-03-07T00:00:00Z", - "returnee":null, - "flex_fields":{ - - }, - "start":null, - "deviceid":"", - "name_enumerator":"", - "org_enumerator":"", - "org_name_enumerator":"", - "village":"", - "registration_method":"", - "collect_individual_data":"", - "currency":"", - "unhcr_id":"", - "kobo_submission_uuid":null, - "kobo_submission_time":null, - "detail_id":"11", - "program_registration_id":null, - "enumerator_rec_id":null, - "flex_registrations_record":null, - "mis_unicef_id":null, - "program_id":"939ff91b-7f89-4e3c-9519-26ed62f51718", - "collect_type":"SINGLE" - } -}, -{ - "model":"registration_datahub.importedhousehold", - "pk":"7c91c5db-3d9a-4532-a1a6-790d72a12a40", - "fields":{ - "created_at":"2024-06-04T13:06:24.323Z", - "updated_at":"2024-06-04T13:06:24.323Z", - "consent_sign":"", - "consent":null, - "consent_sharing":"", - "residence_status":"", - "country_origin":"", - "size":null, - "address":"", - "country":"GH", - "zip_code":null, - "admin_area":"AF3001", - "admin_area_title":"Hirat", - "admin1":"AF09", - "admin1_title":"Baghlan", - "admin2":"AF3001", - "admin2_title":"Hirat", - "admin3":"", - "admin3_title":"", - "admin4":"", - "admin4_title":"", - "geopoint":null, - "female_age_group_0_5_count":null, - "female_age_group_6_11_count":null, - "female_age_group_12_17_count":null, - "female_age_group_18_59_count":null, - "female_age_group_60_count":null, - "pregnant_count":null, - "male_age_group_0_5_count":null, - "male_age_group_6_11_count":null, - "male_age_group_12_17_count":null, - "male_age_group_18_59_count":null, - "male_age_group_60_count":null, - "female_age_group_0_5_disabled_count":null, - "female_age_group_6_11_disabled_count":null, - "female_age_group_12_17_disabled_count":null, - "female_age_group_18_59_disabled_count":null, - "female_age_group_60_disabled_count":null, - "male_age_group_0_5_disabled_count":null, - "male_age_group_6_11_disabled_count":null, - "male_age_group_12_17_disabled_count":null, - "male_age_group_18_59_disabled_count":null, - "male_age_group_60_disabled_count":null, - "head_of_household":"36c74c19-9052-4293-9bae-c255bf72d3f3", - "fchild_hoh":null, - "child_hoh":null, - "registration_data_import":"fdacfb7c-8d8a-467d-acdb-eba1b4bfe291", - "first_registration_date":"2006-02-15T00:00:00Z", - "last_registration_date":"2006-02-15T00:00:00Z", - "returnee":null, - "flex_fields":{ - - }, - "start":null, - "deviceid":"", - "name_enumerator":"", - "org_enumerator":"", - "org_name_enumerator":"", - "village":"", - "registration_method":"", - "collect_individual_data":"", - "currency":"", - "unhcr_id":"", - "kobo_submission_uuid":null, - "kobo_submission_time":null, - "detail_id":"7", - "program_registration_id":null, - "enumerator_rec_id":null, - "flex_registrations_record":null, - "mis_unicef_id":null, - "program_id":"939ff91b-7f89-4e3c-9519-26ed62f51718", - "collect_type":"SINGLE" - } -}, -{ - "model":"registration_datahub.importedhousehold", - "pk":"a8792392-5ba0-41fe-bc0a-aeefd2f03a48", - "fields":{ - "created_at":"2024-06-04T13:06:24.277Z", - "updated_at":"2024-06-04T13:06:24.277Z", - "consent_sign":"", - "consent":null, - "consent_sharing":"", - "residence_status":"", - "country_origin":"", - "size":null, - "address":"", - "country":"ES", - "zip_code":null, - "admin_area":"AF2004", - "admin_area_title":"Sozmaqala", - "admin1":"AF04", - "admin1_title":"Wardak", - "admin2":"AF2004", - "admin2_title":"Sozmaqala", - "admin3":"", - "admin3_title":"", - "admin4":"", - "admin4_title":"", - "geopoint":null, - "female_age_group_0_5_count":null, - "female_age_group_6_11_count":null, - "female_age_group_12_17_count":null, - "female_age_group_18_59_count":null, - "female_age_group_60_count":null, - "pregnant_count":null, - "male_age_group_0_5_count":null, - "male_age_group_6_11_count":null, - "male_age_group_12_17_count":null, - "male_age_group_18_59_count":null, - "male_age_group_60_count":null, - "female_age_group_0_5_disabled_count":null, - "female_age_group_6_11_disabled_count":null, - "female_age_group_12_17_disabled_count":null, - "female_age_group_18_59_disabled_count":null, - "female_age_group_60_disabled_count":null, - "male_age_group_0_5_disabled_count":null, - "male_age_group_6_11_disabled_count":null, - "male_age_group_12_17_disabled_count":null, - "male_age_group_18_59_disabled_count":null, - "male_age_group_60_disabled_count":null, - "head_of_household":"351307ae-cfc8-479a-86f5-55450758512b", - "fchild_hoh":null, - "child_hoh":null, - "registration_data_import":"fdacfb7c-8d8a-467d-acdb-eba1b4bfe291", - "first_registration_date":"2005-05-30T00:00:00Z", - "last_registration_date":"2005-05-30T00:00:00Z", - "returnee":null, - "flex_fields":{ - - }, - "start":null, - "deviceid":"", - "name_enumerator":"", - "org_enumerator":"", - "org_name_enumerator":"", - "village":"", - "registration_method":"", - "collect_individual_data":"", - "currency":"", - "unhcr_id":"", - "kobo_submission_uuid":null, - "kobo_submission_time":null, - "detail_id":"3", - "program_registration_id":null, - "enumerator_rec_id":null, - "flex_registrations_record":null, - "mis_unicef_id":null, - "program_id":"939ff91b-7f89-4e3c-9519-26ed62f51718", - "collect_type":"SINGLE" - } -}, -{ - "model":"registration_datahub.importedhousehold", - "pk":"cba378ef-f9ba-427a-b00f-4c3dc64bf7b4", - "fields":{ - "created_at":"2024-06-04T13:06:24.329Z", - "updated_at":"2024-06-04T13:06:24.329Z", - "consent_sign":"", - "consent":null, - "consent_sharing":"", - "residence_status":"", - "country_origin":"", - "size":null, - "address":"", - "country":"MF", - "zip_code":null, - "admin_area":"AF3306", - "admin_area_title":"Shahwalikot", - "admin1":"AF14", - "admin1_title":"Nuristan", - "admin2":"AF3306", - "admin2_title":"Shahwalikot", - "admin3":"", - "admin3_title":"", - "admin4":"", - "admin4_title":"", - "geopoint":null, - "female_age_group_0_5_count":null, - "female_age_group_6_11_count":null, - "female_age_group_12_17_count":null, - "female_age_group_18_59_count":null, - "female_age_group_60_count":null, - "pregnant_count":null, - "male_age_group_0_5_count":null, - "male_age_group_6_11_count":null, - "male_age_group_12_17_count":null, - "male_age_group_18_59_count":null, - "male_age_group_60_count":null, - "female_age_group_0_5_disabled_count":null, - "female_age_group_6_11_disabled_count":null, - "female_age_group_12_17_disabled_count":null, - "female_age_group_18_59_disabled_count":null, - "female_age_group_60_disabled_count":null, - "male_age_group_0_5_disabled_count":null, - "male_age_group_6_11_disabled_count":null, - "male_age_group_12_17_disabled_count":null, - "male_age_group_18_59_disabled_count":null, - "male_age_group_60_disabled_count":null, - "head_of_household":"a26ccd5a-3ea0-45d1-b160-ad7bafe579b8", - "fchild_hoh":null, - "child_hoh":null, - "registration_data_import":"fdacfb7c-8d8a-467d-acdb-eba1b4bfe291", - "first_registration_date":"2005-08-14T00:00:00Z", - "last_registration_date":"2005-08-14T00:00:00Z", - "returnee":null, - "flex_fields":{ - - }, - "start":null, - "deviceid":"", - "name_enumerator":"", - "org_enumerator":"", - "org_name_enumerator":"", - "village":"", - "registration_method":"", - "collect_individual_data":"", - "currency":"", - "unhcr_id":"", - "kobo_submission_uuid":null, - "kobo_submission_time":null, - "detail_id":"8", - "program_registration_id":null, - "enumerator_rec_id":null, - "flex_registrations_record":null, - "mis_unicef_id":null, - "program_id":"939ff91b-7f89-4e3c-9519-26ed62f51718", - "collect_type":"SINGLE" - } -}, -{ - "model":"registration_datahub.importedhousehold", - "pk":"d3cbfd6c-2ea2-4554-a816-b5dd5bad98bc", - "fields":{ - "created_at":"2024-06-04T13:06:24.316Z", - "updated_at":"2024-06-04T13:06:24.316Z", - "consent_sign":"", - "consent":null, - "consent_sharing":"", - "residence_status":"", - "country_origin":"", - "size":null, - "address":"", - "country":"AX", - "zip_code":null, - "admin_area":"AF2207", - "admin_area_title":"Sang-e-Takht", - "admin1":"AF33", - "admin1_title":"Kandahar", - "admin2":"AF2207", - "admin2_title":"Sang-e-Takht", - "admin3":"", - "admin3_title":"", - "admin4":"", - "admin4_title":"", - "geopoint":null, - "female_age_group_0_5_count":null, - "female_age_group_6_11_count":null, - "female_age_group_12_17_count":null, - "female_age_group_18_59_count":null, - "female_age_group_60_count":null, - "pregnant_count":null, - "male_age_group_0_5_count":null, - "male_age_group_6_11_count":null, - "male_age_group_12_17_count":null, - "male_age_group_18_59_count":null, - "male_age_group_60_count":null, - "female_age_group_0_5_disabled_count":null, - "female_age_group_6_11_disabled_count":null, - "female_age_group_12_17_disabled_count":null, - "female_age_group_18_59_disabled_count":null, - "female_age_group_60_disabled_count":null, - "male_age_group_0_5_disabled_count":null, - "male_age_group_6_11_disabled_count":null, - "male_age_group_12_17_disabled_count":null, - "male_age_group_18_59_disabled_count":null, - "male_age_group_60_disabled_count":null, - "head_of_household":"5bfffcaa-10f2-4d98-8957-d87e3a9e5e82", - "fchild_hoh":null, - "child_hoh":null, - "registration_data_import":"fdacfb7c-8d8a-467d-acdb-eba1b4bfe291", - "first_registration_date":"2008-12-07T00:00:00Z", - "last_registration_date":"2008-12-07T00:00:00Z", - "returnee":null, - "flex_fields":{ - - }, - "start":null, - "deviceid":"", - "name_enumerator":"", - "org_enumerator":"", - "org_name_enumerator":"", - "village":"", - "registration_method":"", - "collect_individual_data":"", - "currency":"", - "unhcr_id":"", - "kobo_submission_uuid":null, - "kobo_submission_time":null, - "detail_id":"6", - "program_registration_id":null, - "enumerator_rec_id":null, - "flex_registrations_record":null, - "mis_unicef_id":null, - "program_id":"939ff91b-7f89-4e3c-9519-26ed62f51718", - "collect_type":"SINGLE" - } -}, -{ - "model":"registration_datahub.importedhousehold", - "pk":"de7d12e6-0118-4fdd-9f84-b41d97fda2bb", - "fields":{ - "created_at":"2024-06-04T13:06:24.344Z", - "updated_at":"2024-06-04T13:06:24.344Z", - "consent_sign":"", - "consent":null, - "consent_sharing":"", - "residence_status":"", - "country_origin":"", - "size":null, - "address":"", - "country":"EH", - "zip_code":null, - "admin_area":"AF3010", - "admin_area_title":"Adraskan", - "admin1":"AF33", - "admin1_title":"Kandahar", - "admin2":"AF3010", - "admin2_title":"Adraskan", - "admin3":"", - "admin3_title":"", - "admin4":"", - "admin4_title":"", - "geopoint":null, - "female_age_group_0_5_count":null, - "female_age_group_6_11_count":null, - "female_age_group_12_17_count":null, - "female_age_group_18_59_count":null, - "female_age_group_60_count":null, - "pregnant_count":null, - "male_age_group_0_5_count":null, - "male_age_group_6_11_count":null, - "male_age_group_12_17_count":null, - "male_age_group_18_59_count":null, - "male_age_group_60_count":null, - "female_age_group_0_5_disabled_count":null, - "female_age_group_6_11_disabled_count":null, - "female_age_group_12_17_disabled_count":null, - "female_age_group_18_59_disabled_count":null, - "female_age_group_60_disabled_count":null, - "male_age_group_0_5_disabled_count":null, - "male_age_group_6_11_disabled_count":null, - "male_age_group_12_17_disabled_count":null, - "male_age_group_18_59_disabled_count":null, - "male_age_group_60_disabled_count":null, - "head_of_household":"3cd2607d-a3c9-4526-be56-db218d2e81a9", - "fchild_hoh":null, - "child_hoh":null, - "registration_data_import":"fdacfb7c-8d8a-467d-acdb-eba1b4bfe291", - "first_registration_date":"2005-05-07T00:00:00Z", - "last_registration_date":"2005-05-07T00:00:00Z", - "returnee":null, - "flex_fields":{ - - }, - "start":null, - "deviceid":"", - "name_enumerator":"", - "org_enumerator":"", - "org_name_enumerator":"", - "village":"", - "registration_method":"", - "collect_individual_data":"", - "currency":"", - "unhcr_id":"", - "kobo_submission_uuid":null, - "kobo_submission_time":null, - "detail_id":"10", - "program_registration_id":null, - "enumerator_rec_id":null, - "flex_registrations_record":null, - "mis_unicef_id":null, - "program_id":"939ff91b-7f89-4e3c-9519-26ed62f51718", - "collect_type":"SINGLE" - } -}, -{ - "model":"registration_datahub.importedhousehold", - "pk":"e2fa3120-b5fa-4fe6-8839-fac2d3ca898a", - "fields":{ - "created_at":"2024-06-04T13:06:24.309Z", - "updated_at":"2024-06-04T13:06:24.309Z", - "consent_sign":"", - "consent":null, - "consent_sharing":"", - "residence_status":"", - "country_origin":"", - "size":null, - "address":"", - "country":"CK", - "zip_code":null, - "admin_area":"AF2802", - "admin_area_title":"Khwajasabzposh", - "admin1":"AF09", - "admin1_title":"Baghlan", - "admin2":"AF2802", - "admin2_title":"Khwajasabzposh", - "admin3":"", - "admin3_title":"", - "admin4":"", - "admin4_title":"", - "geopoint":null, - "female_age_group_0_5_count":null, - "female_age_group_6_11_count":null, - "female_age_group_12_17_count":null, - "female_age_group_18_59_count":null, - "female_age_group_60_count":null, - "pregnant_count":null, - "male_age_group_0_5_count":null, - "male_age_group_6_11_count":null, - "male_age_group_12_17_count":null, - "male_age_group_18_59_count":null, - "male_age_group_60_count":null, - "female_age_group_0_5_disabled_count":null, - "female_age_group_6_11_disabled_count":null, - "female_age_group_12_17_disabled_count":null, - "female_age_group_18_59_disabled_count":null, - "female_age_group_60_disabled_count":null, - "male_age_group_0_5_disabled_count":null, - "male_age_group_6_11_disabled_count":null, - "male_age_group_12_17_disabled_count":null, - "male_age_group_18_59_disabled_count":null, - "male_age_group_60_disabled_count":null, - "head_of_household":"8a505757-9f83-48e2-8c0c-a29b17b5995f", - "fchild_hoh":null, - "child_hoh":null, - "registration_data_import":"fdacfb7c-8d8a-467d-acdb-eba1b4bfe291", - "first_registration_date":"2007-09-19T00:00:00Z", - "last_registration_date":"2007-09-19T00:00:00Z", - "returnee":null, - "flex_fields":{ - - }, - "start":null, - "deviceid":"", - "name_enumerator":"", - "org_enumerator":"", - "org_name_enumerator":"", - "village":"", - "registration_method":"", - "collect_individual_data":"", - "currency":"", - "unhcr_id":"", - "kobo_submission_uuid":null, - "kobo_submission_time":null, - "detail_id":"5", - "program_registration_id":null, - "enumerator_rec_id":null, - "flex_registrations_record":null, - "mis_unicef_id":null, - "program_id":"939ff91b-7f89-4e3c-9519-26ed62f51718", - "collect_type":"SINGLE" - } -}, -{ - "model":"registration_datahub.importedindividual", - "pk":"1e854b23-eea5-4184-a779-a74cd40d0068", - "fields":{ - "created_at":"2024-06-04T13:06:24.385Z", - "updated_at":"2024-06-04T13:06:24.385Z", - "individual_id":"", - "photo":"", - "full_name":"Paula Roberts", - "given_name":"", - "middle_name":"", - "family_name":"Bryan Powell MD", - "relationship":"HEAD", - "sex":"FEMALE", - "birth_date":"2005-08-08", - "estimated_birth_date":false, - "marital_status":"SEPARATED", - "phone_no":"(722)996-1758x54168", - "phone_no_valid":null, - "phone_no_alternative":"", - "phone_no_alternative_valid":null, - "email":"", - "payment_delivery_phone_no":"", - "household":"10629102-0e9a-46b9-a17e-87548e623ea8", - "registration_data_import":"fdacfb7c-8d8a-467d-acdb-eba1b4bfe291", - "disability":"not disabled", - "work_status":"0", - "first_registration_date":"2008-10-21", - "last_registration_date":"2008-10-21", - "deduplication_batch_status":"UNIQUE_IN_BATCH", - "deduplication_golden_record_status":"UNIQUE", - "deduplication_batch_results":{ - "score":{ - "max":0, - "min":9223372036854775807, - "qty":0 - }, - "duplicates":[ - - ], - "possible_duplicates":[ - - ] - }, - "deduplication_golden_record_results":{ - "duplicates":[ - - ], - "possible_duplicates":[ - - ] - }, - "flex_fields":{ - - }, - "pregnant":false, - "observed_disability":"HEARING", - "seeing_disability":"SOME_DIFFICULTY", - "hearing_disability":"CANNOT_DO", - "physical_disability":"SOME_DIFFICULTY", - "memory_disability":"CANNOT_DO", - "selfcare_disability":"LOT_DIFFICULTY", - "comms_disability":"LOT_DIFFICULTY", - "who_answers_phone":"", - "who_answers_alt_phone":"", - "detail_id":"12", - "disability_certificate_picture":"", - "preferred_language":null, - "mis_unicef_id":null, - "program_id":"939ff91b-7f89-4e3c-9519-26ed62f51718", - "age_at_registration":18, - "wallet_name":"", - "blockchain_name":"", - "wallet_address":"" - } -}, -{ - "model":"registration_datahub.importedindividual", - "pk":"241d9b2e-d5be-4c70-b58c-d2ec0261c7d0", - "fields":{ - "created_at":"2024-06-04T13:06:24.384Z", - "updated_at":"2024-06-04T13:06:24.384Z", - "individual_id":"", - "photo":"", - "full_name":"Samantha Adams", - "given_name":"", - "middle_name":"", - "family_name":"Christopher Kramer", - "relationship":"HEAD", - "sex":"MALE", - "birth_date":"1999-05-10", - "estimated_birth_date":false, - "marital_status":"", - "phone_no":"001-919-758-4253x495", - "phone_no_valid":null, - "phone_no_alternative":"", - "phone_no_alternative_valid":null, - "email":"", - "payment_delivery_phone_no":"", - "household":"056ca352-7ee3-4e0b-978e-d57925f712b1", - "registration_data_import":"fdacfb7c-8d8a-467d-acdb-eba1b4bfe291", - "disability":"not disabled", - "work_status":"1", - "first_registration_date":"2009-10-09", - "last_registration_date":"2009-10-09", - "deduplication_batch_status":"UNIQUE_IN_BATCH", - "deduplication_golden_record_status":"UNIQUE", - "deduplication_batch_results":{ - "score":{ - "max":0, - "min":9223372036854775807, - "qty":0 - }, - "duplicates":[ - - ], - "possible_duplicates":[ - - ] - }, - "deduplication_golden_record_results":{ - "duplicates":[ - - ], - "possible_duplicates":[ - - ] - }, - "flex_fields":{ - - }, - "pregnant":false, - "observed_disability":"SELF_CARE", - "seeing_disability":"CANNOT_DO", - "hearing_disability":"LOT_DIFFICULTY", - "physical_disability":"CANNOT_DO", - "memory_disability":"CANNOT_DO", - "selfcare_disability":"SOME_DIFFICULTY", - "comms_disability":"", - "who_answers_phone":"", - "who_answers_alt_phone":"", - "detail_id":"9", - "disability_certificate_picture":"", - "preferred_language":null, - "mis_unicef_id":null, - "program_id":"939ff91b-7f89-4e3c-9519-26ed62f51718", - "age_at_registration":25, - "wallet_name":"", - "blockchain_name":"", - "wallet_address":"" - } -}, -{ - "model":"registration_datahub.importedindividual", - "pk":"351307ae-cfc8-479a-86f5-55450758512b", - "fields":{ - "created_at":"2024-06-04T13:06:24.361Z", - "updated_at":"2024-06-04T13:06:24.361Z", - "individual_id":"", - "photo":"", - "full_name":"Samuel Russell", - "given_name":"", - "middle_name":"", - "family_name":"Dr. April Hobbs", - "relationship":"HEAD", - "sex":"FEMALE", - "birth_date":"2005-08-17", - "estimated_birth_date":false, - "marital_status":"WIDOWED", - "phone_no":"(266)977-6431x857", - "phone_no_valid":null, - "phone_no_alternative":"", - "phone_no_alternative_valid":null, - "email":"", - "payment_delivery_phone_no":"", - "household":"a8792392-5ba0-41fe-bc0a-aeefd2f03a48", - "registration_data_import":"fdacfb7c-8d8a-467d-acdb-eba1b4bfe291", - "disability":"not disabled", - "work_status":"NOT_PROVIDED", - "first_registration_date":"2005-05-30", - "last_registration_date":"2005-05-30", - "deduplication_batch_status":"UNIQUE_IN_BATCH", - "deduplication_golden_record_status":"UNIQUE", - "deduplication_batch_results":{ - "score":{ - "max":0, - "min":9223372036854775807, - "qty":0 - }, - "duplicates":[ - - ], - "possible_duplicates":[ - - ] - }, - "deduplication_golden_record_results":{ - "duplicates":[ - - ], - "possible_duplicates":[ - - ] - }, - "flex_fields":{ - - }, - "pregnant":false, - "observed_disability":"SEEING", - "seeing_disability":"SOME_DIFFICULTY", - "hearing_disability":"CANNOT_DO", - "physical_disability":"LOT_DIFFICULTY", - "memory_disability":"CANNOT_DO", - "selfcare_disability":"LOT_DIFFICULTY", - "comms_disability":"", - "who_answers_phone":"", - "who_answers_alt_phone":"", - "detail_id":"3", - "disability_certificate_picture":"", - "preferred_language":null, - "mis_unicef_id":null, - "program_id":"939ff91b-7f89-4e3c-9519-26ed62f51718", - "age_at_registration":18, - "wallet_name":"", - "blockchain_name":"", - "wallet_address":"" - } -}, -{ - "model":"registration_datahub.importedindividual", - "pk":"36c74c19-9052-4293-9bae-c255bf72d3f3", - "fields":{ - "created_at":"2024-06-04T13:06:24.384Z", - "updated_at":"2024-06-04T13:06:24.384Z", - "individual_id":"", - "photo":"", - "full_name":"Austin Smith", - "given_name":"", - "middle_name":"", - "family_name":"Karen Smith", - "relationship":"HEAD", - "sex":"FEMALE", - "birth_date":"1995-01-09", - "estimated_birth_date":false, - "marital_status":"DIVORCED", - "phone_no":"(558)362-8774", - "phone_no_valid":null, - "phone_no_alternative":"", - "phone_no_alternative_valid":null, - "email":"", - "payment_delivery_phone_no":"", - "household":"7c91c5db-3d9a-4532-a1a6-790d72a12a40", - "registration_data_import":"fdacfb7c-8d8a-467d-acdb-eba1b4bfe291", - "disability":"not disabled", - "work_status":"1", - "first_registration_date":"2006-02-15", - "last_registration_date":"2006-02-15", - "deduplication_batch_status":"UNIQUE_IN_BATCH", - "deduplication_golden_record_status":"UNIQUE", - "deduplication_batch_results":{ - "score":{ - "max":0, - "min":9223372036854775807, - "qty":0 - }, - "duplicates":[ - - ], - "possible_duplicates":[ - - ] - }, - "deduplication_golden_record_results":{ - "duplicates":[ - - ], - "possible_duplicates":[ - - ] - }, - "flex_fields":{ - - }, - "pregnant":false, - "observed_disability":"SEEING", - "seeing_disability":"SOME_DIFFICULTY", - "hearing_disability":"SOME_DIFFICULTY", - "physical_disability":"CANNOT_DO", - "memory_disability":"CANNOT_DO", - "selfcare_disability":"SOME_DIFFICULTY", - "comms_disability":"LOT_DIFFICULTY", - "who_answers_phone":"", - "who_answers_alt_phone":"", - "detail_id":"7", - "disability_certificate_picture":"", - "preferred_language":null, - "mis_unicef_id":null, - "program_id":"939ff91b-7f89-4e3c-9519-26ed62f51718", - "age_at_registration":29, - "wallet_name":"", - "blockchain_name":"", - "wallet_address":"" - } -}, -{ - "model":"registration_datahub.importedindividual", - "pk":"3cd2607d-a3c9-4526-be56-db218d2e81a9", - "fields":{ - "created_at":"2024-06-04T13:06:24.384Z", - "updated_at":"2024-06-04T13:06:24.384Z", - "individual_id":"", - "photo":"", - "full_name":"Stacey Freeman", - "given_name":"", - "middle_name":"", - "family_name":"Todd Adams", - "relationship":"HEAD", - "sex":"FEMALE", - "birth_date":"2018-12-02", - "estimated_birth_date":false, - "marital_status":"", - "phone_no":"394.494.6165x76079", - "phone_no_valid":null, - "phone_no_alternative":"", - "phone_no_alternative_valid":null, - "email":"", - "payment_delivery_phone_no":"", - "household":"de7d12e6-0118-4fdd-9f84-b41d97fda2bb", - "registration_data_import":"fdacfb7c-8d8a-467d-acdb-eba1b4bfe291", - "disability":"not disabled", - "work_status":"NOT_PROVIDED", - "first_registration_date":"2005-05-07", - "last_registration_date":"2005-05-07", - "deduplication_batch_status":"UNIQUE_IN_BATCH", - "deduplication_golden_record_status":"UNIQUE", - "deduplication_batch_results":{ - "score":{ - "max":0, - "min":9223372036854775807, - "qty":0 - }, - "duplicates":[ - - ], - "possible_duplicates":[ - - ] - }, - "deduplication_golden_record_results":{ - "duplicates":[ - - ], - "possible_duplicates":[ - - ] - }, - "flex_fields":{ - - }, - "pregnant":false, - "observed_disability":"WALKING", - "seeing_disability":"SOME_DIFFICULTY", - "hearing_disability":"LOT_DIFFICULTY", - "physical_disability":"", - "memory_disability":"CANNOT_DO", - "selfcare_disability":"SOME_DIFFICULTY", - "comms_disability":"LOT_DIFFICULTY", - "who_answers_phone":"", - "who_answers_alt_phone":"", - "detail_id":"10", - "disability_certificate_picture":"", - "preferred_language":null, - "mis_unicef_id":null, - "program_id":"939ff91b-7f89-4e3c-9519-26ed62f51718", - "age_at_registration":5, - "wallet_name":"", - "blockchain_name":"", - "wallet_address":"" - } -}, -{ - "model":"registration_datahub.importedindividual", - "pk":"5bfffcaa-10f2-4d98-8957-d87e3a9e5e82", - "fields":{ - "created_at":"2024-06-04T13:06:24.383Z", - "updated_at":"2024-06-04T13:06:24.383Z", - "individual_id":"", - "photo":"", - "full_name":"James Gonzalez II", - "given_name":"", - "middle_name":"", - "family_name":"Kenneth Brooks", - "relationship":"HEAD", - "sex":"MALE", - "birth_date":"1998-06-13", - "estimated_birth_date":false, - "marital_status":"DIVORCED", - "phone_no":"+14508345669", - "phone_no_valid":null, - "phone_no_alternative":"", - "phone_no_alternative_valid":null, - "email":"", - "payment_delivery_phone_no":"", - "household":"d3cbfd6c-2ea2-4554-a816-b5dd5bad98bc", - "registration_data_import":"fdacfb7c-8d8a-467d-acdb-eba1b4bfe291", - "disability":"not disabled", - "work_status":"0", - "first_registration_date":"2008-12-07", - "last_registration_date":"2008-12-07", - "deduplication_batch_status":"UNIQUE_IN_BATCH", - "deduplication_golden_record_status":"UNIQUE", - "deduplication_batch_results":{ - "score":{ - "max":0, - "min":9223372036854775807, - "qty":0 - }, - "duplicates":[ - - ], - "possible_duplicates":[ - - ] - }, - "deduplication_golden_record_results":{ - "duplicates":[ - - ], - "possible_duplicates":[ - - ] - }, - "flex_fields":{ - - }, - "pregnant":false, - "observed_disability":"WALKING", - "seeing_disability":"SOME_DIFFICULTY", - "hearing_disability":"SOME_DIFFICULTY", - "physical_disability":"LOT_DIFFICULTY", - "memory_disability":"LOT_DIFFICULTY", - "selfcare_disability":"SOME_DIFFICULTY", - "comms_disability":"CANNOT_DO", - "who_answers_phone":"", - "who_answers_alt_phone":"", - "detail_id":"6", - "disability_certificate_picture":"", - "preferred_language":null, - "mis_unicef_id":null, - "program_id":"939ff91b-7f89-4e3c-9519-26ed62f51718", - "age_at_registration":25, - "wallet_name":"", - "blockchain_name":"", - "wallet_address":"" - } -}, -{ - "model":"registration_datahub.importedindividual", - "pk":"7fdeb99d-b1bf-45e8-8866-d0a4521299e8", - "fields":{ - "created_at":"2024-06-04T13:06:24.385Z", - "updated_at":"2024-06-04T13:06:24.385Z", - "individual_id":"", - "photo":"", - "full_name":"James Bernard", - "given_name":"", - "middle_name":"", - "family_name":"Allen Miller", - "relationship":"HEAD", - "sex":"FEMALE", - "birth_date":"2008-11-30", - "estimated_birth_date":false, - "marital_status":"MARRIED", - "phone_no":"001-731-676-2759x5087", - "phone_no_valid":null, - "phone_no_alternative":"", - "phone_no_alternative_valid":null, - "email":"", - "payment_delivery_phone_no":"", - "household":"472f54df-76c6-4f26-8914-5a7e22683a75", - "registration_data_import":"fdacfb7c-8d8a-467d-acdb-eba1b4bfe291", - "disability":"not disabled", - "work_status":"0", - "first_registration_date":"2020-03-07", - "last_registration_date":"2020-03-07", - "deduplication_batch_status":"UNIQUE_IN_BATCH", - "deduplication_golden_record_status":"UNIQUE", - "deduplication_batch_results":{ - "score":{ - "max":0, - "min":9223372036854775807, - "qty":0 - }, - "duplicates":[ - - ], - "possible_duplicates":[ - - ] - }, - "deduplication_golden_record_results":{ - "duplicates":[ - - ], - "possible_duplicates":[ - - ] - }, - "flex_fields":{ - - }, - "pregnant":false, - "observed_disability":"COMMUNICATING", - "seeing_disability":"", - "hearing_disability":"LOT_DIFFICULTY", - "physical_disability":"SOME_DIFFICULTY", - "memory_disability":"SOME_DIFFICULTY", - "selfcare_disability":"SOME_DIFFICULTY", - "comms_disability":"", - "who_answers_phone":"", - "who_answers_alt_phone":"", - "detail_id":"11", - "disability_certificate_picture":"", - "preferred_language":null, - "mis_unicef_id":null, - "program_id":"939ff91b-7f89-4e3c-9519-26ed62f51718", - "age_at_registration":15, - "wallet_name":"", - "blockchain_name":"", - "wallet_address":"" - } -}, -{ - "model":"registration_datahub.importedindividual", - "pk":"8a505757-9f83-48e2-8c0c-a29b17b5995f", - "fields":{ - "created_at":"2024-06-04T13:06:24.383Z", - "updated_at":"2024-06-04T13:06:24.383Z", - "individual_id":"", - "photo":"", - "full_name":"Jenna Beasley", - "given_name":"", - "middle_name":"", - "family_name":"Terry Hodges", - "relationship":"HEAD", - "sex":"MALE", - "birth_date":"2004-12-11", - "estimated_birth_date":false, - "marital_status":"WIDOWED", - "phone_no":"001-239-394-7967x746", - "phone_no_valid":null, - "phone_no_alternative":"", - "phone_no_alternative_valid":null, - "email":"", - "payment_delivery_phone_no":"", - "household":"e2fa3120-b5fa-4fe6-8839-fac2d3ca898a", - "registration_data_import":"fdacfb7c-8d8a-467d-acdb-eba1b4bfe291", - "disability":"not disabled", - "work_status":"NOT_PROVIDED", - "first_registration_date":"2007-09-19", - "last_registration_date":"2007-09-19", - "deduplication_batch_status":"UNIQUE_IN_BATCH", - "deduplication_golden_record_status":"UNIQUE", - "deduplication_batch_results":{ - "score":{ - "max":0, - "min":9223372036854775807, - "qty":0 - }, - "duplicates":[ - - ], - "possible_duplicates":[ - - ] - }, - "deduplication_golden_record_results":{ - "duplicates":[ - - ], - "possible_duplicates":[ - - ] - }, - "flex_fields":{ - - }, - "pregnant":false, - "observed_disability":"COMMUNICATING", - "seeing_disability":"LOT_DIFFICULTY", - "hearing_disability":"", - "physical_disability":"SOME_DIFFICULTY", - "memory_disability":"SOME_DIFFICULTY", - "selfcare_disability":"", - "comms_disability":"", - "who_answers_phone":"", - "who_answers_alt_phone":"", - "detail_id":"5", - "disability_certificate_picture":"", - "preferred_language":null, - "mis_unicef_id":null, - "program_id":"939ff91b-7f89-4e3c-9519-26ed62f51718", - "age_at_registration":19, - "wallet_name":"", - "blockchain_name":"", - "wallet_address":"" - } -}, -{ - "model":"registration_datahub.importedindividual", - "pk":"a26ccd5a-3ea0-45d1-b160-ad7bafe579b8", - "fields":{ - "created_at":"2024-06-04T13:06:24.384Z", - "updated_at":"2024-06-04T13:06:24.384Z", - "individual_id":"", - "photo":"", - "full_name":"Charles Braun", - "given_name":"", - "middle_name":"", - "family_name":"Theresa Lozano", - "relationship":"HEAD", - "sex":"MALE", - "birth_date":"2021-05-01", - "estimated_birth_date":false, - "marital_status":"WIDOWED", - "phone_no":"+1-357-665-3567x540", - "phone_no_valid":null, - "phone_no_alternative":"", - "phone_no_alternative_valid":null, - "email":"", - "payment_delivery_phone_no":"", - "household":"cba378ef-f9ba-427a-b00f-4c3dc64bf7b4", - "registration_data_import":"fdacfb7c-8d8a-467d-acdb-eba1b4bfe291", - "disability":"not disabled", - "work_status":"0", - "first_registration_date":"2005-08-14", - "last_registration_date":"2005-08-14", - "deduplication_batch_status":"UNIQUE_IN_BATCH", - "deduplication_golden_record_status":"UNIQUE", - "deduplication_batch_results":{ - "score":{ - "max":0, - "min":9223372036854775807, - "qty":0 - }, - "duplicates":[ - - ], - "possible_duplicates":[ - - ] - }, - "deduplication_golden_record_results":{ - "duplicates":[ - - ], - "possible_duplicates":[ - - ] - }, - "flex_fields":{ - - }, - "pregnant":false, - "observed_disability":"NONE", - "seeing_disability":"CANNOT_DO", - "hearing_disability":"", - "physical_disability":"SOME_DIFFICULTY", - "memory_disability":"SOME_DIFFICULTY", - "selfcare_disability":"", - "comms_disability":"SOME_DIFFICULTY", - "who_answers_phone":"", - "who_answers_alt_phone":"", - "detail_id":"8", - "disability_certificate_picture":"", - "preferred_language":null, - "mis_unicef_id":null, - "program_id":"939ff91b-7f89-4e3c-9519-26ed62f51718", - "age_at_registration":3, - "wallet_name":"", - "blockchain_name":"", - "wallet_address":"" - } -}, -{ - "model":"registration_datahub.importedindividual", - "pk":"a5aac76e-c630-4eb9-ab01-b192f2833105", - "fields":{ - "created_at":"2024-06-04T13:06:24.383Z", - "updated_at":"2024-06-04T13:06:24.383Z", - "individual_id":"", - "photo":"", - "full_name":"Julie Hernandez", - "given_name":"", - "middle_name":"", - "family_name":"Eric Roberts", - "relationship":"HEAD", - "sex":"FEMALE", - "birth_date":"2019-06-13", - "estimated_birth_date":false, - "marital_status":"", - "phone_no":"+19285508880", - "phone_no_valid":null, - "phone_no_alternative":"", - "phone_no_alternative_valid":null, - "email":"", - "payment_delivery_phone_no":"", - "household":"0aa989ae-0bea-499c-a6e5-78d9fa98569a", - "registration_data_import":"fdacfb7c-8d8a-467d-acdb-eba1b4bfe291", - "disability":"not disabled", - "work_status":"0", - "first_registration_date":"2012-03-03", - "last_registration_date":"2012-03-03", - "deduplication_batch_status":"UNIQUE_IN_BATCH", - "deduplication_golden_record_status":"UNIQUE", - "deduplication_batch_results":{ - "score":{ - "max":0, - "min":9223372036854775807, - "qty":0 - }, - "duplicates":[ - - ], - "possible_duplicates":[ - - ] - }, - "deduplication_golden_record_results":{ - "duplicates":[ - - ], - "possible_duplicates":[ - - ] - }, - "flex_fields":{ - - }, - "pregnant":false, - "observed_disability":"MEMORY", - "seeing_disability":"LOT_DIFFICULTY", - "hearing_disability":"", - "physical_disability":"LOT_DIFFICULTY", - "memory_disability":"", - "selfcare_disability":"SOME_DIFFICULTY", - "comms_disability":"SOME_DIFFICULTY", - "who_answers_phone":"", - "who_answers_alt_phone":"", - "detail_id":"4", - "disability_certificate_picture":"", - "preferred_language":null, - "mis_unicef_id":null, - "program_id":"939ff91b-7f89-4e3c-9519-26ed62f51718", - "age_at_registration":4, - "wallet_name":"", - "blockchain_name":"", - "wallet_address":"" - } -}, -{ - "model":"registration_datahub.importedindividualroleinhousehold", - "pk":"970fed99-a819-4e5b-bb8b-f4070b102741", - "fields":{ - "created_at":"2024-06-04T13:06:24.482Z", - "updated_at":"2024-06-04T13:06:24.482Z", - "individual":"241d9b2e-d5be-4c70-b58c-d2ec0261c7d0", - "household":"056ca352-7ee3-4e0b-978e-d57925f712b1", - "role":"PRIMARY" - } -}, -{ - "model":"registration_datahub.importedindividualroleinhousehold", - "pk":"2e9ff193-aebc-4fee-a819-9893f38c7707", - "fields":{ - "created_at":"2024-06-04T13:06:24.482Z", - "updated_at":"2024-06-04T13:06:24.482Z", - "individual":"a5aac76e-c630-4eb9-ab01-b192f2833105", - "household":"0aa989ae-0bea-499c-a6e5-78d9fa98569a", - "role":"PRIMARY" - } -}, -{ - "model":"registration_datahub.importedindividualroleinhousehold", - "pk":"65dfb6b6-bbbc-4d74-93ab-104de8cb3501", - "fields":{ - "created_at":"2024-06-04T13:06:24.482Z", - "updated_at":"2024-06-04T13:06:24.482Z", - "individual":"1e854b23-eea5-4184-a779-a74cd40d0068", - "household":"10629102-0e9a-46b9-a17e-87548e623ea8", - "role":"PRIMARY" - } -}, -{ - "model":"registration_datahub.importedindividualroleinhousehold", - "pk":"3f8ff6e4-8863-4ae1-b06e-68e8c7c3580d", - "fields":{ - "created_at":"2024-06-04T13:06:24.482Z", - "updated_at":"2024-06-04T13:06:24.482Z", - "individual":"7fdeb99d-b1bf-45e8-8866-d0a4521299e8", - "household":"472f54df-76c6-4f26-8914-5a7e22683a75", - "role":"PRIMARY" - } -}, -{ - "model":"registration_datahub.importedindividualroleinhousehold", - "pk":"0a66f146-900a-4982-92af-030affaeddd9", - "fields":{ - "created_at":"2024-06-04T13:06:24.482Z", - "updated_at":"2024-06-04T13:06:24.482Z", - "individual":"36c74c19-9052-4293-9bae-c255bf72d3f3", - "household":"7c91c5db-3d9a-4532-a1a6-790d72a12a40", - "role":"PRIMARY" - } -}, -{ - "model":"registration_datahub.importedindividualroleinhousehold", - "pk":"c698f0b2-c5fe-4708-97dc-77d849df7897", - "fields":{ - "created_at":"2024-06-04T13:06:24.482Z", - "updated_at":"2024-06-04T13:06:24.482Z", - "individual":"351307ae-cfc8-479a-86f5-55450758512b", - "household":"a8792392-5ba0-41fe-bc0a-aeefd2f03a48", - "role":"PRIMARY" - } -}, -{ - "model":"registration_datahub.importedindividualroleinhousehold", - "pk":"4b78099e-4786-411c-bbf9-e7b75f6e3a55", - "fields":{ - "created_at":"2024-06-04T13:06:24.482Z", - "updated_at":"2024-06-04T13:06:24.482Z", - "individual":"a26ccd5a-3ea0-45d1-b160-ad7bafe579b8", - "household":"cba378ef-f9ba-427a-b00f-4c3dc64bf7b4", - "role":"PRIMARY" - } -}, -{ - "model":"registration_datahub.importedindividualroleinhousehold", - "pk":"8050655c-3c04-4320-9ac8-8c98c3c26a51", - "fields":{ - "created_at":"2024-06-04T13:06:24.482Z", - "updated_at":"2024-06-04T13:06:24.482Z", - "individual":"5bfffcaa-10f2-4d98-8957-d87e3a9e5e82", - "household":"d3cbfd6c-2ea2-4554-a816-b5dd5bad98bc", - "role":"PRIMARY" - } -}, -{ - "model":"registration_datahub.importedindividualroleinhousehold", - "pk":"26bc1e0b-2127-49e4-827e-923f1cd1840d", - "fields":{ - "created_at":"2024-06-04T13:06:24.482Z", - "updated_at":"2024-06-04T13:06:24.482Z", - "individual":"3cd2607d-a3c9-4526-be56-db218d2e81a9", - "household":"de7d12e6-0118-4fdd-9f84-b41d97fda2bb", - "role":"PRIMARY" - } -}, -{ - "model":"registration_datahub.importedindividualroleinhousehold", - "pk":"e7b8b2a0-2f0e-43ac-afa5-b94a3d97b06f", - "fields":{ - "created_at":"2024-06-04T13:06:24.482Z", - "updated_at":"2024-06-04T13:06:24.482Z", - "individual":"8a505757-9f83-48e2-8c0c-a29b17b5995f", - "household":"e2fa3120-b5fa-4fe6-8839-fac2d3ca898a", - "role":"PRIMARY" - } -}, -{ - "model":"registration_datahub.importdata", - "pk":"e04a2d90-8208-4b68-93aa-3da17a97f6ec", - "fields":{ - "created_at":"2024-06-04T13:05:58.062Z", - "updated_at":"2024-06-04T13:05:58.593Z", - "status":"FINISHED", - "business_area_slug":"afghanistan", - "file":"rdi_import_1_hh_10_people_seed_12.xlsx", - "data_type":"XLSX", - "number_of_households":0, - "number_of_individuals":10, - "error":"", - "validation_errors":"", - "created_by_id":"4196c2c5-c2dd-48d2-887f-3a9d39e78916" - } -}, -{ - "model":"registration_datahub.importeddocument", - "pk":"01eb1603-c615-42c5-9c06-2fdbb08d9440", - "fields":{ - "created_at":"2024-06-04T13:06:24.472Z", - "updated_at":"2024-06-04T13:06:24.472Z", - "document_number":"1905862545", - "photo":"", - "individual":"a5aac76e-c630-4eb9-ab01-b192f2833105", - "type":"d2c54476-0a45-4f0a-aca1-e78e78f1e2cc", - "country":"BA", - "doc_date":null, - "issuance_date":null, - "expiry_date":null - } -}, -{ - "model":"registration_datahub.importeddocument", - "pk":"0bcbd9aa-141f-478d-80c1-98929de6aa2c", - "fields":{ - "created_at":"2024-06-04T13:06:24.472Z", - "updated_at":"2024-06-04T13:06:24.472Z", - "document_number":"1639135744", - "photo":"", - "individual":"351307ae-cfc8-479a-86f5-55450758512b", - "type":"89481e2a-3ef1-40fb-8021-6b92bcb03db4", - "country":"AL", - "doc_date":null, - "issuance_date":null, - "expiry_date":null - } -}, -{ - "model":"registration_datahub.importeddocument", - "pk":"0d48ed2e-9f0a-4e46-98e1-7d470dd9f555", - "fields":{ - "created_at":"2024-06-04T13:06:24.473Z", - "updated_at":"2024-06-04T13:06:24.473Z", - "document_number":"1861792821", - "photo":"", - "individual":"5bfffcaa-10f2-4d98-8957-d87e3a9e5e82", - "type":"185d0037-a1bc-4eef-a679-749b5964c1f6", - "country":"SZ", - "doc_date":null, - "issuance_date":null, - "expiry_date":null - } -}, -{ - "model":"registration_datahub.importeddocument", - "pk":"1052440d-c58a-4e72-a49b-a14f45734cbd", - "fields":{ - "created_at":"2024-06-04T13:06:24.474Z", - "updated_at":"2024-06-04T13:06:24.474Z", - "document_number":"946523477", - "photo":"", - "individual":"7fdeb99d-b1bf-45e8-8866-d0a4521299e8", - "type":"185d0037-a1bc-4eef-a679-749b5964c1f6", - "country":"MY", - "doc_date":null, - "issuance_date":null, - "expiry_date":null - } -}, -{ - "model":"registration_datahub.importeddocument", - "pk":"118d229a-1d65-40be-a535-a3e4151f2b81", - "fields":{ - "created_at":"2024-06-04T13:06:24.473Z", - "updated_at":"2024-06-04T13:06:24.473Z", - "document_number":"864729173", - "photo":"", - "individual":"7fdeb99d-b1bf-45e8-8866-d0a4521299e8", - "type":"db4b73d0-3a53-48b5-9d2b-bdf0de29ccbf", - "country":"PL", - "doc_date":null, - "issuance_date":null, - "expiry_date":null - } -}, -{ - "model":"registration_datahub.importeddocument", - "pk":"15cdd496-0528-48c2-880e-ff3b65df909e", - "fields":{ - "created_at":"2024-06-04T13:06:24.472Z", - "updated_at":"2024-06-04T13:06:24.472Z", - "document_number":"958825596", - "photo":"", - "individual":"a5aac76e-c630-4eb9-ab01-b192f2833105", - "type":"185d0037-a1bc-4eef-a679-749b5964c1f6", - "country":"BJ", - "doc_date":null, - "issuance_date":null, - "expiry_date":null - } -}, -{ - "model":"registration_datahub.importeddocument", - "pk":"1aaec64d-9275-4a4d-bb8c-1660f18eb2a1", - "fields":{ - "created_at":"2024-06-04T13:06:24.472Z", - "updated_at":"2024-06-04T13:06:24.472Z", - "document_number":"1976622439", - "photo":"", - "individual":"351307ae-cfc8-479a-86f5-55450758512b", - "type":"d2c54476-0a45-4f0a-aca1-e78e78f1e2cc", - "country":"PL", - "doc_date":null, - "issuance_date":null, - "expiry_date":null - } -}, -{ - "model":"registration_datahub.importeddocument", - "pk":"246857ce-6044-44d1-828d-3104221359d5", - "fields":{ - "created_at":"2024-06-04T13:06:24.473Z", - "updated_at":"2024-06-04T13:06:24.473Z", - "document_number":"132693862", - "photo":"", - "individual":"241d9b2e-d5be-4c70-b58c-d2ec0261c7d0", - "type":"89481e2a-3ef1-40fb-8021-6b92bcb03db4", - "country":"SO", - "doc_date":null, - "issuance_date":null, - "expiry_date":null - } -}, -{ - "model":"registration_datahub.importeddocument", - "pk":"2c914edc-d837-4403-97aa-d6ffd1995258", - "fields":{ - "created_at":"2024-06-04T13:06:24.473Z", - "updated_at":"2024-06-04T13:06:24.473Z", - "document_number":"1224154289", - "photo":"", - "individual":"a26ccd5a-3ea0-45d1-b160-ad7bafe579b8", - "type":"db4b73d0-3a53-48b5-9d2b-bdf0de29ccbf", - "country":"MV", - "doc_date":null, - "issuance_date":null, - "expiry_date":null - } -}, -{ - "model":"registration_datahub.importeddocument", - "pk":"2dd91439-327c-4124-af91-85525b37c058", - "fields":{ - "created_at":"2024-06-04T13:06:24.473Z", - "updated_at":"2024-06-04T13:06:24.473Z", - "document_number":"1384939777", - "photo":"", - "individual":"36c74c19-9052-4293-9bae-c255bf72d3f3", - "type":"218fa71b-0d15-4f4b-85fe-86a9b9f59f0d", - "country":"TT", - "doc_date":null, - "issuance_date":null, - "expiry_date":null - } -}, -{ - "model":"registration_datahub.importeddocument", - "pk":"2df12560-758a-49c4-9397-0af2e4245747", - "fields":{ - "created_at":"2024-06-04T13:06:24.473Z", - "updated_at":"2024-06-04T13:06:24.473Z", - "document_number":"1972515425", - "photo":"", - "individual":"5bfffcaa-10f2-4d98-8957-d87e3a9e5e82", - "type":"218fa71b-0d15-4f4b-85fe-86a9b9f59f0d", - "country":"GW", - "doc_date":null, - "issuance_date":null, - "expiry_date":null - } -}, -{ - "model":"registration_datahub.importeddocument", - "pk":"2e0016be-10b6-46a0-810d-19894d91e178", - "fields":{ - "created_at":"2024-06-04T13:06:24.473Z", - "updated_at":"2024-06-04T13:06:24.473Z", - "document_number":"1439813266", - "photo":"", - "individual":"8a505757-9f83-48e2-8c0c-a29b17b5995f", - "type":"218fa71b-0d15-4f4b-85fe-86a9b9f59f0d", - "country":"GN", - "doc_date":null, - "issuance_date":null, - "expiry_date":null - } -}, -{ - "model":"registration_datahub.importeddocument", - "pk":"30b6bec9-743c-4078-881c-cd78bddc6f0b", - "fields":{ - "created_at":"2024-06-04T13:06:24.474Z", - "updated_at":"2024-06-04T13:06:24.474Z", - "document_number":"1549796360", - "photo":"", - "individual":"1e854b23-eea5-4184-a779-a74cd40d0068", - "type":"db4b73d0-3a53-48b5-9d2b-bdf0de29ccbf", - "country":"NF", - "doc_date":null, - "issuance_date":null, - "expiry_date":null - } -}, -{ - "model":"registration_datahub.importeddocument", - "pk":"3aa362b5-bd71-473d-a774-1768f0033e6c", - "fields":{ - "created_at":"2024-06-04T13:06:24.472Z", - "updated_at":"2024-06-04T13:06:24.472Z", - "document_number":"977725105", - "photo":"", - "individual":"351307ae-cfc8-479a-86f5-55450758512b", - "type":"218fa71b-0d15-4f4b-85fe-86a9b9f59f0d", - "country":"FM", - "doc_date":null, - "issuance_date":null, - "expiry_date":null - } -}, -{ - "model":"registration_datahub.importeddocument", - "pk":"40a4ead7-2e2e-43c7-9ee1-1fd40a0a8c44", - "fields":{ - "created_at":"2024-06-04T13:06:24.473Z", - "updated_at":"2024-06-04T13:06:24.473Z", - "document_number":"1784441634", - "photo":"", - "individual":"241d9b2e-d5be-4c70-b58c-d2ec0261c7d0", - "type":"d2c54476-0a45-4f0a-aca1-e78e78f1e2cc", - "country":"MH", - "doc_date":null, - "issuance_date":null, - "expiry_date":null - } -}, -{ - "model":"registration_datahub.importeddocument", - "pk":"4a246ccc-042c-40ad-880d-1c299cf11d89", - "fields":{ - "created_at":"2024-06-04T13:06:24.473Z", - "updated_at":"2024-06-04T13:06:24.473Z", - "document_number":"1175906110", - "photo":"", - "individual":"5bfffcaa-10f2-4d98-8957-d87e3a9e5e82", - "type":"89481e2a-3ef1-40fb-8021-6b92bcb03db4", - "country":"AG", - "doc_date":null, - "issuance_date":null, - "expiry_date":null - } -}, -{ - "model":"registration_datahub.importeddocument", - "pk":"4df2fd14-9d1c-4b26-8af7-038a6c7530b0", - "fields":{ - "created_at":"2024-06-04T13:06:24.473Z", - "updated_at":"2024-06-04T13:06:24.473Z", - "document_number":"664889493", - "photo":"", - "individual":"36c74c19-9052-4293-9bae-c255bf72d3f3", - "type":"d2c54476-0a45-4f0a-aca1-e78e78f1e2cc", - "country":"AO", - "doc_date":null, - "issuance_date":null, - "expiry_date":null - } -}, -{ - "model":"registration_datahub.importeddocument", - "pk":"4e03470e-b928-4467-9392-212f9ed929fb", - "fields":{ - "created_at":"2024-06-04T13:06:24.472Z", - "updated_at":"2024-06-04T13:06:24.472Z", - "document_number":"79904860", - "photo":"", - "individual":"a5aac76e-c630-4eb9-ab01-b192f2833105", - "type":"db4b73d0-3a53-48b5-9d2b-bdf0de29ccbf", - "country":"UM", - "doc_date":null, - "issuance_date":null, - "expiry_date":null - } -}, -{ - "model":"registration_datahub.importeddocument", - "pk":"50af24e4-824f-458b-8f52-bbcf4c6e377a", - "fields":{ - "created_at":"2024-06-04T13:06:24.472Z", - "updated_at":"2024-06-04T13:06:24.472Z", - "document_number":"1656114431", - "photo":"", - "individual":"8a505757-9f83-48e2-8c0c-a29b17b5995f", - "type":"185d0037-a1bc-4eef-a679-749b5964c1f6", - "country":"PY", - "doc_date":null, - "issuance_date":null, - "expiry_date":null - } -}, -{ - "model":"registration_datahub.importeddocument", - "pk":"5dd9735f-c38a-4385-b377-2bcb27b35368", - "fields":{ - "created_at":"2024-06-04T13:06:24.473Z", - "updated_at":"2024-06-04T13:06:24.473Z", - "document_number":"162911365", - "photo":"", - "individual":"241d9b2e-d5be-4c70-b58c-d2ec0261c7d0", - "type":"185d0037-a1bc-4eef-a679-749b5964c1f6", - "country":"TC", - "doc_date":null, - "issuance_date":null, - "expiry_date":null - } -}, -{ - "model":"registration_datahub.importeddocument", - "pk":"635c26cd-ccc0-438e-85eb-1d97df7ade9e", - "fields":{ - "created_at":"2024-06-04T13:06:24.473Z", - "updated_at":"2024-06-04T13:06:24.473Z", - "document_number":"1094965842", - "photo":"", - "individual":"a26ccd5a-3ea0-45d1-b160-ad7bafe579b8", - "type":"89481e2a-3ef1-40fb-8021-6b92bcb03db4", - "country":"AI", - "doc_date":null, - "issuance_date":null, - "expiry_date":null - } -}, -{ - "model":"registration_datahub.importeddocument", - "pk":"682a2cb4-2727-4701-a3b6-7d05c4716eb2", - "fields":{ - "created_at":"2024-06-04T13:06:24.472Z", - "updated_at":"2024-06-04T13:06:24.472Z", - "document_number":"1083953926", - "photo":"", - "individual":"8a505757-9f83-48e2-8c0c-a29b17b5995f", - "type":"d2c54476-0a45-4f0a-aca1-e78e78f1e2cc", - "country":"DK", - "doc_date":null, - "issuance_date":null, - "expiry_date":null - } -}, -{ - "model":"registration_datahub.importeddocument", - "pk":"85c38323-e5c8-4382-866a-a6c4c5e49e05", - "fields":{ - "created_at":"2024-06-04T13:06:24.473Z", - "updated_at":"2024-06-04T13:06:24.473Z", - "document_number":"1427939569", - "photo":"", - "individual":"3cd2607d-a3c9-4526-be56-db218d2e81a9", - "type":"db4b73d0-3a53-48b5-9d2b-bdf0de29ccbf", - "country":"BI", - "doc_date":null, - "issuance_date":null, - "expiry_date":null - } -}, -{ - "model":"registration_datahub.importeddocument", - "pk":"8dbfd7e1-ec8b-404d-b20d-68a96f10c95e", - "fields":{ - "created_at":"2024-06-04T13:06:24.473Z", - "updated_at":"2024-06-04T13:06:24.473Z", - "document_number":"37064952", - "photo":"", - "individual":"36c74c19-9052-4293-9bae-c255bf72d3f3", - "type":"89481e2a-3ef1-40fb-8021-6b92bcb03db4", - "country":"LU", - "doc_date":null, - "issuance_date":null, - "expiry_date":null - } -}, -{ - "model":"registration_datahub.importeddocument", - "pk":"90115cba-bee4-445e-b476-48be8e10b35c", - "fields":{ - "created_at":"2024-06-04T13:06:24.473Z", - "updated_at":"2024-06-04T13:06:24.473Z", - "document_number":"594330686", - "photo":"", - "individual":"a26ccd5a-3ea0-45d1-b160-ad7bafe579b8", - "type":"218fa71b-0d15-4f4b-85fe-86a9b9f59f0d", - "country":"DJ", - "doc_date":null, - "issuance_date":null, - "expiry_date":null - } -}, -{ - "model":"registration_datahub.importeddocument", - "pk":"90784d65-e6b8-40fc-897b-051dc0faae29", - "fields":{ - "created_at":"2024-06-04T13:06:24.473Z", - "updated_at":"2024-06-04T13:06:24.473Z", - "document_number":"15857295", - "photo":"", - "individual":"a26ccd5a-3ea0-45d1-b160-ad7bafe579b8", - "type":"185d0037-a1bc-4eef-a679-749b5964c1f6", - "country":"PT", - "doc_date":null, - "issuance_date":null, - "expiry_date":null - } -}, -{ - "model":"registration_datahub.importeddocument", - "pk":"92c2a0b7-d65a-428d-bafa-2bde905d4789", - "fields":{ - "created_at":"2024-06-04T13:06:24.473Z", - "updated_at":"2024-06-04T13:06:24.473Z", - "document_number":"755043089", - "photo":"", - "individual":"3cd2607d-a3c9-4526-be56-db218d2e81a9", - "type":"218fa71b-0d15-4f4b-85fe-86a9b9f59f0d", - "country":"AI", - "doc_date":null, - "issuance_date":null, - "expiry_date":null - } -}, -{ - "model":"registration_datahub.importeddocument", - "pk":"9ddd1388-d5d7-4ae3-9f79-1ef727463979", - "fields":{ - "created_at":"2024-06-04T13:06:24.473Z", - "updated_at":"2024-06-04T13:06:24.473Z", - "document_number":"1342079771", - "photo":"", - "individual":"3cd2607d-a3c9-4526-be56-db218d2e81a9", - "type":"185d0037-a1bc-4eef-a679-749b5964c1f6", - "country":"TF", - "doc_date":null, - "issuance_date":null, - "expiry_date":null - } -}, -{ - "model":"registration_datahub.importeddocument", - "pk":"9e2c3f11-5d30-4169-89e3-1a8bb2da52c6", - "fields":{ - "created_at":"2024-06-04T13:06:24.474Z", - "updated_at":"2024-06-04T13:06:24.474Z", - "document_number":"1319401614", - "photo":"", - "individual":"1e854b23-eea5-4184-a779-a74cd40d0068", - "type":"89481e2a-3ef1-40fb-8021-6b92bcb03db4", - "country":"TD", - "doc_date":null, - "issuance_date":null, - "expiry_date":null - } -}, -{ - "model":"registration_datahub.importeddocument", - "pk":"a6318a68-2a3d-4e7f-8ed5-d3fc8dd14ee0", - "fields":{ - "created_at":"2024-06-04T13:06:24.473Z", - "updated_at":"2024-06-04T13:06:24.473Z", - "document_number":"1037607088", - "photo":"", - "individual":"36c74c19-9052-4293-9bae-c255bf72d3f3", - "type":"db4b73d0-3a53-48b5-9d2b-bdf0de29ccbf", - "country":"SB", - "doc_date":null, - "issuance_date":null, - "expiry_date":null - } -}, -{ - "model":"registration_datahub.importeddocument", - "pk":"aa440643-bc2e-43cf-9eb0-d70ee4f4417c", - "fields":{ - "created_at":"2024-06-04T13:06:24.473Z", - "updated_at":"2024-06-04T13:06:24.473Z", - "document_number":"1872704691", - "photo":"", - "individual":"3cd2607d-a3c9-4526-be56-db218d2e81a9", - "type":"d2c54476-0a45-4f0a-aca1-e78e78f1e2cc", - "country":"GN", - "doc_date":null, - "issuance_date":null, - "expiry_date":null - } -}, -{ - "model":"registration_datahub.importeddocument", - "pk":"afc29475-7457-455a-9ce6-94fab0317599", - "fields":{ - "created_at":"2024-06-04T13:06:24.474Z", - "updated_at":"2024-06-04T13:06:24.474Z", - "document_number":"1857377932", - "photo":"", - "individual":"7fdeb99d-b1bf-45e8-8866-d0a4521299e8", - "type":"89481e2a-3ef1-40fb-8021-6b92bcb03db4", - "country":"FI", - "doc_date":null, - "issuance_date":null, - "expiry_date":null - } -}, -{ - "model":"registration_datahub.importeddocument", - "pk":"bb3e22b8-1431-40f6-a3b0-f38956b80de8", - "fields":{ - "created_at":"2024-06-04T13:06:24.473Z", - "updated_at":"2024-06-04T13:06:24.473Z", - "document_number":"171897247", - "photo":"", - "individual":"36c74c19-9052-4293-9bae-c255bf72d3f3", - "type":"185d0037-a1bc-4eef-a679-749b5964c1f6", - "country":"DO", - "doc_date":null, - "issuance_date":null, - "expiry_date":null - } -}, -{ - "model":"registration_datahub.importeddocument", - "pk":"bb5a3f44-5524-4910-aece-76164f6e2f4a", - "fields":{ - "created_at":"2024-06-04T13:06:24.473Z", - "updated_at":"2024-06-04T13:06:24.473Z", - "document_number":"859719368", - "photo":"", - "individual":"241d9b2e-d5be-4c70-b58c-d2ec0261c7d0", - "type":"218fa71b-0d15-4f4b-85fe-86a9b9f59f0d", - "country":"SI", - "doc_date":null, - "issuance_date":null, - "expiry_date":null - } -}, -{ - "model":"registration_datahub.importeddocument", - "pk":"bbc2afac-787f-45c2-8801-9da762952329", - "fields":{ - "created_at":"2024-06-04T13:06:24.474Z", - "updated_at":"2024-06-04T13:06:24.474Z", - "document_number":"2124320687", - "photo":"", - "individual":"1e854b23-eea5-4184-a779-a74cd40d0068", - "type":"218fa71b-0d15-4f4b-85fe-86a9b9f59f0d", - "country":"AM", - "doc_date":null, - "issuance_date":null, - "expiry_date":null - } -}, -{ - "model":"registration_datahub.importeddocument", - "pk":"c4580a35-e5d6-4ed8-a9aa-dd8a217d75c3", - "fields":{ - "created_at":"2024-06-04T13:06:24.473Z", - "updated_at":"2024-06-04T13:06:24.473Z", - "document_number":"1141736323", - "photo":"", - "individual":"a26ccd5a-3ea0-45d1-b160-ad7bafe579b8", - "type":"d2c54476-0a45-4f0a-aca1-e78e78f1e2cc", - "country":"IE", - "doc_date":null, - "issuance_date":null, - "expiry_date":null - } -}, -{ - "model":"registration_datahub.importeddocument", - "pk":"cc82632a-8cfd-4847-b0b2-462b3c31e770", - "fields":{ - "created_at":"2024-06-04T13:06:24.474Z", - "updated_at":"2024-06-04T13:06:24.474Z", - "document_number":"1995571277", - "photo":"", - "individual":"7fdeb99d-b1bf-45e8-8866-d0a4521299e8", - "type":"218fa71b-0d15-4f4b-85fe-86a9b9f59f0d", - "country":"HN", - "doc_date":null, - "issuance_date":null, - "expiry_date":null - } -}, -{ - "model":"registration_datahub.importeddocument", - "pk":"cd7d7f73-18bc-4417-9767-fe7535309006", - "fields":{ - "created_at":"2024-06-04T13:06:24.472Z", - "updated_at":"2024-06-04T13:06:24.472Z", - "document_number":"261068272", - "photo":"", - "individual":"a5aac76e-c630-4eb9-ab01-b192f2833105", - "type":"89481e2a-3ef1-40fb-8021-6b92bcb03db4", - "country":"ES", - "doc_date":null, - "issuance_date":null, - "expiry_date":null - } -}, -{ - "model":"registration_datahub.importeddocument", - "pk":"cfa31db3-a388-47d6-924a-a55b41b73558", - "fields":{ - "created_at":"2024-06-04T13:06:24.473Z", - "updated_at":"2024-06-04T13:06:24.473Z", - "document_number":"334925810", - "photo":"", - "individual":"5bfffcaa-10f2-4d98-8957-d87e3a9e5e82", - "type":"db4b73d0-3a53-48b5-9d2b-bdf0de29ccbf", - "country":"PR", - "doc_date":null, - "issuance_date":null, - "expiry_date":null - } -}, -{ - "model":"registration_datahub.importeddocument", - "pk":"d8db041c-8064-47e6-8f4a-f8d997bd30c5", - "fields":{ - "created_at":"2024-06-04T13:06:24.473Z", - "updated_at":"2024-06-04T13:06:24.473Z", - "document_number":"667541607", - "photo":"", - "individual":"241d9b2e-d5be-4c70-b58c-d2ec0261c7d0", - "type":"db4b73d0-3a53-48b5-9d2b-bdf0de29ccbf", - "country":"UG", - "doc_date":null, - "issuance_date":null, - "expiry_date":null - } -}, -{ - "model":"registration_datahub.importeddocument", - "pk":"dabcf7fe-b671-4cd9-b58a-de1a14d4f1c4", - "fields":{ - "created_at":"2024-06-04T13:06:24.472Z", - "updated_at":"2024-06-04T13:06:24.472Z", - "document_number":"1609558290", - "photo":"", - "individual":"351307ae-cfc8-479a-86f5-55450758512b", - "type":"185d0037-a1bc-4eef-a679-749b5964c1f6", - "country":"LS", - "doc_date":null, - "issuance_date":null, - "expiry_date":null - } -}, -{ - "model":"registration_datahub.importeddocument", - "pk":"e00978c4-0f38-4e3a-8ea1-cf684e85e17e", - "fields":{ - "created_at":"2024-06-04T13:06:24.472Z", - "updated_at":"2024-06-04T13:06:24.472Z", - "document_number":"1559625253", - "photo":"", - "individual":"8a505757-9f83-48e2-8c0c-a29b17b5995f", - "type":"89481e2a-3ef1-40fb-8021-6b92bcb03db4", - "country":"TL", - "doc_date":null, - "issuance_date":null, - "expiry_date":null - } -}, -{ - "model":"registration_datahub.importeddocument", - "pk":"e3622a23-126e-4d7e-8fc5-4c2d15f1966a", - "fields":{ - "created_at":"2024-06-04T13:06:24.474Z", - "updated_at":"2024-06-04T13:06:24.474Z", - "document_number":"577648131", - "photo":"", - "individual":"1e854b23-eea5-4184-a779-a74cd40d0068", - "type":"d2c54476-0a45-4f0a-aca1-e78e78f1e2cc", - "country":"EC", - "doc_date":null, - "issuance_date":null, - "expiry_date":null - } -}, -{ - "model":"registration_datahub.importeddocument", - "pk":"e4b89333-a6b0-47bb-9e74-ea64339eb763", - "fields":{ - "created_at":"2024-06-04T13:06:24.474Z", - "updated_at":"2024-06-04T13:06:24.474Z", - "document_number":"583737432", - "photo":"", - "individual":"1e854b23-eea5-4184-a779-a74cd40d0068", - "type":"185d0037-a1bc-4eef-a679-749b5964c1f6", - "country":"LB", - "doc_date":null, - "issuance_date":null, - "expiry_date":null - } -}, -{ - "model":"registration_datahub.importeddocument", - "pk":"e6da8c11-ddcd-4c00-b7ce-0e90364a491d", - "fields":{ - "created_at":"2024-06-04T13:06:24.472Z", - "updated_at":"2024-06-04T13:06:24.472Z", - "document_number":"1817658557", - "photo":"", - "individual":"a5aac76e-c630-4eb9-ab01-b192f2833105", - "type":"218fa71b-0d15-4f4b-85fe-86a9b9f59f0d", - "country":"ZM", - "doc_date":null, - "issuance_date":null, - "expiry_date":null - } -}, -{ - "model":"registration_datahub.importeddocument", - "pk":"ecbad909-b0e9-41cd-ba72-63b8cb6f02f4", - "fields":{ - "created_at":"2024-06-04T13:06:24.473Z", - "updated_at":"2024-06-04T13:06:24.473Z", - "document_number":"223590930", - "photo":"", - "individual":"5bfffcaa-10f2-4d98-8957-d87e3a9e5e82", - "type":"d2c54476-0a45-4f0a-aca1-e78e78f1e2cc", - "country":"MW", - "doc_date":null, - "issuance_date":null, - "expiry_date":null - } -}, -{ - "model":"registration_datahub.importeddocument", - "pk":"f0fb1558-f83a-4ee0-9f6d-686f22931e6b", - "fields":{ - "created_at":"2024-06-04T13:06:24.473Z", - "updated_at":"2024-06-04T13:06:24.473Z", - "document_number":"388855545", - "photo":"", - "individual":"3cd2607d-a3c9-4526-be56-db218d2e81a9", - "type":"89481e2a-3ef1-40fb-8021-6b92bcb03db4", - "country":"BL", - "doc_date":null, - "issuance_date":null, - "expiry_date":null - } -}, -{ - "model":"registration_datahub.importeddocument", - "pk":"f1428208-ccb0-4ed7-a8cf-05158f0dc793", - "fields":{ - "created_at":"2024-06-04T13:06:24.472Z", - "updated_at":"2024-06-04T13:06:24.472Z", - "document_number":"1123407711", - "photo":"", - "individual":"8a505757-9f83-48e2-8c0c-a29b17b5995f", - "type":"db4b73d0-3a53-48b5-9d2b-bdf0de29ccbf", - "country":"GT", - "doc_date":null, - "issuance_date":null, - "expiry_date":null - } -}, -{ - "model":"registration_datahub.importeddocument", - "pk":"f1782a20-030d-4937-989f-011939712e18", - "fields":{ - "created_at":"2024-06-04T13:06:24.472Z", - "updated_at":"2024-06-04T13:06:24.472Z", - "document_number":"1502316764", - "photo":"", - "individual":"351307ae-cfc8-479a-86f5-55450758512b", - "type":"db4b73d0-3a53-48b5-9d2b-bdf0de29ccbf", - "country":"BI", - "doc_date":null, - "issuance_date":null, - "expiry_date":null - } -}, -{ - "model":"registration_datahub.importeddocument", - "pk":"f6338903-89eb-42f0-b399-be15a9db22a0", - "fields":{ - "created_at":"2024-06-04T13:06:24.474Z", - "updated_at":"2024-06-04T13:06:24.474Z", - "document_number":"1428140171", - "photo":"", - "individual":"7fdeb99d-b1bf-45e8-8866-d0a4521299e8", - "type":"d2c54476-0a45-4f0a-aca1-e78e78f1e2cc", - "country":"KY", - "doc_date":null, - "issuance_date":null, - "expiry_date":null - } -}, -{ - "model":"registration_datahub.importedindividualidentity", - "pk":2, - "fields":{ - "individual":"351307ae-cfc8-479a-86f5-55450758512b", - "document_number":"1177027804", - "country":"MK", - "partner":"UNHCR" - } -}, -{ - "model":"registration_datahub.importedindividualidentity", - "pk":3, - "fields":{ - "individual":"351307ae-cfc8-479a-86f5-55450758512b", - "document_number":"7154888", - "country":"PS", - "partner":"WFP" - } -}, -{ - "model":"registration_datahub.importedindividualidentity", - "pk":4, - "fields":{ - "individual":"a5aac76e-c630-4eb9-ab01-b192f2833105", - "document_number":"1820247318", - "country":"VN", - "partner":"UNHCR" - } -}, -{ - "model":"registration_datahub.importedindividualidentity", - "pk":5, - "fields":{ - "individual":"a5aac76e-c630-4eb9-ab01-b192f2833105", - "document_number":"580119081", - "country":"MR", - "partner":"WFP" - } -}, -{ - "model":"registration_datahub.importedindividualidentity", - "pk":6, - "fields":{ - "individual":"8a505757-9f83-48e2-8c0c-a29b17b5995f", - "document_number":"1331021630", - "country":"BW", - "partner":"UNHCR" - } -}, -{ - "model":"registration_datahub.importedindividualidentity", - "pk":7, - "fields":{ - "individual":"8a505757-9f83-48e2-8c0c-a29b17b5995f", - "document_number":"1594575488", - "country":"MG", - "partner":"WFP" - } -}, -{ - "model":"registration_datahub.importedindividualidentity", - "pk":8, - "fields":{ - "individual":"5bfffcaa-10f2-4d98-8957-d87e3a9e5e82", - "document_number":"2140181085", - "country":"GD", - "partner":"UNHCR" - } -}, -{ - "model":"registration_datahub.importedindividualidentity", - "pk":9, - "fields":{ - "individual":"5bfffcaa-10f2-4d98-8957-d87e3a9e5e82", - "document_number":"896760976", - "country":"GR", - "partner":"WFP" - } -}, -{ - "model":"registration_datahub.importedindividualidentity", - "pk":10, - "fields":{ - "individual":"36c74c19-9052-4293-9bae-c255bf72d3f3", - "document_number":"498467453", - "country":"GG", - "partner":"UNHCR" - } -}, -{ - "model":"registration_datahub.importedindividualidentity", - "pk":11, - "fields":{ - "individual":"36c74c19-9052-4293-9bae-c255bf72d3f3", - "document_number":"1200187540", - "country":"KP", - "partner":"WFP" - } -}, -{ - "model":"registration_datahub.importedindividualidentity", - "pk":12, - "fields":{ - "individual":"a26ccd5a-3ea0-45d1-b160-ad7bafe579b8", - "document_number":"117078847", - "country":"BN", - "partner":"UNHCR" - } -}, -{ - "model":"registration_datahub.importedindividualidentity", - "pk":13, - "fields":{ - "individual":"a26ccd5a-3ea0-45d1-b160-ad7bafe579b8", - "document_number":"860146609", - "country":"JM", - "partner":"WFP" - } -}, -{ - "model":"registration_datahub.importedindividualidentity", - "pk":14, - "fields":{ - "individual":"241d9b2e-d5be-4c70-b58c-d2ec0261c7d0", - "document_number":"313495412", - "country":"AE", - "partner":"UNHCR" - } -}, -{ - "model":"registration_datahub.importedindividualidentity", - "pk":15, - "fields":{ - "individual":"241d9b2e-d5be-4c70-b58c-d2ec0261c7d0", - "document_number":"1629816969", - "country":"SI", - "partner":"WFP" - } -}, -{ - "model":"registration_datahub.importedindividualidentity", - "pk":16, - "fields":{ - "individual":"3cd2607d-a3c9-4526-be56-db218d2e81a9", - "document_number":"771861294", - "country":"SA", - "partner":"UNHCR" - } -}, -{ - "model":"registration_datahub.importedindividualidentity", - "pk":17, - "fields":{ - "individual":"3cd2607d-a3c9-4526-be56-db218d2e81a9", - "document_number":"898322765", - "country":"LR", - "partner":"WFP" - } -}, -{ - "model":"registration_datahub.importedindividualidentity", - "pk":18, - "fields":{ - "individual":"7fdeb99d-b1bf-45e8-8866-d0a4521299e8", - "document_number":"630046978", - "country":"LU", - "partner":"UNHCR" - } -}, -{ - "model":"registration_datahub.importedindividualidentity", - "pk":19, - "fields":{ - "individual":"7fdeb99d-b1bf-45e8-8866-d0a4521299e8", - "document_number":"1073210510", - "country":"KI", - "partner":"WFP" - } -}, -{ - "model":"registration_datahub.importedindividualidentity", - "pk":20, - "fields":{ - "individual":"1e854b23-eea5-4184-a779-a74cd40d0068", - "document_number":"969263558", - "country":"ZA", - "partner":"UNHCR" - } -}, -{ - "model":"registration_datahub.importedindividualidentity", - "pk":21, - "fields":{ - "individual":"1e854b23-eea5-4184-a779-a74cd40d0068", - "document_number":"1842926067", - "country":"ZA", - "partner":"WFP" - } -} -] diff --git a/backend/hct_mis_api/apps/registration_datahub/management/commands/remove_imported_individuals_from_es.py b/backend/hct_mis_api/apps/registration_datahub/management/commands/remove_imported_individuals_from_es.py deleted file mode 100644 index 7c944e915b..0000000000 --- a/backend/hct_mis_api/apps/registration_datahub/management/commands/remove_imported_individuals_from_es.py +++ /dev/null @@ -1,33 +0,0 @@ -from typing import Any - -from django.core.management import BaseCommand - -from hct_mis_api.apps.registration_data.models import RegistrationDataImport -from hct_mis_api.apps.registration_datahub.documents import ( - ImportedIndividualDocumentAfghanistan, - ImportedIndividualDocumentOthers, - ImportedIndividualDocumentUkraine, -) -from hct_mis_api.apps.utils.elasticsearch_utils import ( - remove_elasticsearch_documents_by_matching_ids, -) - - -class Command(BaseCommand): - help = "Remove ImportedIndividuals from elasticsearch documents" - - def handle(self, *args: Any, **options: Any) -> None: - es_documents = [ - ImportedIndividualDocumentAfghanistan, - ImportedIndividualDocumentUkraine, - ImportedIndividualDocumentOthers, - ] - - for es_document in es_documents: - print(f"Removing {es_document} index {es_document.Index.name}") - - qs = es_document().get_queryset().filter(registration_data_import__status=RegistrationDataImport.MERGED) - print(f"Count {qs.count()}") - remove_elasticsearch_documents_by_matching_ids(list(qs.values_list("id", flat=True)), es_document) - - print("Done") diff --git a/backend/hct_mis_api/apps/registration_datahub/migrations/0001_migration_squashed_0088_migration.py b/backend/hct_mis_api/apps/registration_datahub/migrations/0001_migration_squashed_0088_migration.py index c69c42906f..4f88057836 100644 --- a/backend/hct_mis_api/apps/registration_datahub/migrations/0001_migration_squashed_0088_migration.py +++ b/backend/hct_mis_api/apps/registration_datahub/migrations/0001_migration_squashed_0088_migration.py @@ -23,159 +23,6 @@ from hct_mis_api.apps.utils.phone import calculate_phone_numbers_validity -def remove_duplicates(apps, schema_editor): - ImportedDocument = apps.get_model("registration_datahub", "ImportedDocument") - - master_qs_docs = ImportedDocument.objects.annotate( - concat_id_doc_num=Concat( - F("type__id"), - F("document_number"), - output_field=models.CharField(), - ), - ).distinct("concat_id_doc_num") - - for master in master_qs_docs: - ImportedDocument.objects.filter( - type=master.type, document_number=master.document_number - ).exclude(pk=master.pk).delete() - - -def remove_duplicates_2nd(apps, schema_editor): - ImportedDocumentType = apps.get_model( - "registration_datahub", "ImportedDocumentType" - ) - - master_qs_types = ImportedDocumentType.objects.annotate( - concat_country_type=F("type") - ).distinct("concat_country_type") - - for master in master_qs_types: - ImportedDocumentType.objects.filter(type=master.type).exclude( - pk=master.pk - ).delete() - - -def set_document_types(apps, schema_editor): - choices = { - "Driving License": "DRIVERS_LICENSE", - "Birth Certificate": "BIRTH_CERTIFICATE", - "National ID": "NATIONAL_ID", - "National Passport": "NATIONAL_PASSPORT", - } - ImportedDocumentType = apps.get_model( - "registration_datahub", "ImportedDocumentType" - ) - imported_doc_types = ImportedDocumentType.objects.all() - for obj in imported_doc_types: - obj.type = choices.get(obj.label) - obj.save() - - -def cast_flex_field_values(apps, schema_editor): - pass - - -def empty_reverse(apps, schema_editor): - pass - - -def round_muac(apps, schema_editor): - ImportedIndividual = apps.get_model("registration_datahub", "ImportedIndividual") - individuals_with_muac = ImportedIndividual.objects.filter( - flex_fields__muac_i_f__isnull=False - ) - - for individual in individuals_with_muac: - individual.flex_fields["muac_i_f"] = "{:.2f}".format( - float(individual.flex_fields["muac_i_f"]) - ) - - ImportedIndividual.objects.bulk_update( - individuals_with_muac, ("flex_fields",), 1000 - ) - - -def fix_fields_individuals(apps, schema_editor): - ImportedIndividual = apps.get_model("registration_datahub", "ImportedIndividual") - individuals = ImportedIndividual.objects.all() - - all_flex_fields = serialize_flex_attributes().get("individuals", {}) - if all_flex_fields and individuals: - decimal_flex_fields = [ - key - for key, value in all_flex_fields.items() - if value["type"] == TYPE_DECIMAL - ] - - individuals = fix_flex_type_fields(individuals, decimal_flex_fields) - ImportedIndividual.objects.bulk_update(individuals, ("flex_fields",), 1000) - - -def fix_fields_households(apps, schema_editor): - ImportedHousehold = apps.get_model("registration_datahub", "ImportedHousehold") - households = ImportedHousehold.objects.all() - - all_flex_fields = serialize_flex_attributes().get("households", {}) - if all_flex_fields and households: - decimal_flex_fields = [ - key - for key, value in all_flex_fields.items() - if value["type"] == TYPE_DECIMAL - ] - - households = fix_flex_type_fields(households, decimal_flex_fields) - ImportedHousehold.objects.bulk_update(households, ("flex_fields",), 1000) - - -def migrate_doc_type(apps, schema_editor): - ImportedDocument = apps.get_model("registration_datahub", "ImportedDocument") - ImportedDocumentType = apps.get_model( - "registration_datahub", "ImportedDocumentType" - ) - - countries = ( - ImportedDocumentType.objects.order_by("country") - .values_list("country", flat=True) - .distinct() - ) - - for country in countries: - ImportedDocument.objects.filter(type__country=country).update(country=country) - - tostay = countries.first() - if tostay: - for code, _ in IDENTIFICATION_TYPE_CHOICE: - new_type, _ = ImportedDocumentType.objects.get_or_create( - type=code, country=tostay - ) - ImportedDocument.objects.filter(type__type=code).update(type=new_type) - ImportedDocumentType.objects.exclude(country=tostay).delete() - - -@transaction.atomic -def update_each_phone_numbers_validity(apps, schema_editor): - ImportedIndividual = apps.get_model("registration_datahub", "ImportedIndividual") - for individual in ImportedIndividual.objects.only( - "phone_no", - "phone_no_alternative", - "phone_no_valid", - "phone_no_alternative_valid", - ).iterator(): - individual = calculate_phone_numbers_validity(individual) - individual.save(update_fields=["phone_no_valid", "phone_no_alternative_valid"]) - - -def populate_partner_and_country(apps, schema_editor): - IndividualIdentity = apps.get_model( - "registration_datahub", "ImportedIndividualIdentity" - ) - - for identity in IndividualIdentity.objects.prefetch_related("agency").all(): - identity.partner = identity.agency.type - identity.country = identity.agency.country - identity.save(update_fields=("partner", "country")) - - class Migration(migrations.Migration): dependencies = [] @@ -756,7 +603,6 @@ class Migration(migrations.Migration): max_length=255, ), ), - migrations.RunPython(remove_duplicates, migrations.RunPython.noop), migrations.AddField( model_name="importeddocumenttype", name="type", @@ -775,7 +621,6 @@ class Migration(migrations.Migration): ), preserve_default=False, ), - migrations.RunPython(set_document_types, migrations.RunPython.noop), migrations.AlterField( model_name="importeddocumenttype", name="type", @@ -791,7 +636,6 @@ class Migration(migrations.Migration): max_length=50, ), ), - migrations.RunPython(remove_duplicates_2nd, migrations.RunPython.noop), migrations.AlterUniqueTogether( name="importeddocumenttype", unique_together={("country", "type")}, @@ -1750,8 +1594,6 @@ class Migration(migrations.Migration): name="admin2_title", field=models.CharField(blank=True, default="", max_length=255), ), - migrations.RunPython(cast_flex_field_values, empty_reverse), - migrations.RunPython(round_muac, empty_reverse), migrations.AlterField( model_name="importedindividual", name="disability", @@ -1856,8 +1698,6 @@ class Migration(migrations.Migration): old_name="male_age_group_6_11_disabled_count", new_name="male_age_group_5_12_disabled_count", ), - migrations.RunPython(fix_fields_individuals, migrations.RunPython.noop), - migrations.RunPython(fix_fields_households, migrations.RunPython.noop), migrations.RenameField( model_name="importedhousehold", old_name="female_age_group_0_4_count", @@ -2783,7 +2623,6 @@ class Migration(migrations.Migration): name="importeddocumenttype", unique_together=set(), ), - migrations.RunPython(migrate_doc_type, migrations.RunPython.noop), migrations.RemoveField( model_name="importeddocumenttype", name="country", @@ -2798,9 +2637,6 @@ class Migration(migrations.Migration): name="phone_no_valid", field=models.BooleanField(default=False), ), - migrations.RunPython( - update_each_phone_numbers_validity, migrations.RunPython.noop - ), migrations.AddField( model_name="importedindividualidentity", name="country", @@ -2811,7 +2647,6 @@ class Migration(migrations.Migration): name="partner", field=models.CharField(max_length=100, null=True), ), - migrations.RunPython(populate_partner_and_country, migrations.RunPython.noop), migrations.RemoveField( model_name="importedindividualidentity", name="agency", diff --git a/backend/hct_mis_api/apps/registration_datahub/mutations.py b/backend/hct_mis_api/apps/registration_datahub/mutations.py index 327bbe4daa..e43dbac7f8 100644 --- a/backend/hct_mis_api/apps/registration_datahub/mutations.py +++ b/backend/hct_mis_api/apps/registration_datahub/mutations.py @@ -63,8 +63,7 @@ logger = logging.getLogger(__name__) -@transaction.atomic(using="default") -@transaction.atomic(using="registration_datahub") +@transaction.atomic() def create_registration_data_import_objects( registration_data_import_data: Dict, user: "User", @@ -102,8 +101,7 @@ def create_registration_data_import_objects( ) -@transaction.atomic(using="default") -@transaction.atomic(using="registration_datahub") +@transaction.atomic() def create_registration_data_import_for_import_program_population( registration_data_import_data: Dict, user: "User", @@ -164,8 +162,7 @@ def validate_import_data( raise ValidationError("Cannot import empty form") @classmethod - @transaction.atomic(using="default") - @transaction.atomic(using="registration_datahub") + @transaction.atomic() @is_authenticated def processed_mutate( cls, root: Any, info: Any, registration_data_import_data: Dict @@ -229,8 +226,7 @@ class Arguments: registration_data_import_data = RegistrationProgramPopulationImportMutationInput(required=True) @classmethod - @transaction.atomic(using="default") - @transaction.atomic(using="registration_datahub") + @transaction.atomic() @is_authenticated def processed_mutate( cls, root: Any, info: Any, registration_data_import_data: Dict @@ -335,8 +331,7 @@ class Arguments: registration_data_import_data = RegistrationKoboImportMutationInput(required=True) @classmethod - @transaction.atomic(using="default") - @transaction.atomic(using="registration_datahub") + @transaction.atomic() @is_authenticated def processed_mutate( cls, root: Any, info: Any, registration_data_import_data: Dict @@ -398,8 +393,7 @@ class Arguments: version = BigInt(required=False) @classmethod - @transaction.atomic(using="default") - @transaction.atomic(using="registration_datahub") + @transaction.atomic() @is_authenticated @raise_program_status_is(Program.FINISHED) def mutate(cls, root: Any, info: Any, id: Optional[str], **kwargs: Any) -> "MergeRegistrationDataImportMutation": @@ -447,7 +441,7 @@ def validate_object_status(cls, *args: Any, **kwargs: Any) -> None: raise ValidationError("Only In Review Registration Data Import can be refused") @classmethod - @transaction.atomic(using="default") + @transaction.atomic() @is_authenticated @raise_program_status_is(Program.FINISHED) def mutate(cls, root: Any, info: Any, id: Optional[str], **kwargs: Any) -> "RefuseRegistrationDataImportMutation": @@ -492,7 +486,7 @@ class Arguments: version = BigInt(required=False) @classmethod - @transaction.atomic(using="default") + @transaction.atomic() @is_authenticated @raise_program_status_is(Program.FINISHED) def mutate(cls, root: Any, info: Any, id: Optional[str], **kwargs: Any) -> "EraseRegistrationDataImportMutation": @@ -538,8 +532,7 @@ class Arguments: business_area_slug = graphene.String(required=True) @classmethod - @transaction.atomic(using="default") - @transaction.atomic(using="registration_datahub") + @transaction.atomic() @is_authenticated def mutate(cls, root: Any, info: Any, file: IO, business_area_slug: str) -> "UploadImportDataXLSXFileAsync": cls.has_permission(info, Permissions.RDI_IMPORT_DATA, business_area_slug) diff --git a/backend/hct_mis_api/apps/registration_datahub/schema.py b/backend/hct_mis_api/apps/registration_datahub/schema.py index b69d921d5e..3909f9a11c 100644 --- a/backend/hct_mis_api/apps/registration_datahub/schema.py +++ b/backend/hct_mis_api/apps/registration_datahub/schema.py @@ -1,12 +1,9 @@ import json -from datetime import date from typing import Any, Dict, List, Optional from django.db.models import Prefetch, Q, QuerySet import graphene -from dateutil.parser import parse -from dateutil.relativedelta import relativedelta from graphene import Boolean, Int, relay from graphene_django import DjangoObjectType from graphene_django.filter import DjangoFilterConnectionField @@ -47,6 +44,7 @@ KoboImportData, RegistrationDataImportDatahub, ) +from hct_mis_api.apps.registration_data.nodes import DeduplicationResultNode from hct_mis_api.apps.registration_datahub.filters import ( ImportedHouseholdFilter, ImportedIndividualFilter, @@ -54,33 +52,6 @@ from hct_mis_api.apps.utils.schema import Arg, FlexFieldsScalar -class DeduplicationResultNode(graphene.ObjectType): - hit_id = graphene.ID() - full_name = graphene.String() - score = graphene.Float() - proximity_to_score = graphene.Float() - location = graphene.String() - age = graphene.Int() - duplicate = graphene.Boolean() - distinct = graphene.Boolean() - - def resolve_age(self, info: Any) -> Optional[int]: - date_of_birth = self.get("dob") - if date_of_birth: - today = date.today() - return relativedelta(today, parse(date_of_birth)).years - return None - - def resolve_location(self, info: Any) -> str: - return self.get("location", "Not provided") - - def resolve_duplicate(self, info: Any) -> bool: - return self.get("duplicate", False) - - def resolve_distinct(self, info: Any) -> bool: - return self.get("distinct", False) - - class ImportedDocumentNode(DjangoObjectType): country = graphene.String(description="Document country") photo = graphene.String(description="Photo url") diff --git a/backend/hct_mis_api/apps/registration_datahub/tasks/pull_kobo_submissions.py b/backend/hct_mis_api/apps/registration_datahub/tasks/pull_kobo_submissions.py index dfc7f22439..ee1ecd08e3 100644 --- a/backend/hct_mis_api/apps/registration_datahub/tasks/pull_kobo_submissions.py +++ b/backend/hct_mis_api/apps/registration_datahub/tasks/pull_kobo_submissions.py @@ -18,8 +18,7 @@ class PullKoboSubmissions: - @transaction.atomic(using="default") - @transaction.atomic(using="registration_datahub") + @transaction.atomic() def execute(self, kobo_import_data: KoboImportData, program: Program) -> Dict: kobo_import_data.status = KoboImportData.STATUS_RUNNING kobo_import_data.save() diff --git a/backend/hct_mis_api/apps/registration_datahub/tasks/rdi_kobo_create.py b/backend/hct_mis_api/apps/registration_datahub/tasks/rdi_kobo_create.py index 334b778fe2..19ef243fcb 100644 --- a/backend/hct_mis_api/apps/registration_datahub/tasks/rdi_kobo_create.py +++ b/backend/hct_mis_api/apps/registration_datahub/tasks/rdi_kobo_create.py @@ -16,6 +16,7 @@ from hct_mis_api.apps.core.kobo.common import ( KOBO_FORM_INDIVIDUALS_COLUMN_NAME, get_field_name, + get_submission_metadata, ) from hct_mis_api.apps.core.models import BusinessArea from hct_mis_api.apps.core.utils import chunks, rename_dict_keys @@ -44,7 +45,6 @@ from hct_mis_api.apps.registration_datahub.tasks.rdi_base_create import ( RdiBaseCreateTask, ) -from hct_mis_api.apps.registration_datahub.tasks.utils import get_submission_metadata from hct_mis_api.apps.registration_datahub.utils import ( calculate_hash_for_kobo_submission, find_attachment_in_kobo, diff --git a/backend/hct_mis_api/apps/registration_datahub/tasks/rdi_merge.py b/backend/hct_mis_api/apps/registration_datahub/tasks/rdi_merge.py index f6a9cc047f..aa5dc44909 100644 --- a/backend/hct_mis_api/apps/registration_datahub/tasks/rdi_merge.py +++ b/backend/hct_mis_api/apps/registration_datahub/tasks/rdi_merge.py @@ -237,7 +237,7 @@ def execute(self, registration_data_import_id: str) -> None: individual_ids = list(individuals.values_list("id", flat=True)) household_ids = list(households.values_list("id", flat=True)) try: - with transaction.atomic(using="default"): + with transaction.atomic(): old_obj_hct = copy_model_object(obj_hct) transaction.on_commit(lambda: recalculate_population_fields_task(household_ids, obj_hct.program_id)) diff --git a/backend/hct_mis_api/apps/registration_datahub/tasks/utils.py b/backend/hct_mis_api/apps/registration_datahub/tasks/utils.py index 082d8cbf87..f69b4c7627 100644 --- a/backend/hct_mis_api/apps/registration_datahub/tasks/utils.py +++ b/backend/hct_mis_api/apps/registration_datahub/tasks/utils.py @@ -1,4 +1,4 @@ -from typing import Any, Dict, List, Union +from typing import Any, List, Union def collectors_str_ids_to_list(values: Any) -> Union[None, str, List[str]]: @@ -11,16 +11,3 @@ def collectors_str_ids_to_list(values: Any) -> Union[None, str, List[str]]: return [str(temp_value)] else: return str(values).strip(";").replace(" ", "").split(";") - - -def get_submission_metadata(household_data_dict: Dict) -> Dict: - meta_fields_mapping = { - "_uuid": "kobo_submission_uuid", - "_xform_id_string": "kobo_asset_id", - "_submission_time": "kobo_submission_time", - } - submission_meta_data = {} - for meta_field, model_field_name in meta_fields_mapping.items(): - submission_meta_data[model_field_name] = household_data_dict.get(meta_field) - - return submission_meta_data diff --git a/backend/hct_mis_api/apps/registration_datahub/tasks/validate_xlsx_import.py b/backend/hct_mis_api/apps/registration_datahub/tasks/validate_xlsx_import.py index d7d01583d3..25e3a88e75 100644 --- a/backend/hct_mis_api/apps/registration_datahub/tasks/validate_xlsx_import.py +++ b/backend/hct_mis_api/apps/registration_datahub/tasks/validate_xlsx_import.py @@ -12,7 +12,7 @@ class ValidateXlsxImport: - @transaction.atomic(using="default") + @transaction.atomic() def execute(self, import_data: ImportData, program: Program) -> Dict: import_data.status = ImportData.STATUS_RUNNING import_data.save() diff --git a/backend/hct_mis_api/apps/registration_datahub/tests/test_celery_tasks.py b/backend/hct_mis_api/apps/registration_datahub/tests/test_celery_tasks.py index a005b27b48..17c0d5e242 100644 --- a/backend/hct_mis_api/apps/registration_datahub/tests/test_celery_tasks.py +++ b/backend/hct_mis_api/apps/registration_datahub/tests/test_celery_tasks.py @@ -559,7 +559,6 @@ class TestAutomatingRDICreationTask(TestCase): "cash_assist_datahub_ca", "cash_assist_datahub_erp", "cash_assist_datahub_mis", - "registration_datahub", } fixtures = (f"{settings.PROJECT_ROOT}/apps/geo/fixtures/data.json",) diff --git a/backend/hct_mis_api/apps/registration_datahub/tests/test_clean_old_record_files_task.py b/backend/hct_mis_api/apps/registration_datahub/tests/test_clean_old_record_files_task.py index 0f8e059837..20b1462880 100644 --- a/backend/hct_mis_api/apps/registration_datahub/tests/test_clean_old_record_files_task.py +++ b/backend/hct_mis_api/apps/registration_datahub/tests/test_clean_old_record_files_task.py @@ -7,8 +7,6 @@ class TestClearRecordFilesTask(APITestCase): - databases = {"default", "registration_datahub"} - @classmethod def setUpTestData(cls) -> None: cls.record_1 = Record.objects.create( diff --git a/backend/hct_mis_api/apps/registration_datahub/tests/test_deduplication.py b/backend/hct_mis_api/apps/registration_datahub/tests/test_deduplication.py index d2510d86ad..ada51fbccc 100644 --- a/backend/hct_mis_api/apps/registration_datahub/tests/test_deduplication.py +++ b/backend/hct_mis_api/apps/registration_datahub/tests/test_deduplication.py @@ -14,17 +14,14 @@ UNIQUE, WIFE_HUSBAND, Individual, + PendingIndividual, ) from hct_mis_api.apps.program.fixtures import ProgramFactory from hct_mis_api.apps.registration_data.fixtures import RegistrationDataImportFactory -from hct_mis_api.apps.registration_data.models import ImportData -from hct_mis_api.apps.registration_datahub.fixtures import ( - create_imported_household_and_individuals, -) -from hct_mis_api.apps.registration_datahub.models import ( +from hct_mis_api.apps.registration_data.models import ( DUPLICATE_IN_BATCH, UNIQUE_IN_BATCH, - ImportedIndividual, + ImportData, ) from hct_mis_api.apps.registration_datahub.tasks.deduplicate import DeduplicateTask from hct_mis_api.apps.utils.elasticsearch_utils import populate_index @@ -34,7 +31,6 @@ @disabled_locally_test class TestBatchDeduplication(BaseElasticSearchTestCase): - databases = {"default", "registration_datahub"} fixtures = (f"{settings.PROJECT_ROOT}/apps/geo/fixtures/data.json",) @classmethod @@ -71,7 +67,7 @@ def setUpTestData(cls) -> None: ( cls.household, cls.individuals, - ) = create_imported_household_and_individuals( + ) = create_household_and_individuals( household_data={ "registration_data_import": cls.registration_data_import, "program_id": cls.program.id, @@ -236,10 +232,10 @@ def test_batch_deduplication(self) -> None: with self.assertNumQueries(11): task.deduplicate_pending_individuals(self.registration_data_import) - duplicate_in_batch = ImportedIndividual.objects.order_by("full_name").filter( + duplicate_in_batch = PendingIndividual.objects.order_by("full_name").filter( deduplication_batch_status=DUPLICATE_IN_BATCH ) - unique_in_batch = ImportedIndividual.objects.order_by("full_name").filter( + unique_in_batch = PendingIndividual.objects.order_by("full_name").filter( deduplication_batch_status=UNIQUE_IN_BATCH ) @@ -266,13 +262,13 @@ def test_batch_deduplication(self) -> None: expected_uniques, ) - duplicate_in_golden_record = ImportedIndividual.objects.order_by("full_name").filter( + duplicate_in_golden_record = PendingIndividual.objects.order_by("full_name").filter( deduplication_golden_record_status=DUPLICATE ) - needs_adjudication_in_golden_record = ImportedIndividual.objects.order_by("full_name").filter( + needs_adjudication_in_golden_record = PendingIndividual.objects.order_by("full_name").filter( deduplication_golden_record_status=NEEDS_ADJUDICATION ) - unique_in_golden_record = ImportedIndividual.objects.order_by("full_name").filter( + unique_in_golden_record = PendingIndividual.objects.order_by("full_name").filter( deduplication_golden_record_status=UNIQUE ) @@ -302,7 +298,6 @@ def test_batch_deduplication(self) -> None: @disabled_locally_test class TestGoldenRecordDeduplication(BaseElasticSearchTestCase): - databases = {"default", "registration_datahub"} fixtures = (f"{settings.PROJECT_ROOT}/apps/geo/fixtures/data.json",) @classmethod diff --git a/backend/hct_mis_api/apps/registration_datahub/tests/test_extract_records.py b/backend/hct_mis_api/apps/registration_datahub/tests/test_extract_records.py index e00ed35764..8ec9532ae3 100644 --- a/backend/hct_mis_api/apps/registration_datahub/tests/test_extract_records.py +++ b/backend/hct_mis_api/apps/registration_datahub/tests/test_extract_records.py @@ -11,8 +11,6 @@ class TestExtractRecords(TestCase): - databases = {"default", "registration_datahub"} - @classmethod def setUpTestData(cls) -> None: content = Path(f"{settings.PROJECT_ROOT}/apps/registration_datahub/tests/test_file/image.jpeg").read_bytes() diff --git a/backend/hct_mis_api/apps/registration_datahub/tests/test_imported_document_type_models.py b/backend/hct_mis_api/apps/registration_datahub/tests/test_imported_document_type_models.py deleted file mode 100644 index aa354c3a90..0000000000 --- a/backend/hct_mis_api/apps/registration_datahub/tests/test_imported_document_type_models.py +++ /dev/null @@ -1,14 +0,0 @@ -from django.test import TestCase - -from hct_mis_api.apps.core.utils import IDENTIFICATION_TYPE_TO_KEY_MAPPING -from hct_mis_api.apps.household.models import IDENTIFICATION_TYPE_BIRTH_CERTIFICATE -from hct_mis_api.apps.registration_datahub.models import ImportedDocumentType - - -class TestImportedDocumentTypeModel(TestCase): - databases = "__all__" - - def test_create_document_type(self) -> None: - assert ImportedDocumentType.objects.create( - key=IDENTIFICATION_TYPE_TO_KEY_MAPPING[IDENTIFICATION_TYPE_BIRTH_CERTIFICATE] - ) diff --git a/backend/hct_mis_api/apps/registration_datahub/tests/test_kobo_validators_methods.py b/backend/hct_mis_api/apps/registration_datahub/tests/test_kobo_validators_methods.py index 3b7627d7ec..04995c416e 100644 --- a/backend/hct_mis_api/apps/registration_datahub/tests/test_kobo_validators_methods.py +++ b/backend/hct_mis_api/apps/registration_datahub/tests/test_kobo_validators_methods.py @@ -14,7 +14,6 @@ class TestKoboSaveValidatorsMethods(TestCase): - databases = {"default", "registration_datahub"} fixtures = (f"{settings.PROJECT_ROOT}/apps/geo/fixtures/data.json",) VALID_JSON = [ diff --git a/backend/hct_mis_api/apps/registration_datahub/tests/test_models.py b/backend/hct_mis_api/apps/registration_datahub/tests/test_models.py index 0bbff79da2..e450708016 100644 --- a/backend/hct_mis_api/apps/registration_datahub/tests/test_models.py +++ b/backend/hct_mis_api/apps/registration_datahub/tests/test_models.py @@ -7,8 +7,6 @@ class TestImportedHousehold(TestCase): - databases = {"default", "registration_datahub"} - @classmethod def setUpTestData(cls) -> None: create_afghanistan() diff --git a/backend/hct_mis_api/apps/registration_datahub/tests/test_program_population_to_pending_objects.py b/backend/hct_mis_api/apps/registration_datahub/tests/test_program_population_to_pending_objects.py index 8e415afc9a..8d9e7e093f 100644 --- a/backend/hct_mis_api/apps/registration_datahub/tests/test_program_population_to_pending_objects.py +++ b/backend/hct_mis_api/apps/registration_datahub/tests/test_program_population_to_pending_objects.py @@ -127,8 +127,6 @@ class TestProgramPopulationToPendingObjects(APITestCase): - databases = {"default", "registration_datahub"} - @classmethod def setUpTestData(cls) -> None: cls.afghanistan = create_afghanistan() diff --git a/backend/hct_mis_api/apps/registration_datahub/tests/test_rdi_merge.py b/backend/hct_mis_api/apps/registration_datahub/tests/test_rdi_merge.py index 81f8c5a3ed..e1ee6b0b8f 100644 --- a/backend/hct_mis_api/apps/registration_datahub/tests/test_rdi_merge.py +++ b/backend/hct_mis_api/apps/registration_datahub/tests/test_rdi_merge.py @@ -77,7 +77,6 @@ def capture_on_commit_callbacks( class TestRdiMergeTask(BaseElasticSearchTestCase): - databases = {"default", "registration_datahub"} fixtures = [ f"{settings.PROJECT_ROOT}/apps/geo/fixtures/data.json", f"{settings.PROJECT_ROOT}/apps/core/fixtures/data.json", @@ -592,8 +591,6 @@ def test_merging_external_collector(self) -> None: class TestRdiMergeTaskDeliveryMechanismData(TestCase): - databases = {"default", "registration_datahub"} - fixtures = [ f"{settings.PROJECT_ROOT}/apps/geo/fixtures/data.json", f"{settings.PROJECT_ROOT}/apps/core/fixtures/data.json", diff --git a/backend/hct_mis_api/apps/registration_datahub/tests/test_rdi_people_create.py b/backend/hct_mis_api/apps/registration_datahub/tests/test_rdi_people_create.py index 20cd50f677..c98f992250 100644 --- a/backend/hct_mis_api/apps/registration_datahub/tests/test_rdi_people_create.py +++ b/backend/hct_mis_api/apps/registration_datahub/tests/test_rdi_people_create.py @@ -33,10 +33,6 @@ class TestRdiXlsxPeople(BaseElasticSearchTestCase): - databases = { - "default", - "registration_datahub", - } fixtures = (f"{settings.PROJECT_ROOT}/apps/geo/fixtures/data.json",) @classmethod diff --git a/backend/hct_mis_api/apps/registration_datahub/tests/test_registration_program_population_import_task.py b/backend/hct_mis_api/apps/registration_datahub/tests/test_registration_program_population_import_task.py index 0b06b5ae20..32b2035d90 100644 --- a/backend/hct_mis_api/apps/registration_datahub/tests/test_registration_program_population_import_task.py +++ b/backend/hct_mis_api/apps/registration_datahub/tests/test_registration_program_population_import_task.py @@ -33,8 +33,6 @@ class TestRegistrationProgramPopulationImportTask(BaseElasticSearchTestCase): - databases = {"default", "registration_datahub"} - @classmethod def setUpTestData(cls) -> None: super().setUpTestData() diff --git a/backend/hct_mis_api/apps/registration_datahub/tests/test_ukrainian_registration_service.py b/backend/hct_mis_api/apps/registration_datahub/tests/test_ukrainian_registration_service.py index d5cb7d5756..734b6e12eb 100644 --- a/backend/hct_mis_api/apps/registration_datahub/tests/test_ukrainian_registration_service.py +++ b/backend/hct_mis_api/apps/registration_datahub/tests/test_ukrainian_registration_service.py @@ -31,10 +31,6 @@ class BaseTestUkrainianRegistrationService(TestCase): - databases = { - "default", - "registration_datahub", - } fixtures = (f"{settings.PROJECT_ROOT}/apps/geo/fixtures/data.json",) @classmethod diff --git a/backend/hct_mis_api/apps/sanction_list/tests/test_load_xml.py b/backend/hct_mis_api/apps/sanction_list/tests/test_load_xml.py index 51ed1ebd68..85384d8a24 100644 --- a/backend/hct_mis_api/apps/sanction_list/tests/test_load_xml.py +++ b/backend/hct_mis_api/apps/sanction_list/tests/test_load_xml.py @@ -11,7 +11,6 @@ @disabled_locally_test class TestLoadXML(BaseElasticSearchTestCase): - databases = {"default", "registration_datahub"} fixtures = (f"{settings.PROJECT_ROOT}/apps/geo/fixtures/data.json",) def test_execute(self) -> None: diff --git a/backend/hct_mis_api/apps/utils/tests/test_registration_data_xlsx_import_celery_manager.py b/backend/hct_mis_api/apps/utils/tests/test_registration_data_xlsx_import_celery_manager.py index 295e825a64..5c68395767 100644 --- a/backend/hct_mis_api/apps/utils/tests/test_registration_data_xlsx_import_celery_manager.py +++ b/backend/hct_mis_api/apps/utils/tests/test_registration_data_xlsx_import_celery_manager.py @@ -10,8 +10,6 @@ class TestRegistrationDataXlsxImportCeleryManager(APITestCase): - databases = {"default", "registration_datahub"} - @classmethod def setUpTestData(cls) -> None: call_command("loadbusinessareas") diff --git a/backend/hct_mis_api/aurora/admin.py b/backend/hct_mis_api/aurora/admin.py index 3050472d3c..02b626c6a7 100644 --- a/backend/hct_mis_api/aurora/admin.py +++ b/backend/hct_mis_api/aurora/admin.py @@ -1,10 +1,11 @@ import base64 -from typing import Any, Generator, Optional, Type +from typing import Any, Dict, Generator, Optional, Type from uuid import UUID from django import forms from django.contrib import admin, messages from django.contrib.admin.views.main import ChangeList +from django.core.signing import BadSignature, Signer from django.db.models import QuerySet from django.http import HttpRequest, HttpResponse from django.shortcuts import render @@ -28,7 +29,6 @@ from hct_mis_api.apps.program.models import Program from hct_mis_api.apps.registration_data.models import RegistrationDataImport -from hct_mis_api.apps.registration_datahub.admin import FetchForm from hct_mis_api.apps.utils.admin import HOPEModelAdminBase from hct_mis_api.apps.utils.security import is_root from hct_mis_api.aurora import models @@ -385,3 +385,35 @@ def fetch(self, request: HttpRequest) -> TemplateResponse: @admin.register(Record) class RecordDatahubAdmin(RecordMixinAdmin, HOPEModelAdminBase): pass + + +class RemeberDataForm(forms.Form): + SYNC_COOKIE = "fetch" + remember = forms.BooleanField(label="Remember me", required=False) + + def get_signed_cookie(self, request: HttpRequest) -> Any: + signer = Signer(str(request.user.password)) + return signer.sign_object(self.cleaned_data) + + @classmethod + def get_saved_config(cls, request: HttpRequest) -> Dict: + try: + signer = Signer(str(request.user.password)) + obj: Dict = signer.unsign_object(request.COOKIES.get(cls.SYNC_COOKIE, "")) + return obj + except BadSignature: + return {} + + +class FetchForm(RemeberDataForm): + SYNC_COOKIE = "fetch" + + host = forms.URLField() + username = forms.CharField() + password = forms.CharField(widget=forms.PasswordInput) + registration = forms.IntegerField() + start = forms.IntegerField() + end = forms.IntegerField() + + def clean(self) -> Optional[Dict[str, Any]]: + return super().clean() diff --git a/backend/hct_mis_api/config/settings.py b/backend/hct_mis_api/config/settings.py index 5efe14e644..a7c600ea94 100644 --- a/backend/hct_mis_api/config/settings.py +++ b/backend/hct_mis_api/config/settings.py @@ -148,17 +148,12 @@ "sslrootcert": "/code/psql-cert.crt", "options": "-c search_path=erp", } - DATABASES["registration_datahub"]["OPTIONS"] = { - "sslmode": "verify-full", - "sslrootcert": "/code/psql-cert.crt", - } # If app is not specified here it will use default db DATABASE_APPS_MAPPING: Dict[str, str] = { "cash_assist_datahub": "cash_assist_datahub_ca", "mis_datahub": "cash_assist_datahub_mis", "erp_datahub": "cash_assist_datahub_erp", - "registration_datahub": "registration_datahub", } DATABASE_ROUTERS = ("hct_mis_api.apps.core.dbrouters.DbRouter",) @@ -423,7 +418,7 @@ def filter_environment(key: str, config: Dict, request: HttpRequest) -> bool: def masker(key: str, value: Any, config: Dict, request: HttpRequest) -> Any: from django_sysinfo.utils import cleanse_setting - from .apps.utils.security import is_root # noqa: ABS101 + from ..apps.utils.security import is_root # noqa: ABS101 if key in ["PATH", "PYTHONPATH"]: return mark_safe(value.replace(":", r":
")) @@ -453,7 +448,6 @@ def masker(key: str, value: Any, config: Dict, request: HttpRequest) -> Any: "HUB MIS": "cash_assist_datahub_mis", "HUB CA": "cash_assist_datahub_ca", "HUB ERP": "cash_assist_datahub_erp", - "HUB Reg": "registration_datahub", } EXPLORER_DEFAULT_CONNECTION = "default" EXPLORER_PERMISSION_VIEW = lambda r: r.user.has_perm("explorer.view_query") diff --git a/backend/selenium_tests/filters/test_filters.py b/backend/selenium_tests/filters/test_filters.py index 7afbc65395..faad9c9fe4 100644 --- a/backend/selenium_tests/filters/test_filters.py +++ b/backend/selenium_tests/filters/test_filters.py @@ -13,6 +13,7 @@ from hct_mis_api.apps.grievance.fixtures import GrievanceTicketFactory from hct_mis_api.apps.grievance.models import GrievanceTicket from hct_mis_api.apps.household.fixtures import create_household +from hct_mis_api.apps.household.models import DocumentType from hct_mis_api.apps.payment.fixtures import ( CashPlanFactory, PaymentRecordFactory, @@ -21,12 +22,7 @@ from hct_mis_api.apps.payment.models import PaymentPlan, PaymentVerificationPlan from hct_mis_api.apps.program.models import Program from hct_mis_api.apps.registration_data.fixtures import RegistrationDataImportFactory -from hct_mis_api.apps.registration_data.models import RegistrationDataImport -from hct_mis_api.apps.registration_datahub.models import ( - ImportData, - ImportedDocumentType, - RegistrationDataImportDatahub, -) +from hct_mis_api.apps.registration_data.models import ImportData, RegistrationDataImport from hct_mis_api.apps.targeting.fixtures import ( TargetingCriteriaFactory, TargetPopulationFactory, @@ -41,7 +37,7 @@ ProgrammeDetails, ) -pytestmark = pytest.mark.django_db(transaction=True, databases=["registration_datahub", "default"]) +pytestmark = pytest.mark.django_db(transaction=True) @pytest.fixture @@ -229,7 +225,7 @@ def create_targeting() -> None: @pytest.fixture def create_rdi() -> None: - ImportedDocumentType.objects.create(key="tax_id", label="Tax ID") + DocumentType.objects.create(key="tax_id", label="Tax ID") business_area = BusinessArea.objects.get(slug="afghanistan") programme = Program.objects.filter(name="Test Programm").first() imported_by = User.objects.first() @@ -237,7 +233,15 @@ def create_rdi() -> None: number_of_households = 0 status = RegistrationDataImport.IMPORTING - rdi = RegistrationDataImport.objects.create( + import_data = ImportData.objects.create( + status=ImportData.STATUS_PENDING, + business_area_slug=business_area.slug, + data_type=ImportData.FLEX_REGISTRATION, + number_of_individuals=number_of_individuals, + number_of_households=number_of_households, + created_by_id=imported_by.id if imported_by else None, + ) + RegistrationDataImport.objects.create( name="Test", data_source=RegistrationDataImport.FLEX_REGISTRATION, imported_by=imported_by, @@ -246,6 +250,7 @@ def create_rdi() -> None: business_area=business_area, status=status, program=programme, + import_data=import_data, ) RegistrationDataImport.objects.create( @@ -259,24 +264,6 @@ def create_rdi() -> None: program=programme, ) - import_data = ImportData.objects.create( - status=ImportData.STATUS_PENDING, - business_area_slug=business_area.slug, - data_type=ImportData.FLEX_REGISTRATION, - number_of_individuals=number_of_individuals, - number_of_households=number_of_households, - created_by_id=imported_by.id if imported_by else None, - ) - rdi_datahub = RegistrationDataImportDatahub.objects.create( - name="Test", - hct_id=rdi.id, - import_data=import_data, - import_done=RegistrationDataImportDatahub.NOT_STARTED, - business_area_slug=business_area.slug, - ) - rdi.datahub_id = rdi_datahub.id - rdi.save(update_fields=("datahub_id",)) - @pytest.fixture def create_programs() -> None: diff --git a/backend/selenium_tests/registration_data_import/test_registration_data_import.py b/backend/selenium_tests/registration_data_import/test_registration_data_import.py index 17846df476..c62480c6c2 100644 --- a/backend/selenium_tests/registration_data_import/test_registration_data_import.py +++ b/backend/selenium_tests/registration_data_import/test_registration_data_import.py @@ -15,7 +15,7 @@ from hct_mis_api.apps.geo.models import Area, AreaType, Country from hct_mis_api.apps.utils.elasticsearch_utils import rebuild_search_index -pytestmark = pytest.mark.django_db(transaction=True, databases=["registration_datahub", "default"]) +pytestmark = pytest.mark.django_db(transaction=True) @pytest.fixture diff --git a/backend/selenium_tests/targeting/test_targeting.py b/backend/selenium_tests/targeting/test_targeting.py index 0f1720434b..5e642beebe 100644 --- a/backend/selenium_tests/targeting/test_targeting.py +++ b/backend/selenium_tests/targeting/test_targeting.py @@ -45,7 +45,7 @@ from hct_mis_api.apps.targeting.models import TargetPopulation from selenium_tests.page_object.filters import Filters -pytestmark = pytest.mark.django_db(transaction=True, databases=["registration_datahub", "default"]) +pytestmark = pytest.mark.django_db(transaction=True) @pytest.fixture