🚧 UserAction
This commit is contained in:
		
							
								
								
									
										48
									
								
								src/models/UserAction.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										48
									
								
								src/models/UserAction.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,48 @@
 | 
			
		||||
import { PrimaryGeneratedColumn, Column, OneToMany, Entity } from "typeorm";
 | 
			
		||||
import {
 | 
			
		||||
  IsInt,
 | 
			
		||||
  IsNotEmpty,
 | 
			
		||||
  IsOptional,
 | 
			
		||||
  IsString,
 | 
			
		||||
} from "class-validator";
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Defines the UserAction interface.
 | 
			
		||||
*/
 | 
			
		||||
@Entity()
 | 
			
		||||
export class UserAction {
 | 
			
		||||
  /**
 | 
			
		||||
   * Autogenerated unique id (primary key).
 | 
			
		||||
   */
 | 
			
		||||
  @PrimaryGeneratedColumn()
 | 
			
		||||
  @IsOptional()
 | 
			
		||||
  @IsInt()
 | 
			
		||||
  id: number;
 | 
			
		||||
 | 
			
		||||
  // TODO:
 | 
			
		||||
  // user: relation
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
   * The actions's target (e.g. Track#2)
 | 
			
		||||
   */
 | 
			
		||||
  @Column()
 | 
			
		||||
  @IsNotEmpty()
 | 
			
		||||
  @IsString()
 | 
			
		||||
  target: string;
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
   * The actions's action (e.g. UPDATE)
 | 
			
		||||
   */
 | 
			
		||||
  @Column()
 | 
			
		||||
  @IsNotEmpty()
 | 
			
		||||
  @IsString()
 | 
			
		||||
  action: string;
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
   * The description of change (before-> after; e.g. distance:15->17)
 | 
			
		||||
   */
 | 
			
		||||
  @Column()
 | 
			
		||||
  @IsOptional()
 | 
			
		||||
  @IsString()
 | 
			
		||||
  changed: string;
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user