deck card count added

This commit is contained in:
magdo
2025-10-20 19:13:50 +02:00
parent 99fa7ebd98
commit aa3587b60a
2 changed files with 10 additions and 1 deletions
@@ -15,6 +15,7 @@ export interface ShortDeckDto {
type: number; type: number;
playedNumber: number; playedNumber: number;
ctype: number; ctype: number;
cardsCount: number;
} }
export interface DetailDeckDto { export interface DetailDeckDto {
@@ -9,6 +9,7 @@ export class DeckMapper {
type: deck.type, type: deck.type,
playedNumber: deck.playedNumber, playedNumber: deck.playedNumber,
ctype: deck.ctype, ctype: deck.ctype,
cardsCount: deck.cards.length,
}; };
} }
@@ -26,6 +27,13 @@ export class DeckMapper {
} }
static toShortDtoList(decks: DeckAggregate[]): ShortDeckDto[] { static toShortDtoList(decks: DeckAggregate[]): ShortDeckDto[] {
return decks.map(this.toShortDto); return decks.map(deck => ({
id: deck.id,
name: deck.name,
type: deck.type,
playedNumber: deck.playedNumber,
ctype: deck.ctype,
cardsCount: deck.cards.length,
}));
} }
} }