Add NATS account-balance SoT and statement review for customers, CS, and sales
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:
George Lambert 2026-09-11 15:35:37 -04:00
parent a1a5b957fd
commit ac38676645
135 changed files with 3078 additions and 130 deletions

View file

@ -15,9 +15,10 @@
"services": {
"nats": { "min": 1, "max": 1, "keepFloor": false, "enabled": true, "managed": false },
"zappier-edge": { "min": 1, "max": 1, "keepFloor": true, "enabled": true },
"customer-service": { "min": 0, "max": 1, "keepFloor": false, "enabled": true },
"sales-pricing": { "min": 0, "max": 1, "keepFloor": false, "enabled": true },
"accounting-export": { "min": 0, "max": 1, "keepFloor": false, "enabled": true },
"account-balance": { "min": 1, "max": 1, "keepFloor": true, "enabled": true },
"customer-service": { "min": 1, "max": 1, "keepFloor": true, "enabled": true },
"sales-pricing": { "min": 1, "max": 1, "keepFloor": true, "enabled": true },
"accounting-export": { "min": 1, "max": 1, "keepFloor": true, "enabled": true },
"middleware-http": { "min": 1, "max": 1, "keepFloor": true, "enabled": true },
"job-poller": { "min": 1, "max": 2, "keepFloor": true, "enabled": true },
"webhook-deliver": { "min": 1, "max": 2, "keepFloor": true, "enabled": true },

View file

@ -0,0 +1,31 @@
{
"id": "account-balance",
"title": "Account balance (NATS billing SoT)",
"kind": "http",
"package": "zappier-account-balance",
"role": "account-balance",
"managed": true,
"runtime": "HTTP :3010 + NATS verae.billing.*",
"health": { "type": "http", "path": "/health", "timeoutMs": 2000 },
"ports": { "healthBase": 3010 },
"spawn": {
"cwd": "../zappier-account-balance",
"command": "node",
"args": ["src/server.js"]
},
"env": {
"PORT": "3010",
"NATS_URL": "nats://127.0.0.1:4222"
},
"nats": {
"in": [
"verae.billing.statement.get",
"verae.billing.balance.get",
"verae.billing.balance.adjust",
"verae.billing.usage.recorded",
"verae.billing.payment.recorded",
"verae.billing.credit.applied"
],
"out": []
}
}

View file

@ -15,7 +15,9 @@
},
"env": {
"PORT": "3013",
"ZAPPIER_ADMIN_URL": "http://127.0.0.1:3000"
"ZAPPIER_ADMIN_URL": "http://127.0.0.1:3000",
"ACCOUNT_BALANCE_URL": "http://127.0.0.1:3010",
"NATS_URL": "nats://127.0.0.1:4222"
},
"nats": { "in": [], "out": [] }
"nats": { "in": [], "out": ["verae.billing.statement.get"] }
}

View file

@ -1,11 +1,11 @@
{
"id": "customer-service",
"title": "Customer-service credits",
"title": "Customer-service credits and review",
"kind": "http",
"package": "zappier-customer-service",
"role": "customer-service",
"managed": true,
"runtime": "HTTP :3011 CS credits → zappier-edge",
"runtime": "HTTP :3011 CS credits + NATS statement review",
"health": { "type": "http", "path": "/health", "timeoutMs": 2000 },
"ports": { "healthBase": 3011 },
"spawn": {
@ -15,8 +15,13 @@
},
"env": {
"PORT": "3011",
"ZAPPIER_ADMIN_URL": "http://127.0.0.1:3000"
"ZAPPIER_ADMIN_URL": "http://127.0.0.1:3000",
"ACCOUNT_BALANCE_URL": "http://127.0.0.1:3010",
"NATS_URL": "nats://127.0.0.1:4222"
},
"nats": { "in": [], "out": [] },
"notes": "Department API. Prepaid balances live on zappier-edge."
"nats": {
"in": [],
"out": ["verae.billing.statement.get", "verae.billing.balance.adjust"]
},
"notes": "CS review and credits. Balances live on account-balance over NATS."
}

View file

@ -5,7 +5,7 @@
"package": "zappier-sales-pricing",
"role": "sales-pricing",
"managed": true,
"runtime": "HTTP :3012 quotes → zappier-edge",
"runtime": "HTTP :3012 quotes + NATS statement review",
"health": { "type": "http", "path": "/health", "timeoutMs": 2000 },
"ports": { "healthBase": 3012 },
"spawn": {
@ -15,7 +15,9 @@
},
"env": {
"PORT": "3012",
"ZAPPIER_ADMIN_URL": "http://127.0.0.1:3000"
"ZAPPIER_ADMIN_URL": "http://127.0.0.1:3000",
"ACCOUNT_BALANCE_URL": "http://127.0.0.1:3010",
"NATS_URL": "nats://127.0.0.1:4222"
},
"nats": { "in": [], "out": [] }
"nats": { "in": [], "out": ["verae.billing.statement.get"] }
}

View file

@ -18,8 +18,18 @@
"ZAPPIER_UPSTREAM": "http://127.0.0.1:3100",
"CS_SERVICE_URL": "http://127.0.0.1:3011",
"SALES_PRICING_URL": "http://127.0.0.1:3012",
"ACCOUNTING_EXPORT_URL": "http://127.0.0.1:3013"
"ACCOUNTING_EXPORT_URL": "http://127.0.0.1:3013",
"NATS_URL": "nats://127.0.0.1:4222"
},
"nats": { "in": [], "out": [] },
"notes": "Zapier x-api-key lands here. HTTPS to middleware only."
"nats": {
"in": [],
"out": [
"verae.billing.usage.recorded",
"verae.billing.payment.recorded",
"verae.billing.credit.applied",
"verae.billing.statement.get",
"verae.billing.balance.adjust"
]
},
"notes": "Zapier x-api-key lands here. HTTPS to middleware. NATS billing to account-balance."
}

View file

@ -53,6 +53,7 @@ describe('verae-fleet', () => {
for (const need of [
'nats',
'zappier-edge',
'account-balance',
'customer-service',
'sales-pricing',
'accounting-export',