Compare commits
No commits in common. "d47983a032c5bb4d4b2958cc013df0b92ece2844" and "932e782a14454a05aa59f9b76c7c9638aa440385" have entirely different histories.
d47983a032
...
932e782a14
@ -1,99 +0,0 @@
|
||||
import { Entity, Column, OneToMany, ManyToOne, PrimaryGeneratedColumn, Generated, Unique } from "typeorm";
|
||||
import { IsBoolean, IsEmail, IsInt, IsNotEmpty, IsOptional, IsString, isUUID, } from "class-validator";
|
||||
import { UserGroup } from './UserGroup';
|
||||
|
||||
/**
|
||||
* Defines a admin user.
|
||||
*/
|
||||
@Entity()
|
||||
export class User {
|
||||
/**
|
||||
* autogenerated unique id (primary key).
|
||||
*/
|
||||
@PrimaryGeneratedColumn()
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
id: number;
|
||||
|
||||
/**
|
||||
* autogenerated uuid
|
||||
*/
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
@Generated("uuid")
|
||||
uuid: string;
|
||||
|
||||
/**
|
||||
* user email
|
||||
*/
|
||||
@IsEmail()
|
||||
email: string;
|
||||
|
||||
/**
|
||||
* username
|
||||
*/
|
||||
@IsString()
|
||||
username: string;
|
||||
|
||||
/**
|
||||
* firstname
|
||||
*/
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
firstname: string;
|
||||
|
||||
/**
|
||||
* middlename
|
||||
*/
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
middlename: string;
|
||||
|
||||
/**
|
||||
* lastname
|
||||
*/
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
lastname: string;
|
||||
|
||||
/**
|
||||
* password
|
||||
*/
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
password: string;
|
||||
|
||||
/**
|
||||
* userpermissions
|
||||
*/
|
||||
// TODO: UserPermission implementation
|
||||
// @OneToMany(() => UserPermission,userpermission=>)
|
||||
// userpermissions: UserPermission[];
|
||||
|
||||
/**
|
||||
* groups
|
||||
*/
|
||||
// TODO: UserGroup implementation
|
||||
// @OneToMany(() => UserGroup, usergroup => usergroup.)
|
||||
@IsOptional()
|
||||
groups: UserGroup[];
|
||||
|
||||
/**
|
||||
* is user enabled?
|
||||
*/
|
||||
@IsBoolean()
|
||||
enabled: boolean;
|
||||
|
||||
/**
|
||||
* jwt refresh count
|
||||
*/
|
||||
@IsInt()
|
||||
@Column({ default: 1 })
|
||||
refreshTokenCount: number;
|
||||
|
||||
/**
|
||||
* profilepic
|
||||
*/
|
||||
@IsString()
|
||||
profilepic: string;
|
||||
}
|
@ -1,44 +0,0 @@
|
||||
import { PrimaryGeneratedColumn, Column, OneToMany, Entity } from "typeorm";
|
||||
import {
|
||||
IsInt,
|
||||
IsNotEmpty,
|
||||
IsOptional,
|
||||
IsString,
|
||||
} from "class-validator";
|
||||
import { User } from "./User";
|
||||
|
||||
/**
|
||||
* Defines the UserGroup interface.
|
||||
*/
|
||||
@Entity()
|
||||
export abstract class UserGroup {
|
||||
/**
|
||||
* Autogenerated unique id (primary key).
|
||||
*/
|
||||
@PrimaryGeneratedColumn()
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
id: number;
|
||||
|
||||
/**
|
||||
* The group's name
|
||||
*/
|
||||
@Column()
|
||||
@IsNotEmpty()
|
||||
@IsString()
|
||||
name: string;
|
||||
|
||||
/**
|
||||
* The group's description
|
||||
*/
|
||||
@Column()
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
description: string;
|
||||
|
||||
/**
|
||||
* Used to link users to a user group.
|
||||
*/
|
||||
// TODO:
|
||||
// grouppermissions: GroupPermissions[];
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user