Add NATS account-balance SoT and statement review for customers, CS, and sales
Some checks are pending
offline / test (push) Waiting to run
Some checks are pending
offline / test (push) Waiting to run
Internal billing now uses verae.billing.* request-reply and pubs. zappier-account-balance tracks prepaid, credits, usage, and payments. Portal, admin, CS, and sales all review the same statement. Independent Forgejo repos stay split via push-module-repos.
This commit is contained in:
parent
a1a5b957fd
commit
ac38676645
135 changed files with 3078 additions and 130 deletions
31
packages/zappier-account-balance/README.md
Normal file
31
packages/zappier-account-balance/README.md
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
# zappier-account-balance
|
||||
|
||||
Source of truth for **customer prepaid balances**. Internal traffic is **NATS request-reply**; HTTP is health plus a fallback.
|
||||
|
||||
**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
|
||||
|
||||
```bash
|
||||
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[] }`.
|
||||
Loading…
Add table
Add a link
Reference in a new issue