The OpenAPI document this page is rendered from: openapi.json. In a running bank it is served at /v1/openapi.json and this page under About.
Read off the code at build time: every route the servers register and what each handler reads and answers. Branches are not followed, so a response listed is one the handler can write on some path through it. The same walk as /v1/openapi.json.
git.bytestone.uk/hum3/gobank/bffPackage bff is the backend-for-frontend for the Model Bank apps.
It is the only server the thin clients talk to. It owns sessions and login, and turns banking data into screen-ready trees (package screen). Apart from health, the public login screen and login itself, every endpoint requires a session; the customer identity always comes from the session, never from the request.
The banking core is reached through the core package's CustomerQueries and Authenticator contracts (ADR-0002).
whether the server is up, the API document, and not_found for every path no other route serves.
| Method | Path | Route |
|---|---|---|
GET | / | Every other path under /v1/: not_found, as JSON |
GET | /v1/health | Answers as soon as the process serves HTTP |
GET | /v1/openapi.json | Serves the API document (package api): the surface this server and the staff web present, as built |
the login and the logout.
| Method | Path | Route |
|---|---|---|
POST | /v1/login | Checks the customer ID and password, from a JSON body or a form, and opens a session: a JSON client gets the token and the home screen; a form post or a browser gets the mb_session cookie and is sent to the home screen |
POST | /v1/logout | Ends the session: a browser's cookie is cleared and it is sent to the login screen; a JSON client gets the login screen |
the trees the app renders, the login screen open and the rest for a signed-in customer.
| Method | Path | Route |
|---|---|---|
GET | /v1/screen/accounts | The home screen: the customer's net position and a row per account, each opening its product screen |
GET | /v1/screen/activity | The customer's transactions across every account, newest first, one page (?page=) at a time |
GET | /v1/screen/login | The front door: the login form, whose submit is POST /v1/login, with the deployment's note |
GET | /v1/screen/product/{index} | One account, by its index in the customer's list: its details and its own transactions, one page (?page=) at a time; 404 for an index the customer has no account at |
git.bytestone.uk/hum3/gobank/bff/staffPackage staff is the staff web of the Model Bank: the login (story 1.7.1), the pages a member of staff reads the bank through (accounting, products, customers, payments, treasury, reports, about and the documentation), the role the signed-in user holds and the PII authorisation that gate what they see, the layout every page is rendered in, and the simulation console when there is one (ADR-0002 stage 6, stories 1.6.3 and 1.6.4).
It reads the bank through core.StaffQueries, acts on it through core.Commands, checks logins through core.Users and drives the simulation through Console, and knows nothing else of it. The BFF mounts it beside the customer routes (bff.Config.Staff) and its sessions are kept in the BFF's store.
Gate (*Site).requireLogin: every route but /about.json, /favicon.ico, /favicon.svg, /login needs the staff_session cookie or a bearer token.
requireLogin serves the open paths as they are and every other with the session the request's cookie names, or sends the browser to the login page with the page it wanted to come back to. An HTMX request that has lost its session is told to load the login page whole.
the dashboard and its controls, the payments generator and the settings, what gobank-deploy drives.
| Method | Path | Route |
|---|---|---|
GET | / | The dashboard: the bank's position, the run's state and its controls; it polls its own sections |
POST | /add-customers | Opens n customers in the background (POST n=), with the product mix the simulation uses; /about.json shows the batch's rate sim_controls |
POST | /advance | Runs one business day while the run is stopped (POST) sim_controls |
GET | /dashboard/update | The dashboard's polled sections, as an HTML fragment |
POST | /payments/run | Starts the payment generator (POST): the settings' payments a day send_payment |
POST | /payments/send | Sends one generated payment now (POST) send_payment |
POST | /payments/stop | Stops the payment generator (POST) send_payment |
POST | /reset | Empties the bank and starts again on its opening day (POST); the settings are kept sim_controls |
GET POST | /settings | The console settings: the page (GET), and the change (POST max_customers, payments_per_day, day_length; 0s runs flat out, a day length that does not parse leaves the current one) settings |
GET | /settings/status | The settings page's status line, polled on its own so the form is never re-rendered under the operator |
POST | /start | Starts the run (POST): the simulation moves day after day at the settings' day length until stopped sim_controls |
POST | /stop | Stops the run after the day in progress (POST) sim_controls |
the login and the logout, the PII authorisation and the view switch.
| Method | Path | Route |
|---|---|---|
POST | /auth/authorize | PII (POST): an admin authorises themselves to see personal data for a while, then returns to redirect= |
POST | /auth/revoke | PII (POST): the admin gives the authorisation up and returns to redirect= |
GET POST | /login | The staff login: the form (GET) and its check (POST login, password) against the users component |
POST | /logout | Ends the staff session (POST): the cookie is cleared and the browser sent to the login page |
GET | /view/{name} | Switches this browser between the bank's view and the customer's: GET view/{name}?back=<path> sets the staff_view cookie for a year and returns to the page that offered it |
the profit and loss, the balance sheet and a movement of the ledger.
| Method | Path | Route |
|---|---|---|
GET | /accounting/balance-sheet | The balance sheet on the current business day, with the CET1 position |
GET | /accounting/pnl | The profit and loss statement since the bank opened, on an accrual basis |
GET | /movements/{id} | Serves one movement of the ledger (ADR-0008): its page; with the suffix .goluca its plain-text-accounting text, with .json the movement itself |
the masters (a family's products, the bank's own) and the detail, a parameter's own page, which is also where a staff setting is made (ADR-0010), decided by the signed-in user.
| Method | Path | Route |
|---|---|---|
GET | /products/bank | The bank's own parameters (Bank Rate, the reserve ratio and the rest), as the Bank tab shows them |
GET | /products/lending | The lending products: the family's catalogue, each product with its book |
GET | /products/savings | The savings products: the family's catalogue, each product with its book |
GET POST | /products/{owner}/parameters/{key} | One parameter of a product or of the bank: its history and, for a signed-in user who may, the form that sets it (POST value, effective); ?refused= carries a refusal back to the page settings |
the register, the search by name and a customer's detail and accounts.
| Method | Path | Route |
|---|---|---|
GET | /customers | The customers, one page (?page=) at a time; personal data only for an authorised admin |
GET | /customers/ | Under /customers/: a customer's detail at /customers/{id}, or one of their accounts at /customers/{id}/account/{index}, each with its transactions one page (?txpage=) at a time |
POST | /customers/search | Customer search by name (POST name=): the customers whose name contains it, oldest first and at most core.CustomerSearchLimit, as the register's table — the matches alone for htmx, the Customers page with them for a browser |
the list and a payment's detail; the generator that makes them is Simulation's.
| Method | Path | Route |
|---|---|---|
GET | /payments | Payments: the list, newest first, one page (?page=) at a time, with the generator's controls |
GET | /payments/{id} | One payment: its detail and the movements it made |
the cash position, the capital and the gilts.
| Method | Path | Route |
|---|---|---|
GET | /treasury/capital | The reserve ratio against its requirement, and the lending headroom |
GET | /treasury/cash | The cash position: deposits, loans, cash at the BoE against the required reserves, and the Bank Rate |
GET | /treasury/gilts | The gilt holdings and the purchase form |
POST | /treasury/gilts/buy | Buys a gilt (POST tenor, face_value in pounds): admin only; returns to the gilts page buy_gilt |
the charts, the BBSI return and a customer as the app shows them.
| Method | Path | Route |
|---|---|---|
GET | /reports/bbsi | The BBSI return (Bank and Building Society Interest): each customer's interest for the year; personal data only for an authorised admin |
GET | /reports/charts | The charts: the book, the customer count and the rates over the run |
GET | /reports/customer-view | A customer as the app shows them (?id=); without an id, the customer list |
the project, the models, the documentation, the API and the ADRs; with a console, the runtime and the state another program reads.
| Method | Path | Route |
|---|---|---|
GET | /about | The project: what the Model Bank is, its aims and its non-goals |
GET | /about.json | The demo's state for another program (GET, no session): version, schema, settings, the run and its rates, the position and the restart record |
GET | /about/adr | The architecture decision records compiled into this build |
GET | /about/api | The API: every route the BFF and the staff web serve, read off the code at build time (package api), in clusters by subject (the function each is registered in), each linking to its own page; the types the bodies are made of follow |
GET | /about/api/{method}/{path...} | One route of the API: what its handler needs, reads and answers, with a link to the registration in the source at this build's tag |
GET | /about/docs | The system documentation: the component registry, who may read what, the pre-rule debt and the ADR list |
GET | /about/docs/adr/ | An ADR whole: its page, or one of the diagrams and sources its markdown names beside it |
GET | /about/models | The architecture models: the C4 system context and container diagrams |
GET | /about/runtime | Runtime: the process, its memory against the limit, the schema versions and the restart record |
the events, and with a console the explorer, export and import.
| Method | Path | Route |
|---|---|---|
GET | /events | Events: the record of what happened and what it caused (ADR-0011) |
GET | /export.goluca | The whole book as a .goluca file (GET): admin only export |
POST | /import | Replaces the book with an uploaded .goluca file (POST, multipart file=): admin only export |
GET | /internal/explorer | The DB explorer: every component's tables, read-only; a role sees only the components it may (customers needs view_pii) |
GET | /internal/explorer/ | The DB explorer's tables and rows, under its prefix |
the tab icons and pta2svg's browser renderer.
| Method | Path | Route |
|---|---|---|
GET | /favicon.ico | The tab icon as .ico, from lofigui unknown |
GET | /favicon.svg | The tab icon as SVG |
GET | /wasm/ | pta2svg's browser renderer and its loader, embedded (ADR-0008), so the movement page draws in the tab |
bff › HealthGET /Every other path under /v1/: not_found, as JSON
| Needs | nothing: open |
|---|---|
| Answers | |
| Source | bff/server.go:136, registered in (*Server).healthRoutes |
bff › HealthGET /v1/healthAnswers as soon as the process serves HTTP
No session.
| Needs | nothing: open |
|---|---|
| Answers |
200 OK as application/json
|
| Source | bff/server.go:133 (*Server).health, registered in (*Server).healthRoutes |
bff › Customer sessionPOST /v1/loginChecks the customer ID and password, from a JSON body or a form, and opens a session: a JSON client gets the token and the home screen; a form post or a browser gets the mb_session cookie and is sent to the home screen
Five failures for one customer ID or from one address in fifteen minutes lock that key for the rest of the window (429 with Retry-After).
| Needs | nothing: open |
|---|---|
| Form | customer_id password |
| JSON body | bff.loginRequest |
| Answers |
200 OK as application/json: bff.loginResponse303 Redirect to /v1/screen/accounts 401 Unauthenticated as application/json, text/html:
screen.Screen or bff.errorBody (bad_credentials) |
| Source | bff/server.go:143 (*Server).login, registered in (*Server).sessionRoutes |
bff › Customer sessionPOST /v1/logoutEnds the session: a browser's cookie is cleared and it is sent to the login screen; a JSON client gets the login screen
| Needs | cookie mb_session, bearer token |
|---|---|
| Answers |
200 OK as application/json: bff.screenBody303 Redirect to /v1/screen/login 401 Unauthenticated as application/json, text/html:
screen.Screen or bff.errorBody (unauthenticated) |
| Source | bff/server.go:144 (*Server).logout in (*Server).authed, registered in (*Server).sessionRoutes |
bff › HealthGET /v1/openapi.jsonServes the API document (package api): the surface this server and the staff web present, as built
| Needs | nothing: open |
|---|---|
| Answers |
200 OK as application/json
|
| Source | bff/server.go:134 (*Server).openapi, registered in (*Server).healthRoutes |
bff › ScreensGET /v1/screen/accountsThe home screen: the customer's net position and a row per account, each opening its product screen
| Needs | cookie mb_session, bearer token |
|---|---|
| Answers |
200 OK as application/json, text/html: screen.Screen303 Redirect to /v1/screen/login 401 Unauthenticated as application/json, text/html:
screen.Screen or bff.errorBody (unauthenticated) |
| Source | bff/server.go:151 (*Server).accounts in (*Server).authed, registered in (*Server).screenRoutes |
bff › ScreensGET /v1/screen/activityThe customer's transactions across every account, newest first, one page (?page=) at a time
| Needs | cookie mb_session, bearer token |
|---|---|
| Query | page |
| Answers |
200 OK as application/json, text/html: screen.Screen303 Redirect to /v1/screen/login 401 Unauthenticated as application/json, text/html:
screen.Screen or bff.errorBody (unauthenticated) |
| Source | bff/server.go:152 (*Server).activity in (*Server).authed, registered in (*Server).screenRoutes |
bff › ScreensGET /v1/screen/loginThe front door: the login form, whose submit is POST /v1/login, with the deployment's note
No session.
| Needs | nothing: open |
|---|---|
| Answers |
200 OK as application/json, text/html:
screen.Screen |
| Source | bff/server.go:150 (*Server).loginScreen, registered in (*Server).screenRoutes |
bff › ScreensGET /v1/screen/product/{index}One account, by its index in the customer's list: its details and its own transactions, one page (?page=) at a time; 404 for an index the customer has no account at
| Needs | cookie mb_session, bearer token |
|---|---|
| Path | index |
| Query | page |
| Answers |
200 OK as application/json, text/html: screen.Screen303 Redirect to /v1/screen/login 401 Unauthenticated as application/json, text/html:
screen.Screen or bff.errorBody (unauthenticated) |
| Source | bff/server.go:153 (*Server).product in (*Server).authed, registered in (*Server).screenRoutes |
staff › SimulationGET /The dashboard: the bank's position, the run's state and its controls; it polls its own sections
| Needs | cookie staff_session, bearer token |
|---|---|
| Answers |
200 OK as text/html 404 Not found as text/plain 405 Method not allowed as text/plain (Method not allowed)
|
| Source | bff/staff/console_routes.go:21, registered in (*Site).simulationRoutes |
staff › AboutGET /aboutThe project: what the Model Bank is, its aims and its non-goals
| Needs | cookie staff_session, bearer token |
|---|---|
| Answers |
200 OK as text/html 404 Not found as text/plain 405 Method not allowed as text/plain (Method not allowed)
|
| Source | bff/staff/site.go:542, registered in (*Site).aboutRoutes |
staff › AboutGET /about.jsonThe demo's state for another program (GET, no session): version, schema, settings, the run and its rates, the position and the restart record
gobank-deploy's upgrade drill reads it before and after each redeploy; a performance run reads the rates.
| Needs | nothing: open |
|---|---|
| Answers |
200 OK as application/json: staff.AboutStatus405 Method not allowed as text/plain (Method not allowed)
|
| Source | bff/staff/site.go:617, registered in (*Site).aboutRoutes |
staff › AboutGET /about/adrThe architecture decision records compiled into this build
| Needs | cookie staff_session, bearer token |
|---|---|
| Answers |
200 OK as text/html 405 Method not allowed as text/plain (Method not allowed)
|
| Source | bff/staff/site.go:587, registered in (*Site).aboutRoutes |
staff › AboutGET /about/apiThe API: every route the BFF and the staff web serve, read off the code at build time (package api), in clusters by subject (the function each is registered in), each linking to its own page; the types the bodies are made of follow
The OpenAPI document is at v1/openapi.json. A static page: the surface does not change while the run goes.
| Needs | cookie staff_session, bearer token |
|---|---|
| Answers |
405 Method not allowed as text/plain (Method not allowed)
|
| Source | bff/staff/site.go:564, registered in (*Site).aboutRoutes |
staff › AboutGET /about/api/{method}/{path...}One route of the API: what its handler needs, reads and answers, with a link to the registration in the source at this build's tag
The method is the pattern's or "any", the path the pattern's.
| Needs | cookie staff_session, bearer token |
|---|---|
| Path | method path |
| Answers |
404 Not found as text/plain 405 Method not allowed as text/plain (Method not allowed)
|
| Source | bff/staff/site.go:574, registered in (*Site).aboutRoutes |
staff › AboutGET /about/docsThe system documentation: the component registry, who may read what, the pre-rule debt and the ADR list
| Needs | cookie staff_session, bearer token |
|---|---|
| Answers |
200 OK as text/html 405 Method not allowed as text/plain (Method not allowed)
|
| Source | bff/staff/site.go:555, registered in (*Site).aboutRoutes |
staff › AboutGET /about/docs/adr/An ADR whole: its page, or one of the diagrams and sources its markdown names beside it
| Needs | cookie staff_session, bearer token |
|---|---|
| Answers |
200 OK as text/html 404 Not found as text/plain 405 Method not allowed as text/plain (Method not allowed)
|
| Source | bff/staff/site.go:592, registered in (*Site).aboutRoutes |
staff › AboutGET /about/modelsThe architecture models: the C4 system context and container diagrams
| Needs | cookie staff_session, bearer token |
|---|---|
| Answers |
200 OK as text/html 405 Method not allowed as text/plain (Method not allowed)
|
| Source | bff/staff/site.go:550, registered in (*Site).aboutRoutes |
staff › AboutGET /about/runtimeRuntime: the process, its memory against the limit, the schema versions and the restart record
| Needs | cookie staff_session, bearer token |
|---|---|
| Answers |
200 OK as text/html 405 Method not allowed as text/plain (Method not allowed)
|
| Source | bff/staff/site.go:610, registered in (*Site).aboutRoutes |
staff › AccountingGET /accounting/balance-sheetThe balance sheet on the current business day, with the CET1 position
| Needs | cookie staff_session, bearer token |
|---|---|
| Answers |
200 OK as text/html 405 Method not allowed as text/plain (Method not allowed)
|
| Source | bff/staff/site.go:287, registered in (*Site).accountingRoutes |
staff › AccountingGET /accounting/pnlThe profit and loss statement since the bank opened, on an accrual basis
| Needs | cookie staff_session, bearer token |
|---|---|
| Answers |
200 OK as text/html 405 Method not allowed as text/plain (Method not allowed)
|
| Source | bff/staff/site.go:283, registered in (*Site).accountingRoutes |
staff › SimulationPOST /add-customersOpens n customers in the background (POST n=), with the product mix the simulation uses; /about.json shows the batch's rate
| Needs | cookie staff_session, bearer token; role action sim_controls |
|---|---|
| Form | n |
| Answers |
303 Redirect 403 Forbidden as text/plain (Forbidden)
|
| Source | bff/staff/console_routes.go:78 via control, registered in (*Site).simulationRoutes |
staff › SimulationPOST /advanceRuns one business day while the run is stopped (POST)
| Needs | cookie staff_session, bearer token; role action sim_controls |
|---|---|
| Answers |
303 Redirect 403 Forbidden as text/plain (Forbidden)
|
| Source | bff/staff/console_routes.go:72 via control, registered in (*Site).simulationRoutes |
staff › SessionPOST /auth/revokePII (POST): the admin gives the authorisation up and returns to redirect=
| Needs | cookie staff_session, bearer token |
|---|---|
| Form | redirect |
| Answers |
303 Redirect
|
| Source | bff/staff/login.go:69, registered in (*Site).sessionRoutes |
staff › CustomersGET /customersThe customers, one page (?page=) at a time; personal data only for an authorised admin
| Needs | cookie staff_session, bearer token |
|---|---|
| Query | page |
| Answers |
200 OK as text/html 405 Method not allowed as text/plain (Method not allowed)
|
| Source | bff/staff/site.go:382, registered in (*Site).customersRoutes |
staff › CustomersGET /customers/Under /customers/: a customer's detail at /customers/{id}, or one of their accounts at /customers/{id}/account/{index}, each with its transactions one page (?txpage=) at a time
| Needs | cookie staff_session, bearer token |
|---|---|
| Query | txpage |
| Answers |
200 OK as text/html 303 Redirect 404 Not found as text/plain 405 Method not allowed as text/plain (Method not allowed)
|
| Source | bff/staff/site.go:408, registered in (*Site).customersRoutes |
staff › CustomersPOST /customers/searchCustomer search by name (POST name=): the customers whose name contains it, oldest first and at most core.CustomerSearchLimit, as the register's table — the matches alone for htmx, the Customers page with them for a browser
The name is personal data: it travels in the body and never in a URL, and only an authorised admin may search.
| Needs | cookie staff_session, bearer token |
|---|---|
| Form | name |
| Answers |
200 OK as text/html 403 Forbidden as text/plain (Forbidden) 405 Method not allowed as text/plain (Method not allowed)
|
| Source | bff/staff/site.go:390, registered in (*Site).customersRoutes |
staff › SimulationGET /dashboard/updateThe dashboard's polled sections, as an HTML fragment
| Needs | cookie staff_session, bearer token |
|---|---|
| Answers |
200 OK as text/html 405 Method not allowed as text/plain (Method not allowed)
|
| Source | bff/staff/console_routes.go:41, registered in (*Site).simulationRoutes |
staff › InternalGET /eventsEvents: the record of what happened and what it caused (ADR-0011)
| Needs | cookie staff_session, bearer token |
|---|---|
| Answers |
200 OK as text/html 405 Method not allowed as text/plain (Method not allowed)
|
| Source | bff/staff/site.go:637, registered in (*Site).internalRoutes |
staff › InternalGET /export.golucaThe whole book as a .goluca file (GET): admin only
| Needs | cookie staff_session, bearer token; role action export |
|---|---|
| Answers |
200 OK as application/octet-stream 403 Forbidden as text/plain (Forbidden) 405 Method not allowed as text/plain (Method not allowed) 500 Internal error as text/plain
|
| Source | bff/staff/site.go:668, registered in (*Site).internalRoutes |
staff › AssetsGET /favicon.icoThe tab icon as .ico, from lofigui
| Needs | nothing: open |
|---|---|
| Answers | |
| Source | bff/staff/site.go:720 lofigui.ServeFavicon, registered in (*Site).assetRoutes |
| Unknown | handler lofigui.ServeFavicon: body outside the walk; no response found |
staff › AssetsGET /favicon.svgThe tab icon as SVG
| Needs | nothing: open |
|---|---|
| Answers |
200 OK as image/svg+xml
|
| Source | bff/staff/site.go:722, registered in (*Site).assetRoutes |
staff › InternalPOST /importReplaces the book with an uploaded .goluca file (POST, multipart file=): admin only
| Needs | cookie staff_session, bearer token; role action export |
|---|---|
| Upload | file |
| Answers |
303 Redirect 400 Bad request as text/plain (No file uploaded; Read error) 403 Forbidden as text/plain (Forbidden) 405 Method not allowed as text/plain (Method not allowed) 500 Internal error as text/plain
|
| Source | bff/staff/site.go:687, registered in (*Site).internalRoutes |
staff › InternalGET /internal/explorerThe DB explorer: every component's tables, read-only; a role sees only the components it may (customers needs view_pii)
| Needs | cookie staff_session, bearer token |
|---|---|
| Answers |
200 OK as text/html 303 Redirect 405 Method not allowed as text/plain (Method not allowed)
|
| Source | bff/staff/site.go:663, registered in (*Site).internalRoutes |
staff › InternalGET /internal/explorer/The DB explorer's tables and rows, under its prefix
| Needs | cookie staff_session, bearer token |
|---|---|
| Answers |
200 OK as text/html 303 Redirect 405 Method not allowed as text/plain (Method not allowed)
|
| Source | bff/staff/site.go:665, registered in (*Site).internalRoutes |
staff › SessionGET POST /loginThe staff login: the form (GET) and its check (POST login, password) against the users component
Five failures for one login or from one address lock it for fifteen minutes; 503 on a deployment with no users.
| Needs | nothing: open |
|---|---|
| Query | redirect |
| Form | login password redirect |
| Answers |
200 OK 303 Redirect 400 Bad request as text/plain (Malformed login form; Enter your login and password.) 401 Unauthenticated (Unknown login or wrong password.) 405 Method not allowed as text/plain (Method not allowed) 429 Too many requests 503 Unavailable (Staff login is not set up on this deployment.)
|
| Source | bff/staff/login.go:26, registered in (*Site).sessionRoutes |
staff › SessionPOST /logoutEnds the staff session (POST): the cookie is cleared and the browser sent to the login page
| Needs | cookie staff_session, bearer token |
|---|---|
| Answers |
303 Redirect
|
| Source | bff/staff/login.go:42, registered in (*Site).sessionRoutes |
staff › AccountingGET /movements/{id}Serves one movement of the ledger (ADR-0008): its page; with the suffix .goluca its plain-text-accounting text, with .json the movement itself
| Needs | cookie staff_session, bearer token |
|---|---|
| Path | id |
| Answers |
200 OK as application/json, text/html, text/plain: core.Movement404 Not found as text/plain 405 Method not allowed as text/plain (Method not allowed) 500 Internal error as text/plain (Internal error)
|
| Source | bff/staff/site.go:291 (*Site).movement, registered in (*Site).accountingRoutes |
staff › PaymentsGET /paymentsPayments: the list, newest first, one page (?page=) at a time, with the generator's controls
| Needs | cookie staff_session, bearer token |
|---|---|
| Query | page |
| Answers |
200 OK as text/html 405 Method not allowed as text/plain (Method not allowed)
|
| Source | bff/staff/site.go:454, registered in (*Site).paymentsRoutes |
staff › SimulationPOST /payments/runStarts the payment generator (POST): the settings' payments a day
| Needs | cookie staff_session, bearer token; role action send_payment |
|---|---|
| Answers |
303 Redirect 403 Forbidden as text/plain (Forbidden)
|
| Source | bff/staff/console_routes.go:104 via payments, registered in (*Site).simulationRoutes |
staff › SimulationPOST /payments/sendSends one generated payment now (POST)
| Needs | cookie staff_session, bearer token; role action send_payment |
|---|---|
| Answers |
303 Redirect 403 Forbidden as text/plain (Forbidden)
|
| Source | bff/staff/console_routes.go:102 via payments, registered in (*Site).simulationRoutes |
staff › SimulationPOST /payments/stopStops the payment generator (POST)
| Needs | cookie staff_session, bearer token; role action send_payment |
|---|---|
| Answers |
303 Redirect 403 Forbidden as text/plain (Forbidden)
|
| Source | bff/staff/console_routes.go:106 via payments, registered in (*Site).simulationRoutes |
staff › PaymentsGET /payments/{id}One payment: its detail and the movements it made
| Needs | cookie staff_session, bearer token |
|---|---|
| Path | id |
| Answers |
200 OK as text/html 404 Not found as text/plain 405 Method not allowed as text/plain (Method not allowed)
|
| Source | bff/staff/site.go:442, registered in (*Site).paymentsRoutes |
staff › ProductsGET /products/bankThe bank's own parameters (Bank Rate, the reserve ratio and the rest), as the Bank tab shows them
| Needs | cookie staff_session, bearer token |
|---|---|
| Answers |
200 OK as text/html 405 Method not allowed as text/plain (Method not allowed)
|
| Source | bff/staff/site.go:313, registered in (*Site).productsRoutes |
staff › ProductsGET /products/lendingThe lending products: the family's catalogue, each product with its book
| Needs | cookie staff_session, bearer token |
|---|---|
| Answers |
200 OK as text/html 405 Method not allowed as text/plain (Method not allowed)
|
| Source | bff/staff/site.go:308, registered in (*Site).productsRoutes |
staff › ProductsGET /products/savingsThe savings products: the family's catalogue, each product with its book
| Needs | cookie staff_session, bearer token |
|---|---|
| Answers |
200 OK as text/html 405 Method not allowed as text/plain (Method not allowed)
|
| Source | bff/staff/site.go:303, registered in (*Site).productsRoutes |
staff › ProductsGET POST /products/{owner}/parameters/{key}One parameter of a product or of the bank: its history and, for a signed-in user who may, the form that sets it (POST value, effective); ?refused= carries a refusal back to the page
| Needs | cookie staff_session, bearer token; role action settings |
|---|---|
| Path | owner key |
| Query | refused |
| Form | value effective |
| Answers |
200 OK as text/html 303 Redirect 403 Forbidden as text/plain (Forbidden) 404 Not found as text/plain 405 Method not allowed as text/plain (Method not allowed)
|
| Source | bff/staff/site.go:319, registered in (*Site).productsRoutes |
staff › ReportsGET /reports/bbsiThe BBSI return (Bank and Building Society Interest): each customer's interest for the year; personal data only for an authorised admin
| Needs | cookie staff_session, bearer token |
|---|---|
| Answers |
200 OK as text/html 405 Method not allowed as text/plain (Method not allowed)
|
| Source | bff/staff/site.go:519, registered in (*Site).reportsRoutes |
staff › ReportsGET /reports/chartsThe charts: the book, the customer count and the rates over the run
| Needs | cookie staff_session, bearer token |
|---|---|
| Answers |
200 OK as text/html 405 Method not allowed as text/plain (Method not allowed)
|
| Source | bff/staff/site.go:514, registered in (*Site).reportsRoutes |
staff › ReportsGET /reports/customer-viewA customer as the app shows them (?id=); without an id, the customer list
| Needs | cookie staff_session, bearer token |
|---|---|
| Query | id |
| Answers |
200 OK as text/html 303 Redirect 405 Method not allowed as text/plain (Method not allowed)
|
| Source | bff/staff/site.go:524, registered in (*Site).reportsRoutes |
staff › SimulationPOST /resetEmpties the bank and starts again on its opening day (POST); the settings are kept
| Needs | cookie staff_session, bearer token; role action sim_controls |
|---|---|
| Answers |
303 Redirect 403 Forbidden as text/plain (Forbidden)
|
| Source | bff/staff/console_routes.go:75 via control, registered in (*Site).simulationRoutes |
staff › SimulationGET POST /settingsThe console settings: the page (GET), and the change (POST max_customers, payments_per_day, day_length; 0s runs flat out, a day length that does not parse leaves the current one)
The day length set here is the run's and outlives the process.
| Needs | cookie staff_session, bearer token; role action settings |
|---|---|
| Form | max_customers payments_per_day day_length |
| Answers |
200 OK as text/html 303 Redirect 403 Forbidden as text/plain (Forbidden) 405 Method not allowed as text/plain (Method not allowed)
|
| Source | bff/staff/console_routes.go:114, registered in (*Site).simulationRoutes |
staff › SimulationGET /settings/statusThe settings page's status line, polled on its own so the form is never re-rendered under the operator
| Needs | cookie staff_session, bearer token |
|---|---|
| Answers |
200 OK as text/html 405 Method not allowed as text/plain (Method not allowed)
|
| Source | bff/staff/console_routes.go:142, registered in (*Site).simulationRoutes |
staff › SimulationPOST /startStarts the run (POST): the simulation moves day after day at the settings' day length until stopped
| Needs | cookie staff_session, bearer token; role action sim_controls |
|---|---|
| Answers |
303 Redirect 403 Forbidden as text/plain (Forbidden)
|
| Source | bff/staff/console_routes.go:68 via control, registered in (*Site).simulationRoutes |
staff › SimulationPOST /stopStops the run after the day in progress (POST)
| Needs | cookie staff_session, bearer token; role action sim_controls |
|---|---|
| Answers |
303 Redirect 403 Forbidden as text/plain (Forbidden)
|
| Source | bff/staff/console_routes.go:70 via control, registered in (*Site).simulationRoutes |
staff › TreasuryGET /treasury/capitalThe reserve ratio against its requirement, and the lending headroom
| Needs | cookie staff_session, bearer token |
|---|---|
| Answers |
200 OK as text/html 405 Method not allowed as text/plain (Method not allowed)
|
| Source | bff/staff/site.go:474, registered in (*Site).treasuryRoutes |
staff › TreasuryGET /treasury/cashThe cash position: deposits, loans, cash at the BoE against the required reserves, and the Bank Rate
| Needs | cookie staff_session, bearer token |
|---|---|
| Answers |
200 OK as text/html 405 Method not allowed as text/plain (Method not allowed)
|
| Source | bff/staff/site.go:470, registered in (*Site).treasuryRoutes |
staff › TreasuryGET /treasury/giltsThe gilt holdings and the purchase form
| Needs | cookie staff_session, bearer token |
|---|---|
| Answers |
200 OK as text/html 405 Method not allowed as text/plain (Method not allowed)
|
| Source | bff/staff/site.go:478, registered in (*Site).treasuryRoutes |
staff › TreasuryPOST /treasury/gilts/buyBuys a gilt (POST tenor, face_value in pounds): admin only; returns to the gilts page
| Needs | cookie staff_session, bearer token; role action buy_gilt |
|---|---|
| Form | tenor face_value |
| Answers |
303 Redirect 403 Forbidden as text/plain (Forbidden)
|
| Source | bff/staff/site.go:483, registered in (*Site).treasuryRoutes |
staff › SessionGET /view/{name}Switches this browser between the bank's view and the customer's: GET view/{name}?back=<path> sets the staff_view cookie for a year and returns to the page that offered it
| Needs | cookie staff_session, bearer token |
|---|---|
| Path | name |
| Query | back |
| Answers |
303 Redirect
|
| Source | bff/staff/login.go:80 (*Site).viewSwitch, registered in (*Site).sessionRoutes |
staff › AssetsGET /wasm/pta2svg's browser renderer and its loader, embedded (ADR-0008), so the movement page draws in the tab
| Needs | cookie staff_session, bearer token |
|---|---|
| Answers |
200 OK (static files)
|
| Source | bff/staff/site.go:729 in http.StripPrefix, registered in (*Site).assetRoutes |
Every type the bodies above are made of, from the Go declarations and their comments.
bff.errorBody objecterrorBody is every error as a JSON client gets it: a stable code to switch on, what to tell the customer, and the screen to show with it when there is one (the login screen with its notice).
| Field | Type | |
|---|---|---|
error | string | bad_request, unauthenticated, bad_credentials, rate_limited, not_found or internal |
message | string | |
screen | screen.Screen or null optional |
bff.loginRequest object| Field | Type | |
|---|---|---|
customer_id | string | |
password | string |
bff.loginResponse objectloginResponse is what a JSON client gets for a login: the session token to send back as a bearer, when the session ends whatever happens (it also ends after fifteen idle minutes), and the home screen, so the client has nothing more to fetch.
| Field | Type | |
|---|---|---|
token | string | |
expires_at | string | RFC 3339, UTC |
screen | screen.Screen |
bff.screenBody objectscreenBody is a screen on its own, as the logout answers a JSON client.
| Field | Type | |
|---|---|---|
screen | screen.Screen |
core.EventRecord objectEventRecord is one event on the bank's record (ADR-0011): something that happened at an instant, raised by someone, whose cascade is pending or done.
| Field | Type | |
|---|---|---|
ID | string | |
Kind | string | "start of day", "publication", "payment", "setting", "opening" |
At | time.Time | |
Status | string | "pending", "done" |
By | string | who raised it: a user, a customer, a market's name, "clock" |
RaisedAt | time.Time | RaisedAt and DoneAt are wall time: in a simulation the bank's time (At) runs apart from the wall's, and the gap between them is how fast the bank works through its events. |
DoneAt | time.Time |
core.Leg objectLeg is one side of a movement: the account and the balance it was left with, signed as the ledger holds it.
| Field | Type | |
|---|---|---|
AccountID | string | |
Path | string | "Liability:Savings:cust-001:easy-access" |
Type | string | the path's first segment: Asset, Liability, Equity, Income, Expense |
Balance | luca.Amount |
core.Movement objectMovement is one ledger movement as written (ADR-0008): a signed amount from one account to another, the to account's balance rising by it and the from account's falling, with the balance each is left with, in the bank's view.
| Field | Type | |
|---|---|---|
ID | string | |
From | core.Leg | |
To | core.Leg | |
Amount | luca.Amount | |
Currency | string | |
Code | string | |
ValueTime | time.Time | |
KnowledgeTime | time.Time | |
Description | string | |
Cause | core.EventRecord or null | Cause is the root event a rule's posting was made under (ADR-0011) and Step the posting's name within it; nil and empty for a movement that is not a rule's, or from before the record. |
Step | string |
luca.Amount integerscreen.Action objectAction is what happens when the user taps a component. Exactly one of the fields is set.
| Field | Type | |
|---|---|---|
screen | string optional | GET this path and show the result |
submit | string optional | POST form values to this path |
logout | boolean optional | end the session |
screen.Component objectComponent is one element of a screen body. Type selects the component and which of the other fields are meaningful; unused fields are omitted from JSON.
| Field | Type | |
|---|---|---|
type | string | |
tone | screen.Tone optional | |
icon | screen.Icon optional | |
title | string optional | |
subtitle | string optional | |
value | string optional | |
note | string optional | |
currency | string optional | ISO 4217 code of the money a row or tx shows; the renderer picks the glyph by it |
text | string optional | |
pairs | []screen.Pair optional | |
fields | []screen.Field optional | |
action | screen.Action or null optional |
screen.Field objectField is one input in a form.
| Field | Type | |
|---|---|---|
name | string | |
label | string | |
kind | string | "text", "password", "number" |
placeholder | string optional | |
required | boolean optional |
screen.Icon stringIcon names a glyph. Clients map icons to their icon set.
One of: accounts, activity, bank, home, in, interest, lending, loan, "", out, savings
screen.Nav objectNav is the bottom tab bar.
| Field | Type | |
|---|---|---|
active | string | |
tabs | []screen.Tab |
screen.Pair objectPair is a label/value line inside a hero or details component.
| Field | Type | |
|---|---|---|
label | string | |
value | string |
screen.Screen objectScreen is one app view.
| Field | Type | |
|---|---|---|
schema | integer | |
id | string | |
path | string | GET path that returns this screen |
title | string | |
subtitle | string optional | |
back | screen.Action or null optional | |
body | []screen.Component | |
nav | screen.Nav or null optional |
screen.Tab objectTab is one entry in the bottom tab bar.
| Field | Type | |
|---|---|---|
key | string | |
label | string | |
icon | screen.Icon | |
screen | string |
screen.Tone stringTone selects a colour treatment. Clients map tones to their theme.
One of: danger, lending, muted, negative, "", positive, savings
staff.AboutOwed objectAboutOwed is core.Owed as another program reads it.
| Field | Type | |
|---|---|---|
at_rest | boolean | |
days | integer | |
unprojected | integer | |
events | integer | root events due and not done: cascades in progress (ADR-0011) |
staff.AboutPosition objectAboutPosition is the bank's position: what the dashboard leads with.
| Field | Type | |
|---|---|---|
day | string | YYYY-MM-DD |
day_count | integer | |
customers | integer | |
savings | string | formatted, as the dashboard shows it |
lending | string |
staff.AboutRestart objectAboutRestart is one row of the restart record, newest first, read with the row before it (see Restart).
| Field | Type | |
|---|---|---|
version | string | |
started_at | time.Time | |
day_count | integer | |
customers | integer | |
previous_version | string | "" for unrecorded or none |
previous_stopped_at | time.Time or null | |
downtime | string | Go duration; "" when unknown |
intact | boolean or null | day and customers equal across the stop; null when the previous row cannot say |
stopped_at | time.Time or null | |
stop_day_count | integer | |
stop_customers | integer |
staff.AboutRoute objectAboutRoute is one route's figures since the process started, as internal/routestats keeps them: the count, the latency (last, p50 and p95 of the latest requests, the maximum ever), the most in flight at once and the rate over the last minute.
| Field | Type | |
|---|---|---|
pattern | string | as registered: "GET /v1/health" |
method | string optional | |
path | string | |
count | integer | |
in_flight | integer | |
peak_in_flight | integer | |
last | string | Go durations |
p50 | string | |
p95 | string | |
max | string | |
per_second | number | completed in the last minute, a second |
staff.AboutSettings objectAboutSettings are the console settings.
| Field | Type | |
|---|---|---|
day_length | string | Go duration; "0s" is flat out |
max_customers | integer |
staff.AboutSim objectAboutSim is the run as it is now, with the two rates a performance run reads: customers added per second (the live rate while a batch add runs, else the last batch's) and account days per 12h at the pass's measured whole-day rate, with the last day it is made of.
| Field | Type | |
|---|---|---|
running | boolean | |
wall | string | the wall clock now, RFC 3339 UTC |
clock | string | the bank's clock now (simulated time), RFC 3339 UTC |
warp | number | simulated seconds per wall second; 0 when flat out |
day_ends_in | string | Go duration; "0s" when flat out or stopped |
adding_customers | boolean | |
customers_per_sec | number | |
account_days_per_12h | integer | |
last_day_duration | string | Go duration; "" before the first day |
last_day_accounts | integer | |
day_refused | string optional | why the bank would not follow the clock when last asked |
owed | staff.AboutOwed | what the bank owed when last asked (ADR-0010); a drill waits for at_rest |
next_event | string optional | the event the run loop waits for: "payment at 2020-03-04T10:32:00Z" |
staff.AboutStatus objectAboutStatus is the demo's state as another program reads it, at /about.json: the version and schema this process runs, the console settings, the run's position and the restart record. gobank-deploy's upgrade drill reads it before and after each redeploy to compare the position and read the downtime off the newest restart row.
| Field | Type | |
|---|---|---|
version | string | |
schema | []staff.SchemaVersion | |
settings | staff.AboutSettings | |
sim | staff.AboutSim | |
position | staff.AboutPosition | |
restarts | []staff.AboutRestart | |
routes | []staff.AboutRoute optional | what the process has measured of each route it served |
tables | []staff.AboutTable optional | The data's size on PostgreSQL: every table biggest first, and the whole database. None on pglike. |
database_bytes | integer optional |
staff.AboutTable objectAboutTable is one table's share of the database: its size on disk with indexes and TOAST, and its rows as PostgreSQL estimates them (as of the last ANALYZE; a count would scan the biggest tables).
| Field | Type | |
|---|---|---|
name | string | |
rows | integer | |
bytes | integer |
staff.SchemaVersion objectSchemaVersion is the version a component's tables are at.
| Field | Type | |
|---|---|---|
component | string | |
version | integer |
time.Time string (date-time)RFC 3339