2022-02-26 18:16:28 +01:00
|
|
|
import { Exclude, Expose } from 'class-transformer';
|
2022-02-26 16:06:32 +01:00
|
|
|
import {
|
|
|
|
|
IsDefined,
|
2022-02-26 18:16:28 +01:00
|
|
|
IsEmpty,
|
2022-02-26 16:06:32 +01:00
|
|
|
IsNotEmpty,
|
|
|
|
|
IsOptional,
|
|
|
|
|
} from 'class-validator';
|
2022-03-01 22:05:59 +01:00
|
|
|
// import { Column, Entity, Index, PrimaryGeneratedColumn } from 'typeorm';
|
2022-02-26 16:06:32 +01:00
|
|
|
|
2022-02-26 18:16:28 +01:00
|
|
|
// Different data for public and private
|
|
|
|
|
|
2022-03-01 22:05:59 +01:00
|
|
|
// @Entity()
|
2022-02-26 16:06:32 +01:00
|
|
|
export class EUser {
|
2022-03-01 22:05:59 +01:00
|
|
|
// @PrimaryGeneratedColumn()
|
2022-02-26 18:16:28 +01:00
|
|
|
@IsOptional()
|
|
|
|
|
id?: number;
|
2022-02-26 16:06:32 +01:00
|
|
|
|
2022-03-01 22:05:59 +01:00
|
|
|
// @Index()
|
|
|
|
|
// @Column({ unique: true })
|
2022-02-26 16:06:32 +01:00
|
|
|
@IsNotEmpty()
|
|
|
|
|
username: string;
|
|
|
|
|
|
2022-03-01 22:05:59 +01:00
|
|
|
// @Column({ default: false })
|
2022-02-26 16:06:32 +01:00
|
|
|
@IsDefined()
|
|
|
|
|
isAdmin: boolean;
|
|
|
|
|
|
2022-03-01 22:05:59 +01:00
|
|
|
// @Column({ select: false })
|
2022-02-26 16:06:32 +01:00
|
|
|
@IsOptional()
|
2022-02-26 18:16:28 +01:00
|
|
|
@Exclude()
|
2022-02-26 16:06:32 +01:00
|
|
|
password?: string;
|
|
|
|
|
}
|