Wolfgang Hottgenroth 9163b1848c fixes
2021-12-13 18:01:06 +01:00

157 lines
4.7 KiB
YAML

openapi: 3.0.3
info:
title: Generic Database API Service
version: "2.0.0"
paths:
/pdb/v2/baseItem/{articleNumber}:
get:
tags: [ "Regular" ]
operationId: Regular.baseItem
summary: Returns baseItem entries
description:
DATABASETAGBEGIN
pdb_el_reader1
DATABASETAGEND
STATEMENTBEGIN
SELECT Artikelcode AS articleNumber,
Art AS category,
bezeichnung AS description
FROM stammdaten
WHERE Artikelcode = @articleNumber
STATEMENTEND
parameters:
- name: articleNumber
in: path
required: true
schema:
type: string
responses:
200:
description: Here are your baseItem items
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/baseItem"
400:
$ref: "#/components/responses/clientSideError"
500:
$ref: "#/components/responses/serverSideError"
/pdb/v2/productionOrderItem/{productionOrder}:
get:
tags: [ "Regular" ]
operationId: Regular.productionOrderItem
summary: Returns productionOrderItem entries
description:
DATABASETAGBEGIN
pdb_el_reader1
DATABASETAGEND
STATEMENTBEGIN
SELECT
CAST(auftraege.produktionsauftrag AS INT) AS productionOrder
,auftraege.artikelcode AS articleCode
,(CASE WHEN ISNULL(anonyme_cg_geraete.C_Nummer) THEN FALSE ELSE TRUE END) AS isAnonymous
,(CASE WHEN ISNULL(anonyme_cg_geraete.Artikelcode) THEN (CASE WHEN auftraege.C_Nummer = \"\" THEN NULL ELSE auftraege.C_Nummer END) ELSE anonyme_cg_geraete.C_Nummer END) AS cgNumber
,auftraege.stueckzahl AS numberOfPieces
,auftraege.IX AS bomIndex
,auftraege.referenz_dokument AS referenceDocument
FROM auftraege
LEFT JOIN anonyme_cg_geraete ON auftraege.artikelcode = anonyme_cg_geraete.Artikelcode
WHERE auftraege.produktionsauftrag = @productionOrder
STATEMENTEND
parameters:
- name: productionOrder
in: path
required: true
schema:
type: integer
responses:
200:
description: Here are your productionOrderItem items
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/productionOrderItem"
400:
$ref: "#/components/responses/clientSideError"
500:
$ref: "#/components/responses/serverSideError"
components:
responses:
clientSideError:
description: There is something wrong with the data you sent, look into the response object for details
content:
application/json:
schema:
$ref: "#/components/schemas/errorResultObject"
serverSideError:
description: Internal Server Error, look into the response object for details
content:
application/json:
schema:
$ref: "#/components/schemas/errorResultObject"
schemas:
errorResultObject:
description: Object returned in case of an error
properties:
errorCode:
description: repeat the http error code
type: integer
serviceErrorCode:
description: service-specific error code
type: integer
errorMessage:
description: human-readable error message
type: string
errorInfoURL:
description: URL to some more information on the error
type: string
offensiveData:
description: Input data which causes this error
type: string
baseItem:
description: Selected columns of the stammdaten table from pdb_el
type: object
properties:
articleNumber:
type: string
nullable: true
category:
type: string
nullable: true
description:
type: string
productionOrderItem:
description: Selected columns of the auftraege table from pdb_el
type: object
properties:
productionOrder:
type: integer
nullable: true
articleCode:
type: string
nullable: true
isAnonymous:
type: boolean
nullable: true
cgNumber:
type: string
nullable: true
numberOfPieces:
type: integer
nullable: true
bomIndex:
type: string
nullable: true
referenceDocument:
type: string
nullable: true