@@ -1,14 +1,17 @@
 | 
			
		||||
import {
 | 
			
		||||
  IsEnum,
 | 
			
		||||
  IsInt,
 | 
			
		||||
  IsNotEmpty,
 | 
			
		||||
  IsOptional,
 | 
			
		||||
  IsString
 | 
			
		||||
} from "class-validator";
 | 
			
		||||
import { Column, Entity, ManyToOne, PrimaryGeneratedColumn } from "typeorm";
 | 
			
		||||
import { PermissionAction } from '../enums/PermissionAction';
 | 
			
		||||
import { User } from './User';
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Defines the UserAction interface.
 | 
			
		||||
 * Defines the UserAction entity.
 | 
			
		||||
 * Will later be used to document a user's actions.
 | 
			
		||||
*/
 | 
			
		||||
@Entity()
 | 
			
		||||
export class UserAction {
 | 
			
		||||
@@ -20,7 +23,7 @@ export class UserAction {
 | 
			
		||||
  id: number;
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
   * user
 | 
			
		||||
   * The user that performed the action.
 | 
			
		||||
   */
 | 
			
		||||
  @ManyToOne(() => User, user => user.actions)
 | 
			
		||||
  user: User
 | 
			
		||||
@@ -34,15 +37,16 @@ export class UserAction {
 | 
			
		||||
  target: string;
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
   * The actions's action (e.g. UPDATE)
 | 
			
		||||
   * The actions's action (e.g. UPDATE).
 | 
			
		||||
   * Directly pulled from the PermissionAction Enum.
 | 
			
		||||
   */
 | 
			
		||||
  @Column()
 | 
			
		||||
  @IsNotEmpty()
 | 
			
		||||
  @IsString()
 | 
			
		||||
  action: string;
 | 
			
		||||
  @Column({ type: 'varchar' })
 | 
			
		||||
  @IsEnum(PermissionAction)
 | 
			
		||||
  action: PermissionAction;
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
   * The description of change (before-> after; e.g. distance:15->17)
 | 
			
		||||
   * The description of the change (before-> after; e.g. distance:15->17).
 | 
			
		||||
   * Will later be defined in more detail.
 | 
			
		||||
   */
 | 
			
		||||
  @Column({ nullable: true })
 | 
			
		||||
  @IsOptional()
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user