Interface CardService

All Known Implementing Classes:
CardServiceImpl

public interface CardService
Card service interface for managing card-related operations.
  • Method Summary

    Modifier and Type
    Method
    Description
    addAccountCard(String bankName, UUID accountId, jakarta.servlet.http.HttpServletRequest request)
    Adds a new card to the specified bank account.
    void
    Connects the specified bank account with a card.
    getAccountCardById(String bankName, UUID accountId, UUID cardId, jakarta.servlet.http.HttpServletRequest request, String type)
    Retrieves a specific card associated with a bank account by its unique identifier.
    getAccountCards(String bankName, UUID accountId, jakarta.servlet.http.HttpServletRequest request)
    Retrieves a list of cards associated with a specific bank account.
    void
    removeAccountCard(String bankName, UUID accountId, UUID cardId, jakarta.servlet.http.HttpServletRequest request)
    Removes a specific card from the specified bank account.
    void
    Removes all cards associated with the specified bank account.
  • Method Details

    • getAccountCards

      List<Card> getAccountCards(String bankName, UUID accountId, jakarta.servlet.http.HttpServletRequest request)
      Retrieves a list of cards associated with a specific bank account.
      Parameters:
      bankName - the name of the bank associated with the account
      accountId - the unique identifier of the bank account
      request - the HTTP request containing user information
      Returns:
      a list of Card objects associated with the specified account
    • getAccountCardById

      Card getAccountCardById(String bankName, UUID accountId, UUID cardId, jakarta.servlet.http.HttpServletRequest request, String type)
      Retrieves a specific card associated with a bank account by its unique identifier.
      Parameters:
      bankName - the name of the bank associated with the account
      accountId - the unique identifier of the bank account
      cardId - the unique identifier of the card to retrieve
      request - the HTTP request containing user information
      type - the type of card (e.g., debit, credit)
      Returns:
      the Card associated with the specified account and card ID
    • addAccountCard

      Card addAccountCard(String bankName, UUID accountId, jakarta.servlet.http.HttpServletRequest request) throws Exception
      Adds a new card to the specified bank account.
      Parameters:
      bankName - the name of the bank associated with the account
      accountId - the unique identifier of the bank account
      request - the HTTP request containing user information
      Returns:
      the newly created Card
      Throws:
      Exception - if an error occurs during the card creation process
    • connectCards

      void connectCards(BankAccount account) throws Exception
      Connects the specified bank account with a card.
      Parameters:
      account - the BankAccount to connect with the card
      Throws:
      Exception - if an error occurs during the card connection process
    • removeAccountCard

      void removeAccountCard(String bankName, UUID accountId, UUID cardId, jakarta.servlet.http.HttpServletRequest request)
      Removes a specific card from the specified bank account.
      Parameters:
      bankName - the name of the bank associated with the account
      accountId - the unique identifier of the bank account
      cardId - the unique identifier of the card to be removed
      request - the HTTP request containing user information
    • removeAllCards

      void removeAllCards(BankAccount account)
      Removes all cards associated with the specified bank account.
      Parameters:
      account - the BankAccount from which all cards should be removed