You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b8ffa16
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: api/openapi.gen.yaml
+3-9Lines changed: 3 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -2537,7 +2537,7 @@ components:
2537
2537
2538
2538
`fixed` is bought straight from the listing page: the buyer checks out, pays the item plus the shipping quote, and the order and its shipment exist as soon as the money lands. The seller confirms nothing.
2539
2539
2540
-
`negotiable` cannot be checked out. The buyer opens a negotiation, which is a thread in chat where either side revises the terms, and accepting them is what starts the same checkout. Either way the seller never approves an order — the only thing they can refuse is a price.
2540
+
`negotiable` adds a second way to buy without removing the first: the asking price is still a price a buyer can take outright, and the listing page asks which they want. If they haggle, the negotiation is a thread in chat where either side revises the terms, and agreeing freezes them for the same checkout. Either way the seller never approves an order — the only thing they can refuse is a price.
2541
2541
enum:
2542
2542
- fixed
2543
2543
- negotiable
@@ -6574,7 +6574,7 @@ paths:
6574
6574
description: |
6575
6575
Freezes the listing terms so a price the seller edits afterwards cannot be charged. The server snapshots the listing together with every variant — price and package details live on the variant, and those are exactly what must not move under the buyer — and sets `valid_until`.
6576
6576
6577
-
Only a `fixed` listing has one: a `negotiable` price is agreed in an offer, and the accepted offer is what freezes its terms instead. Asking for one is 422.
6577
+
Every listing has one, whichever way it is priced. A `negotiable` listing carries the seller's asking price like any other, and a buyer who does not want to haggle takes it: the listing page offers both, and this is the "buy now" half. Negotiating instead freezes the agreed terms in the offer, and `POST /offers/{id}/checkout` is the same checkout from there.
6578
6578
requestBody:
6579
6579
content:
6580
6580
application/json:
@@ -6603,12 +6603,6 @@ paths:
6603
6603
schema:
6604
6604
$ref: '#/components/schemas/Error'
6605
6605
description: Listing not found, deleted, or not active
6606
-
"422":
6607
-
content:
6608
-
application/json:
6609
-
schema:
6610
-
$ref: '#/components/schemas/Error'
6611
-
description: The listing is priced negotiable; open an offer instead
6612
6606
security:
6613
6607
- bearerAuth: []
6614
6608
summary: Open a purchase session for one listing
@@ -6670,7 +6664,7 @@ paths:
6670
6664
6671
6665
The session is spent before the money is asked for: the claim is what makes two concurrent checkouts of one draft impossible, and the loser is answered 409 rather than handed a second payment session for the same frozen price.
6672
6666
6673
-
A `negotiable` listing has no draft at all, so there is nothing to check out here — its terms are frozen by the offer both sides agreed on, and `POST /offers/{id}/checkout` is the same checkout from there. The buyer pays delivery either way.
6667
+
This is the checkout for terms a draft froze — the seller's own price, whether the listing is `fixed` or `negotiable`. Terms that were *negotiated* are checked out at `POST /offers/{id}/checkout` instead, which is the same flow against the agreed price. The buyer pays delivery either way.
Copy file name to clipboardExpand all lines: internal/module/order/domain/errors.go
+6-9Lines changed: 6 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -13,15 +13,12 @@ var (
13
13
ErrCartItemNotFound=errx.NewError(http.StatusNotFound, "cart_item_not_found", "cart item not found")
14
14
15
15
// --- drafts and checkout ---
16
-
ErrDraftNotFound=errx.NewError(http.StatusNotFound, "draft_not_found", "purchase session not found")
17
-
ErrDraftExpired=errx.NewError(http.StatusConflict, "draft_expired", "this purchase session has expired")
18
-
ErrDraftSettled=errx.NewError(http.StatusConflict, "draft_settled", "this purchase session is already cancelled or checked out")
19
-
// ErrNegotiableNeedsOffer is a checkout of a listing priced `negotiable`. It cannot be
20
-
// bought from the listing page: the price is agreed in a negotiation first.
21
-
ErrNegotiableNeedsOffer=errx.NewError(http.StatusUnprocessableEntity, "negotiable_needs_offer", "a negotiable listing is bought through an accepted offer")
22
-
ErrPriceMoved=errx.NewError(http.StatusConflict, "price_moved", "the frozen terms no longer match the listing")
23
-
ErrCurrencyMismatch=errx.NewError(http.StatusUnprocessableEntity, "currency_mismatch", "the currency does not match the listing's")
24
-
ErrVariantNotInDraft=errx.NewError(http.StatusUnprocessableEntity, "variant_not_in_draft", "that variant is not in this purchase session")
16
+
ErrDraftNotFound=errx.NewError(http.StatusNotFound, "draft_not_found", "purchase session not found")
17
+
ErrDraftExpired=errx.NewError(http.StatusConflict, "draft_expired", "this purchase session has expired")
18
+
ErrDraftSettled=errx.NewError(http.StatusConflict, "draft_settled", "this purchase session is already cancelled or checked out")
19
+
ErrPriceMoved=errx.NewError(http.StatusConflict, "price_moved", "the frozen terms no longer match the listing")
20
+
ErrCurrencyMismatch=errx.NewError(http.StatusUnprocessableEntity, "currency_mismatch", "the currency does not match the listing's")
21
+
ErrVariantNotInDraft=errx.NewError(http.StatusUnprocessableEntity, "variant_not_in_draft", "that variant is not in this purchase session")
25
22
26
23
// --- items ---
27
24
ErrItemNotFound=errx.NewError(http.StatusNotFound, "item_not_found", "item not found")
0 commit comments