feat: add vpan to card entity

This commit is contained in:
Abdalhamid Alhamad
2025-08-03 11:53:16 +03:00
parent 5e0a4e6bd1
commit fce720237f
7 changed files with 41 additions and 9 deletions

View File

@ -22,6 +22,7 @@ export class CardRepository {
scheme: CardScheme.VISA,
issuer: CardIssuers.NEOLEAP,
accountId: accountId,
vpan: card.vpan,
}),
);
}
@ -34,9 +35,9 @@ export class CardRepository {
return this.cardRepository.findOne({ where: { cardReference: referenceNumber }, relations: ['account'] });
}
getCardByAccountNumber(accountNumber: string): Promise<Card | null> {
getCardByVpan(vpan: string): Promise<Card | null> {
return this.cardRepository.findOne({
where: { account: { accountNumber } },
where: { vpan },
relations: ['account'],
});
}