feat: working on creating parent card

This commit is contained in:
Abdalhamid Alhamad
2025-08-14 14:40:08 +03:00
parent c06086f899
commit e06642225a
29 changed files with 328 additions and 114 deletions

View File

@ -28,7 +28,7 @@ export class CardRepository {
}
getCardById(id: string): Promise<Card | null> {
return this.cardRepository.findOne({ where: { id } });
return this.cardRepository.findOne({ where: { id }, relations: ['account'] });
}
getCardByReferenceNumber(referenceNumber: string): Promise<Card | null> {
@ -42,9 +42,10 @@ export class CardRepository {
});
}
getActiveCardForCustomer(customerId: string): Promise<Card | null> {
getCardByCustomerId(customerId: string): Promise<Card | null> {
return this.cardRepository.findOne({
where: { customerId, status: CardStatus.ACTIVE },
where: { customerId },
relations: ['account'],
});
}