diff --git a/src/main/java/org/mifos/identityaccountmapper/api/definition/BatchAccountLookupApi.java b/src/main/java/org/mifos/identityaccountmapper/api/definition/BatchAccountLookupApi.java index 72993c3..95460e6 100644 --- a/src/main/java/org/mifos/identityaccountmapper/api/definition/BatchAccountLookupApi.java +++ b/src/main/java/org/mifos/identityaccountmapper/api/definition/BatchAccountLookupApi.java @@ -1,5 +1,6 @@ package org.mifos.identityaccountmapper.api.definition; +import org.mifos.identityaccountmapper.data.BatchAccountLookupRequestDTO; import org.mifos.identityaccountmapper.data.RequestDTO; import org.mifos.identityaccountmapper.data.ResponseDTO; import org.springframework.http.ResponseEntity; @@ -8,6 +9,8 @@ import java.util.concurrent.ExecutionException; public interface BatchAccountLookupApi { - @PostMapping("/accountLookup") - ResponseEntity batchAccountLookup(@RequestHeader(value="X-CallbackURL") String callbackURL, @RequestBody RequestDTO requestBody, @RequestHeader(value = "X-Registering-Institution-ID") String registeringInstitutionId) throws ExecutionException, InterruptedException; + @PutMapping("/beneficiary") + ResponseEntity batchAccountLookup(@RequestHeader(value="X-CallbackURL") String callbackURL, + @RequestBody BatchAccountLookupRequestDTO requestBody, + @RequestHeader(value = "X-Registering-Institution-ID") String registeringInstitutionId) throws ExecutionException, InterruptedException; } diff --git a/src/main/java/org/mifos/identityaccountmapper/api/implementation/BatchAccountLookupApiController.java b/src/main/java/org/mifos/identityaccountmapper/api/implementation/BatchAccountLookupApiController.java index 1e08488..973bbe6 100644 --- a/src/main/java/org/mifos/identityaccountmapper/api/implementation/BatchAccountLookupApiController.java +++ b/src/main/java/org/mifos/identityaccountmapper/api/implementation/BatchAccountLookupApiController.java @@ -1,6 +1,7 @@ package org.mifos.identityaccountmapper.api.implementation; import org.mifos.identityaccountmapper.api.definition.BatchAccountLookupApi; +import org.mifos.identityaccountmapper.data.BatchAccountLookupRequestDTO; import org.mifos.identityaccountmapper.data.RequestDTO; import org.mifos.identityaccountmapper.data.ResponseDTO; import org.mifos.identityaccountmapper.service.AccountLookupService; @@ -19,7 +20,7 @@ public class BatchAccountLookupApiController implements BatchAccountLookupApi { @Autowired AccountLookupService accountLookupService; @Override - public ResponseEntity batchAccountLookup(String callbackURL, RequestDTO requestDTO, String registeringInstitutionId) throws ExecutionException, InterruptedException { + public ResponseEntity batchAccountLookup(String callbackURL, BatchAccountLookupRequestDTO requestDTO, String registeringInstitutionId) throws ExecutionException, InterruptedException { try{ accountLookupService.batchAccountLookup(callbackURL, requestDTO.getRequestID(), requestDTO.getBeneficiaries(), registeringInstitutionId); diff --git a/src/main/java/org/mifos/identityaccountmapper/data/BatchAccountLookupRequestDTO.java b/src/main/java/org/mifos/identityaccountmapper/data/BatchAccountLookupRequestDTO.java new file mode 100644 index 0000000..418aa08 --- /dev/null +++ b/src/main/java/org/mifos/identityaccountmapper/data/BatchAccountLookupRequestDTO.java @@ -0,0 +1,18 @@ +package org.mifos.identityaccountmapper.data; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +import java.util.List; + +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor +public class BatchAccountLookupRequestDTO { + private String requestID; + private List< BeneficiaryDTO > beneficiaries ; + +}