From e8f76f6d13b0663bc66ee9adf6d0fe8588bf330b Mon Sep 17 00:00:00 2001 From: "b.boterman@htm.nl" Date: Mon, 7 Oct 2024 13:19:56 +0200 Subject: [PATCH] OVPAY-1116 - Implemented CRUDs. --- .../products/purchased_products-crud.yaml | 398 +++++++++++++++++- 1 file changed, 397 insertions(+), 1 deletion(-) diff --git a/src/openapi/products/purchased_products-crud.yaml b/src/openapi/products/purchased_products-crud.yaml index a4d6e2c..6d11d46 100644 --- a/src/openapi/products/purchased_products-crud.yaml +++ b/src/openapi/products/purchased_products-crud.yaml @@ -12,17 +12,156 @@ paths: - Purchased Product summary: Find purchased products. description: Find purchased products. + parameters: + - in: query + name: productId + schema: + type: integer + example: 1 + required: false + description: The technical id of the product. + - in: query + name: createdBefore + schema: + type: string + format: date-time + example: 2024-10-04T12:34:56.000 + required: false + description: The purchased product should be created before this timestamp. + - in: query + name: createdAfter + schema: + type: string + format: date-time + example: 2024-10-04T12:34:56.000 + required: false + description: The purchased product should be created after this timestamp. + - in: query + name: lastUpdatedBefore + schema: + type: string + format: date-time + example: 2024-10-04T12:34:56.000 + required: false + description: The purchased product should be last updated before this timestamp. + - in: query + name: lastUpdatedAfter + schema: + type: string + format: date-time + example: 2024-10-04T12:34:56.000 + required: false + description: The purchased product should be last updated after this timestamp. + - in: query + name: resrouceName + schema: + type: string + example: orders + required: false + description: The name of the resource. + - in: query + name: resrouceIdentifier + schema: + type: string + example: f461004f-d98e-4323-aa26-f09bf8ea2f2d + required: false + description: The identifier of the resource. responses: "200": description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/unavailable" + example: + [ + { + "purchasedProductId": "45573af8-a9aa-4f7c-95f4-b1971bf2c3c6", + "productId": 12, + "createdOn": "2024-10-04T12:34:56.000", + "lastUpdatedOn": "2024-10-04T12:34:56.000", + "purchasedProductResources": + [ + { + "purchasedProductResourceId": "c7900130-0637-41d7-83fe-6fe283a0a1f1", + "resourceName": + { "resourceNameId": 1, "name": "contracts" }, + "resourceIdentifier": "408eefa9-b393-4bb3-8439-b2e51833abc7", + }, + { + "purchasedProductResourceId": "06dae996-cdfe-45f1-833a-720201c35114", + "resourceName": + { "resourceNameId": 2, "name": "orders" }, + "resourceIdentifier": "f809a6e1-1c8d-4f8e-8a6e-0d0b1e1e1e1e", + }, + ], + "purchasedGboProducts": + [ + { + "purchasedGboProductId": "a9b3dea5-fb8a-4b1e-9fe6-90cad31c0cfd", + "salesTimestamp": "2024-10-04T12:34:56.000", + "refundTimestamp": "2024-10-04T12:34:56.000", + "packageTemplateId": "30003", + "xBot": "f15efe6f-7353-4968-b134-60ba6fc2da8b", + "xTat": "42efebf7-132e-4ee0-9cbb-4037a9a54ad8", + "xSpit": "d67b2f72-918a-4e6c-957d-a39ed9c9e16b", + "customerTokenId": "b6492322-c458-4857-9ac3-a109c1887b9f", + "ovPayTokenId": 13, + }, + ], + }, + ] post: tags: - Purchased Product summary: Create a new purchased product. description: Create a new purchased product. + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/unavailable" + example: + { + "productId": 11, + "createdOn": "2024-10-04T12:34:56.000", + "lastUpdatedOn": "2024-10-04T12:34:56.000", + "purchasedProductResources": + [ + { + "resourceName": + { "resourceNameId": 1, "name": "contracts" }, + "resourceIdentifier": "408eefa9-b393-4bb3-8439-b2e51833abc7", + }, + { + "resourceName": { "resourceNameId": 2, "name": "orders" }, + "resourceIdentifier": "f809a6e1-1c8d-4f8e-8a6e-0d0b1e1e1e1e", + }, + ], + "purchasedGboProducts": + [ + { + "salesTimestamp": "2024-10-04T12:34:56.000", + "refundTimestamp": "2024-10-04T12:34:56.000", + "packageTemplateId": "30003", + "xBot": "f15efe6f-7353-4968-b134-60ba6fc2da8b", + "xTat": "42efebf7-132e-4ee0-9cbb-4037a9a54ad8", + "xSpit": "d67b2f72-918a-4e6c-957d-a39ed9c9e16b", + "customerTokenId": "b6492322-c458-4857-9ac3-a109c1887b9f", + "ovPayTokenId": 13, + }, + ], + } responses: "201": description: Created + content: + application/json: + schema: + $ref: "#/components/schemas/unavailable" + example: + { "purchasedProductId": "a9b3dea5-fb8a-4b1e-9fe6-90cad31c0cfd" } /purchasedproducts/{purchasedProductId}: parameters: - in: path @@ -41,14 +180,64 @@ paths: responses: "200": description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/unavailable" + example: + { + "purchasedProductId": "a9b3dea5-fb8a-4b1e-9fe6-90cad31c0cfd", + "productId": 14, + "createdOn": "2024-10-04T12:34:56.000", + "lastUpdatedOn": "2024-10-04T12:34:56.000", + "purchasedProductResources": + [ + { + "resourceName": + { "resourceNameId": 1, "name": "contracts" }, + "resourceIdentifier": "408eefa9-b393-4bb3-8439-b2e51833abc7", + }, + { + "resourceName": + { "resourceNameId": 2, "name": "orders" }, + "resourceIdentifier": "f809a6e1-1c8d-4f8e-8a6e-0d0b1e1e1e1e", + }, + ], + "purchasedGboProducts": + [ + { + "salesTimestamp": "2024-10-04T12:34:56.000", + "refundTimestamp": "2024-10-04T12:34:56.000", + "packageTemplateId": "30003", + "xBot": "f15efe6f-7353-4968-b134-60ba6fc2da8b", + "xTat": "42efebf7-132e-4ee0-9cbb-4037a9a54ad8", + "xSpit": "d67b2f72-918a-4e6c-957d-a39ed9c9e16b", + "customerTokenId": "b6492322-c458-4857-9ac3-a109c1887b9f", + "ovPayTokenId": 13, + }, + ], + } patch: tags: - Purchased Product summary: Update a purchased product. description: Update a purchased product. + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/unavailable" + example: { "lastUpdatedOn": "2024-10-04T12:34:56.000" } responses: "200": description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/unavailable" + example: + { "purchasedProductId": "a9b3dea5-fb8a-4b1e-9fe6-90cad31c0cfd" } /purchasedproducts/{purchasedProductId}/resources: parameters: - in: path @@ -64,9 +253,28 @@ paths: - Purchased Product summary: Add a resource to a purchased product. description: Add a resource to a purchased product. + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/unavailable" + example: + { + "resourceName": 1, + "resourceIdentifier": "502d2e0d-4e3b-4a7e-9f6e-0d0b1e1e1e1e", + } responses: "201": description: Created + content: + application/json: + schema: + $ref: "#/components/schemas/unavailable" + example: + { + "purchasedProductResourceId": "ff572952-b16e-43ee-919c-a6edb620079e", + } /purchasedproducts/{purchasedProductId}/gboproducts: parameters: - in: path @@ -82,18 +290,158 @@ paths: - Purchased GBO Product summary: Add a GBO purchased product. description: Add a GBO purchased product. + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/unavailable" + example: + { + "salesTimestamp": "2024-10-04T12:34:56.000", + "refundTimestamp": "2024-10-04T12:34:56.000", + "packageTemplateId": "30003", + "xBot": "f15efe6f-7353-4968-b134-60ba6fc2da8b", + "xTat": "42efebf7-132e-4ee0-9cbb-4037a9a54ad8", + "xSpit": "d67b2f72-918a-4e6c-957d-a39ed9c9e16b", + "customerTokenId": "b6492322-c458-4857-9ac3-a109c1887b9f", + "ovPayTokenId": 13, + } responses: "201": description: Created + content: + application/json: + schema: + $ref: "#/components/schemas/unavailable" + example: + { + "purchasedGboProductId": "a9b3dea5-fb8a-4b1e-9fe6-90cad31c0cfd", + } /purchasedgboproducts: get: tags: - Purchased GBO Product summary: Find GBO purchased products. description: Find GBO purchased products. + parameters: + - in: query + name: purchasedGboProductId + schema: + type: string + format: uuid + example: c99dea33-a1be-4336-ad25-ec0869693ef3 + description: The id of the purchased GBO product. + - in: query + name: purchasedProductId + schema: + type: string + format: uuid + example: 058a1af7-897f-45d5-b691-9cc9161e387f + description: The id of the purchased product. + - in: query + name: salesTimestampBefore + schema: + type: string + format: date-time + example: 2024-10-04T12:34:56.000 + description: The purchased GBO product should be sold before this timestamp. + - in: query + name: salesTimestampAfter + schema: + type: string + format: date-time + example: 2024-10-04T12:34:56.000 + description: The purchased GBO product should be sold after this timestamp. + - in: query + name: refundTimestampBefore + schema: + type: string + format: date-time + example: 2024-10-04T12:34:56.000 + description: The purchased GBO product should be refunded before this timestamp. + - in: query + name: refundTimestampAfter + schema: + type: string + format: date-time + example: 2024-10-04T12:34:56.000 + description: The purchased GBO product should be refunded after this timestamp. + - in: query + name: packageTemplateId + schema: + type: string + format: uuid + example: 30003 + description: The id of the package template. + - in: query + name: xBot + schema: + type: string + format: uuid + example: f15efe6f-7353-4968-b134-60ba6fc2da8b + description: The id of the XBOT. + - in: query + name: xTat + schema: + type: string + format: uuid + example: 42efebf7-132e-4ee0-9cbb-4037a9a54ad8 + description: The id of the XTAT. + - in: query + name: xSpit + schema: + type: string + format: uuid + example: d67b2f72-918a-4e6c-957d-a39ed9c9e16b + description: The id of the XSPIT. + - in: query + name: customerTokenId + schema: + type: string + format: uuid + example: b6492322-c458-4857-9ac3-a109c1887b9f + description: The id of the customer token. + - in: query + name: ovPayTokenId + schema: + type: integer + example: 13 + description: The id of the ov pay token. responses: "201": description: Created + content: + application/json: + schema: + $ref: "#/components/schemas/unavailable" + example: + [ + { + "purchasedGboProductId": "a9b3dea5-fb8a-4b1e-9fe6-90cad31c0cfd", + "purchasedProductId": "9e166bb3-806a-4f43-a7a2-0d5b1e90e0c3", + "salesTimestamp": "2024-10-04T12:34:56.000", + "refundTimestamp": "2024-10-05T12:34:56.000", + "packageTemplateId": "30003", + "xBot": "f15efe6f-7353-4968-b134-60ba6fc2da8b", + "xTat": "42efebf7-132e-4ee0-9cbb-4037a9a54ad8", + "xSpit": "d67b2f72-918a-4e6c-957d-a39ed9c9e16b", + "customerTokenId": "b6492322-c458-4857-9ac3-a109c1887b9f", + "ovPayTokenId": 13, + }, + { + "purchasedGboProductId": 431e481f-4330-4ad4-be47-393db38cfe38, + "purchasedProductId": "9e166bb3-806a-4f43-a7a2-0d5b1e90e0c3", + "salesTimestamp": "2024-10-05T12:34:56.000", + "refundTimestamp": "2024-10-06T12:34:56.000", + "packageTemplateId": "30003", + "xBot": "f8f13d64-fd07-44e8-9c85-968857da5d68", + "xTat": "01a82ebe-5d07-45d8-a897-66152e8954dd", + "xSpit": "c3868858-b250-4480-9cb4-725d2e9198f3", + "customerTokenId": "6c7a6d4b-7e6c-4f6a-9b1e-0a9b1e6c7a6d", + "ovPayTokenId": 14, + }, + ] /purchasedgboproducts/{purchasedGboProductId}: parameters: - in: path @@ -109,6 +457,54 @@ paths: - Purchased GBO Product summary: Update a GBO purchased product. description: Update a GBO purchased product. + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/unavailable" + example: { "refundTimestamp": "2024-10-05T12:34:56.000" } responses: "201": - description: Created \ No newline at end of file + description: Created + content: + application/json: + schema: + $ref: "#/components/schemas/unavailable" + example: + { "purchasedGboProductId": "a9b3dea5-fb8a-4b1e-9fe6-90cad31c0cfd" } +components: + securitySchemes: + bearerToken: + type: http + scheme: bearer + bearerFormat: JWT + schemas: + unavailable: + type: object + rfc9457: + type: object + properties: + type: + type: string + format: url + example: https://example.com/probs/out-of-credit + title: + type: string + example: You do not have enough credit. + detail: + type: string + example: Your current balance is 30, but that costs 50. + instance: + type: string + example: /account/12345/msgs/abc + balance: + type: string + example: 30 + accounts: + type: array + items: + type: string + example: + - /account/12345 + - /account/67890