Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -8,6 +9,8 @@
import java.util.concurrent.ExecutionException;

public interface BatchAccountLookupApi {
@PostMapping("/accountLookup")
ResponseEntity<ResponseDTO> batchAccountLookup(@RequestHeader(value="X-CallbackURL") String callbackURL, @RequestBody RequestDTO requestBody, @RequestHeader(value = "X-Registering-Institution-ID") String registeringInstitutionId) throws ExecutionException, InterruptedException;
@PutMapping("/beneficiary")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PUT /beneficiary endpoint is already used for Update beneficiary API

ResponseEntity<ResponseDTO> batchAccountLookup(@RequestHeader(value="X-CallbackURL") String callbackURL,
@RequestBody BatchAccountLookupRequestDTO requestBody,
@RequestHeader(value = "X-Registering-Institution-ID") String registeringInstitutionId) throws ExecutionException, InterruptedException;
}
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -19,7 +20,7 @@ public class BatchAccountLookupApiController implements BatchAccountLookupApi {
@Autowired
AccountLookupService accountLookupService;
@Override
public ResponseEntity<ResponseDTO> batchAccountLookup(String callbackURL, RequestDTO requestDTO, String registeringInstitutionId) throws ExecutionException, InterruptedException {
public ResponseEntity<ResponseDTO> batchAccountLookup(String callbackURL, BatchAccountLookupRequestDTO requestDTO, String registeringInstitutionId) throws ExecutionException, InterruptedException {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This API is async so we have to return RequestDTO, BatchAccountLookupRequestDTO will be sent in callback

try{
accountLookupService.batchAccountLookup(callbackURL, requestDTO.getRequestID(), requestDTO.getBeneficiaries(), registeringInstitutionId);

Expand Down
Original file line number Diff line number Diff line change
@@ -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 ;

}