690503:0135 Update workflow #01
CI / CD Pipeline / build (push) Failing after 6m6s
CI / CD Pipeline / deploy (push) Has been skipped

This commit is contained in:
2026-05-03 01:35:05 +07:00
parent d239b58387
commit 2c24991f88
85 changed files with 6335 additions and 100 deletions
+9 -1
View File
@@ -67,10 +67,18 @@ export function useWorkflowAction(instanceId: string | undefined) {
return;
}
// Clarify Q1: 409 Conflict (ไม่อยู่ในสถานะที่อนุญาตให้อัปโหลด)
// Clarify Q1: 409 Conflict (state violation หรือ optimistic lock conflict)
if (statusCode === 409) {
// M3: reset idempotency key — user intent กับ state เดิมใช้ไม่ได้แล้ว
setIdempotencyKey(uuidv4());
// FR-002: Optimistic lock conflict — แสดง message เฉพาะเพื่อบอก user ให้ refresh
const isVersionConflict = error.error.code === 'WORKFLOW_VERSION_CONFLICT';
if (isVersionConflict) {
toast.error('เอกสารถูกอนุมัติโดยผู้อื่นแล้ว กรุณารีเฟรช', {
description: 'ข้อมูลที่คุณกำลังดูอาจล้าสมัย กรุณาโหลดหน้าใหม่แล้วลองอีกครั้ง',
});
return;
}
toast.error(message || 'ไม่สามารถดำเนินการในสถานะนี้ได้', {
description: recoveryActions?.[0],
});
+8
View File
@@ -77,3 +77,11 @@ export const useGetAvailableActions = () => {
mutationFn: (data: GetAvailableActionsDto) => workflowEngineService.getAvailableActions(data),
});
};
// FR-025: Inline DSL validation (POST /workflow-engine/definitions/validate)
export const useValidateDsl = () => {
return useMutation({
mutationFn: (dsl: Record<string, unknown>) =>
workflowEngineService.validateDsl(dsl),
});
};