feat: tasks jounrey

This commit is contained in:
Abdalhamid Alhamad
2024-12-11 10:27:51 +03:00
parent d539073f29
commit 749ee5457f
27 changed files with 654 additions and 3 deletions
+8
View File
@@ -1,6 +1,8 @@
import { Column, Entity, OneToMany, OneToOne, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm';
import { User } from '~/auth/entities';
import { Junior, Theme } from '~/junior/entities';
import { Task } from '~/task/entities';
import { TaskSubmission } from '~/task/entities/task-submissions.entity';
import { DocumentType } from '../enums';
@Entity('documents')
@@ -29,6 +31,12 @@ export class Document {
@OneToMany(() => Theme, (theme) => theme.avatar)
themes?: Theme[];
@OneToMany(() => Task, (task) => task.image)
tasks?: Task[];
@OneToMany(() => TaskSubmission, (taskSubmission) => taskSubmission.proofOfCompletion)
submissions?: TaskSubmission[];
@UpdateDateColumn({ name: 'updated_at', type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' })
updatedAt!: Date;