Platform backbone (plan 2026-10-13-plattform-rueckgrat), all tasks reviewed: - webhooks with delivery table, retries and stable delivery id - calendar handlers; a finished task removes its Outlook event - tasks, automations, inspections, varroa, treatments, feedings, harvests, colonies, wintering, stock and bottling record domain events in the same transaction; legacy post-commit calls removed - row locks through one helper (lockRowForUpdate, lockRowsForShare, lockRowsForUpdate) - job framework with JobRun, cli exit codes, cleanup, task templates, daily evaluation, hourly app-backup and the rekey job - system API and page "Verwaltung > System" with retry - @nestjs/schedule removed, guard tests against in-process schedulers Field capture T3 (plan 2026-10-13-t3-erfassung-am-stand), all tasks reviewed: - inspection photo offline without metadata - bulk capture for treatments, feedings and varroa (backend + frontend) - offline stand mode with service worker, offline pages and packs - offline session, cold start and logout on shared devices Docs: ARCHITECTURE.md assumptions and sections updated, TASKS.md. Gates: backend lint, typecheck, 1770 unit, 420 e2e, build, no schema drift; frontend lint, typecheck, 913 tests, build. Not rolled out. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
27 lines
934 B
TypeScript
27 lines
934 B
TypeScript
import { CliExitCode, runCli } from './jobs/run-cli';
|
|
import { resolveRole } from './runtime/role';
|
|
import { assertStartupEnvironment } from './runtime/startup-checks';
|
|
|
|
/**
|
|
* Entry point of the job role: `node dist/cli.js <job> [args]`, one run per
|
|
* CronJob pod. Role and environment are checked like in main.ts and
|
|
* worker.ts, before any module connects. Resolves with the exit code:
|
|
* 0 succeeded, 1 failed, 2 wrong call. `env` is for tests; the modules
|
|
* themselves read process.env.
|
|
*/
|
|
export async function bootstrapCli(
|
|
argv: readonly string[] = process.argv.slice(2),
|
|
env: NodeJS.ProcessEnv = process.env,
|
|
): Promise<CliExitCode> {
|
|
const role = resolveRole('cli', env);
|
|
assertStartupEnvironment(role, env);
|
|
return runCli(argv);
|
|
}
|
|
|
|
// Started as `node dist/cli.js`; importing this file starts nothing.
|
|
if (require.main === module) {
|
|
void bootstrapCli().then((code) => {
|
|
process.exitCode = code;
|
|
});
|
|
}
|