docs(server): plain wording in the comments and test titles this change added

Comments and test titles added on this branch cited review labels and
planning documents that do not exist in the repository, and some used
dashes as separators. They now say what the code does and why in plain
sentences, and the Postgres lane's suites share one header format. Test
ids stay as they were.
This commit is contained in:
Maurice
2026-11-18 13:20:09 +01:00
parent e3d195896c
commit 21f4f7d5de
12 changed files with 13 additions and 14 deletions
+1 -1
View File
@@ -1221,7 +1221,7 @@ export interface RuleFixups {
jsonColumns: JsonColumnFixup[];
/** Rule 1c's flags, whose class field `fixFlagClassFieldTypes` turns back into a plain boolean. */
flags: RetypedScalarFixup[];
/** Rule 1's + Rule 1b's + Rule 1c's + Rule 2's retyped scalars together — all need the same `.columnType()` strip (see `stripRedundantColumnType`). */
/** Rule 1's + Rule 1b's + Rule 1c's + Rule 2's retyped scalars together, which all need the same `.columnType()` strip (see `stripRedundantColumnType`). */
retypedScalars: RetypedScalarFixup[];
/** Rule 10's repository-type markers — one per entity class. */
repositoryMarkers: RepositoryTypeMarkerFixup[];
+1 -1
View File
@@ -50,7 +50,7 @@ import nodeHttp from 'node:http';
* 4b. setupApiDocs — Swagger UI/spec at /api/docs* when TREK_API_DOCS_ENABLED.
* 4c. the named body-parser wrappers — the global 100kb JSON/urlencoded
* parsers, exempting /mcp so the MCP SDK reads the raw stream.
* 4d. nulFreeRequest — drops NUL from the path, query, body and cookies.
* 4d. nulFreeRequest, which drops NUL from the path, query, body and cookies.
* 5. app.init() — every domain controller, including the transport surface
* that used to live pre-init: /api/health (FeaturesController), OAuth
* discovery documents (DiscoveryController), the /oauth/consent COOP
@@ -18,7 +18,7 @@ export interface ReservationTraveler {
is_guest?: number | null;
}
/** A reservation row as the joined list/get queries return it (open record —
/** A reservation row as the joined list/get queries return it (an open record:
* the legacy queries selected `r.*` and callers pass the row through; the
* named fields are the columns consumers read in a typed position). */
export type ReservationRow = Record<string, unknown> & {
@@ -613,7 +613,7 @@ export class ReservationsService {
// the two together would bend one of them out of shape. The day stop is the
// part that must not exist twice, so it comes from AccommodationsService.
// The payload's accommodation_id is untrusted input and goes through
// `toRowId` the way update() reads it (L2): a `'0x1'` or an `'abc'` used to
// `toRowId` the way update() reads it: a `'0x1'` or an `'abc'` used to
// be stored as `'0x1.0'`, which Postgres cannot cast back for the join.
let resolvedAccommodationId: number | null = toRowId(accommodation_id) || null;
if (type === 'hotel' && !resolvedAccommodationId && create_accommodation) {
+2 -3
View File
@@ -5,9 +5,8 @@
* answer a 500 there while SQLite stored it. TREK stores no NUL on either
* engine now (src/db/nul-free.ts): every string a statement carries loses it,
* so the same request answers the same status and leaves the same row on both
* engines (M1 / program rule 22 first made it a 201 on SQLite). The control
* characters 0x01-0x1F, which both engines store, are swept in
* places.test.ts.
* engines. The control characters 0x01-0x1F, which both engines store, are
* swept in places.test.ts.
*/
import { buildApp } from '../../src/bootstrap';
import { Places } from '../../src/db/entities/Places.entity';
+1 -1
View File
@@ -202,7 +202,7 @@ describe('Vacay entries', () => {
});
describe('Vacay carry-over', () => {
it('VACAY-046 — a half day left over carries as a half day into the next year, on every engine', async () => {
it('VACAY-046: a half day left over carries as a half day into the next year, on every engine', async () => {
const { user } = await makeUser(orm);
const cookie = authCookie(user.id);
await request(app).get('/api/addons/vacay/plan').set('Cookie', cookie);
@@ -1,5 +1,5 @@
/**
* PGSEM-101..105 — answers that differ by engine although every statement is
* PGSEM-101..105: answers that differ by engine although every statement is
* accepted, so the probe cannot see them; checked here against the real app
* on the lane's Postgres database:
* a booking linked to a stay as '14.0' still shows the stay in the public
+1 -1
View File
@@ -1,5 +1,5 @@
/**
* PARITY-PG — the schema a Postgres database ends with after its bootstrap
* PARITY-PG-001: the schema a Postgres database ends with after its bootstrap
* (the baseline, then every migration after its cut) is the schema the
* entities describe, as scripts/generate-pg-baseline.ts writes it for
* Postgres (src/db/engine/postgres/schema-adjust.ts). MikroORM's comparator
+1 -1
View File
@@ -1,5 +1,5 @@
/**
* PGSEM-001..002 — what SQLite gives for free and Postgres only through the
* PGSEM-001..002: what SQLite gives for free and Postgres only through the
* engine, against the real app on the lane's Postgres database:
* writes in a UnitOfWork run one at a time, as on SQLite's single writer, so
* a read-then-insert never races; counts come back as numbers; and a search
+1 -1
View File
@@ -1,5 +1,5 @@
/**
* PGROLE-001..006 — the check that refuses a restore (and warns at boot) for a
* PGROLE-001..006: the check that refuses a restore (and warns at boot) for a
* role that could reach the database host from SQL
* (src/db/engine/postgres/server-checks.ts), evaluated by the real server as
* each kind of role. Roles belong to the whole server, so this suite creates