import { Column, Entity, Index, PrimaryGeneratedColumn } from 'typeorm'; import { TimestampedEntity } from './timestamped.entity'; export enum InspectionReportFollowUpType { COMPANY_NOTE = 'COMPANY_NOTE', COMPANY_DOCUMENT = 'COMPANY_DOCUMENT', INTERNAL_NOTE = 'INTERNAL_NOTE', VERIFICATION = 'VERIFICATION', OTHER = 'OTHER', } @Entity({ name: 'inspection_report_follow_ups' }) @Index('idx_inspection_report_follow_ups_report_created', ['reportId', 'createdAt']) export class InspectionReportFollowUp extends TimestampedEntity { @PrimaryGeneratedColumn('uuid') id!: string; @Column({ name: 'report_id', type: 'uuid' }) reportId!: string; @Column({ type: 'varchar', length: 40 }) type!: InspectionReportFollowUpType; @Column({ name: 'external_reference', type: 'varchar', length: 255, nullable: true }) externalReference!: string | null; @Column({ name: 'occurred_at', type: 'timestamptz' }) occurredAt!: Date; @Column({ type: 'text', nullable: true }) description!: string | null; @Column({ name: 'original_name', type: 'varchar', length: 255, nullable: true }) originalName!: string | null; @Column({ name: 'stored_name', type: 'varchar', length: 255, nullable: true }) storedName!: string | null; @Column({ name: 'mime_type', type: 'varchar', length: 120, nullable: true }) mimeType!: string | null; @Column({ name: 'size_bytes', type: 'integer', nullable: true }) sizeBytes!: number | null; @Column({ name: 'sha256', type: 'char', length: 64, nullable: true }) sha256!: string | null; @Column({ name: 'created_by', type: 'uuid', nullable: true }) createdBy!: string | null; }