move api to separate repository
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
import { Link } from 'src/links/entities/links.entity';
|
||||
import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from 'typeorm';
|
||||
|
||||
export enum UserRole {
|
||||
ADMIN = 'admin',
|
||||
STANDARD = 'standard',
|
||||
}
|
||||
|
||||
@Entity('Users')
|
||||
export class User {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column()
|
||||
name: string;
|
||||
|
||||
@Column()
|
||||
password: string;
|
||||
|
||||
@Column({ unique: true })
|
||||
email: string;
|
||||
|
||||
@Column({
|
||||
type: 'enum',
|
||||
enum: UserRole,
|
||||
default: UserRole.STANDARD,
|
||||
})
|
||||
role: UserRole;
|
||||
|
||||
@OneToMany(() => Link, (link) => link.user)
|
||||
links: Link[];
|
||||
}
|
||||
Reference in New Issue
Block a user