690414:1113 Update README.md /.agents/skills, /.windsurf/workflows
This commit is contained in:
@@ -43,6 +43,15 @@ export const transmittalService = {
|
||||
return response.data;
|
||||
},
|
||||
|
||||
/**
|
||||
* Submit Transmittal to Workflow (EC-RFA-004 validation fires on backend)
|
||||
* POST /transmittals/:uuid/submit
|
||||
*/
|
||||
submit: async (uuid: string): Promise<{ instanceId: string; currentState: string }> => {
|
||||
const response = await apiClient.post(`/transmittals/${uuid}/submit`);
|
||||
return response.data?.data ?? response.data;
|
||||
},
|
||||
|
||||
/**
|
||||
* ลบเอกสาร (Soft Delete)
|
||||
*/
|
||||
|
||||
@@ -5,9 +5,10 @@ import {
|
||||
UpdateWorkflowDefinitionDto,
|
||||
EvaluateWorkflowDto,
|
||||
GetAvailableActionsDto,
|
||||
WorkflowTransitionWithAttachmentsDto,
|
||||
} from '@/types/dto/workflow-engine/workflow-engine.dto';
|
||||
|
||||
import { Workflow, WorkflowType } from '@/types/workflow';
|
||||
import { Workflow, WorkflowHistoryItem, WorkflowType } from '@/types/workflow';
|
||||
|
||||
interface WorkflowResponseShape {
|
||||
data?: unknown;
|
||||
@@ -185,4 +186,35 @@ export const workflowEngineService = {
|
||||
const response = await apiClient.delete(`/workflow-engine/definitions/${id}`);
|
||||
return response.data?.data || response.data;
|
||||
},
|
||||
|
||||
// --- ADR-021: Workflow Transition + History ---
|
||||
|
||||
/**
|
||||
* ส่ง Action เพื่อเปลี่ยนสถานะ Workflow (พร้อมไฟล์แนบและ Idempotency-Key)
|
||||
* POST /workflow-engine/instances/:id/transition
|
||||
*/
|
||||
transition: async (
|
||||
instanceId: string,
|
||||
dto: WorkflowTransitionWithAttachmentsDto,
|
||||
idempotencyKey: string
|
||||
) => {
|
||||
const response = await apiClient.post(
|
||||
`/workflow-engine/instances/${instanceId}/transition`,
|
||||
dto,
|
||||
{ headers: { 'Idempotency-Key': idempotencyKey } }
|
||||
);
|
||||
return response.data?.data ?? response.data;
|
||||
},
|
||||
|
||||
/**
|
||||
* ดึงประวัติ Workflow พร้อมไฟล์แนบประจำ Step
|
||||
* GET /workflow-engine/instances/:id/history
|
||||
*/
|
||||
getHistory: async (instanceId: string): Promise<WorkflowHistoryItem[]> => {
|
||||
const response = await apiClient.get(
|
||||
`/workflow-engine/instances/${instanceId}/history`
|
||||
);
|
||||
const payload = response.data?.data ?? response.data;
|
||||
return Array.isArray(payload) ? (payload as WorkflowHistoryItem[]) : [];
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user