Package api.mpba.rastvdmy.service
Interface CardService
- All Known Implementing Classes:
CardServiceImpl
public interface CardService
Card service interface for managing card-related operations.
-
Method Summary
Modifier and TypeMethodDescriptionaddAccountCard(String bankName, UUID accountId, jakarta.servlet.http.HttpServletRequest request) Adds a new card to the specified bank account.voidconnectCards(BankAccount account) 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.voidremoveAccountCard(String bankName, UUID accountId, UUID cardId, jakarta.servlet.http.HttpServletRequest request) Removes a specific card from the specified bank account.voidremoveAllCards(BankAccount account) 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 accountaccountId- the unique identifier of the bank accountrequest- the HTTP request containing user information- Returns:
- a list of
Cardobjects 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 accountaccountId- the unique identifier of the bank accountcardId- the unique identifier of the card to retrieverequest- the HTTP request containing user informationtype- the type of card (e.g., debit, credit)- Returns:
- the
Cardassociated 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. -
connectCards
Connects the specified bank account with a card.- Parameters:
account- theBankAccountto 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 accountaccountId- the unique identifier of the bank accountcardId- the unique identifier of the card to be removedrequest- the HTTP request containing user information
-
removeAllCards
Removes all cards associated with the specified bank account.- Parameters:
account- theBankAccountfrom which all cards should be removed
-