added fetchBillByBillId
This commit is contained in:
@@ -6,6 +6,7 @@ import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.billpaymentservice.bbps.dto.ResponseModel;
|
||||
import com.billpaymentservice.bbps.dto.request.BillFetchByBillIdRequest;
|
||||
import com.billpaymentservice.bbps.dto.request.FetchBillRequest;
|
||||
import com.billpaymentservice.bbps.service.AgentService;
|
||||
|
||||
@@ -33,4 +34,20 @@ public class AgentController {
|
||||
ResponseModel response = agentService.initiateBillFetch(fetchBillRequest);
|
||||
return ResponseEntity.ok(response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches bill details from external BBPS service
|
||||
*/
|
||||
@PostMapping(
|
||||
value = "/fetchBillById",
|
||||
consumes = MediaType.APPLICATION_JSON_VALUE,
|
||||
produces = MediaType.APPLICATION_JSON_VALUE
|
||||
)
|
||||
public ResponseEntity<ResponseModel> fetchBillById(
|
||||
@Validated @RequestBody BillFetchByBillIdRequest billFetchByBillIdRequest) {
|
||||
|
||||
ResponseModel response = agentService.fetchBillById(billFetchByBillIdRequest);
|
||||
return ResponseEntity.ok(response);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user