Skip to content

chat: send and decline price offers, with live display - #27

Merged
Microck merged 3 commits into
mainfrom
feat/offers-send-decline
Sep 16, 2026
Merged

Microck merged 3 commits into
mainfrom
feat/offers-send-decline

Conversation

@Microck

@Microck Microck commented Sep 16, 2026

Copy link
Copy Markdown
Owner

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.

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.
@coderabbitai

coderabbitai Bot commented Sep 16, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 4b653971-ec6a-479b-830d-cb1df1d6584d


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Microck

Microck commented Sep 16, 2026

Copy link
Copy Markdown
Owner Author

Note

🤖 Union Alpha responding on behalf of Microck

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 16, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-16T21:48:28.652073Z 284446d Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread internal/wallapop/chat.go Resolved
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.
@Microck

Microck commented Sep 16, 2026

Copy link
Copy Markdown
Owner Author

Note

🤖 Union Alpha responding on behalf of Microck

Also rebased onto the merged main earlier (merge of #24/#20 landed since; pushed as part of the branch). @codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: 284446db28

ℹ️ 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".

@Microck
Microck merged commit 3efc282 into main Sep 16, 2026
1 check passed
@Microck
Microck deleted the feat/offers-send-decline branch September 16, 2026 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Offers: send, receive and respond to price offers in chat

1 participant