플로우 각 단계별 컬럼 설정기능
This commit is contained in:
@@ -26,9 +26,9 @@ export class FlowStepService {
|
||||
flow_definition_id, step_name, step_order, table_name, condition_json,
|
||||
color, position_x, position_y, move_type, status_column, status_value,
|
||||
target_table, field_mappings, required_fields,
|
||||
integration_type, integration_config
|
||||
integration_type, integration_config, display_config
|
||||
)
|
||||
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16)
|
||||
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17)
|
||||
RETURNING *
|
||||
`;
|
||||
|
||||
@@ -51,6 +51,7 @@ export class FlowStepService {
|
||||
request.integrationConfig
|
||||
? JSON.stringify(request.integrationConfig)
|
||||
: null,
|
||||
request.displayConfig ? JSON.stringify(request.displayConfig) : null,
|
||||
]);
|
||||
|
||||
return this.mapToFlowStep(result[0]);
|
||||
@@ -209,6 +210,15 @@ export class FlowStepService {
|
||||
paramIndex++;
|
||||
}
|
||||
|
||||
// 표시 설정 (displayConfig)
|
||||
if (request.displayConfig !== undefined) {
|
||||
fields.push(`display_config = $${paramIndex}`);
|
||||
params.push(
|
||||
request.displayConfig ? JSON.stringify(request.displayConfig) : null
|
||||
);
|
||||
paramIndex++;
|
||||
}
|
||||
|
||||
if (fields.length === 0) {
|
||||
return this.findById(id);
|
||||
}
|
||||
@@ -262,6 +272,17 @@ export class FlowStepService {
|
||||
* DB 행을 FlowStep 객체로 변환
|
||||
*/
|
||||
private mapToFlowStep(row: any): FlowStep {
|
||||
// JSONB 필드는 pg 라이브러리가 자동으로 파싱해줌
|
||||
const displayConfig = row.display_config;
|
||||
|
||||
// 디버깅 로그 (개발 환경에서만)
|
||||
if (displayConfig && process.env.NODE_ENV === "development") {
|
||||
console.log(`🔍 [FlowStep ${row.id}] displayConfig:`, {
|
||||
type: typeof displayConfig,
|
||||
value: displayConfig,
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
id: row.id,
|
||||
flowDefinitionId: row.flow_definition_id,
|
||||
@@ -282,6 +303,8 @@ export class FlowStepService {
|
||||
// 외부 연동 필드
|
||||
integrationType: row.integration_type || "internal",
|
||||
integrationConfig: row.integration_config || undefined,
|
||||
// 표시 설정
|
||||
displayConfig: displayConfig || undefined,
|
||||
createdAt: row.created_at,
|
||||
updatedAt: row.updated_at,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user