Files
paperlessmanager/paperless-backend/src/database/entities/attachment.entity.ts
T
bjoernpoettker dad0136365
Build and Push Multi-Platform Images / build-and-push (push) Successful in 41s
chore: apply ESLint auto-fix across entire backend
Reformats code style (line breaks, indentation, type annotations)
without changing logic. Also includes minor feature additions bundled
in the same lint run (stats service, user-settings groups, agrarmonitor
polling improvements).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-08 09:02:02 +02:00

63 lines
1.4 KiB
TypeScript

import {
Entity,
PrimaryGeneratedColumn,
Column,
ManyToOne,
OneToOne,
JoinColumn,
Index,
} from 'typeorm';
import { Email } from './email.entity';
import { Content } from './content.entity';
@Entity('Attachments')
export class Attachment {
@PrimaryGeneratedColumn({ type: 'int' })
Id!: number;
@Index('IX_Attachments_EmailMessageId')
@Column({ type: 'int' })
EmailMessageId!: number;
@Column({ type: 'varchar', length: 255 })
FileName!: string;
@Column({ type: 'varchar', length: 100 })
ContentType!: string;
@Column({ type: 'tinyint', width: 1 })
Erechnung!: boolean;
@Column({ type: 'varchar', length: 32, default: '' })
Checksum!: string;
@Column({ type: 'varchar', length: 255, nullable: true })
ContentId!: string | null;
@Column({ type: 'tinyint', width: 1 })
IsEmbedded!: boolean;
@Index('IX_Attachments_ParentId')
@Column({ type: 'int', nullable: true })
ParentId!: number | null;
@Column({ type: 'json', nullable: true })
PaperlessDocumentIds!: any | null;
@Column({ type: 'int', default: 0 })
ImportStatus!: number;
@Column({ type: 'varchar', length: 255, nullable: true })
InterneBelegnummer!: string | null;
@Column({ type: 'int', default: 0 })
PageCount!: number;
@ManyToOne(() => Email, (email) => email.Attachments)
@JoinColumn({ name: 'EmailMessageId' })
EmailMessage!: Email;
@OneToOne(() => Content, (content) => content.AttachmentEntity)
Content!: Content;
}