From dccb22976233b02fda9144bd5110da13e8bb3178 Mon Sep 17 00:00:00 2001 From: Paulina Kujawa <42150286+pkujawa@users.noreply.github.com> Date: Thu, 16 May 2024 11:06:49 +0200 Subject: [PATCH] Update initdemo for new partner structure (#3874) --- .../fixtures/businessareapartnerthrough.json | 15 +++++++++++ .../apps/core/management/commands/initdemo.py | 3 +++ .../fixtures/programpartnerthrough.json | 27 +++++++++++++++++++ 3 files changed, 45 insertions(+) create mode 100644 backend/hct_mis_api/apps/core/fixtures/businessareapartnerthrough.json create mode 100644 backend/hct_mis_api/apps/program/fixtures/programpartnerthrough.json diff --git a/backend/hct_mis_api/apps/core/fixtures/businessareapartnerthrough.json b/backend/hct_mis_api/apps/core/fixtures/businessareapartnerthrough.json new file mode 100644 index 0000000000..36df8b4f39 --- /dev/null +++ b/backend/hct_mis_api/apps/core/fixtures/businessareapartnerthrough.json @@ -0,0 +1,15 @@ +[ +{ + "model": "core.businessareapartnerthrough", + "pk": "3bed7924-1255-4da7-8bcc-2e7a821b4ec9", + "fields": { + "created_at": "2024-05-15T20:46:38.430Z", + "updated_at": "2024-05-15T20:46:38.430Z", + "business_area": "c259b1a0-ae3a-494e-b343-f7c8eb060c68", + "partner": 3, + "roles": [ + "e9e8c91a-c711-45b7-be8c-501c14d46330" + ] + } +} +] 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 6ad2765c7f..9a9c798755 100644 --- a/backend/hct_mis_api/apps/core/management/commands/initdemo.py +++ b/backend/hct_mis_api/apps/core/management/commands/initdemo.py @@ -61,6 +61,7 @@ def handle(self, *args: Any, **options: Any) -> None: 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/core/fixtures/businessareapartnerthrough.json") call_command("loaddata", f"{settings.PROJECT_ROOT}/apps/program/fixtures/data.json") call_command("loaddata", f"{settings.PROJECT_ROOT}/apps/registration_data/fixtures/data.json") call_command("loaddata", f"{settings.PROJECT_ROOT}/apps/household/fixtures/documenttype.json") @@ -87,6 +88,8 @@ def handle(self, *args: Any, **options: Any) -> None: generate_reconciled_payment_plan() update_fsps() + call_command("loaddata", f"{settings.PROJECT_ROOT}/apps/program/fixtures/programpartnerthrough.json") + email_list = [ "jan.romaniak@kellton.com", "jakub.krasnowski@kellton.com", diff --git a/backend/hct_mis_api/apps/program/fixtures/programpartnerthrough.json b/backend/hct_mis_api/apps/program/fixtures/programpartnerthrough.json new file mode 100644 index 0000000000..5436632333 --- /dev/null +++ b/backend/hct_mis_api/apps/program/fixtures/programpartnerthrough.json @@ -0,0 +1,27 @@ +[ +{ + "model": "program.programpartnerthrough", + "pk": "93687a51-1515-4c7b-a66b-215703c8ffd8", + "fields": { + "created_at": "2024-05-15T20:46:38.467Z", + "updated_at": "2024-05-15T20:46:38.467Z", + "program": "939ff91b-7f89-4e3c-9519-26ed62f51718", + "partner": 3, + "full_area_access": false, + "areas": [ + "18ff6f29-cd4d-4e80-8e80-13494b32ee53" + ] + } +}, +{ + "model": "program.programpartnerthrough", + "pk": "4478b6c7-8bba-470e-abca-e0c095fd5173", + "fields": { + "created_at": "2024-05-15T20:46:38.445Z", + "updated_at": "2024-05-15T20:46:38.445Z", + "program": "00000000-0000-0000-0000-faceb00c0000", + "partner": 3, + "full_area_access": true + } +} +]