refactor(api): migrate main.ts CRUD routes to PostgreSQL RPC

Replace all db.prepare() calls in main.ts with callCoreFn and the
respondRpc/respondApiError HTTP envelope helpers. Company and project
routes use the RPC response pattern; worker, budget, badge, catalog,
and tenant settings endpoints call their matching core.fn_* functions.

Adds app.onError(onAppError) for consistent error handling. Keeps
companies.ts wrappers, excel.ts document storage, and auth/PDF/S3
unchanged.

Co-authored-by: alberto.martinez <alberto.martinez@mrdev.mx>
This commit is contained in:
Cursor Agent 2026-09-03 23:58:55 +00:00
parent 8717c00a83
commit e92614acb9
No known key found for this signature in database

File diff suppressed because it is too large Load diff