diff --git a/src/openapi/contracts/contracts-crud.yaml b/src/openapi/contracts/contracts-crud.yaml index 8560cec..25205ff 100644 --- a/src/openapi/contracts/contracts-crud.yaml +++ b/src/openapi/contracts/contracts-crud.yaml @@ -206,7 +206,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/Contract" + $ref: "#/components/schemas/Contracts" example: { "contracts": @@ -502,7 +502,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/Contract" + $ref: "#/components/schemas/PatchContractsRequestBody" example: { "contract": @@ -518,7 +518,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/Contract" + $ref: "#/components/schemas/PatchContractsResponseBody" example: { "contract": @@ -546,7 +546,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/InvoiceAccountingStatus" + $ref: "#/components/schemas/PostContractVersionsRequestBody" example: { "contractVersion": @@ -567,7 +567,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/ContractVersion" + $ref: "#/components/schemas/PostContractVersionsResponseBody" example: { "contractVersion": @@ -602,7 +602,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/ContractVersion" + $ref: "#/components/schemas/PatchContractVersionsRequestBody" example: { "contractVersion": { "end": "2024-07-03 15:01:00.000" } } responses: "200": @@ -610,7 +610,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/ContractVersion" + $ref: "#/components/schemas/PatchContractVersionsResponseBody" example: { "contractVersion": @@ -619,6 +619,14 @@ paths: "contractVersionId": 1, }, } + delete: + summary: Delete an existing contract version. + description: Delete an existing contract version. + tags: + - ContractVersion + responses: + "200": + description: OK /contracts/{contractId}/contractinvoices: parameters: - in: path @@ -629,67 +637,6 @@ paths: example: d1dd439b-6072-4b97-89c9-724268865b93 required: true description: The contractId of the Contract, formatted as UUID. - get: - summary: Get invoices of a single contract. DEPRECATED. - description: Get invoices of a single contract. WARNING; This method is deprecated. Please use GET /contractinvoices instead. - deprecated: true - tags: - - ContractInvoice - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: "#/components/schemas/ContractInvoice" - example: - { - "contractInvoices": - [ - { - "contractInvoiceId": "8699d72a-cf4d-4e6b-9e9c-549d837ca51f", - "externalReference": "F2024-0001", - "term": 1, - "invoiceDate": "2024-07-02", - "created": "2024-07-02 15:01:00.000", - "updated": "2024-07-02 15:01:00.000", - "state": "invoice_sent", - "data": "{json}", - "isCredit": false, - "invoiceAccountingStatuses": - [ - { - "invoiceAccountingStatusId": "32785417-1fb8-42c7-bda1-533f5868809f", - "accountingStatus": - { "accountingStatusId": 1, "name": "open" }, - "createdOn": "2024-06-02 15:01:00.000", - "description": null, - }, - ], - }, - { - "contractInvoiceId": "dadff658-4ff5-4eb8-b516-492f1f6c6245", - "externalReference": "F2024-0002", - "term": 2, - "invoiceDate": "2024-08-02", - "created": "2024-08-02 15:01:00.000", - "updated": "2024-08-02 15:01:00.000", - "state": "invoice_created", - "data": "{json}", - "isCredit": false, - "invoiceAccountingStatuses": - [ - { - "invoiceAccountingStatusId": "84af0f01-0416-4860-851a-a0d4b3cf674a", - "accountingStatus": - { "accountingStatusId": 1, "name": "open" }, - "createdOn": "2024-06-02 15:01:00.000", - "description": null, - }, - ], - }, - ], - } post: summary: Add an invoice to an existing contract. description: Add an invoice to an existing contract. @@ -699,7 +646,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/ContractInvoice" + $ref: "#/components/schemas/PostContractInvoicesRequestBody" example: { "contractInvoice": @@ -728,7 +675,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/ContractInvoice" + $ref: "#/components/schemas/PostContractInvoicesResponseBody" example: { "contractInvoice": @@ -841,7 +788,12 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/Contract" + type: object + properties: + contractInvoices: + type: array + items: + $ref: "#/components/schemas/ContractInvoice" example: { "contractInvoices": @@ -911,7 +863,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/ContractInvoice" + $ref: "#/components/schemas/PatchContractInvoicesRequestBody" example: { "contractInvoice": @@ -927,7 +879,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/ContractInvoice" + $ref: "#/components/schemas/PatchContractInvoicesResponseBody" example: { "contractInvoice": @@ -954,7 +906,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/ContractInvoice" + $ref: "#/components/schemas/PostInvoiceAccountingStatusesRequestBody" example: { "accountingStatusId": 1, @@ -967,7 +919,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/ContractInvoice" + $ref: "#/components/schemas/PostInvoiceAccountingStatusesResponseBody" example: { "invoiceAccountingStatusId": "a6836364-4812-4960-9226-69deb2e2b903", @@ -993,7 +945,12 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/Contract" + type: object + properties: + contractActions: + type: array + items: + $ref: "#/components/schemas/ContractAction" example: { "contractActions": @@ -1025,7 +982,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/ContractAction" + $ref: "#/components/schemas/PostContractActionsRequestBody" example: { "contractAction": @@ -1043,7 +1000,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/ContractAction" + $ref: "#/components/schemas/PostContractActionsResponseBody" example: { "contractAction": @@ -1063,7 +1020,12 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/ContractStatus" + type: object + properties: + contractStatuses: + type: array + items: + $ref: "#/components/schemas/ContractStatus" example: { "contractStatuses": @@ -1089,7 +1051,12 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/ActionType" + type: object + properties: + actionTypes: + type: array + items: + $ref: "#/components/schemas/ActionType" example: { "actionTypes": @@ -1207,6 +1174,315 @@ components: - contractNumber required: - contract + PatchContractsRequestBody: + type: object + properties: + contract: + type: object + properties: + contractStatusId: + type: integer + example: 2 + billingDay: + type: integer + example: 15 + highestInvoiceTerm: + type: integer + example: 2 + required: + - contract + PatchContractsResponseBody: + type: object + properties: + contract: + type: object + properties: + contractId: + type: string + format: uuid + example: 5a3876a1-e9a1-4278-8983-4679a8d583c2 + contractNumber: + type: string + pattern: '^D\d{6}$' + example: D123456 + required: + - contractId + - contractNumber + required: + - contract + PostContractVersionsRequestBody: + type: object + properties: + contractVersion: + type: object + properties: + termsAndConditions: + type: string + format: url + example: https://www.htm.nl/reisproducten/productvoorwaarden/htm-maandkorting/ + productId: + type: integer + example: 1 + productName: + type: string + example: HTM Maand 20% korting + taxCode: + type: string + example: V9 + taxPercentage: + type: number + format: float + example: 9.0 + termAmountInclTax: + type: integer + example: 400 + start: + type: string + format: date-time + example: 2024-07-04 15:01:00.000 + end: + type: string + format: date-time + example: 2024-12-31 15:01:00.000 + required: + - termsAndConditions + - productId + - productName + - taxCode + - taxPercentage + - termAmountInclTax + - start + required: + - contractVersion + PostContractVersionsResponseBody: + type: object + properties: + contractVersion: + type: object + properties: + contractId: + type: string + format: uuid + example: 5a3876a1-e9a1-4278-8983-4679a8d583c2 + contractVersionId: + type: integer + example: 1 + required: + - contractId + - contractVersionId + required: + - contractVersion + PatchContractVersionsRequestBody: + type: object + properties: + contractVersion: + type: object + properties: + end: + type: string + format: date-time + example: 2024-12-31 15:01:00.000 + required: + - contractVersion + PatchContractVersionsResponseBody: + type: object + properties: + contractVersion: + type: object + properties: + contractId: + type: string + format: uuid + example: 5a3876a1-e9a1-4278-8983-4679a8d583c2 + contractVersionId: + type: integer + example: 1 + required: + - contractId + - contractVersionId + required: + - contractVersion + PostContractInvoicesRequestBody: + type: object + properties: + contractInvoice: + type: object + properties: + externalReference: + type: string + example: F2024-0001 + term: + type: integer + example: 1 + invoiceDate: + type: string + format: date + example: 2024-07-02 + created: + type: string + format: date-time + example: 2024-07-02 15:01:00.000 + updated: + type: string + format: date-time + example: 2024-07-02 15:01:00.000 + state: + type: string + example: invoice_created + data: + type: string + format: json + example: "{json}" + isCredit: + type: boolean + example: false + invoiceAccountingStatuses: + type: array + items: + type: object + properties: + accountingStatusId: + type: integer + example: 1 + createdOn: + type: string + format: date-time + example: 2024-07-02 15:01:00.000 + description: + type: string + example: null + required: + - accountingStatusId + - createdOn + required: + - externalReference + - term + - invoiceDate + - created + - updated + - state + - data + - isCredit + - invoiceAccountingStatuses + required: + - contractInvoice + PostContractInvoicesResponseBody: + type: object + properties: + contractInvoice: + type: object + properties: + contractInvoiceId: + type: string + format: uuid + example: 8699d72a-cf4d-4e6b-9e9c-549d837ca51f + required: + - contractInvoiceId + required: + - contractInvoice + PatchContractInvoicesRequestBody: + type: object + properties: + contractInvoice: + type: object + properties: + updated: + type: string + format: date-time + example: 2024-07-02 15:01:00.000 + state: + type: string + example: invoice_reopened + data: + type: string + format: json + example: "{json}" + required: + - contractInvoice + PatchContractInvoicesResponseBody: + type: object + properties: + contractInvoice: + type: object + properties: + contractInvoiceId: + type: string + format: uuid + example: 8699d72a-cf4d-4e6b-9e9c-549d837ca51f + required: + - contractInvoiceId + required: + - contractInvoice + PostInvoiceAccountingStatusesRequestBody: + type: object + properties: + accountingStatusId: + type: integer + example: 1 + createdOn: + type: string + format: date-time + example: 2024-07-02 15:01:00.000 + description: + type: string + example: null + required: + - accountingStatusId + - createdOn + PostInvoiceAccountingStatusesResponseBody: + type: object + properties: + invoiceAccountingStatusId: + type: string + format: uuid + example: a6836364-4812-4960-9226-69deb2e2b903 + required: + - invoiceAccountingStatusId + PostContractActionsRequestBody: + type: object + properties: + contractAction: + type: object + properties: + actionType: + type: integer + example: 2 + user: + type: string + example: subid123456 + timestamp: + type: string + format: date-time + example: 2024-07-02 15:01:00.000 + details: + type: string + example: Contract changed xyz + correlationId: + type: string + format: uuid + example: 976e7a4c-bf24-43d2-b444-55817556e7ee + required: + - actionType + - user + - timestamp + - details + - correlationId + required: + - contractAction + PostContractActionsResponseBody: + type: object + properties: + contractAction: + type: object + properties: + contractActionId: + type: string + format: uuid + example: 8699d72a-cf4d-4e6b-9e9c-549d837ca51f + required: + - contractActionId + required: + - contractAction Contract: type: object properties: