feat: get card by child id

This commit is contained in:
Abdalhameed Ahmad
2025-09-15 08:47:56 +03:00
parent 872d231f72
commit df4d2e3c1f
5 changed files with 29 additions and 2 deletions

View File

@ -63,6 +63,15 @@ export class CardService {
return this.getCardById(createdCard.id);
}
async getCardByChildId(guardianId: string, childId: string): Promise<Card> {
const card = await this.cardRepository.findCardByChildId(guardianId, childId);
if (!card) {
throw new BadRequestException('CARD.NOT_FOUND');
}
await this.prepareJuniorImages([card]);
return card;
}
async getCardById(id: string): Promise<Card> {
const card = await this.cardRepository.getCardById(id);