Alle Aufrufe zur Generischen Gutscheinschnittstelle sollten mit folgenden DRAFT 07 JSON-Schema validiert werden, bevor die Antwort an LINA POS gesendet wird.
Gutschein-Verkauf JSON-Schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "required": [ "token" ], "properties": { "token": { "enum": [ "Valid", "Invalid" ] }, "tokencode": { "type": "string", "minLength": 1 }, "wert": { "type": "number", "minimum": -9999999999.99, "maximum": 9999999999.99 }, "grund": { "type": "string", "minLength": 1 } }, "if": { "properties": { "token": { "const": "Valid" } } }, "then": { "required": [ "tokencode", "wert" ] }, "else": { "required": [ "grund" ] } }
Gutschein-Prüfung
{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "required": [ "token" ], "properties": { "token": { "enum": [ "Valid", "Invalid" ] }, "tokencode": { "type": "string", "minLength": 1 }, "startwert": { "type": "number", "minimum": -9999999999.99, "maximum": 9999999999.99 }, "restwert": { "type": "number", "minimum": -9999999999.99, "maximum": 9999999999.99 }, "tokengueltig": { "type": "string", "format": "date" }, "tokencomplete": { "type": "boolean" }, "grund": { "type": "string", "minLength": 1 } }, "if": { "properties": { "token": { "const": "Valid" } } }, "then": { "required": [ "tokencode", "startwert" ] }, "else": { "required": [ "grund" ] } }
Gutschein-Aufladungen
{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "required": [ "token" ], "properties": { "token": { "enum": [ "Valid", "Invalid" ] }, "tokencode": { "type": "string", "minLength": 1 }, "wert_zuvor": { "type": "number", "minimum": -9999999999.99, "maximum": 9999999999.99 }, "wert_jetzt": { "type": "number", "minimum": -9999999999.99, "maximum": 9999999999.99 }, "grund": { "type": "string", "minLength": 1 } }, "if": { "properties": { "token": { "const": "Valid" } } }, "then": { "required": [ "tokencode", "wert_zuvor", "wert_jetzt" ] }, "else": { "required": [ "grund" ] } }
Gutschein-Einlösungen
{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "required": [ "token" ], "properties": { "token": { "enum": [ "Valid", "Invalid" ] }, "tokencode": { "type": "string", "minLength": 1 }, "wert_zuvor": { "type": "number", "minimum": -9999999999.99, "maximum": 9999999999.99 }, "wert_jetzt": { "type": "number", "minimum": -9999999999.99, "maximum": 9999999999.99 }, "grund": { "type": "string", "minLength": 1 } }, "if": { "properties": { "token": { "const": "Valid" } } }, "then": { "required": [ "tokencode", "wert_zuvor", "wert_jetzt" ] }, "else": { "required": [ "grund" ] } }