260228:1427 20260228:14:00 workflow update
Build and Deploy / deploy (push) Successful in 2m37s

This commit is contained in:
admin
2026-02-28 14:27:33 +07:00
parent 276d06e950
commit efd5183906
6 changed files with 73 additions and 33 deletions
@@ -52,12 +52,26 @@ export class WorkflowEngineController {
return this.workflowService.createDefinition(dto);
}
@Get('definitions')
@ApiOperation({ summary: 'ดึง Workflow Definition ทั้งหมด' })
@RequirePermission('system.manage_all')
async getDefinitions() {
return this.workflowService.getDefinitions();
}
@Get('definitions/:id')
@ApiOperation({ summary: 'ดึง Workflow Definition ด้วย ID' })
@RequirePermission('system.manage_all')
async getDefinitionById(@Param('id') id: string) {
return this.workflowService.getDefinitionById(id);
}
@Patch('definitions/:id')
@ApiOperation({ summary: 'แก้ไข Workflow Definition (Re-compile DSL)' })
@RequirePermission('system.manage_all')
async updateDefinition(
@Param('id') id: string,
@Body() dto: UpdateWorkflowDefinitionDto,
@Body() dto: UpdateWorkflowDefinitionDto
) {
return this.workflowService.update(id, dto);
}
@@ -81,7 +95,7 @@ export class WorkflowEngineController {
async processTransition(
@Param('id') instanceId: string,
@Body() dto: WorkflowTransitionDto,
@Request() req: any,
@Request() req: any
) {
// ดึง User ID จาก Token (req.user มาจาก JwtStrategy)
const userId = req.user?.userId;
@@ -91,7 +105,7 @@ export class WorkflowEngineController {
dto.action,
userId,
dto.comment,
dto.payload,
dto.payload
);
}