Files
dh-inspeccion-v2/api-v3/src/database/entities/inspection-act-closure.entity.ts
T

52 lines
1.6 KiB
TypeScript

import { Column, Entity, PrimaryColumn } from 'typeorm';
export enum InspectionActUploadMode {
IMMEDIATE = 'IMMEDIATE',
DEFERRED = 'DEFERRED',
}
@Entity({ name: 'inspection_act_closures' })
export class InspectionActClosure {
@PrimaryColumn({ name: 'act_id', type: 'uuid' })
actId!: string;
@Column({ name: 'schema_version', type: 'varchar', length: 40 })
schemaVersion!: string;
@Column({ name: 'prepared_snapshot', type: 'jsonb' })
preparedSnapshot!: Record<string, unknown>;
@Column({ name: 'prepared_sha256', type: 'char', length: 64 })
preparedSha256!: string;
@Column({ name: 'prepared_at', type: 'timestamptz' })
preparedAt!: Date;
@Column({ name: 'prepared_by', type: 'uuid' })
preparedBy!: string;
@Column({ name: 'final_snapshot', type: 'jsonb', nullable: true })
finalSnapshot!: Record<string, unknown> | null;
@Column({ name: 'final_sha256', type: 'char', length: 64, nullable: true })
finalSha256!: string | null;
@Column({ name: 'device_closed_at', type: 'timestamptz', nullable: true })
deviceClosedAt!: Date | null;
@Column({ name: 'server_closed_at', type: 'timestamptz', nullable: true })
serverClosedAt!: Date | null;
@Column({ name: 'upload_mode', type: 'varchar', length: 20, nullable: true })
uploadMode!: InspectionActUploadMode | null;
@Column({ name: 'closed_by', type: 'uuid', nullable: true })
closedBy!: string | null;
@Column({ name: 'created_at', type: 'timestamptz', default: () => 'CURRENT_TIMESTAMP' })
createdAt!: Date;
@Column({ name: 'updated_at', type: 'timestamptz', default: () => 'CURRENT_TIMESTAMP' })
updatedAt!: Date;
}