mirror of
https://github.com/Sea-Haven-Industries/seahaven-ap.git
synced 2026-10-01 20:13:22 +00:00
91 lines
2.3 KiB
YAML
91 lines
2.3 KiB
YAML
parameters:
|
|
- name: id
|
|
in: path
|
|
required: true
|
|
description: Policy primary key.
|
|
schema:
|
|
type: string
|
|
format: uuid
|
|
example: cccccccc-cccc-4ccc-8ccc-cccccccccccc
|
|
get:
|
|
tags: [Approvals]
|
|
summary: Get an approval policy
|
|
description: Returns one approval policy by id.
|
|
operationId: get-api-approval-policies-id
|
|
responses:
|
|
"200":
|
|
description: Policy.
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: ../components/schemas.yaml#/ApprovalPolicy
|
|
"400":
|
|
description: Invalid id.
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: ../components/schemas.yaml#/Error
|
|
"401":
|
|
description: Missing session.
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: ../components/schemas.yaml#/Error
|
|
"404":
|
|
description: Policy not found.
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: ../components/schemas.yaml#/Error
|
|
patch:
|
|
tags: [Approvals]
|
|
summary: Update an approval policy
|
|
description: Admin-only patch. Requires admin:settings.
|
|
operationId: patch-api-approval-policies-id
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
name:
|
|
type: string
|
|
example: Default approver policy
|
|
priority:
|
|
type: integer
|
|
example: 10
|
|
amountThreshold:
|
|
type: string
|
|
example: "0.00"
|
|
skipBelowAmount:
|
|
type: string
|
|
example: "25.00"
|
|
active:
|
|
type: boolean
|
|
example: true
|
|
responses:
|
|
"200":
|
|
description: Updated policy.
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: ../components/schemas.yaml#/ApprovalPolicy
|
|
"400":
|
|
description: Validation failed.
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: ../components/schemas.yaml#/Error
|
|
"403":
|
|
description: Caller lacks admin:settings.
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: ../components/schemas.yaml#/Error
|
|
"404":
|
|
description: Policy not found.
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: ../components/schemas.yaml#/Error
|