Initial commit with Email Import Wizard and Task Processor updates
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
Index,
|
||||
} from 'typeorm';
|
||||
|
||||
export type InboxSource = 'all' | 'user';
|
||||
|
||||
export interface StoredQrCode {
|
||||
page: number;
|
||||
value: string;
|
||||
}
|
||||
|
||||
@Entity('inbox_documents')
|
||||
@Index(['Source', 'OwnerUsername'])
|
||||
export class InboxDocument {
|
||||
@PrimaryColumn({ type: 'char', length: 36 })
|
||||
Id!: string;
|
||||
|
||||
@Column({ type: 'varchar', length: 255 })
|
||||
OriginalName!: string;
|
||||
|
||||
@Column({ type: 'varchar', length: 10 })
|
||||
Source!: InboxSource;
|
||||
|
||||
@Column({ type: 'varchar', length: 100, nullable: true })
|
||||
OwnerUsername!: string | null;
|
||||
|
||||
@Column({ type: 'int', default: 0 })
|
||||
PageCount!: number;
|
||||
|
||||
@Column({ type: 'json' })
|
||||
QrCodes!: StoredQrCode[];
|
||||
|
||||
@Column({
|
||||
type: 'json',
|
||||
nullable: true,
|
||||
transformer: {
|
||||
to: (v: number[] | null | undefined) => (v && v.length ? v : null),
|
||||
from: (v: number[] | null) => v ?? [],
|
||||
},
|
||||
})
|
||||
DeletedPages!: number[];
|
||||
|
||||
@Column({
|
||||
type: 'json',
|
||||
nullable: true,
|
||||
transformer: {
|
||||
to: (v: Record<string, number> | null | undefined) =>
|
||||
v && Object.keys(v).length ? v : null,
|
||||
from: (v: Record<string, number> | null) => v ?? {},
|
||||
},
|
||||
})
|
||||
Rotations!: Record<string, number>;
|
||||
|
||||
@CreateDateColumn()
|
||||
CreatedAt!: Date;
|
||||
|
||||
@UpdateDateColumn()
|
||||
UpdatedAt!: Date;
|
||||
}
|
||||
Reference in New Issue
Block a user