Skip to content

feat(group-send): let the sender include themselves in the split - #1915

Closed
bmc08gt wants to merge 3 commits into
code/cashfrom
feat/group-send-self-share
Closed

bmc08gt wants to merge 3 commits into
code/cashfrom
feat/group-send-self-share

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator

Implements "Including yourself" from the group-send spec (code-payments/flipcash-client-orchestrator#83). The sender can check a "You" row on Select People to split the total with themselves and keep their part.

  • Select People. The sender's row comes first, under "Members" where the design's dropped Select All sat, unchecked. It is the existing member row with the sender's avatar and the "You" label the request flow already uses. "Send to N People" counts only the other members and stays disabled until one is checked.
  • Split. GroupSendSplit.split takes includesSender. The sender's part is the last share, so it never takes a leftover cent, and GroupSendPlan.Pay.kept holds it. Only parts is paid: You + 4 on $5.00 is a SendPublicMultiPayment of $1.00 to each of the 4, and You + 1 is a SendPublicPayment of half. GroupSendPaymentDelegate is unchanged.
  • Counting the sender. The 10 People Max cap, the "each" amount and its "", and the too-small alert all count the sender's share. isEven and smallest look at every share, the kept one included, so 5¢ between You and 2 people reads "$0.01 each" even though both paid parts are 2¢. The fixture has no vector for that case, so a unit test covers it directly.
  • Confirm shows the entered total, not the amount sent. The chat bubble is unchanged.

test-vectors/group-send-split.json is copied from the orchestrator branch docs/group-send-self-share. GroupSendSplitVectorsTest now checks kept and sent and runs the 9 new includesSender vectors. ChatGroupCashLinkTest adds three cases: You + 4 pays four parts and keeps one, You counts toward the 10, and You alone sends nothing.

Select People lists the sender first as "You", unchecked. Checking it
splits the entered total one more way and the sender keeps their part,
which is always the last share so it never takes a leftover cent. You +
4 on $5.00 pays $1.00 to each of the 4.

GroupSendSplit.split takes includesSender, and GroupSendPlan.Pay carries
the kept part. The 10 cap, the "Each" label and its "~", and the
too-small check count the sender's share; "Send to N People" counts only
the members paid, and Confirm still shows the entered total.

test-vectors/group-send-split.json is the orchestrator's copy with the
includesSender vectors.
@bmc08gt bmc08gt self-assigned this Oct 30, 2026
@github-actions github-actions Bot added type: feature New functionality area: payments Payments, transfers, intents, billing labels Oct 30, 2026
@bmc08gt bmc08gt closed this Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: payments Payments, transfers, intents, billing type: feature New functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant