working on words

This commit is contained in:
2024-12-29 12:04:19 +01:00
commit 03d4a1ba26
8 changed files with 166 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
import { Expose, Type } from 'class-transformer';
import { ConceptResponseDTO } from './conceptresponse.dto';
export class ConceptInTurnResponseDTO {
constructor(partial: Partial<ConceptInTurnResponseDTO>) {
Object.assign(this, partial);
}
@Type(() => ConceptResponseDTO)
@Expose()
concept: ConceptResponseDTO;
@Expose()
order: number;
@Expose()
subconcept: number;
@Expose()
markers: number;
}
+13
View File
@@ -0,0 +1,13 @@
import { Expose } from 'class-transformer';
export class ConceptResponseDTO {
constructor(partial: Partial<ConceptResponseDTO>) {
Object.assign(this, partial);
}
@Expose()
id: number;
@Expose()
value: string;
}
+36
View File
@@ -0,0 +1,36 @@
import { Expose, Type } from 'class-transformer';
import { UserResponseDTO } from './userresponse.dto';
import { PlayerResponseDTO } from './playerresponse.dto';
import { ConceptInTurnResponseDTO } from './conceptinturnresponse.dto';
export class GameResponseDTO {
constructor(partial: Partial<GameResponseDTO>) {
Object.assign(this, partial);
this.owner = partial.owner;
this.players = partial.players;
this.currentPlayer = partial.currentPlayer;
this.currentConcepts = partial.currentConcepts;
}
@Expose()
id: number;
@Type(() => UserResponseDTO)
@Expose()
owner: UserResponseDTO;
@Type(() => PlayerResponseDTO)
@Expose()
players: PlayerResponseDTO[];
@Type(() => PlayerResponseDTO)
@Expose()
currentPlayer: PlayerResponseDTO;
@Expose()
started: boolean;
@Type(() => ConceptInTurnResponseDTO)
@Expose()
currentConcepts: ConceptInTurnResponseDTO[];
}
+16
View File
@@ -0,0 +1,16 @@
import { Expose, Type } from 'class-transformer';
import { UserResponseDTO } from './userresponse.dto';
export class PlayerResponseDTO {
constructor(partial: Partial<PlayerResponseDTO>) {
Object.assign(this, partial);
this.user = partial.user;
}
@Type(() => UserResponseDTO)
@Expose()
user: UserResponseDTO;
@Expose()
score: number;
}
+16
View File
@@ -0,0 +1,16 @@
import { Expose } from 'class-transformer';
export class UserResponseDTO {
constructor(partial: Partial<UserResponseDTO>) {
Object.assign(this, partial);
this.id = partial.id;
}
@Expose()
id: string;
@Expose()
username: string;
@Expose()
avatar: string;
}
+18
View File
@@ -0,0 +1,18 @@
import { Expose } from 'class-transformer';
export class WordResponseDTO {
constructor(partial: Partial<WordResponseDTO>) {
Object.assign(this, partial);
}
@Expose()
id: number;
@Expose()
value: string;
@Expose()
ownerId: string;
@Expose()
enabled: boolean;
}