From 5ebc012ceb1637bcc5d6b335108cfef2bca28270 Mon Sep 17 00:00:00 2001 From: Mirjam Herald Date: Mon, 10 Feb 2025 17:46:17 +0100 Subject: [PATCH] updated existing CRUD with valid examples for stub --- src/openapi/customers/customers-crud-v2.yaml | 699 +++++++++++++------ 1 file changed, 472 insertions(+), 227 deletions(-) diff --git a/src/openapi/customers/customers-crud-v2.yaml b/src/openapi/customers/customers-crud-v2.yaml index 755d2c9..d94b1ca 100644 --- a/src/openapi/customers/customers-crud-v2.yaml +++ b/src/openapi/customers/customers-crud-v2.yaml @@ -1,15 +1,116 @@ openapi: "3.0.3" info: title: ABT Customers CRUD APIs v2 - version: "1.0" + version: "2.0" description: CRUD APIs for ABT Customer database. These are NOT the functional APIs from Service Engine. servers: - - url: https://api.integratielaag.nl + - url: https://api.integratielaag.nl/abt/abtcustomers/2.0 paths: /customers: + post: + tags: + - Customer + summary: Create a customer profile + description: >- + Create a customer profile in the ABT database with status ACTIVE and + debtorStatus Inactive with a start date based on the timestamp of this + post call. + + - Requested format for postal code: + - 0000AA + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/postCustomerProfile" + examples: + minimumProfile: + value: {} + basicCustomerProfile: + value: + debtorStatusId: 2 + person: + birthname: Jan + surname: Jansen + emailAddress: j.jansen@hatseflats.nl + fullCustomerProfile: + value: + customerPreference: + languageId: 1 + debtorStatusId: 2 + person: + birthname: Jan + surname: Jansen + prefix: dhr + suffix: jr + dateOfBirth: "1970-01-01" + emailAddress: j.jansen@hatseflats.nl + addresses: + - street: Laan van Meerdervoort + houseNumber: 5 + houseNumberSuffix: B + postalCode: 2500AA + city: Den Haag + country: NL + isPreferred: true + addressTypeId: 1 + - street: Beeklaan + houseNumber: 30 + houseNumberSuffix: B + postalCode: 2500AA + city: Den Haag + country: NL + isPreferred: false + addressTypeId: 2 + phones: + - number: "6123456789" + countryCode: "+31" + phoneTypeId: 1 + isPreferred: true + - number: "7012345678" + countryCode: "+31" + phoneTypeId: 2 + isPreferred: false + required: true + responses: + "201": + description: Successful created a customer profile + content: + application/json: + schema: + $ref: "#/components/schemas/postCustomerProfileResponse" + examples: + customerProfileCreated: + summary: customerProfileCreated + description: >- + Successfully created a customer profile + value: + customerProfileId: 1 + customerNumber: 1000001 + "400": + description: Bad Request + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" + examples: + invalidDataTypeError: + summary: invalidDataTypeError + description: >- + The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). + value: + type: https://htm.nl/api/v1/probs/bad-request + title: Your request contains an invalid datatype + detail: '''2023-02-01 00:00:00'' is not a valid Datetime' + instance: urn:uuid:4017fabc-1b28-11e8-accf-0ed5f89f718b + security: + - default: [] + x-auth-type: Application & Application User + x-throttling-tier: Unlimited get: tags: - - ABTCustomers + - Customer summary: Search customer profiles description: >- Search for all customer profile list in the ABT database matching given query parameters @@ -177,13 +278,16 @@ paths: example: Mijn ING bankrekening responses: 200: - description: Successfully retrieved customer profile(s) + description: Ok content: application/json: schema: $ref: "#/components/schemas/getCustomerProfiles" examples: - fullCustomerProfile: + getCustomersMultiple: + summary: getCustomersMultiple + description: >- + Found multiple customer profiles matching the search parameters, does not return the financial details value: customers: - customerProfileId: 1 @@ -205,11 +309,6 @@ paths: customerStatusId: 2 fromInclusive: "2022-08-04 15:01:00.000" toInclusive: "2022-08-05 15:01:00.000" - - customerStatus: - name: Blocked - customerStatusId: 3 - fromInclusive: "2022-08-05 15:01:00.000" - toInclusive: null person: birthname: Pieter surname: De valen @@ -323,6 +422,11 @@ paths: name: Blocked customerStatusId: 3 fromInclusive: "2022-08-05 15:01:00.000" + toInclusive: "2023-08-05 15:01:00.000" + - customerStatus: + name: Active + customerStatusId: 2 + fromInclusive: "2023-08-05 15:01:00.000" toInclusive: null person: birthname: Pieter @@ -415,163 +519,366 @@ paths: timestamp: "2023-10-20T17:05:52.000+02:00" correlationId: 01c6d8b4-1cd3-4f9b-85ea-c9adca53ce95 href: null + getCustomerActive: + summary: getCustomerActive + description: >- + Found a single customerProfile with an active status + value: + customers: + - customerProfileId: 1 + customerNumber: 1000001 + debtorNumber: DB100001 + debtorStatus: + debtorStatusId: 1 + name: Inactive + vascustomerNumber: CST005 + customerPreference: + language: + languageId: 1 + name: Dutch + ietfCode: nl-NL + iso639Code: nl + customerStatusInstances: + - customerStatus: + name: Active + customerStatusId: 2 + fromInclusive: "2022-08-04 15:01:00.000" + toInclusive: null + person: + birthname: Pieter + surname: De valen + prefix: De + suffix: PhD + dateOfBirth: "2002-10-29" + emailAddresses: TEST@HTM.NL + addresses: + - addressId: 1 + street: mystreet + houseNumber: 1 + houseNumberSuffix: null + postalCode: 0000AA + city: Den Haag + country: NL + isPreferred: false + addressType: + addressTypeId: 2 + name: Office + - addressId: 2 + street: mystreet 33 + houseNumber: 1 + houseNumberSuffix: null + postalCode: 4455CA + city: Den BOSCH + country: NL + isPreferred: true + addressType: + addressTypeId: 2 + name: Office + phones: + - phoneId: 1 + number: "3112345678" + countryCode: "+31" + phoneType: + phoneTypeId: 1 + name: Home + isPreferred: true + - phoneId: 2 + number: "333225588" + countryCode: "+31" + phoneType: + phoneTypeId: 2 + name: Work + isPreferred: false + ovChipcards: + - ovChipCardId: 1 + chipCardNumber: 1234123412341234 + validUntil: "2023-01-01" + alias: alias + - ovChipCardId: 2 + chipCardNumber: 1234123412341235 + validUntil: "2025-01-01" + alias: alias + ovPayTokens: + - ovPayTokenId: 126 + tokenType: + tokenTypeId: 1 + name: EMV + xTat: 0115b0df-db38-4702-8811-6f7de00db3ac + xBot: 71a88843-32b8-4d52-ac25-de2458c47775 + alias: alias + lastDigits: "5678" + ovpasNumber: null + tokenStatus: + tokenStatusId: 2 + name: Active + expirationDate: "2025-04-20T17:05:52.000+02:00" + replacedByTokenId: 1 + - ovPayTokenId: 127 + tokenType: + tokenTypeId: 2 + name: OV-pas physical + xTat: 0115b0df-db38-4702-8811-6f7de00db3ac + xBot: 71a88843-32b8-4d52-ac25-de2458c47775 + alias: alias + lastDigits: "5674" + ovpasNumber: OV34568 + tokenStatus: + tokenStatusId: 2 + name: Active + expirationDate: "2024-04-20T17:05:52.000+02:00" + replacedByTokenId: 2 + auditTrails: + - auditTrailId: 1 + customerProfileId: 1 + action: insert + user: user + timestamp: "2023-10-20T17:05:52.000+02:00" + correlationId: 01c6d8b4-1cd3-4f9b-85ea-c9adca53ce95 + href: null + getCustomerBlocked: + summary: getCustomerBlocked + description: >- + Found a single customerProfile with a blocked status + value: + customers: + - customerProfileId: 1 + customerNumber: 1000001 + debtorNumber: DB100001 + debtorStatus: + debtorStatusId: 2 + name: Active + vascustomerNumber: CST005 + customerPreference: + language: + languageId: 1 + name: Dutch + ietfCode: nl-NL + iso639Code: nl + customerStatusInstances: + - customerStatus: + name: Active + customerStatusId: 2 + fromInclusive: "2022-08-04 15:01:00.000" + toInclusive: "2022-08-05 15:01:00.000" + - customerStatus: + name: Blocked + customerStatusId: 3 + fromInclusive: "2022-08-05 15:01:00.000" + toInclusive: null + person: + birthname: Pieter + surname: De valen + prefix: De + suffix: PhD + dateOfBirth: "2002-10-29" + emailAddresses: TEST@HTM.NL + addresses: + - addressId: 1 + street: mystreet + houseNumber: 1 + houseNumberSuffix: null + postalCode: 0000AA + city: Den Haag + country: NL + isPreferred: false + addressType: + addressTypeId: 2 + name: Office + - addressId: 2 + street: mystreet 33 + houseNumber: 1 + houseNumberSuffix: null + postalCode: 4455CA + city: Den BOSCH + country: NL + isPreferred: true + addressType: + addressTypeId: 2 + name: Office + phones: + - phoneId: 1 + number: "3112345678" + countryCode: "+31" + phoneType: + phoneTypeId: 1 + name: Home + isPreferred: true + - phoneId: 2 + number: "333225588" + countryCode: "+31" + phoneType: + phoneTypeId: 2 + name: Work + isPreferred: false + ovChipcards: + - ovChipCardId: 1 + chipCardNumber: 1234123412341234 + validUntil: "2023-01-01" + alias: alias + - ovChipCardId: 2 + chipCardNumber: 1234123412341235 + validUntil: "2025-01-01" + alias: alias + ovPayTokens: + - ovPayTokenId: 126 + tokenType: + tokenTypeId: 1 + name: EMV + xTat: 0115b0df-db38-4702-8811-6f7de00db3ac + xBot: 71a88843-32b8-4d52-ac25-de2458c47775 + alias: alias + lastDigits: "5678" + ovpasNumber: null + tokenStatus: + tokenStatusId: 2 + name: Active + expirationDate: "2025-04-20T17:05:52.000+02:00" + replacedByTokenId: 1 + - ovPayTokenId: 127 + tokenType: + tokenTypeId: 2 + name: OV-pas physical + xTat: 0115b0df-db38-4702-8811-6f7de00db3ac + xBot: 71a88843-32b8-4d52-ac25-de2458c47775 + alias: alias + lastDigits: "5674" + ovpasNumber: OV34568 + tokenStatus: + tokenStatusId: 2 + name: Active + expirationDate: "2024-04-20T17:05:52.000+02:00" + replacedByTokenId: 2 + auditTrails: + - auditTrailId: 1 + customerProfileId: 1 + action: insert + user: user + timestamp: "2023-10-20T17:05:52.000+02:00" + correlationId: 01c6d8b4-1cd3-4f9b-85ea-c9adca53ce95 + href: null 400: description: Bad Request content: application/json: schema: - $ref: "#/components/schemas/400Response" - 401: - description: Unauthorized - content: - application/json: - schema: - $ref: "#/components/schemas/401Response" - 404: - description: Not Found - content: - application/json: - schema: - $ref: "#/components/schemas/404Response" - 500: - description: Internal Server Error - content: - application/json: - schema: - $ref: "#/components/schemas/500Response" + $ref: "#/components/schemas/ErrorResponse" + examples: + invalidDataTypeError: + summary: invalidDataTypeError + description: >- + The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). + value: + type: https://htm.nl/api/v1/probs/bad-request + title: Your request contains an invalid datatype + detail: '''2023-02-01 00:00:00'' is not a valid Datetime' + instance: urn:uuid:4017fabc-1b28-11e8-accf-0ed5f89f718b security: - default: [] x-auth-type: Application & Application User x-throttling-tier: Unlimited - post: + /customers/{customerProfileId}: + patch: tags: - - ABTCustomers - summary: Create a customer profile + - Customer + summary: Modify a customer element description: >- - Create a customer profile in the ABT database with status ACTIVE and - debtorStatus Inactive with a start date based on the timestamp of this - post call. - - Requested format for postal code: - - 0000AA - parameters: [] + parameters: + - name: customerProfileId + in: path + required: true + schema: + type: integer + example: 1 requestBody: content: application/json: schema: - $ref: "#/components/schemas/postCustomerProfile" + $ref: "#/components/schemas/customersEntity" examples: - minimumProfile: - value: {} - basicCustomerProfile: + customers: value: debtorStatusId: 2 - person: - birthname: Jan - surname: Jansen - emailAddress: j.jansen@hatseflats.nl - fullCustomerProfile: - value: - customerPreference: - languageId: 1 - debtorStatusId: 2 - person: - birthname: Jan - surname: Jansen - prefix: dhr - suffix: jr - dateOfBirth: "1970-01-01" - emailAddress: j.jansen@hatseflats.nl - addresses: - - street: Laan van Meerdervoort - houseNumber: 5 - houseNumberSuffix: B - postalCode: 2500AA - city: Den Haag - country: NL - isPreferred: true - addressTypeId: 1 - - street: Beeklaan - houseNumber: 30 - houseNumberSuffix: B - postalCode: 2500AA - city: Den Haag - country: NL - isPreferred: false - addressTypeId: 2 - phones: - - number: "6123456789" - countryCode: "+31" - phoneTypeId: 1 - isPreferred: true - - number: "7012345678" - countryCode: "+31" - phoneTypeId: 2 - isPreferred: false required: true responses: "201": - description: Successful created a customer profile + description: Successfully modified a customer content: application/json: schema: - $ref: "#/components/schemas/postCustomerProfileCustomerNumberResponse" - "400": - description: Bad Request + $ref: "#/components/schemas/patchCustomerProfileResponse" + security: + - default: [] + x-auth-type: Application & Application User + x-throttling-tier: Unlimited + /customers/{customerProfileId}/customerPreferences: + post: + tags: + - CustomerPreferences + summary: Create a customer preference element + description: >- + + parameters: + - name: customerProfileId + in: path + required: true + schema: + type: integer + example: 1 + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/customerPreferencesEntity" + examples: + customerPreference: + value: + customerPreference: + languageId: 1 + required: true + responses: + "201": + description: Successfully created a customer preference content: application/json: schema: - $ref: "#/components/schemas/400Response" - examples: - InvalidPostalCodeFormatForAddressCountryNLError: - value: - code: "400" - type: Bad Request - Input parameters - message: Invalid input parameter for country validation (NL). - description: >- - ECMA 262 regex \"^(?:\\d{4}[A-Z]{2})?$\" does not match - input string \"2500 AA\ - MissingRequiredParameterError: - value: - code: "400" - type: Bad Request - Input parameters - message: Invalid input parameter. - description: >- - object has missing required properties - ([\"addressTypeId\"]) - InvalidDataTypeError: - value: - code: "400" - type: Bad Request - Input parameters - message: Invalid input parameter. - description: >- - Bad Request - please verify the value for the following - field \"id\ - "401": - description: Unauthorized + $ref: "#/components/schemas/postCustomerPreferencesResponse" + security: + - default: [] + x-auth-type: Application & Application User + x-throttling-tier: Unlimited + /customerPreferences/{customerPreferenceId}: + patch: + tags: + - CustomerPreferences + summary: Modify a customer preference element + description: >- + + parameters: + - name: customerPreferenceId + in: path + required: true + schema: + type: integer + example: 1 + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/customerPreferencesEntity" + examples: + customerPreference: + value: + customerPreference: + languageId: 1 + required: true + responses: + "200": + description: Successfully modified a customer preference content: application/json: schema: - $ref: "#/components/schemas/401Response" - "409": - description: Conflict - content: - application/json: - schema: - $ref: "#/components/schemas/409Response" - examples: - emailAddressAlreadyPresent: - value: - code: "409" - type: Conflict - message: emailAddress already exists. - description: "" - "500": - description: Internal Server Error - content: - application/json: - schema: - $ref: "#/components/schemas/500Response" + $ref: "#/components/schemas/patchCustomerPreferencesResponse" security: - default: [] x-auth-type: Application & Application User @@ -1179,13 +1486,21 @@ components: type: object properties: languageId: - type: string - postCustomerProfileCustomerNumberResponse: + type: integer + customersEntity: + type: object + properties: + debtorStatusId: + type: integer + postCustomerProfileResponse: type: object properties: customerNumber: type: integer - example: 10000001 + example: 10000001 + customerProfileId: + type: integer + example: 1 postCustomerProfileAddressResponse: type: object properties: @@ -1234,15 +1549,24 @@ components: patchCustomerProfileResponse: type: object properties: - customerNumber: + customerProfileId: type: integer - example: 10000001 + example: 1 + postCustomerPreferencesResponse: + type: object + properties: + customerPreferenceId: + type: integer + example: 1 patchCustomerPreferencesResponse: type: object properties: - customerNumber: + customerPreferenceId: type: integer - example: 10000001 + example: 1 + customerLanguageId: + type: integer + example: 1 ovPayTokenGetEntity: type: object properties: @@ -1289,93 +1613,14 @@ components: ovPayTokenId: type: integer example: 1 - 400Response: + ErrorResponse: type: object properties: - code: - type: string - example: "400" type: type: string - message: + title: type: string - example: Bad Request - description: - type: string - example: >- - 'Bad Request: Input parameters missing! Please fill in at least 1 - valid input parameter. - 401Response: - type: object - properties: - code: - type: string - example: "900901" - type: - type: string - message: - type: string - example: Invalid Credentials - description: - type: string - example: >- - Invalid Credentials. Make sure you have provided the correct - security credentials - 404Response: - type: object - properties: - code: - type: string - example: "404" - type: - type: string - example: Status report - message: - type: string - example: Not Found - description: - type: string - example: The requested resource is not available. - 409Response: - type: object - properties: - code: - type: string - example: "409" - type: - type: string - example: Conflict - message: - type: string - example: Entry already exists - description: - type: string - 422Response: - type: object - properties: - code: - type: string - example: "422" - type: - type: string - example: Unprocessable entity - message: - type: string - example: >- - Forbidden state transition requested! From Active to Cleared not - allowed. - description: - type: string - 500Response: - type: object - properties: - code: - type: string - example: "500" - type: - type: string - message: - type: string - example: Internal Server Error - description: + detail: type: string + instance: + type: string \ No newline at end of file