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
|
|
@ -3,6 +3,7 @@
|
|||
High-level description of the whole system: what it is, which **independent git repositories** implement it, how it stays up, how it behaves when the local network fails, and how it talks to the **central Verae NATS.IO 3-server cluster**. New work is added by **new address routing**, not by teaching Zapier about NATS.
|
||||
|
||||
**This repo:** https://git.georgelambert.org/marchon/overview
|
||||
**Bring online:** https://zapier.georgelambert.org/packages/verae-ops/GETTING-STARTED.pdf
|
||||
**Live catalog (PDF by default):** https://zapier.georgelambert.org/ · [Markdown indexes](https://zapier.georgelambert.org/index-md.html)
|
||||
**Clone:** `ssh://git@git.georgelambert.org:2223/marchon/overview.git`
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ This is the operations repo. Application code lives in the other independent git
|
|||
|
||||
## Reading order
|
||||
|
||||
0. **[GETTING-STARTED.md](GETTING-STARTED.md)** — install, first-up, monitor (read this first)
|
||||
1. [01-dependencies.md](01-dependencies.md) — what must exist, who talks to whom
|
||||
2. [02-docker.md](02-docker.md) — Compose (NATS 3-node cluster + HTTPS edges)
|
||||
3. [03-proxmox.md](03-proxmox.md) — LXC / QEMU VMs
|
||||
|
|
|
|||
31
docs/sphinx/repos/zappier-account-balance.md
Normal file
31
docs/sphinx/repos/zappier-account-balance.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[] }`.
|
||||
21
docs/sphinx/repos/zappier-accounting-export.md
Normal file
21
docs/sphinx/repos/zappier-accounting-export.md
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
# zappier-accounting-export
|
||||
|
||||
Accounting-department export of **invoices, billing, and payment history** to **QuickBooks IIF** and generic CSV (also usable in other ledgers).
|
||||
|
||||
**Forgejo:** https://git.georgelambert.org/marchon/zappier-accounting-export
|
||||
**Catalog:** https://zapier.georgelambert.org/packages/zappier-accounting-export/README.pdf
|
||||
|
||||
Reads issued/paid invoices from zappier-edge (`ZAPPIER_ADMIN_URL`). Customer statements (credits, balances, usage, payments) come from NATS `verae.billing.statement.get`.
|
||||
|
||||
Staff UI: http://127.0.0.1:3013/
|
||||
|
||||
```bash
|
||||
PORT=3013 NATS_URL=nats://127.0.0.1:4222 node src/server.js
|
||||
curl http://127.0.0.1:3013/review/cust_1
|
||||
curl 'http://127.0.0.1:3013/export/quickbooks.iif?period=2026-07' -o zappier.iif
|
||||
curl 'http://127.0.0.1:3013/export/accounting.csv?period=2026-07' -o zappier.csv
|
||||
```
|
||||
|
||||
Import the IIF in QuickBooks Desktop: **File → Utilities → Import → IIF**. The CSV is a flat invoice register for other systems.
|
||||
|
||||
History is the invoice list on zappier-edge (draft / issued / paid) plus CS credit ledger and portal prepaid reloads.
|
||||
23
docs/sphinx/repos/zappier-customer-service.md
Normal file
23
docs/sphinx/repos/zappier-customer-service.md
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
# zappier-customer-service
|
||||
|
||||
Department API for **customer-service credit additions** and **review** of credits, balances, usage, and payments. Internally uses **NATS** `verae.billing.*` (account-balance). HTTP fallback to account-balance then zappier-edge.
|
||||
|
||||
**Forgejo:** https://git.georgelambert.org/marchon/zappier-customer-service
|
||||
**Catalog:** https://zapier.georgelambert.org/packages/zappier-customer-service/README.pdf
|
||||
**Plugs into:** zappier-edge admin (`x-admin-key`) at `ZAPPIER_ADMIN_URL` (default `http://127.0.0.1:3000`).
|
||||
|
||||
```bash
|
||||
PORT=3011 ZAPPIER_ADMIN_URL=http://127.0.0.1:3000 node src/server.js
|
||||
curl -X POST http://127.0.0.1:3011/credits -H 'content-type: application/json' \
|
||||
-d '{"customerId":"cust_1","cents":500,"reason":"goodwill","agent":"cs-anna"}'
|
||||
```
|
||||
|
||||
| Route | Job |
|
||||
|-------|-----|
|
||||
| `GET /` | Staff review UI |
|
||||
| `GET /health` | `{ ok, role }` |
|
||||
| `POST /credits` | Add/subtract prepaid cents (NATS `balance.adjust`) |
|
||||
| `GET /credits?customerId=` | Ledger |
|
||||
| `GET /review/:customerId` | Full statement (balance, credits, usage, payments) |
|
||||
|
||||
Talks to NATS `verae.billing.*` internally. Never talks to Zapier cloud.
|
||||
19
docs/sphinx/repos/zappier-sales-pricing.md
Normal file
19
docs/sphinx/repos/zappier-sales-pricing.md
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
# zappier-sales-pricing
|
||||
|
||||
Sales-department API for **per-customer pricing** (tier + `multiplierOverride`). zappier-edge remains the rate-card store.
|
||||
|
||||
**Forgejo:** https://git.georgelambert.org/marchon/zappier-sales-pricing
|
||||
**Catalog:** https://zapier.georgelambert.org/packages/zappier-sales-pricing/README.pdf
|
||||
|
||||
Internal reviews use NATS `verae.billing.statement.get` (account-balance).
|
||||
|
||||
Staff UI: http://127.0.0.1:3012/ — review credits, balances, usage, payments.
|
||||
|
||||
```bash
|
||||
PORT=3012 NATS_URL=nats://127.0.0.1:4222 node src/server.js
|
||||
curl http://127.0.0.1:3012/review/cust_2
|
||||
curl http://127.0.0.1:3012/quotes/cust_2
|
||||
curl -X PUT http://127.0.0.1:3012/customers/cust_2/pricing \
|
||||
-H 'content-type: application/json' \
|
||||
-d '{"multiplierOverride":0.4,"tierId":"business"}'
|
||||
```
|
||||
|
|
@ -5,8 +5,11 @@ monthly credits, a usage ledger, Stripe metered billing, purchase-order
|
|||
invoicing, a company admin console, a self-service customer portal, and a
|
||||
Zapier integration.
|
||||
|
||||
This is the **billing and user platform** (originally the standalone `zappier` git tree at `~/zappier`). Forgejo name: **zappier-edge**. It owns signup, TOTP, API keys, rate card, Stripe meter, PO invoices, admin users, and the customer portal. Verae middleware does not replace this.
|
||||
|
||||
**Forgejo:** https://git.georgelambert.org/marchon/zappier-edge
|
||||
**Catalog README:** https://zapier.georgelambert.org/packages/zappier/README.pdf
|
||||
**Catalog README:** https://zapier.georgelambert.org/packages/zappier/README.pdf
|
||||
**Bring the whole system online:** https://zapier.georgelambert.org/packages/verae-ops/GETTING-STARTED.pdf
|
||||
|
||||
## Documentation (public PDFs)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue