mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-11-26 16:44:54 +00:00
feat: add vpan to card entity
This commit is contained in:
@ -37,8 +37,8 @@ export class CardService {
|
||||
return card;
|
||||
}
|
||||
|
||||
async getCardByAccountNumber(accountNumber: string): Promise<Card> {
|
||||
const card = await this.cardRepository.getCardByAccountNumber(accountNumber);
|
||||
async getCardByVpan(vpan: string): Promise<Card> {
|
||||
const card = await this.cardRepository.getCardByVpan(vpan);
|
||||
|
||||
if (!card) {
|
||||
throw new BadRequestException('CARD.NOT_FOUND');
|
||||
@ -55,7 +55,7 @@ export class CardService {
|
||||
}
|
||||
|
||||
async updateCardStatus(body: AccountCardStatusChangedWebhookRequest) {
|
||||
const card = await this.getCardByAccountNumber(body.cardId);
|
||||
const card = await this.getCardByVpan(body.cardId);
|
||||
const { description, status } = CardStatusMapper[body.newStatus] || CardStatusMapper['99'];
|
||||
|
||||
return this.cardRepository.updateCardStatus(card.id, status, description);
|
||||
|
||||
Reference in New Issue
Block a user