master-zapier-plan-draft/packages/zappier-account-balance
George Lambert 9cc0018708
Some checks are pending
offline / test (push) Waiting to run
Add customer names on the ledger, staff session login, and exclusive jobs.events.
Account-balance stores display names and looks up by name. Edge writes
names on customer create/edit; staff UIs join from edge when needed.
New verae-staff-session issues a host cookie; department HTML redirects
when STAFF_AUTH=1. JOBS_EVENTS_EXCLUSIVE lets jobs-events own the durable
consumer. Catalog index is cards; disabled fleet machines are grey.
2026-09-11 18:11:21 -04:00
..
src Add customer names on the ledger, staff session login, and exclusive jobs.events. 2026-09-11 18:11:21 -04:00
test Add customer names on the ledger, staff session login, and exclusive jobs.events. 2026-09-11 18:11:21 -04:00
NATS.md Add NATS account-balance SoT and statement review for customers, CS, and sales 2026-09-11 15:35:37 -04:00
package-lock.json Add NATS account-balance SoT and statement review for customers, CS, and sales 2026-09-11 15:35:37 -04:00
package.json Add NATS account-balance SoT and statement review for customers, CS, and sales 2026-09-11 15:35:37 -04:00
README.md Clean prepaid SoT, identity mailbox, public access planes, leaf policy, fleet spawn 2026-09-11 17:15:16 -04:00

zappier-account-balance

Source of truth for customer prepaid balances (persisted books.json). Internal traffic is NATS request-reply; HTTP is health plus a fallback. zappier-edge balanceCents is a cache of this book.

Forgejo: https://git.georgelambert.org/marchon/zappier-account-balance
Catalog: https://zapier.georgelambert.org/packages/zappier-account-balance/README.pdf

Zapier cloud never connects here. zappier-edge, customer-service, sales-pricing, and accounting-export do.

Subjects

Subject Kind Who
verae.billing.statement.get request-reply portal, CS, sales, admin
verae.billing.balance.get request-reply anyone internal
verae.billing.balance.adjust request-reply CS credits, portal reload
verae.billing.usage.recorded pub zappier-edge meter
verae.billing.payment.recorded pub portal reload, invoice paid
verae.billing.credit.applied pub CS

Queue group: account-balance.

Run

NATS_URL=nats://127.0.0.1:4222 PORT=3010 npm start
curl http://127.0.0.1:3010/health
curl http://127.0.0.1:3010/statement/cust_1

Statement JSON: { customerId, prepaidCents, credits[], usage[], payments[] }.