feat: add leave submission withdrawal and audit trail
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
openapi: 3.1.0
|
||||
info:
|
||||
title: AIOA API
|
||||
version: 0.2.0
|
||||
version: 0.3.0
|
||||
servers:
|
||||
- url: /api/v1
|
||||
paths:
|
||||
@@ -104,8 +104,78 @@ paths:
|
||||
$ref: "#/components/responses/NotFound"
|
||||
"409":
|
||||
$ref: "#/components/responses/Conflict"
|
||||
/leave-requests/{id}/submit:
|
||||
post:
|
||||
operationId: submitLeaveRequest
|
||||
summary: 提交请假草稿
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/LeaveRequestId"
|
||||
- $ref: "#/components/parameters/IdempotencyKey"
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/TransitionRequest"
|
||||
responses:
|
||||
"200":
|
||||
description: 已提交或幂等重放
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/LeaveRequest"
|
||||
"404":
|
||||
$ref: "#/components/responses/NotFound"
|
||||
"409":
|
||||
$ref: "#/components/responses/Conflict"
|
||||
/leave-requests/{id}/withdraw:
|
||||
post:
|
||||
operationId: withdrawLeaveRequest
|
||||
summary: 撤回待审批申请
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/LeaveRequestId"
|
||||
- $ref: "#/components/parameters/IdempotencyKey"
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/TransitionRequest"
|
||||
responses:
|
||||
"200":
|
||||
description: 已撤回或幂等重放
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/LeaveRequest"
|
||||
"404":
|
||||
$ref: "#/components/responses/NotFound"
|
||||
"409":
|
||||
$ref: "#/components/responses/Conflict"
|
||||
/leave-requests/{id}/timeline:
|
||||
get:
|
||||
operationId: getLeaveRequestTimeline
|
||||
summary: 查询本人申请状态时间线
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/LeaveRequestId"
|
||||
responses:
|
||||
"200":
|
||||
description: 状态事件列表
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/components/schemas/LeaveRequestEvent"
|
||||
"404":
|
||||
$ref: "#/components/responses/NotFound"
|
||||
components:
|
||||
parameters:
|
||||
LeaveRequestId:
|
||||
name: id
|
||||
in: path
|
||||
required: true
|
||||
schema: { type: string, format: uuid }
|
||||
IdempotencyKey:
|
||||
name: Idempotency-Key
|
||||
in: header
|
||||
@@ -204,6 +274,26 @@ components:
|
||||
version: { type: integer, minimum: 0 }
|
||||
createdAt: { type: string, format: date-time }
|
||||
updatedAt: { type: string, format: date-time }
|
||||
TransitionRequest:
|
||||
type: object
|
||||
required: [version]
|
||||
properties:
|
||||
version: { type: integer, format: int64, minimum: 0 }
|
||||
LeaveRequestEvent:
|
||||
type: object
|
||||
required: [id, eventType, fromStatus, toStatus, actorId, traceId, occurredAt]
|
||||
properties:
|
||||
id: { type: string, format: uuid }
|
||||
eventType: { type: string }
|
||||
fromStatus:
|
||||
type: string
|
||||
enum: [DRAFT, PENDING, APPROVED, REJECTED, WITHDRAWN]
|
||||
toStatus:
|
||||
type: string
|
||||
enum: [DRAFT, PENDING, APPROVED, REJECTED, WITHDRAWN]
|
||||
actorId: { type: string, format: uuid }
|
||||
traceId: { type: string }
|
||||
occurredAt: { type: string, format: date-time }
|
||||
Problem:
|
||||
type: object
|
||||
required: [type, title, status, code, traceId]
|
||||
|
||||
Reference in New Issue
Block a user