Spaces:
Sleeping
Sleeping
File size: 903 Bytes
9ffaa46 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | import {
Entity,
PrimaryGeneratedColumn,
Column,
CreateDateColumn,
ManyToOne,
JoinColumn,
} from 'typeorm';
import { User } from '../../users/user.entity';
export enum DocumentType {
COVER_LETTER = 'cover_letter',
PROFESSIONAL_EMAIL = 'professional_email',
UNIVERSITY_STATEMENT = 'university_statement',
}
@Entity('generated_documents')
export class GeneratedDocument {
@PrimaryGeneratedColumn('uuid')
id: string;
@Column({ type: 'uuid' })
userId: string;
@ManyToOne(() => User, { onDelete: 'CASCADE' })
@JoinColumn({ name: 'userId' })
user: User;
@Column({ type: 'enum', enum: DocumentType })
documentType: DocumentType;
@Column({ type: 'jsonb' })
formData: Record<string, any>;
@Column({ type: 'text' })
content: string;
@Column({ type: 'varchar', length: 200, nullable: true })
title: string | null;
@CreateDateColumn()
createdAt: Date;
}
|