feat: create junior

This commit is contained in:
Abdalhamid Alhamad
2024-12-09 13:11:18 +03:00
parent 3fd29b3905
commit 970a41c895
35 changed files with 625 additions and 26 deletions
+7
View File
@@ -1,5 +1,6 @@
import { Column, Entity, OneToOne, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm';
import { User } from '~/auth/entities';
import { Junior } from '~/junior/entities';
import { DocumentType } from '../enums';
@Entity('documents')
@@ -19,6 +20,12 @@ export class Document {
@OneToOne(() => User, (user) => user.profilePicture, { onDelete: 'CASCADE' })
user!: User;
@OneToOne(() => Junior, (junior) => junior.civilIdFront, { onDelete: 'CASCADE' })
juniorCivilIdFront!: User;
@OneToOne(() => Junior, (junior) => junior.civilIdBack, { onDelete: 'CASCADE' })
juniorCivilIdBack!: User;
@UpdateDateColumn({ name: 'updated_at', type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' })
updatedAt!: Date;