feat(migration): ADR-028 migration architecture refactor
- เพิ่ม POST /api/ai/jobs + GET /api/ai/jobs/:jobId endpoints (FR-001, FR-002) - เพิ่ม BullMQ Worker MigrateDocumentWorker + OCR auto-detect (FR-003, FR-004) - เพิ่ม cleanup-temp-files + expire-pending-reviews workers (FR-005, FR-005a/b) - สร้าง SQL deltas: tags, correspondence_tags, alter migration_review_queue (FR-006, ADR-009) - เพิ่ม MigrationReviewService.commitRecord() + SELECT FOR UPDATE (FR-007, FR-007a) - เพิ่ม CASL permission migration.commit + MigrationReviewController (FR-007) - สร้าง TagsModule + TagsService + TagsController (US3) - สร้าง Migration Review Queue frontend page + ReviewQueueTable (US2) - อัปเดต n8n guide: deterministic Idempotency-Key + token pre-flight (FR-001a, FR-010a/b) - สร้าง spec.md, plan.md, tasks.md, data-model.md, contracts/, quickstart.md - สร้าง ADR-028 document + validation-report.md (PASS 32/32 tasks, 173/173 tests)
This commit is contained in:
@@ -1,7 +1,12 @@
|
||||
// File: types/migration.ts
|
||||
// Change Log:
|
||||
// - 2026-05-22: Initial creation and update for ADR-019 compatibility and added subject fields
|
||||
|
||||
export enum MigrationReviewStatus {
|
||||
PENDING = 'PENDING',
|
||||
APPROVED = 'APPROVED',
|
||||
REJECTED = 'REJECTED',
|
||||
IMPORTED = 'IMPORTED',
|
||||
}
|
||||
|
||||
export interface MigrationReviewQueueItem {
|
||||
@@ -10,9 +15,12 @@ export interface MigrationReviewQueueItem {
|
||||
documentNumber: string;
|
||||
title?: string;
|
||||
originalTitle?: string;
|
||||
subject?: string;
|
||||
originalSubject?: string;
|
||||
body?: string;
|
||||
aiSuggestedCategory?: string;
|
||||
aiConfidence?: number;
|
||||
aiIssues?: Record<string, unknown>;
|
||||
aiIssues?: Record<string, unknown>[];
|
||||
reviewReason?: string;
|
||||
status: MigrationReviewStatus;
|
||||
reviewedBy?: string;
|
||||
@@ -25,7 +33,7 @@ export interface MigrationReviewQueueItem {
|
||||
issuedDate?: string;
|
||||
remarks?: string;
|
||||
aiSummary?: string;
|
||||
extractedTags?: Record<string, unknown>;
|
||||
extractedTags?: Record<string, unknown>[];
|
||||
tempAttachmentId?: number | string; // ADR-019: Accept UUID
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user