Spaces:
Sleeping
Sleeping
| import { | |
| Entity, | |
| PrimaryGeneratedColumn, | |
| Column, | |
| ManyToOne, | |
| JoinColumn, | |
| CreateDateColumn, | |
| } from 'typeorm'; | |
| import { User } from '../../auth/entities/user.entity'; | |
| export enum ActivityType { | |
| LOGIN = 'login', | |
| LOGOUT = 'logout', | |
| VIEW = 'view', | |
| SUBMIT = 'submit', | |
| DOWNLOAD = 'download', | |
| UPLOAD = 'upload', | |
| CHAT = 'chat', | |
| QUIZ = 'quiz', | |
| OTHER = 'other', | |
| } | |
| ('activity_logs') | |
| export class ActivityLog { | |
| ({ | |
| name: 'log_id', | |
| type: 'bigint', | |
| unsigned: true, | |
| }) | |
| logId: number; | |
| ({ name: 'user_id', type: 'bigint', unsigned: true }) | |
| userId: number; | |
| ({ name: 'activity_type', type: 'enum', enum: ActivityType }) | |
| activityType: ActivityType; | |
| ({ | |
| name: 'entity_type', | |
| type: 'varchar', | |
| length: 50, | |
| nullable: true, | |
| }) | |
| entityType: string; | |
| ({ | |
| name: 'entity_id', | |
| type: 'bigint', | |
| unsigned: true, | |
| nullable: true, | |
| }) | |
| entityId: number; | |
| ({ name: 'description', type: 'text', nullable: true }) | |
| description: string; | |
| ({ name: 'ip_address', type: 'varchar', length: 45, nullable: true }) | |
| ipAddress: string; | |
| ({ name: 'user_agent', type: 'text', nullable: true }) | |
| userAgent: string; | |
| ({ | |
| name: 'session_duration_minutes', | |
| type: 'int', | |
| nullable: true, | |
| }) | |
| sessionDurationMinutes: number; | |
| ({ name: 'created_at' }) | |
| createdAt: Date; | |
| (() => User) | |
| ({ name: 'user_id' }) | |
| user: User; | |
| } | |