import { Column, CreateDateColumn, Entity, PrimaryGeneratedColumn } from 'typeorm'
import { FileStatus } from '../enums/file-status.enum'

@Entity()
export class KnowledgeFile {
    @PrimaryGeneratedColumn()
    id: number

    @CreateDateColumn()
    createdAt: Date

    @Column()
    orgId: number

    @Column()
    knowledgeId: number

    @Column()
    fileName: string

    @Column()
    fileHash: string

    @Column()
    fileUrl: string

    @Column()
    fileType: string

    @Column()
    size: number

    @Column({ nullable: true })
    description: string

    @Column({ type: 'enum', enum: FileStatus, default: FileStatus.PENDING })
    status: FileStatus

    @Column({ nullable: true })
    error: string
}
