157 lines
4.8 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(pdb_el.auftraege.produktionsauftrag AS INT) AS production_order
,pdb_el.auftraege.artikelcode AS article_code
,(CASE WHEN ISNULL(pdb_el.anonyme_cg_geraete.C_Nummer) THEN FALSE ELSE TRUE END) AS is_anonymous
,(CASE WHEN ISNULL(pdb_el.anonyme_cg_geraete.Artikelcode) THEN (CASE WHEN pdb_el.auftraege.C_Nummer = "" THEN NULL ELSE pdb_el.auftraege.C_Nummer END) ELSE pdb_el.anonyme_cg_geraete.C_Nummer END) AS cg_number
,pdb_el.auftraege.stueckzahl AS number_of_pieces
,pdb_el.auftraege.IX AS bom_index
,pdb_el.auftraege.referenz_dokument AS reference_document
FROM pdb_el.auftraege
LEFT JOIN pdb_el.anonyme_cg_geraete ON pdb_el.auftraege.artikelcode = pdb_el.anonyme_cg_geraete.Artikelcode
WHERE pdb_el.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