Let an expense's payer invite people - #73
Merged
Merged
Conversation
A beneficiary can now be marked invited (`CostBeneficiaries.invited`,
schema v38): the payer paid for them and does not want it back. Per
beneficiary, so one dinner can hold a guest and somebody who repays.
The share stays the guest's and totals and categories do not move;
`computeTripStats` books it to the guest's `invitedMinor` and the payer's
`hostedMinor`, which the balance reads. It only counts on an expense with
a payer, for someone other than the payer, on an explicit split.
The form toggles it on the "paid for" chips, plus a tristate
"Invited by {payer}" box. It travels with a routine's fare, and a trip
using it is exported as `.tpt` v6.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An expense's payer can now mark people they paid for as invited: those people owe nothing back for it. Say Ann pays 90 for Ann, Bo and Cy, and Bo is her guest. Then only Cy owes Ann 30, and the cost doesn't have to be split in two.
Model and math
CostBeneficiaries.invited(schema v38,addColumnguarded byfrom >= 10). The flag is set per beneficiary, not per cost.computeTripStatstakesinvitedByCost. The guest keeps their share inshareMinor, and totals and categories don't change. The share goes into the guest'sinvitedMinorand the payer'shostedMinor, andborneMinor = share − invited + hostedfeedsnetMinor.mergeTripStatspools both fields.CostControllerand the importer never store it there.UI
volunteer_activismicon. A tristate "Invited by {payer}" box invites everyone or clears all invitations.Elsewhere
.tpt: exported as v6 only when the trip uses the flag, because an older app would show the guest owing their share.invitedis written only when non-empty.Tests
cost_beneficiariesin their hand-written schemas; every real database from v10 onward has that table. The v37 test also drops the new column.CHANGELOG,
docs/features.mdand AGENTS.md are updated.🤖 Generated with Claude Code