diff --git a/docs/openapi.json b/docs/openapi.json index 78a9ef6..c222710 100644 --- a/docs/openapi.json +++ b/docs/openapi.json @@ -13,42 +13,12 @@ "version" : "0.1.0" }, "paths" : { - "/contracts/v2/version" : { - "get" : { - "tags" : [ "version" ], - "summary" : "Callable way of retrieving current API version (following semver)", - "description" : "Endpoint to retrieve the current API version (following semver). Can be compared to the URI version. Can be used for testing purposes.", - "operationId" : "version", - "responses" : { - "default" : { - "description" : "Version identifier", - "content" : { - "application/json; charset=UTF-8" : { - "schema" : { - "$ref" : "#/components/schemas/Version" - } - } - } - }, - "503" : { - "description" : "Technical issue on server side, please retry later", - "content" : { - "application/json; charset=UTF-8" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - } - } - }, - "/contracts/v1" : { + "/contracts/v2" : { "post" : { "tags" : [ "contracts" ], - "summary" : "Upload a contract V1 to the insurer.", + "summary" : "Upload a contract to the insurer.", "description" : "Uploads a contract. If validation fails processing is refused, a corresponding error is thrown", - "operationId" : "uploadContractV1", + "operationId" : "uploadContract", "parameters" : [ { "name" : "X-Caller-Name", "in" : "header", @@ -74,7 +44,7 @@ "content" : { "application/json; charset=UTF-8" : { "schema" : { - "$ref" : "#/components/schemas/ContractV1" + "$ref" : "#/components/schemas/Contract" } } }, @@ -114,12 +84,12 @@ } } }, - "/contracts/v2" : { + "/contracts/v1/documents" : { "post" : { - "tags" : [ "contracts" ], - "summary" : "Upload a contract to the insurer.", - "description" : "Uploads a contract. If validation fails processing is refused, a corresponding error is thrown", - "operationId" : "uploadContract", + "tags" : [ "documents" ], + "summary" : "Upload a document for a contract.", + "description" : "Please note that this operation needs to be called per document for a contract to be uploaded. The response contains a handle to the document. This handle should be provided with the contract to be uploaded via uploadContract", + "operationId" : "uploadDocumentV1", "parameters" : [ { "name" : "X-Caller-Name", "in" : "header", @@ -141,11 +111,11 @@ } } ], "requestBody" : { - "description" : "Contract that needs to be uploaded to the insurer", + "description" : "a documnent that is part of a contract", "content" : { "application/json; charset=UTF-8" : { "schema" : { - "$ref" : "#/components/schemas/Contract" + "$ref" : "#/components/schemas/Document" } } }, @@ -153,17 +123,17 @@ }, "responses" : { "default" : { - "description" : "A handle to the contract for conversation with the insurer is provided", + "description" : "A handle for the uploaded document which can be used in providing a new contract via POST contracts", "content" : { "application/json; charset=UTF-8" : { "schema" : { - "$ref" : "#/components/schemas/ContractReference" + "$ref" : "#/components/schemas/FileHandle" } } } }, "400" : { - "description" : "Invalid contract is provided. See ErrorResponse for more information about validation issues", + "description" : "Invalid document is provided. See ErrorResponse for more information about validation issues", "content" : { "application/json; charset=UTF-8" : { "schema" : { @@ -185,12 +155,12 @@ } } }, - "/contracts/v1/documents" : { + "/contracts/v2/documents" : { "post" : { "tags" : [ "documents" ], "summary" : "Upload a document for a contract.", "description" : "Please note that this operation needs to be called per document for a contract to be uploaded. The response contains a handle to the document. This handle should be provided with the contract to be uploaded via uploadContract", - "operationId" : "uploadDocumentV1", + "operationId" : "uploadDocument", "parameters" : [ { "name" : "X-Caller-Name", "in" : "header", @@ -256,12 +226,42 @@ } } }, - "/contracts/v2/documents" : { + "/contracts/v1/version" : { + "get" : { + "tags" : [ "version" ], + "summary" : "Callable way of retrieving current API version (following semver)", + "description" : "Endpoint to retrieve the current API version (following semver). Can be compared to the URI version. Can be used for testing purposes.", + "operationId" : "versionV1", + "responses" : { + "default" : { + "description" : "Version identifier", + "content" : { + "application/json; charset=UTF-8" : { + "schema" : { + "$ref" : "#/components/schemas/Version" + } + } + } + }, + "503" : { + "description" : "Technical issue on server side, please retry later", + "content" : { + "application/json; charset=UTF-8" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/contracts/v1" : { "post" : { - "tags" : [ "documents" ], - "summary" : "Upload a document for a contract.", - "description" : "Please note that this operation needs to be called per document for a contract to be uploaded. The response contains a handle to the document. This handle should be provided with the contract to be uploaded via uploadContract", - "operationId" : "uploadDocument", + "tags" : [ "contracts" ], + "summary" : "Upload a contract V1 to the insurer.", + "description" : "Uploads a contract. If validation fails processing is refused, a corresponding error is thrown", + "operationId" : "uploadContractV1", "parameters" : [ { "name" : "X-Caller-Name", "in" : "header", @@ -283,11 +283,11 @@ } } ], "requestBody" : { - "description" : "a documnent that is part of a contract", + "description" : "Contract that needs to be uploaded to the insurer", "content" : { "application/json; charset=UTF-8" : { "schema" : { - "$ref" : "#/components/schemas/Document" + "$ref" : "#/components/schemas/ContractV1" } } }, @@ -295,17 +295,17 @@ }, "responses" : { "default" : { - "description" : "A handle for the uploaded document which can be used in providing a new contract via POST contracts", + "description" : "A handle to the contract for conversation with the insurer is provided", "content" : { "application/json; charset=UTF-8" : { "schema" : { - "$ref" : "#/components/schemas/FileHandle" + "$ref" : "#/components/schemas/ContractReference" } } } }, "400" : { - "description" : "Invalid document is provided. See ErrorResponse for more information about validation issues", + "description" : "Invalid contract is provided. See ErrorResponse for more information about validation issues", "content" : { "application/json; charset=UTF-8" : { "schema" : { @@ -327,36 +327,6 @@ } } }, - "/contracts/v1/version" : { - "get" : { - "tags" : [ "version" ], - "summary" : "Callable way of retrieving current API version (following semver)", - "description" : "Endpoint to retrieve the current API version (following semver). Can be compared to the URI version. Can be used for testing purposes.", - "operationId" : "versionV1", - "responses" : { - "default" : { - "description" : "Version identifier", - "content" : { - "application/json; charset=UTF-8" : { - "schema" : { - "$ref" : "#/components/schemas/Version" - } - } - } - }, - "503" : { - "description" : "Technical issue on server side, please retry later", - "content" : { - "application/json; charset=UTF-8" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - } - } - }, "/contracts/v2/cancellations" : { "post" : { "tags" : [ "contracts" ], @@ -427,17 +397,46 @@ } } } + }, + "/contracts/v2/version" : { + "get" : { + "tags" : [ "version" ], + "summary" : "Callable way of retrieving current API version (following semver)", + "description" : "Endpoint to retrieve the current API version (following semver). Can be compared to the URI version. Can be used for testing purposes.", + "operationId" : "version", + "responses" : { + "default" : { + "description" : "Version identifier", + "content" : { + "application/json; charset=UTF-8" : { + "schema" : { + "$ref" : "#/components/schemas/Version" + } + } + } + }, + "503" : { + "description" : "Technical issue on server side, please retry later", + "content" : { + "application/json; charset=UTF-8" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + } + } + } } }, "components" : { "schemas" : { - "Version" : { - "required" : [ "value" ], + "ContractReference" : { "type" : "object", "properties" : { - "value" : { + "reference" : { "type" : "string", - "description" : "Version identifier of the current API definition" + "description" : "Under this reference the contract is stored at the insurer" } } }, @@ -462,12 +461,24 @@ } } }, - "ContractReference" : { + "Action" : { + "required" : [ "reason", "type" ], "type" : "object", "properties" : { - "reference" : { + "type" : { + "type" : "integer", + "description" : "The type of the action", + "format" : "int32" + }, + "reason" : { + "type" : "integer", + "description" : "The reason for this type", + "format" : "int32" + }, + "effective" : { "type" : "string", - "description" : "Under this reference the contract is stored at the insurer" + "description" : "The date when this change should be effective", + "format" : "date" } } }, @@ -570,8 +581,8 @@ } } }, - "ContractV1" : { - "required" : [ "conditionMonthYear", "contractId", "creationDate", "endDate", "fileHandles", "paymentCode", "product", "roles", "startDate", "totalNetPrice" ], + "Contract" : { + "required" : [ "action", "conditionMonthYear", "creationDate", "endDate", "fileHandles", "identifier", "payment", "product", "roles", "stampTaxCode", "startDate", "termsOfService", "totalNetPrice" ], "type" : "object", "properties" : { "creationDate" : { @@ -589,12 +600,6 @@ "description" : "End of contract which means end of insurance coverage", "format" : "date" }, - "contractId" : { - "maxLength" : 20, - "minLength" : 0, - "type" : "string", - "description" : "Id given by SaaS provider" - }, "totalNetPrice" : { "$ref" : "#/components/schemas/MonetaryAmount" }, @@ -613,11 +618,6 @@ "agent" : { "$ref" : "#/components/schemas/Agent" }, - "paymentCode" : { - "type" : "integer", - "description" : "A code uniquely identifying the type of payment e.g. invoice or creditcard, Paypal etc.", - "format" : "int32" - }, "fileHandles" : { "maxItems" : 2, "minItems" : 1, @@ -632,6 +632,23 @@ "minLength" : 4, "type" : "string", "description" : "When was the condition issued? Format MMYY" + }, + "stampTaxCode" : { + "type" : "integer", + "description" : "The tax stamp code for this contract", + "format" : "int32" + }, + "termsOfService" : { + "$ref" : "#/components/schemas/TermsOfService" + }, + "action" : { + "$ref" : "#/components/schemas/Action" + }, + "identifier" : { + "$ref" : "#/components/schemas/Identifier" + }, + "payment" : { + "$ref" : "#/components/schemas/Payment" } } }, @@ -687,6 +704,21 @@ } } }, + "Identifier" : { + "required" : [ "id", "type" ], + "type" : "object", + "properties" : { + "id" : { + "type" : "string", + "description" : "Id depending on the type." + }, + "type" : { + "type" : "string", + "description" : "The type of the id. EXT or INT.", + "enum" : [ "INT", "EXT" ] + } + } + }, "MonetaryAmount" : { "required" : [ "amount" ], "type" : "object", @@ -697,6 +729,27 @@ } } }, + "Payment" : { + "required" : [ "code", "recurringType" ], + "type" : "object", + "properties" : { + "code" : { + "type" : "integer", + "description" : "A code uniquely identifying the type of payment e.g. invoice or creditcard, Paypal etc.", + "format" : "int32" + }, + "recurringType" : { + "type" : "integer", + "description" : "The recurring type code.", + "format" : "int32" + }, + "dueDate" : { + "type" : "string", + "description" : "The due date for the recurring type", + "format" : "date" + } + } + }, "Person" : { "type" : "object", "properties" : { @@ -803,29 +856,68 @@ } } }, - "Action" : { - "required" : [ "reason", "type" ], + "TermsOfService" : { + "required" : [ "edition", "type" ], "type" : "object", "properties" : { "type" : { "type" : "integer", - "description" : "The type of the action", + "description" : "The type of service terms", "format" : "int32" }, - "reason" : { + "edition" : { "type" : "integer", - "description" : "The reason for this type", + "description" : "The edition of the service terms", "format" : "int32" + } + } + }, + "Document" : { + "required" : [ "contractId", "data", "documentType", "fileName", "mediaType" ], + "type" : "object", + "properties" : { + "data" : { + "type" : "array", + "description" : "The document itself", + "items" : { + "type" : "string", + "format" : "byte" + } }, - "effective" : { + "contractId" : { + "maxLength" : 20, + "minLength" : 0, "type" : "string", - "description" : "The date when this change should be effective", - "format" : "date" + "description" : "The contract this document belongs to" + }, + "mediaType" : { + "type" : "string", + "description" : "Accepted media types for documents represented by data byte[]", + "enum" : [ "APPLICATION_PDF", "IMAGE_JPEG", "IMAGE_TIFF", "IMAGE_PNG", "IMAGE_BMP", "IMAGE_GIF" ] + }, + "fileName" : { + "maxLength" : 256, + "minLength" : 0, + "type" : "string" + }, + "documentType" : { + "type" : "string", + "enum" : [ "CONTRACT", "RECEIPT", "COVER_LETTER" ] } } }, - "Contract" : { - "required" : [ "action", "conditionMonthYear", "creationDate", "endDate", "fileHandles", "identifier", "payment", "product", "roles", "stampTaxCode", "startDate", "termsOfService", "totalNetPrice" ], + "Version" : { + "required" : [ "value" ], + "type" : "object", + "properties" : { + "value" : { + "type" : "string", + "description" : "Version identifier of the current API definition" + } + } + }, + "ContractV1" : { + "required" : [ "conditionMonthYear", "contractId", "creationDate", "endDate", "fileHandles", "paymentCode", "product", "roles", "startDate", "totalNetPrice" ], "type" : "object", "properties" : { "creationDate" : { @@ -843,6 +935,12 @@ "description" : "End of contract which means end of insurance coverage", "format" : "date" }, + "contractId" : { + "maxLength" : 20, + "minLength" : 0, + "type" : "string", + "description" : "Id given by SaaS provider" + }, "totalNetPrice" : { "$ref" : "#/components/schemas/MonetaryAmount" }, @@ -861,6 +959,11 @@ "agent" : { "$ref" : "#/components/schemas/Agent" }, + "paymentCode" : { + "type" : "integer", + "description" : "A code uniquely identifying the type of payment e.g. invoice or creditcard, Paypal etc.", + "format" : "int32" + }, "fileHandles" : { "maxItems" : 2, "minItems" : 1, @@ -875,109 +978,6 @@ "minLength" : 4, "type" : "string", "description" : "When was the condition issued? Format MMYY" - }, - "stampTaxCode" : { - "type" : "integer", - "description" : "The tax stamp code for this contract", - "format" : "int32" - }, - "termsOfService" : { - "$ref" : "#/components/schemas/TermsOfService" - }, - "action" : { - "$ref" : "#/components/schemas/Action" - }, - "identifier" : { - "$ref" : "#/components/schemas/Identifier" - }, - "payment" : { - "$ref" : "#/components/schemas/Payment" - } - } - }, - "Identifier" : { - "required" : [ "id", "type" ], - "type" : "object", - "properties" : { - "id" : { - "type" : "string", - "description" : "Id depending on the type." - }, - "type" : { - "type" : "string", - "description" : "The type of the id. EXT or INT.", - "enum" : [ "INT", "EXT" ] - } - } - }, - "Payment" : { - "required" : [ "code", "recurringType" ], - "type" : "object", - "properties" : { - "code" : { - "type" : "integer", - "description" : "A code uniquely identifying the type of payment e.g. invoice or creditcard, Paypal etc.", - "format" : "int32" - }, - "recurringType" : { - "type" : "integer", - "description" : "The recurring type code.", - "format" : "int32" - }, - "dueDate" : { - "type" : "string", - "description" : "The due date for the recurring type", - "format" : "date" - } - } - }, - "TermsOfService" : { - "required" : [ "edition", "type" ], - "type" : "object", - "properties" : { - "type" : { - "type" : "integer", - "description" : "The type of service terms", - "format" : "int32" - }, - "edition" : { - "type" : "integer", - "description" : "The edition of the service terms", - "format" : "int32" - } - } - }, - "Document" : { - "required" : [ "contractId", "data", "documentType", "fileName", "mediaType" ], - "type" : "object", - "properties" : { - "data" : { - "type" : "array", - "description" : "The document itself", - "items" : { - "type" : "string", - "format" : "byte" - } - }, - "contractId" : { - "maxLength" : 20, - "minLength" : 0, - "type" : "string", - "description" : "The contract this document belongs to" - }, - "mediaType" : { - "type" : "string", - "description" : "Accepted media types for documents represented by data byte[]", - "enum" : [ "APPLICATION_PDF", "IMAGE_JPEG", "IMAGE_TIFF", "IMAGE_PNG", "IMAGE_BMP", "IMAGE_GIF" ] - }, - "fileName" : { - "maxLength" : 256, - "minLength" : 0, - "type" : "string" - }, - "documentType" : { - "type" : "string", - "enum" : [ "CONTRACT", "RECEIPT", "COVER_LETTER" ] } } }, diff --git a/docs/swagger.json b/docs/swagger.json index c1f7036..fe0c958 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -417,6 +417,11 @@ "minLength": 0, "type": "string" }, + "riskLocationRef": { + "description": "With access to the Baloise internal partner system it is also possible to deliver the internal reference to the corresponding address of the risk location.", + "format": "int32", + "type": "integer" + }, "street": { "maxLength": 35, "minLength": 0,