feat(rfa-ai): Complete RFA Approval Refactor and AI Model Revision
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
// File: src/modules/ai/entities/migration-review-queue.entity.ts
|
||||
// Change Log
|
||||
// - 2026-05-15: เพิ่ม re-export สำหรับชื่อ entity ตาม ADR-023A tasks.md โดยไม่สร้าง metadata ซ้ำ.
|
||||
|
||||
export {
|
||||
MigrationReviewRecord as MigrationReviewQueueEntity,
|
||||
MigrationReviewRecord,
|
||||
MigrationReviewRecordStatus,
|
||||
} from './migration-review.entity';
|
||||
@@ -1,6 +1,7 @@
|
||||
// File: src/modules/ai/entities/migration-review.entity.ts
|
||||
// Change Log
|
||||
// - 2026-05-14: เพิ่ม entity staging queue สำหรับ Unified AI Architecture.
|
||||
// - 2026-05-15: เพิ่ม column สำหรับ ADR-023A migration_review_queue schema.
|
||||
import {
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
@@ -28,9 +29,34 @@ export class MigrationReviewRecord extends UuidBaseEntity {
|
||||
@Column({ name: 'batch_id', type: 'varchar', length: 100 })
|
||||
batchId!: string;
|
||||
|
||||
@Index('uq_migration_review_idempotency', { unique: true })
|
||||
@Column({
|
||||
name: 'idempotency_key',
|
||||
type: 'varchar',
|
||||
length: 200,
|
||||
nullable: true,
|
||||
})
|
||||
idempotencyKey?: string;
|
||||
|
||||
@Column({ name: 'original_file_name', type: 'varchar', length: 255 })
|
||||
originalFileName!: string;
|
||||
|
||||
@Column({
|
||||
name: 'original_filename',
|
||||
type: 'varchar',
|
||||
length: 500,
|
||||
nullable: true,
|
||||
})
|
||||
originalFilename?: string;
|
||||
|
||||
@Column({
|
||||
name: 'storage_temp_path',
|
||||
type: 'varchar',
|
||||
length: 1000,
|
||||
nullable: true,
|
||||
})
|
||||
storageTempPath?: string;
|
||||
|
||||
@Column({ name: 'source_attachment_public_id', type: 'uuid', nullable: true })
|
||||
sourceAttachmentPublicId?: string;
|
||||
|
||||
@@ -40,6 +66,9 @@ export class MigrationReviewRecord extends UuidBaseEntity {
|
||||
@Column({ name: 'extracted_metadata', type: 'json', nullable: true })
|
||||
extractedMetadata?: Record<string, unknown>;
|
||||
|
||||
@Column({ name: 'ai_metadata_json', type: 'json', nullable: true })
|
||||
aiMetadataJson?: Record<string, unknown>;
|
||||
|
||||
@Column({
|
||||
name: 'confidence_score',
|
||||
type: 'decimal',
|
||||
@@ -49,6 +78,9 @@ export class MigrationReviewRecord extends UuidBaseEntity {
|
||||
})
|
||||
confidenceScore?: number;
|
||||
|
||||
@Column({ name: 'ocr_used', type: 'boolean', default: false })
|
||||
ocrUsed!: boolean;
|
||||
|
||||
@Index('idx_migration_review_status')
|
||||
@Column({
|
||||
type: 'enum',
|
||||
@@ -60,6 +92,20 @@ export class MigrationReviewRecord extends UuidBaseEntity {
|
||||
@Column({ name: 'error_reason', type: 'text', nullable: true })
|
||||
errorReason?: string;
|
||||
|
||||
@Column({ name: 'reviewed_by', type: 'int', nullable: true })
|
||||
reviewedBy?: number;
|
||||
|
||||
@Column({ name: 'reviewed_at', type: 'datetime', nullable: true })
|
||||
reviewedAt?: Date;
|
||||
|
||||
@Column({
|
||||
name: 'rejection_reason',
|
||||
type: 'varchar',
|
||||
length: 500,
|
||||
nullable: true,
|
||||
})
|
||||
rejectionReason?: string;
|
||||
|
||||
@VersionColumn({ name: 'version' })
|
||||
version!: number;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user