WIP GET customers, GET OvPayTokens with HATEOAS

This commit is contained in:
Max Martens 2024-12-03 09:00:49 +01:00
parent 3eb98b0d23
commit feaaec2a53

View File

@ -17,7 +17,8 @@ paths:
get: get:
tags: tags:
- ServiceEngine Customers - ServiceEngine Customers
summary: Get a customer profile based on search parameters, only returns a unique profile summary: Get a single customer profile based on search parameters
description: Get a single customer profile based on search parameters. Only returns a profile if a single result matches the parameters; when multiple results are found, additional seach parameters are required to disambiguate.
parameters: parameters:
- name: customerProfileId - name: customerProfileId
in: query in: query
@ -28,17 +29,17 @@ paths:
in: query in: query
schema: schema:
type: integer type: integer
example: 1 example: 1000001
- name: debtorNumber - name: debtorNumber
in: query in: query
schema: schema:
type: integer type: integer
example: 1 example: 100001
- name: birthname - name: birthname
in: query in: query
schema: schema:
type: string type: string
example: Jon example: John
- name: surname - name: surname
in: query in: query
schema: schema:
@ -49,7 +50,7 @@ paths:
schema: schema:
type: string type: string
format: email format: email
example: jon.doe@mymailprovider.com example: john.doe@mymailprovider.com
- name: dateOfBirth - name: dateOfBirth
in: query in: query
schema: schema:
@ -90,7 +91,7 @@ paths:
in: query in: query
schema: schema:
type: string type: string
example: The Netherlands example: "0123456789"
- name: ovChipcardNumber - name: ovChipcardNumber
in: query in: query
schema: schema:
@ -123,17 +124,53 @@ paths:
example: e1307c73-676a-4d07-967b-6141276f7c7c example: e1307c73-676a-4d07-967b-6141276f7c7c
responses: responses:
'200': '200':
description: Ok description: OK
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/CustomersResponse' $ref: '#/components/schemas/CustomersResponse'
'404': '404':
description: Customer not found description: No customer found
content:
application/json:
example:
{
"type": "https://api.integratielaag.nl/abt/serviceengine/1.0/customers",
"apiErrorCode": "400.1",
"title": "Niet gevonden",
"detail": "Klant niet gevonden",
"instance": "555d00b5-bc3f-4591-949b-479e76d49ea7",
"errors": [
{
"subApiErrorCode": "0017"
}
]
}
'409':
description: Multiple customers found
content:
application/json:
example:
{
"type": "https://api.integratielaag.nl/abt/serviceengine/1.0/customers",
"apiErrorCode": "409.1",
"title": "Meer dan 1 klantprofiel gevonden",
"detail": "Meer dan 1 klantprofiel gevonden. Verfijn je zoekcriteria.",
"instance": "555d00b5-bc3f-4591-949b-479e76d49ea7"
}
/customers/tokens:
get:
tags:
- ServiceEngine Customers
summary: Get a list of all OvPayTokens for a certain customer
description: Get a list of all OvPayTokens for a certain customer.
responses:
'200':
description: OK
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/CustomersResponse' $ref: '#/components/schemas/OvPayTokensResponse'
/customers/tokens/{tokenId}/product-instances: /customers/tokens/{tokenId}/product-instances:
get: get:
tags: tags:
@ -166,6 +203,335 @@ paths:
Entries: [] Entries: []
components: components:
schemas: schemas:
CustomersResponse:
type: object
properties:
customerProfileId:
type: integer
example: 1
customerNumber:
type: integer
example: 1000001
debtorNumber:
type: string
example: DB100001
customerStatus:
type: object
properties:
customerStatusId:
type: integer
example: 1
name:
type: string
example: Active
person:
type: object
properties:
prefix:
type: string
example: Mr
birthname:
type: string
example: John
surname:
type: string
example: Doe
suffix:
type: string
example: Jr.
dateOfBirth:
type: string
format: date
example: '2023-02-01'
emailAdress:
type: string
format: email
example: 4j2dD@example.com
addresses:
type: array
items:
type: object
properties:
addressId:
type: integer
example: 1
isPreferred:
type: boolean
example: true
addressType:
type: object
properties:
addressTypeId:
type: integer
example: 1
name:
type: string
example: Brug
street:
type: string
example: Appelstraat
houseNumber:
type: integer
example: 1
houseNumberSuffix:
type: string
example: BS
postalCode:
type: string
example: 1234AB
city:
type: string
example: Den Haag
country:
type: string
example: Nederland
_links:
type: object
properties:
delete:
type: object
properties:
href:
type: string
example: https://api.integratielaag.nl/abt/serviceengine/1.0/customers/addresses/1
method:
type: string
example: DELETE
phones:
type: array
items:
type: object
properties:
phoneId:
type: integer
example: 1
isPreferred:
type: boolean
example: true
phoneType:
type: object
properties:
phoneTypeId:
type: integer
example: 1
name:
type: string
example: Mobiel
number:
type: string
example: "0123456789"
countryCode:
type: string
example: "0031"
_links:
type: object
properties:
delete:
type: object
properties:
href:
type: string
example: https://api.integratielaag.nl/abt/serviceengine/1.0/customers/phones/1
method:
type: string
example: DELETE
_links:
type: object
properties:
partial_edit:
type: object
properties:
href:
type: string
example: https://api.integratielaag.nl/abt/serviceengine/1.0/customers
method:
type: string
example: PATCH
templated:
type: boolean
example: true
get_tokens:
type: object
properties:
href:
type: string
example: https://api.integratielaag.nl/abt/serviceengine/1.0/customers/tokens
method:
type: string
example: GET
templated:
type: boolean
example: true
create_token:
type: object
properties:
href:
type: string
example: https://api.integratielaag.nl/abt/serviceengine/1.0/customers/tokens
method:
type: string
example: POST
templated:
type: boolean
example: true
_templates:
type: object
properties:
partial_edit:
type: object
properties:
method:
type: string
example: PATCH
properties:
example:
[
{ name: person, required: true, properties: [
{ name: prefix, required: false, type: string },
{ name: birthname, required: false, type: string },
{ name: surname, required: false, type: string },
{ name: suffix, required: false, type: string },
{ name: dateOfBirth, required: false, type: string },
{ name: emailAdress, required: false, type: string },
{ name: addresses, required: false, multi: true, properties: [
{ name: addressId, required: false, type: integer },
{ name: isPreferred, required: false, type: boolean },
{ name: addressTypeId, required: false, type: integer },
{ name: street, required: false, type: string },
{ name: houseNumber, required: false, type: integer },
{ name: houseNumberSuffix, required: false, type: string },
{ name: postalCode, required: false, type: string },
{ name: city, required: false, type: string },
{ name: country, required: false, type: string }
]},
{ name: phones, required: false, multi: true, properties: [
{ name: phoneId, required: false, type: integer },
{ name: isPreferred, required: false, type: boolean },
{ name: phoneTypeId, required: false, type: integer },
{ name: number, required: false, type: string },
{ name: countryCode, required: false, type: string }
]}
] }
]
create_token:
type: object
properties:
method:
type: string
example: POST
properties:
example:
[
{ name: ovPayToken, required: true, properties: [
{ name: tokenTypeId, required: true, type: integer },
{ name: alias, required: true, type: string },
{ name: serviceReferenceId, required: false, type: string },
{ name: amount, required: false, type: integer },
]}
]
OvPayTokensResponse:
type: object
required:
- ovPayTokens
properties:
Entries:
type: array
items:
type: object
properties:
ovPayTokenId:
type: integer
example: 1
tokenType:
type: object
properties:
tokenTypeId:
type: integer
example: 1
name:
type: string
example: EMV
alias:
type: string
example: MyToken
tokenStatus:
type: object
properties:
tokenStatusId:
type: integer
example: 1
name:
type: string
example: Active
expirationDate:
type: string
format: date
example: '2023-02-01'
replacedByTokenId:
type: integer
example: 1
_links:
type: object
properties:
partial_edit:
type: object
properties:
href:
type: string
example: https://api.integratielaag.nl/abt/serviceengine/1.0/customers/tokens/1
method:
type: string
example: PATCH
templated:
type: boolean
example: true
delete:
type: object
properties:
href:
type: string
example: https://api.integratielaag.nl/abt/serviceengine/1.0/customers/tokens/1
method:
type: string
example: DELETE
product-instances:
type: object
properties:
href:
type: string
example: https://api.integratielaag.nl/abt/serviceengine/1.0/customers/tokens/1/product-instances
method:
type: string
example: GET
trips:
type: object
properties:
href:
type: string
example: https://api.integratielaag.nl/abt/serviceengine/1.0/customers/tokens/1/trips
method:
type: string
example: GET
_templates:
type: object
properties:
partial_edit:
type: object
properties:
method:
type: string
example: PATCH
properties:
example:
[
{ name: ovPayToken, required: true, properties: [
{ name: tokenStatusId, required: false, type: integer },
{ name: alias, required: false, type: string }
]}
]
TokenProductInstancesResponse: TokenProductInstancesResponse:
type: object type: object
required: required:
@ -173,5 +539,5 @@ components:
properties: properties:
Entries: Entries:
type: array type: array
CustomersResponse:
type: object