Ajout du user dans Shared
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import { IsEmail, IsNotEmpty, MinLength } from 'class-validator';
|
import { IsEmail, IsNotEmpty, MinLength } from 'class-validator';
|
||||||
|
import { ICreateUserDTO } from '@gim/shared';
|
||||||
|
|
||||||
export class CreateUserDto {
|
export class CreateUserDto implements ICreateUserDTO {
|
||||||
@IsEmail({}, { message: "L'email doit être valide" })
|
@IsEmail({}, { message: "L'email doit être valide" })
|
||||||
email!: string;
|
email!: string;
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { IUser } from '@gim/shared';
|
||||||
import {
|
import {
|
||||||
Entity,
|
Entity,
|
||||||
PrimaryGeneratedColumn,
|
PrimaryGeneratedColumn,
|
||||||
@@ -6,7 +7,7 @@ import {
|
|||||||
} from 'typeorm';
|
} from 'typeorm';
|
||||||
|
|
||||||
@Entity('utilisateurs')
|
@Entity('utilisateurs')
|
||||||
export class User {
|
export class User implements IUser {
|
||||||
@PrimaryGeneratedColumn('uuid')
|
@PrimaryGeneratedColumn('uuid')
|
||||||
id!: string;
|
id!: string;
|
||||||
|
|
||||||
|
|||||||
1
packages/shared/src/index.ts
Normal file
1
packages/shared/src/index.ts
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export * from './users/user.interface';
|
||||||
20
packages/shared/src/users/user.interface.ts
Normal file
20
packages/shared/src/users/user.interface.ts
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
/**
|
||||||
|
* Contrat pour les données envoyées lors de l'inscription
|
||||||
|
*/
|
||||||
|
export interface ICreateUserDTO {
|
||||||
|
email: string;
|
||||||
|
motDePasse: string;
|
||||||
|
nom: string;
|
||||||
|
prenom: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Contrat pour les données renvoyées par l'API (profil public)
|
||||||
|
*/
|
||||||
|
export interface IUser {
|
||||||
|
id: string;
|
||||||
|
email: string;
|
||||||
|
nom: string;
|
||||||
|
prenom: string;
|
||||||
|
dateCreation: Date;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user