DB 스키마 업데이트

This commit is contained in:
hyeonsu
2025-09-12 09:49:53 +09:00
parent 898866a2f0
commit 978a4937ad
4 changed files with 383 additions and 1 deletions

View File

@@ -2,6 +2,68 @@ import { apiClient, ApiResponse } from "./client";
// 테이블 간 데이터 관계 설정 관련 타입 정의
// 조건부 연결 관련 타입들
export interface ConditionControl {
triggerType: "insert" | "update" | "delete" | "insert_update";
conditionTree: ConditionNode;
}
export interface ConditionNode {
type: "group" | "condition";
operator?: "AND" | "OR";
children?: ConditionNode[];
field?: string;
operator_type?:
| "="
| "!="
| ">"
| "<"
| ">="
| "<="
| "LIKE"
| "NOT_LIKE"
| "CONTAINS"
| "STARTS_WITH"
| "ENDS_WITH"
| "IN"
| "NOT_IN"
| "IS_NULL"
| "IS_NOT_NULL"
| "BETWEEN"
| "NOT_BETWEEN";
value?: any;
dataType?: string;
}
export interface ConnectionCategory {
type: "simple-key" | "data-save" | "external-call" | "conditional-link";
rollbackOnError?: boolean;
enableLogging?: boolean;
maxRetryCount?: number;
}
export interface ExecutionPlan {
sourceTable: string;
targetActions: TargetAction[];
}
export interface TargetAction {
id: string;
actionType: "insert" | "update" | "delete" | "upsert";
targetTable: string;
enabled: boolean;
fieldMappings: FieldMapping[];
conditions?: ConditionNode;
description?: string;
}
export interface FieldMapping {
sourceField: string;
targetField: string;
transformFunction?: string;
defaultValue?: string;
}
export interface ColumnInfo {
columnName: string;
columnLabel?: string;
@@ -46,7 +108,7 @@ export interface TableRelationship {
to_table_name: string;
to_column_name: string;
relationship_type: "one-to-one" | "one-to-many" | "many-to-one" | "many-to-many";
connection_type: "simple-key" | "data-save" | "external-call";
connection_type: "simple-key" | "data-save" | "external-call" | "conditional-link";
settings?: Record<string, unknown>;
company_code: string;
is_active?: string;
@@ -98,6 +160,11 @@ export interface DataFlowDiagram {
relationshipCount: number;
tables: string[];
companyCode: string; // 회사 코드 추가
// 조건부 연결 관련 필드
control?: ConditionControl; // 조건 설정
category?: ConnectionCategory; // 연결 종류
plan?: ExecutionPlan; // 실행 계획
createdAt: Date;
createdBy: string;
updatedAt: Date;