From e8848d5afc8336aecb0cf0182d218b8b0d7c234b Mon Sep 17 00:00:00 2001
From: himeshr <himeshl@samanvayfoundation.org>
Date: Wed, 21 Aug 2024 14:00:11 +0530
Subject: [PATCH] #776 | Setup base org metadata as well during org creation

---
 .../java/org/avni/server/service/OrganisationService.java    | 5 +++++
 .../java/org/avni/server/web/OrganisationController.java     | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/avni-server-api/src/main/java/org/avni/server/service/OrganisationService.java b/avni-server-api/src/main/java/org/avni/server/service/OrganisationService.java
index e0e1eb49b..9b45163d0 100644
--- a/avni-server-api/src/main/java/org/avni/server/service/OrganisationService.java
+++ b/avni-server-api/src/main/java/org/avni/server/service/OrganisationService.java
@@ -944,6 +944,11 @@ private void createDefaultGenders(Organisation org) {
         createGender("Other", org);
     }
 
+    public void setupBaseOrganisationData(Organisation organisation) {
+        setupBaseOrganisationMetadata(organisation);
+        setupBaseOrganisationAdminConfig(organisation);
+    }
+
     public void setupBaseOrganisationAdminConfig(Organisation organisation) {
         organisationConfigService.createDefaultOrganisationConfig(organisation);
     }
diff --git a/avni-server-api/src/main/java/org/avni/server/web/OrganisationController.java b/avni-server-api/src/main/java/org/avni/server/web/OrganisationController.java
index bd68c0ed3..c6fc8a43e 100644
--- a/avni-server-api/src/main/java/org/avni/server/web/OrganisationController.java
+++ b/avni-server-api/src/main/java/org/avni/server/web/OrganisationController.java
@@ -60,7 +60,7 @@ public ResponseEntity save(@RequestBody OrganisationContract request) {
         setOrgAccountByIdOrDefault(org, request.getAccountId());
 
         organisationRepository.save(org);
-        organisationService.setupBaseOrganisationAdminConfig(org);
+        organisationService.setupBaseOrganisationData(org);
         return new ResponseEntity<>(org, HttpStatus.CREATED);
     }