mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-11-27 17:14:55 +00:00
feat: add-account-details
This commit is contained in:
@ -13,7 +13,7 @@ export class CardService {
|
||||
|
||||
@Transactional()
|
||||
async createCard(customerId: string, cardData: CreateApplicationResponse): Promise<Card> {
|
||||
const account = await this.accountService.createAccount(cardData.accountId);
|
||||
const account = await this.accountService.createAccount(cardData);
|
||||
return this.cardRepository.createCard(customerId, account.id, cardData);
|
||||
}
|
||||
|
||||
@ -37,6 +37,15 @@ export class CardService {
|
||||
return card;
|
||||
}
|
||||
|
||||
async getCardByAccountNumber(accountNumber: string): Promise<Card> {
|
||||
const card = await this.cardRepository.getCardByAccountNumber(accountNumber);
|
||||
|
||||
if (!card) {
|
||||
throw new BadRequestException('CARD.NOT_FOUND');
|
||||
}
|
||||
return card;
|
||||
}
|
||||
|
||||
async getActiveCardForCustomer(customerId: string): Promise<Card> {
|
||||
const card = await this.cardRepository.getActiveCardForCustomer(customerId);
|
||||
if (!card) {
|
||||
|
||||
Reference in New Issue
Block a user