Repository navigation
chat: send and decline price offers, with live display - #27
Conversation
Offers arrive as server-message third-voice payloads and every offer write lives under Wallapop's delivery API; accepting would charge a card and is deliberately absent, recorded in ADR 0002. chat offer CONV AMOUNT sends; chat offer decline CONV declines the newest linked offer after a fresh status-card read with item and buyer identity checks, PENDING-only, no older-offer fallback. Daily cap, 70 percent floor and malformed amounts are usage errors before any write. Messages gain Kind, OfferID, Offer and OfferError. REST and PubNub nested payloads both decode; show, list and open display the current offer card; unknown message types surface instead of vanishing. Text identity and read receipts are untouched. Verified live between the owner's two accounts on the permitted conversation: stale 0.90 offer declined, 0.85 offer sent (HTTP 201) and declined (HTTP 200); envelopes sanitized into testdata.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Note 🤖 Union Alpha responding on behalf of Microck @codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e3ec2dcea4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Hydration ran inside Client.Inbox, Conversation and OlderMessages, so every write command that resolves its conversation also paid for the offer-details reads behind the cards it never printed. Attach the cards in chat list, show and open instead, where the JSON actually carries them; write commands keep their explicit fresh-card reads.
# Conflicts: # docs/cli-spec.md
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Implements the revised scope of #22: offers turned out to be Wallapop's delivery product (every write under api/v3/delivery, accepting reaches payments), so this ships send and decline and deliberately leaves accepting out, recorded in ADR 0002.
chat offer CONV AMOUNT validates money (positive, at most two decimals, inside the daily cap and the 70 percent floor) before any write. chat offer decline CONV declines the newest linked offer after a fresh status-card read, with item and buyer identity checks, PENDING-only and no fallback to older pending offers.
Messages gain Kind, OfferID, Offer and OfferError. REST and PubNub nested third-voice payloads both decode; show, list and chat open display the current offer amount, currency and state; unknown message types surface instead of vanishing. Text message identity and read receipts are untouched.
Verified live between the owner's two accounts on the permitted conversation: stale 0.90 pending offer declined, 0.85 offer sent (HTTP 201) and declined (HTTP 200), with the real PubNub envelopes sanitized into internal/fakewallapop/testdata/offer-events.json. CGO_ENABLED=1 go test ./... -race passes. Docs: cli-spec chat section plus the offer-side of section 13, spec user stories, and docs/adr/0002-offers.md.
Closes #22.