- 删除 preflight_import 工具、预检卡、resolve 接口与 ui.import_preflight 事件 - 删除 imports.preflight 解析器与 PreflightReport 类型 - SYSTEM_PROMPT 改为上传 Excel 后直接确认列映射/策略并调用 start_import_wizard - 前端同步移除预检类型/组件/测试,保留导入向导
45 lines
1.4 KiB
TypeScript
45 lines
1.4 KiB
TypeScript
import { Column, CreateDateColumn, Entity, Index, PrimaryColumn, UpdateDateColumn } from 'typeorm';
|
|
import type { ImportRunSource, ImportRunStatus, ImportStepKey } from '../imports.types';
|
|
|
|
@Entity('import_runs')
|
|
@Index('idx_import_runs_user_created', ['userId', 'createdAt'])
|
|
export class ImportRun {
|
|
@PrimaryColumn({ type: 'varchar', length: 36 })
|
|
id: string;
|
|
|
|
@Column({ name: 'user_id', type: 'integer' })
|
|
userId: number;
|
|
|
|
@Column({ name: 'conversation_id', type: 'integer', nullable: true })
|
|
conversationId: number | null;
|
|
|
|
@Column({ type: 'varchar', length: 10, default: 'manual' })
|
|
source: ImportRunSource;
|
|
|
|
@Column({ name: 'file_name', type: 'varchar', length: 255 })
|
|
fileName: string;
|
|
|
|
/** Serialized sheet data — parsed rows are kept here for v1. */
|
|
@Column({ name: 'sheets_json', type: 'mediumtext' })
|
|
sheetsJson: string;
|
|
|
|
/** Serialized ImportRunSettings — mapping/policies confirmed by the user. */
|
|
@Column({ name: 'settings_json', type: 'text', nullable: true })
|
|
settingsJson: string | null;
|
|
|
|
@Column({ type: 'varchar', length: 20, default: 'preparing' })
|
|
status: ImportRunStatus;
|
|
|
|
@Column({ name: 'current_step_key', type: 'varchar', length: 20, nullable: true })
|
|
currentStepKey: ImportStepKey | null;
|
|
|
|
@Column({ type: 'varchar', length: 500, nullable: true })
|
|
error: string | null;
|
|
|
|
@CreateDateColumn({ name: 'created_at' })
|
|
createdAt: Date;
|
|
|
|
@UpdateDateColumn({ name: 'updated_at' })
|
|
updatedAt: Date;
|
|
}
|