mirror of
https://github.com/Sea-Haven-Industries/seahaven-ap.git
synced 2026-09-30 04:33:15 +00:00
72 lines
1.8 KiB
YAML
72 lines
1.8 KiB
YAML
|
|
get:
|
||
|
|
tags: [Approvals]
|
||
|
|
summary: List approval policies
|
||
|
|
description: Returns every approval policy.
|
||
|
|
operationId: get-api-approval-policies
|
||
|
|
responses:
|
||
|
|
"200":
|
||
|
|
description: Policy list.
|
||
|
|
content:
|
||
|
|
application/json:
|
||
|
|
schema:
|
||
|
|
type: object
|
||
|
|
required: [items]
|
||
|
|
properties:
|
||
|
|
items:
|
||
|
|
type: array
|
||
|
|
items:
|
||
|
|
$ref: ../components/schemas.yaml#/ApprovalPolicy
|
||
|
|
"401":
|
||
|
|
description: Missing session.
|
||
|
|
content:
|
||
|
|
application/json:
|
||
|
|
schema:
|
||
|
|
$ref: ../components/schemas.yaml#/Error
|
||
|
|
post:
|
||
|
|
tags: [Approvals]
|
||
|
|
summary: Create an approval policy
|
||
|
|
description: Admin-only insert. Requires admin:settings.
|
||
|
|
operationId: post-api-approval-policies
|
||
|
|
requestBody:
|
||
|
|
required: true
|
||
|
|
content:
|
||
|
|
application/json:
|
||
|
|
schema:
|
||
|
|
type: object
|
||
|
|
required: [name]
|
||
|
|
properties:
|
||
|
|
name:
|
||
|
|
type: string
|
||
|
|
example: High dollar
|
||
|
|
priority:
|
||
|
|
type: integer
|
||
|
|
example: 1
|
||
|
|
amountThreshold:
|
||
|
|
type: string
|
||
|
|
example: "500.00"
|
||
|
|
skipBelowAmount:
|
||
|
|
type: string
|
||
|
|
example: "25.00"
|
||
|
|
active:
|
||
|
|
type: boolean
|
||
|
|
example: true
|
||
|
|
responses:
|
||
|
|
"201":
|
||
|
|
description: Created 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
|