added fetchBillByBillId

This commit is contained in:
himanshu
2025-10-29 13:55:49 +05:30
parent c8191b54cd
commit 5325f26a64
10 changed files with 262 additions and 10 deletions
@@ -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);
}
}