From 959ed1cd96c0f5eacb4bb3f123346a18d11e9c18 Mon Sep 17 00:00:00 2001 From: "b.boterman@htm.nl" Date: Fri, 28 Nov 2025 13:47:58 +0100 Subject: [PATCH] OVPAY-2294 - Introduced voucherStatusInstance. --- .../products/purchased_products-crud.yaml | 130 +++++++++++++++--- 1 file changed, 111 insertions(+), 19 deletions(-) diff --git a/src/openapi/products/purchased_products-crud.yaml b/src/openapi/products/purchased_products-crud.yaml index 3ab0f95..991e1f7 100644 --- a/src/openapi/products/purchased_products-crud.yaml +++ b/src/openapi/products/purchased_products-crud.yaml @@ -204,8 +204,27 @@ paths: { "issuedVoucherId": "e1f2g3h4-i5j6-k7l8-m9n0-o1p2q3r4s5t6", "voucherCode": "VOUCHER12345", - "voucherStatus": - { "voucherStatusId": 1, "name": "Active" }, + "voucherStatusInstances": + [ + { + "voucherStatusInstanceId": "ac8c54d1-79f7-4167-8817-c66b9575d679", + "voucherStatus": + { + "voucherStatusId": 1, + "name": "New", + }, + "createdOn": "2024-10-04T12:34:56.000", + }, + { + "voucherStatusInstanceId": "b01412e6-70fb-4c05-9bef-e65bf2747ca1", + "voucherStatus": + { + "voucherStatusId": 2, + "name": "Issued", + }, + "createdOn": "2024-10-04T12:37:14.000", + }, + ], "voucherClaims": [ { @@ -331,7 +350,13 @@ paths: [ { "voucherCode": "VOUCHER123", - "voucherStatusId": 1, + "voucherStatusInstances": + [ + { + "voucherStatusId": 1, + "createdOn": "2024-10-04T12:34:56.000", + }, + ], "voucherClaims": [ { @@ -484,12 +509,33 @@ paths: { "issuedVoucherId": "e1f2g3h4-i5j6-k7l8-m9n0-o1p2q3r4s5t6", "voucherCode": "VOUCHER12345", - "redeemedOn": null, - "expiresOn": "2024-12-31T23:59:59.000", - "createdOn": "2024-10-04T12:34:56.000", - "lastUpdatedOn": "2024-10-04T12:34:56.000", - "createdBy": "admin", - "lastUpdatedBy": "admin", + "voucherStatusInstances": + [ + { + "voucherStatusInstanceId": "ac8c54d1-79f7-4167-8817-c66b9575d679", + "voucherStatus": + { "voucherStatusId": 1, "name": "New" }, + "createdOn": "2024-10-04T12:34:56.000", + }, + { + "voucherStatusInstanceId": "b01412e6-70fb-4c05-9bef-e65bf2747ca1", + "voucherStatus": + { "voucherStatusId": 2, "name": "Issued" }, + "createdOn": "2024-10-04T12:37:14.000", + }, + ], + "voucherClaims": + [ + { + "voucherClaimId": "b1c2d3e4-f5g6-h7i8-j9k0-l1m2n3o4p5q6", + "mandatoryCustomerDataItem": + { + "mandatoryCustomerDataItemId": 8, + "name": "PadBirthdate", + }, + "value": "1990-01-01", + }, + ], }, ], } @@ -1085,7 +1131,13 @@ paths: example: { "voucherCode": "VOUCHER123", - "voucherStatusId": 1, + "voucherStatusInstances": + [ + { + "voucherStatusId": 1, + "createdOn": "2024-10-04T12:34:56.000", + }, + ], "voucherClaims": [ { "mandatoryCustomerDataItemId": 8, "value": "1999-12-31" }, @@ -1139,7 +1191,7 @@ paths: type: integer explode: false required: false - description: The status id of the voucher. + description: The moest recent status id of the voucher. responses: "200": description: OK @@ -1155,8 +1207,21 @@ paths: "issuedVoucherId": "d4e5f6a7-b8c9-0d1e-2f3a-4b5c6d7e8f90", "purchasedProductId": "058a1af7-897f-45d5-b691-9cc9161e387f", "voucherCode": "VOUCHER123", - "voucherStatus": - { "voucherStatusId": 1, "name": "New" }, + "voucherStatusInstances": + [ + { + "voucherStatusInstanceId": "ac8c54d1-79f7-4167-8817-c66b9575d679", + "voucherStatus": + { "voucherStatusId": 1, "name": "New" }, + "createdOn": "2024-10-04T12:34:56.000", + }, + { + "voucherStatusInstanceId": "b01412e6-70fb-4c05-9bef-e65bf2747ca1", + "voucherStatus": + { "voucherStatusId": 2, "name": "Issued" }, + "createdOn": "2024-10-04T12:37:14.000", + }, + ], "voucherClaims": [ { @@ -1179,7 +1244,7 @@ paths: }, ], } - /issuedvouchers/{issuedVoucherId}: + /issuedvouchers/{issuedVoucherId}/voucherstatusinstances: parameters: - in: path name: issuedVoucherId @@ -1189,18 +1254,19 @@ paths: example: d4e5f6a7-b8c9-0d1e-2f3a-4b5c6d7e8f90 required: true description: The id of the issued voucher to process. - patch: + post: tags: - Issued Voucher - summary: Update an issued voucher. - description: Update an issued voucher. + summary: Update the status of an issued voucher. + description: Update the status of an issued voucher. requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/unavailable" - example: { "voucherStatusId": 2 } + example: + { "voucherStatusId": 2, "createdOn": "2024-10-04T12:34:56.000" } responses: "200": description: OK @@ -1209,7 +1275,33 @@ paths: schema: $ref: "#/components/schemas/unavailable" example: - { "issuedVoucherId": "d4e5f6a7-b8c9-0d1e-2f3a-4b5c6d7e8f90" } + { + "voucherStatusInstanceId": "d4e5f6a7-b8c9-0d1e-2f3a-4b5c6d7e8f90", + } + /voucherstatuses: + get: + tags: + - References + summary: Get voucher statuses. + description: Get voucher statuses. + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/unavailable" + example: + { + "voucherStatuses": + [ + { "voucherStatusId": 1, "name": "New" }, + { "voucherStatusId": 2, "name": "Issued" }, + { "voucherStatusId": 3, "name": "Redeemed" }, + { "voucherStatusId": 4, "name": "Revoked" }, + { "voucherStatusId": 5, "name": "Expired" }, + ], + } components: securitySchemes: bearerToken: