38 lines
695 B
TypeScript
38 lines
695 B
TypeScript
import { ApiProperty } from "@nestjs/swagger"
|
|
import { Player } from "@prisma/client"
|
|
import { Exclude } from 'class-transformer'
|
|
import { IsOptional } from "class-validator"
|
|
|
|
export class PlayerEntity implements Player {
|
|
constructor(partial: Partial<PlayerEntity>) {
|
|
Object.assign(this, partial)
|
|
}
|
|
|
|
/**
|
|
* Identifiant unique
|
|
*/
|
|
id: number
|
|
|
|
/**
|
|
* Nom de læ joueur⋅se
|
|
*/
|
|
name: string
|
|
|
|
/**
|
|
* Mot de passe hashé
|
|
*/
|
|
@Exclude()
|
|
password: string
|
|
|
|
/**
|
|
* Nombre de jetons dont dispose actuellement læ joueur⋅se
|
|
*/
|
|
money: number
|
|
|
|
/**
|
|
* Identifiant du défi en cours d'accomplissement
|
|
*/
|
|
@IsOptional()
|
|
activeChallengeId: number | null
|
|
}
|