mirror of
https://github.com/Kevsl/crypto-exchange-api.git
synced 2025-07-09 14:00:12 +02:00
added age on user
This commit is contained in:
parent
0ba8b52be3
commit
cf8fbe4fe5
2
prisma/migrations/20240611111548_added_age/migration.sql
Normal file
2
prisma/migrations/20240611111548_added_age/migration.sql
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE "User" ADD COLUMN "age" INTEGER NOT NULL DEFAULT 20;
|
@ -89,6 +89,7 @@ model User {
|
|||||||
isActive Boolean
|
isActive Boolean
|
||||||
city String
|
city String
|
||||||
dollarAvailables Float
|
dollarAvailables Float
|
||||||
|
age Int @default(20)
|
||||||
created_at DateTime @default(now())
|
created_at DateTime @default(now())
|
||||||
updated_at DateTime @updatedAt @default(now())
|
updated_at DateTime @updatedAt @default(now())
|
||||||
|
|
||||||
|
@ -41,6 +41,7 @@ export class AuthService {
|
|||||||
city: dto.city,
|
city: dto.city,
|
||||||
email: dto.email,
|
email: dto.email,
|
||||||
hash,
|
hash,
|
||||||
|
age: dto.age,
|
||||||
roleId: userRole.id,
|
roleId: userRole.id,
|
||||||
isActive: true,
|
isActive: true,
|
||||||
dollarAvailables: balance,
|
dollarAvailables: balance,
|
||||||
|
@ -1,10 +1,13 @@
|
|||||||
import { ApiProperty } from '@nestjs/swagger';
|
import { ApiProperty } from '@nestjs/swagger';
|
||||||
import {
|
import {
|
||||||
IsEmail,
|
IsEmail,
|
||||||
|
IsInt,
|
||||||
IsNotEmpty,
|
IsNotEmpty,
|
||||||
IsOptional,
|
IsOptional,
|
||||||
IsString,
|
IsString,
|
||||||
|
Max,
|
||||||
MaxLength,
|
MaxLength,
|
||||||
|
Min,
|
||||||
MinLength,
|
MinLength,
|
||||||
} from 'class-validator';
|
} from 'class-validator';
|
||||||
export class AuthRegisterDto {
|
export class AuthRegisterDto {
|
||||||
@ -78,4 +81,14 @@ export class AuthRegisterDto {
|
|||||||
})
|
})
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
promoCode: string;
|
promoCode: string;
|
||||||
|
|
||||||
|
@ApiProperty({
|
||||||
|
type: Number,
|
||||||
|
description: 'age',
|
||||||
|
example: 20,
|
||||||
|
})
|
||||||
|
@IsInt()
|
||||||
|
@Min(0)
|
||||||
|
@Max(120)
|
||||||
|
age: number;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user