refactor: 重构项目结构并优化类型定义
- 移除extension模块,将功能迁移至node-agent - 修复类型导出问题,使用export type明确类型导出 - 统一数据库连接方式,从直接导入改为使用config/database - 更新文档中的项目结构描述 - 添加多个服务的实用方法,如getForecast、getBalances等 - 修复类型错误和TS1205警告 - 优化RedisService调用方式 - 添加新的实体类型定义 - 更新审计日志格式,统一字段命名
This commit is contained in:
@@ -38,13 +38,17 @@ export class DynamicRecompositionService {
|
||||
|
||||
// 审计记录
|
||||
await AuditService.log({
|
||||
tenant_id: tenantId,
|
||||
tenantId: tenantId,
|
||||
action: 'SUPPLY_CHAIN_RECOMPOSITION_PROPOSED',
|
||||
target_type: 'SUPPLY_CHAIN',
|
||||
target_id: id.toString(),
|
||||
trace_id: traceId,
|
||||
new_data: JSON.stringify({ reason, proposedNodes: recompositionLogic.proposedNodes }),
|
||||
metadata: JSON.stringify({ logic: recompositionLogic.reasoning })
|
||||
module: 'SUPPLY_CHAIN',
|
||||
resourceType: 'SUPPLY_CHAIN',
|
||||
resourceId: id.toString(),
|
||||
traceId: traceId,
|
||||
userId: 'system',
|
||||
result: 'success',
|
||||
source: 'console',
|
||||
afterSnapshot: { reason, proposedNodes: recompositionLogic.proposedNodes },
|
||||
metadata: { logic: recompositionLogic.reasoning }
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -66,13 +70,17 @@ export class DynamicRecompositionService {
|
||||
|
||||
// 审计记录
|
||||
await AuditService.log({
|
||||
tenant_id: tenantId,
|
||||
tenantId: tenantId,
|
||||
action: 'SUPPLY_CHAIN_RECOMPOSITION_EXECUTED',
|
||||
target_type: 'SUPPLY_CHAIN',
|
||||
target_id: recompositionId.toString(),
|
||||
trace_id: traceId,
|
||||
new_data: JSON.stringify({ status: 'COMPLETED' }),
|
||||
metadata: JSON.stringify({ category: proposal.category })
|
||||
module: 'SUPPLY_CHAIN',
|
||||
resourceType: 'SUPPLY_CHAIN',
|
||||
resourceId: recompositionId.toString(),
|
||||
traceId: traceId,
|
||||
userId: 'system',
|
||||
result: 'success',
|
||||
source: 'console',
|
||||
afterSnapshot: { status: 'COMPLETED' },
|
||||
metadata: { category: proposal.category }
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user