Class TransactionController

java.lang.Object
org.training.transactions.controller.TransactionController

@RestController @RequestMapping("/transactions") public class TransactionController extends Object
  • Constructor Details

    • TransactionController

      public TransactionController()
  • Method Details

    • addTransactions

      @PostMapping public org.springframework.http.ResponseEntity<Response> addTransactions(@RequestBody TransactionDto transactionDto)
      Add transactions to the system.
      Parameters:
      transactionDto - The transaction data to be added.
      Returns:
      The response entity with the added transaction data.
    • makeInternalTransaction

      @PostMapping("/internal") public org.springframework.http.ResponseEntity<Response> makeInternalTransaction(@RequestBody List<TransactionDto> transactionDtos, @RequestParam String transactionReference)
      Handles the endpoint for making internal transactions.
      Parameters:
      transactionDtos - The list of transaction DTOs.
      transactionReference - The transaction reference.
      Returns:
      The response entity containing the response.
    • getTransactions

      @GetMapping public org.springframework.http.ResponseEntity<List<TransactionRequest>> getTransactions(@RequestParam String accountId)
      Retrieves a list of transactions for a given account ID.
      Parameters:
      accountId - The ID of the account
      Returns:
      The list of transactions
    • getTransactionByTransactionReference

      @GetMapping("/{referenceId}") public org.springframework.http.ResponseEntity<List<TransactionRequest>> getTransactionByTransactionReference(@PathVariable String referenceId)
      Retrieves a list of transaction requests based on the provided transaction reference ID.
      Parameters:
      referenceId - The transaction reference ID
      Returns:
      A ResponseEntity object containing the list of transaction requests