Moved to a "cleaner" directory structure

ref #11
This commit is contained in:
2020-12-03 20:38:47 +01:00
parent 3a04bb54bd
commit e8727ca922
27 changed files with 145 additions and 145 deletions

View File

@@ -0,0 +1,44 @@
import { PrimaryGeneratedColumn, Column, OneToMany, Entity, ManyToOne } from "typeorm";
import {
IsInt,
IsNotEmpty,
IsOptional,
IsString,
} from "class-validator";
import { Permission } from "./Permission";
/**
* Defines the UserGroup interface.
*/
@Entity()
export abstract class UserGroup {
/**
* Autogenerated unique id (primary key).
*/
@PrimaryGeneratedColumn()
@IsOptional()
@IsInt()
id: number;
/**
* permissions
*/
@ManyToOne(() => Permission, permission => permission.groups, { nullable: true })
permissions: Permission[];
/**
* The group's name
*/
@Column()
@IsNotEmpty()
@IsString()
name: string;
/**
* The group's description
*/
@Column({nullable: true})
@IsOptional()
@IsString()
description?: string;
}