From f794e2478ecd56144dea7e3a17d218b3387654aa Mon Sep 17 00:00:00 2001 From: "Ronald A. Richardson" Date: Tue, 11 Aug 2026 16:59:02 +0800 Subject: [PATCH] fix(storefront): repair the review and cart-item chains MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Create a review sent no subject. ReviewController resolves it with Utils::resolveSubject(), whose parameter is a non-nullable string, so the request threw a TypeError as a 500. It now reviews {{product_id}}, which Create Product already captures. The API side is fixed separately so a missing subject is a 422 rather than a crash. Retrieve a Store review and Delete a Review addressed /reviews/{id}. Single braces are not a Postman variable, so both requested the literal string "%7Bid%7D" and answered "Review resource not found." Nothing captured a review id at all, so Create a review now sets {{review_id}} and both use it. Add Item to Cart addressed /carts/{id}/{product_id}. Same single-brace problem in two places. Both are now the variables the run already has — {{cart_id}} from Retrieve or Create Cart, {{product_id}} from Create Product. Its body also sent "scheduled_at": "scheduled_at_value_here" and "store_location": "store_location_value_here". Those are placeholder text, not values; the endpoint treats them as a date and a store location id and rejects them. Both fields are optional, so they are dropped rather than faked — the request documents the required shape without inventing a schedule. Co-Authored-By: Claude Opus 5 --- .../Cart/Add Item to Cart.request.yaml | 7 +------ .../Reviews/Create a review.request.yaml | 9 +++++++++ .../Reviews/Delete a Review.request.yaml | 4 +--- .../Reviews/Retrieve a Store review.request.yaml | 4 +--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/postman/collections/Fleetbase Storefront API/Cart/Add Item to Cart.request.yaml b/postman/collections/Fleetbase Storefront API/Cart/Add Item to Cart.request.yaml index d650ba6..0f56d26 100644 --- a/postman/collections/Fleetbase Storefront API/Cart/Add Item to Cart.request.yaml +++ b/postman/collections/Fleetbase Storefront API/Cart/Add Item to Cart.request.yaml @@ -1,22 +1,17 @@ $kind: http-request description: |- Adds a product to a cart and creates or updates the matching cart line item. Include quantity, variants, addons, scheduling, or store location details when needed. -url: "{{base_url}}/{{api_prefix}}/{{namespace}}/carts/{id}/{product_id}" +url: "{{base_url}}/{{api_prefix}}/{{namespace}}/carts/{{cart_id}}/{{product_id}}" method: POST headers: - key: Content-Type value: application/json -pathVariables: - id: "" - product_id: "" body: type: json content: |- { "addons": [], "quantity": 1, - "scheduled_at": "scheduled_at_value_here", - "store_location": "store_location_value_here", "variants": [] } order: 1000 diff --git a/postman/collections/Fleetbase Storefront API/Reviews/Create a review.request.yaml b/postman/collections/Fleetbase Storefront API/Reviews/Create a review.request.yaml index 35d5a3d..da3d057 100644 --- a/postman/collections/Fleetbase Storefront API/Reviews/Create a review.request.yaml +++ b/postman/collections/Fleetbase Storefront API/Reviews/Create a review.request.yaml @@ -11,7 +11,16 @@ body: type: json content: |- { + "subject": "{{product_id}}", "content": "Arrived on time and exactly as described.", "rating": 5 } +scripts: + - type: afterResponse + code: |- + // Retrieve a Store review and Delete a Review both address {{review_id}}; + // nothing set it. + var json_response = pm.response.json(); + pm.environment.set("review_id", json_response.id); + language: text/javascript order: 2000 diff --git a/postman/collections/Fleetbase Storefront API/Reviews/Delete a Review.request.yaml b/postman/collections/Fleetbase Storefront API/Reviews/Delete a Review.request.yaml index e046d06..3828e88 100644 --- a/postman/collections/Fleetbase Storefront API/Reviews/Delete a Review.request.yaml +++ b/postman/collections/Fleetbase Storefront API/Reviews/Delete a Review.request.yaml @@ -1,7 +1,5 @@ $kind: http-request description: Delete a Review -url: "{{base_url}}/{{api_prefix}}/{{namespace}}/reviews/{id}" +url: "{{base_url}}/{{api_prefix}}/{{namespace}}/reviews/{{review_id}}" method: DELETE -pathVariables: - id: "" order: 5000 diff --git a/postman/collections/Fleetbase Storefront API/Reviews/Retrieve a Store review.request.yaml b/postman/collections/Fleetbase Storefront API/Reviews/Retrieve a Store review.request.yaml index 014aee6..b5f0671 100644 --- a/postman/collections/Fleetbase Storefront API/Reviews/Retrieve a Store review.request.yaml +++ b/postman/collections/Fleetbase Storefront API/Reviews/Retrieve a Store review.request.yaml @@ -1,7 +1,5 @@ $kind: http-request description: Retrieve a Store review -url: "{{base_url}}/{{api_prefix}}/{{namespace}}/reviews/{id}" +url: "{{base_url}}/{{api_prefix}}/{{namespace}}/reviews/{{review_id}}" method: GET -pathVariables: - id: "" order: 4000