feature/pubsub #7

Merged
mats merged 67 commits from feature/pubsub into main 2025-11-28 17:45:22 +01:00
Showing only changes of commit 430da09264 - Show all commits

View File

@@ -333,6 +333,118 @@
}
}
},
"/cart/user": {
"put": {
"summary": "Set user ID for cart",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/SetUserIdRequest" }
}
}
},
"responses": {
"200": {
"description": "User ID set",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/CartGrain" }
}
}
},
"400": { "description": "Invalid body" },
"500": { "description": "Server error" }
}
}
},
"/cart/item/{itemId}/marking": {
"put": {
"summary": "Set marking for line item",
"parameters": [
{
"name": "itemId",
"in": "path",
"required": true,
"schema": { "type": "integer", "format": "int64", "minimum": 0 },
"description": "Internal cart line item identifier."
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/LineItemMarkingRequest"
}
}
}
},
"responses": {
"200": {
"description": "Marking set",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/CartGrain" }
}
}
},
"400": { "description": "Invalid body or id" },
"500": { "description": "Server error" }
}
},
"delete": {
"summary": "Remove marking from line item",
"parameters": [
{
"name": "itemId",
"in": "path",
"required": true,
"schema": { "type": "integer", "format": "int64", "minimum": 0 },
"description": "Internal cart line item identifier."
}
],
"responses": {
"200": {
"description": "Marking removed",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/CartGrain" }
}
}
},
"400": { "description": "Invalid id" },
"500": { "description": "Server error" }
}
}
},
"/cart/checkout-order": {
"post": {
"summary": "Create checkout order",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CreateCheckoutOrderRequest"
}
}
}
},
"responses": {
"200": {
"description": "Checkout order created",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/CartGrain" }
}
}
},
"400": { "description": "Invalid body" },
"500": { "description": "Server error" }
}
}
},
"/cart/byid/{id}": {
"get": {
"summary": "Get cart by explicit id",
@@ -569,6 +681,122 @@
}
}
},
"/cart/byid/{id}/user": {
"put": {
"summary": "Set user ID (by id variant)",
"parameters": [{ "$ref": "#/components/parameters/CartIdParam" }],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/SetUserIdRequest" }
}
}
},
"responses": {
"200": {
"description": "User ID set",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/CartGrain" }
}
}
},
"400": { "description": "Invalid body" },
"500": { "description": "Server error" }
}
}
},
"/cart/byid/{id}/item/{itemId}/marking": {
"put": {
"summary": "Set marking (by id variant)",
"parameters": [
{ "$ref": "#/components/parameters/CartIdParam" },
{
"name": "itemId",
"in": "path",
"required": true,
"schema": { "type": "integer", "format": "int64", "minimum": 0 },
"description": "Internal cart line item identifier."
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/LineItemMarkingRequest"
}
}
}
},
"responses": {
"200": {
"description": "Marking set",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/CartGrain" }
}
}
},
"400": { "description": "Invalid body or ids" },
"500": { "description": "Server error" }
}
},
"delete": {
"summary": "Remove marking (by id variant)",
"parameters": [
{ "$ref": "#/components/parameters/CartIdParam" },
{
"name": "itemId",
"in": "path",
"required": true,
"schema": { "type": "integer", "format": "int64", "minimum": 0 },
"description": "Internal cart line item identifier."
}
],
"responses": {
"200": {
"description": "Marking removed",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/CartGrain" }
}
}
},
"400": { "description": "Invalid ids" },
"500": { "description": "Server error" }
}
}
},
"/cart/byid/{id}/checkout-order": {
"post": {
"summary": "Create checkout order (by id variant)",
"parameters": [{ "$ref": "#/components/parameters/CartIdParam" }],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CreateCheckoutOrderRequest"
}
}
}
},
"responses": {
"200": {
"description": "Checkout order created",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/CartGrain" }
}
}
},
"400": { "description": "Invalid body" },
"500": { "description": "Server error" }
}
}
},
"/healthz": {
"get": {
"summary": "Liveness & capacity probe",
@@ -675,6 +903,18 @@
"additionalProperties": {
"$ref": "#/components/schemas/SubscriptionDetails"
}
},
"confirmationViewCount": { "type": "integer" },
"confirmationLastViewedAt": {
"type": "string",
"format": "date-time"
},
"checkoutOrderId": { "type": "string" },
"checkoutStatus": { "type": "string" },
"checkoutCountry": { "type": "string" },
"paymentDeclinedNotices": {
"type": "array",
"items": { "$ref": "#/components/schemas/Notice" }
}
},
"required": ["id", "items", "totalPrice", "totalTax", "totalDiscount"]
@@ -710,7 +950,11 @@
"type": { "type": "string", "description": "Article type" },
"image": { "type": "string" },
"outlet": { "type": "string", "nullable": true },
"storeId": { "type": "string", "nullable": true }
"storeId": { "type": "string", "nullable": true },
"marking": { "$ref": "#/components/schemas/Marking" },
"subscriptionDetailsId": { "type": "string" },
"orderReference": { "type": "string" },
"isSubscribed": { "type": "boolean" }
},
"required": ["id", "sku", "name", "price", "qty", "tax"]
},
@@ -845,6 +1089,46 @@
"data": { "type": "object" }
},
"required": ["id"]
},
"Marking": {
"type": "object",
"properties": {
"type": { "type": "integer" },
"text": { "type": "string" }
},
"required": ["type", "text"]
},
"Notice": {
"type": "object",
"properties": {
"timestamp": { "type": "string", "format": "date-time" },
"message": { "type": "string" },
"code": { "type": "string", "nullable": true }
},
"required": ["timestamp", "message"]
},
"SetUserIdRequest": {
"type": "object",
"properties": {
"userId": { "type": "string" }
},
"required": ["userId"]
},
"LineItemMarkingRequest": {
"type": "object",
"properties": {
"type": { "type": "integer" },
"marking": { "type": "string" }
},
"required": ["type", "marking"]
},
"CreateCheckoutOrderRequest": {
"type": "object",
"properties": {
"terms": { "type": "string" },
"country": { "type": "string" }
},
"required": ["terms", "country"]
}
}
},