Skip to content

feat(acme): settle the advance in Xero (lands #8 on main) - #9

Merged
tela merged 6 commits into
mainfrom
feat/ui-v1
Nov 4, 2026
Merged

tela merged 6 commits into
mainfrom
feat/ui-v1

Conversation

@tela

@tela tela commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Motivation

localstack-samples/localstack-app-emulators#8 was merged into feat/ui-v1, which #7 had already merged into main. The settlement commits never reached main. This PR carries them there.

Changes

  • Seed the bank account with a real Stripe test token (btok_us_verified).
  • Record the advance in the merchant's Xero books (account 810, RECEIVE bank transaction by reference).
  • Add the settle route to the API.
  • Show the settlement and run it on the second click.
  • Document settling in Xero.

These are the commits of #8, unchanged, plus its merge commit.

Tests

The same commits passed build-and-test and web on localstack-samples/localstack-app-emulators#8. CI on this PR runs the same jobs against main.

Related

localstack-samples/localstack-app-emulators#8, localstack-samples/localstack-app-emulators#7. Merge with a merge commit, not a squash.

tela and others added 6 commits November 3, 2026 22:03
The seeder gave the merchant's first bank account the token btok_us, which Stripe does not have. The old Stripe app emulator accepted any token, but the current one refuses a token it does not know, and seeding failed with No such token. Use btok_us_verified, one of Stripe's own test tokens, which both builds accept.
Funding moves the money, and the merchant's books have to show it. The advance is booked as money received against a new loan liability account, which debits the bank and credits the loan, so it needs no manual journal. The account and the lender contact are created only if missing, and the bank transaction is found by its reference before it is recorded, so a retry never books the advance twice.
The UI's second click now runs accept, fund and settle.
The second click now accepts the offer, pays the advance out and records it in the merchant's Xero books. The funding card shows where it was booked: the bank account it was received into, the loan account and the bank transaction. A failed settlement retries on its own, without paying the advance out again.
Say how the advance is booked, why it needs no manual journal, that every step checks before it creates so a retry or a second application duplicates nothing, and which Xero app emulator builds can do it.
feat: record the advance in the merchant's Xero books
@tela
tela merged commit 16580e7 into main Nov 4, 2026
2 checks passed
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.

1 participant