added age on user

This commit is contained in:
Kevsl 2024-06-11 13:16:35 +02:00
parent 0ba8b52be3
commit cf8fbe4fe5
4 changed files with 17 additions and 0 deletions

View File

@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "User" ADD COLUMN "age" INTEGER NOT NULL DEFAULT 20;

View File

@ -89,6 +89,7 @@ model User {
isActive Boolean
city String
dollarAvailables Float
age Int @default(20)
created_at DateTime @default(now())
updated_at DateTime @updatedAt @default(now())

View File

@ -41,6 +41,7 @@ export class AuthService {
city: dto.city,
email: dto.email,
hash,
age: dto.age,
roleId: userRole.id,
isActive: true,
dollarAvailables: balance,

View File

@ -1,10 +1,13 @@
import { ApiProperty } from '@nestjs/swagger';
import {
IsEmail,
IsInt,
IsNotEmpty,
IsOptional,
IsString,
Max,
MaxLength,
Min,
MinLength,
} from 'class-validator';
export class AuthRegisterDto {
@ -78,4 +81,14 @@ export class AuthRegisterDto {
})
@IsOptional()
promoCode: string;
@ApiProperty({
type: Number,
description: 'age',
example: 20,
})
@IsInt()
@Min(0)
@Max(120)
age: number;
}