Add customer names on the ledger, staff session login, and exclusive jobs.events.
Some checks are pending
offline / test (push) Waiting to run
Some checks are pending
offline / test (push) Waiting to run
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.
This commit is contained in:
parent
cb07f5b321
commit
9cc0018708
38 changed files with 533 additions and 68 deletions
|
|
@ -24,6 +24,14 @@ test('adjust credits prepaid and statement lists credits usage payments', () =>
|
|||
assert.equal(st.payments[0].kind, 'payment');
|
||||
});
|
||||
|
||||
test('customer.put stores display name and lookup by name', () => {
|
||||
const books = new AccountBooks();
|
||||
handle(SUBJECTS.CUSTOMER_PUT, { customerId: 'cust_1', name: 'Ada (free)' }, books);
|
||||
const st = handle(SUBJECTS.STATEMENT_GET, { customerId: 'Ada (free)' }, books);
|
||||
assert.equal(st.customerId, 'cust_1');
|
||||
assert.equal(st.name, 'Ada (free)');
|
||||
});
|
||||
|
||||
test('persist round-trip keeps prepaid', () => {
|
||||
const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'books-'));
|
||||
process.env.BOOKS_PATH = path.join(dir, 'books.json');
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
import { test } from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { spawn } from 'node:child_process';
|
||||
import fs from 'node:fs';
|
||||
import os from 'node:os';
|
||||
import path from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
|
|
@ -8,9 +10,10 @@ const root = path.join(path.dirname(fileURLToPath(import.meta.url)), '..');
|
|||
|
||||
test('account-balance health and statement', async () => {
|
||||
const port = 18010;
|
||||
const books = path.join(os.tmpdir(), `books-health-${Date.now()}.json`);
|
||||
const child = spawn(process.execPath, ['src/server.js'], {
|
||||
cwd: root,
|
||||
env: { ...process.env, PORT: String(port) },
|
||||
env: { ...process.env, PORT: String(port), BOOKS_PATH: books },
|
||||
stdio: ['ignore', 'pipe', 'pipe'],
|
||||
});
|
||||
await new Promise((r) => setTimeout(r, 400));
|
||||
|
|
@ -26,5 +29,6 @@ test('account-balance health and statement', async () => {
|
|||
assert.equal(st.prepaidCents, 200);
|
||||
} finally {
|
||||
child.kill('SIGTERM');
|
||||
fs.rmSync(books, { force: true });
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue