feat: Sprint 1 — backend fondations TetaRdPG
Auth SuperOAuth (JWT validation + httpOnly cookie), entités users/characters/level_thresholds, lazy calculation endurance, seed 100 niveaux, config prod-ready (trust proxy, helmet, CORS, rate limit). Validé : health 200, auth flow, character CRUD, endurance lazy, 401 sans cookie.
This commit is contained in:
35
src/character/dto/create-character.dto.ts
Normal file
35
src/character/dto/create-character.dto.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import { IsInt, IsString, Length, Min, Max } from 'class-validator';
|
||||
|
||||
// 5 points de stats à répartir — chaque stat démarre à 1
|
||||
// Contrainte : force + agilite + intelligence + chance + vitalite = 10 (5 base + 5 extra)
|
||||
// Validé dans le service
|
||||
export class CreateCharacterDto {
|
||||
@IsString()
|
||||
@Length(2, 100)
|
||||
name: string;
|
||||
|
||||
@IsInt()
|
||||
@Min(1)
|
||||
@Max(6)
|
||||
force: number;
|
||||
|
||||
@IsInt()
|
||||
@Min(1)
|
||||
@Max(6)
|
||||
agilite: number;
|
||||
|
||||
@IsInt()
|
||||
@Min(1)
|
||||
@Max(6)
|
||||
intelligence: number;
|
||||
|
||||
@IsInt()
|
||||
@Min(1)
|
||||
@Max(6)
|
||||
chance: number;
|
||||
|
||||
@IsInt()
|
||||
@Min(1)
|
||||
@Max(6)
|
||||
vitalite: number;
|
||||
}
|
||||
Reference in New Issue
Block a user