fix: resolve 27 pre-existing TypeScript compilation errors#271
fix: resolve 27 pre-existing TypeScript compilation errors#271shinzoxD wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR primarily unblocks CI by addressing a set of pre-existing TypeScript compilation errors across the Express app, container wiring, routes, and tests. It also introduces a local development bootstrap workflow (script + seed data + docs/env tweaks), which expands the PR scope beyond typecheck fixes.
Changes:
- Fix missing/incorrect symbols and properties causing TS compilation failures (container accessors, route/service usage, safer error propagation in handlers, logging import/usage, test typing fix).
- Update DB index migration for borrower-based credit line lookups and align seed/dev setup materials.
- Add a
dev:bootstrapworkflow (script + deterministic seed SQL) and document it in README, plus related.env.exampleand.gitattributesupdates.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/services/drawWebhookService.ts | Adds logger import and adjusts structured logging calls to match the logger API. |
| src/routes/simulation.ts | Uses utilized instead of non-existent balance and returns next(err) consistently. |
| src/routes/creditBulk.ts | Fixes service access and request shaping for bulk credit line creation; uses shared response envelope helper. |
| src/routes/tests/metrics.test.ts | Resolves TS narrowing issue around layer.route access in tests. |
| src/container/Container.ts | Adds dashboardSummaryService field + getter to satisfy callers and typecheck. |
| src/container/tests/Container.contract.test.ts | Adjusts cast to satisfy TS. |
| src/app.ts | Imports and wires metrics + maintenance components previously referenced but missing. |
| scripts/dev-seed.sql | Adds deterministic local seed dataset for bootstrap. |
| scripts/dev-bootstrap.sh | Adds reproducible local bootstrap flow (env setup, compose db, migrate/validate, seed). |
| README.md | Documents local bootstrap prerequisites and usage. |
| package.json | Adds dev:bootstrap script entrypoint. |
| migrations/005_db_indexes_hot_queries.sql | Updates indexes to use borrower-based lookup and a partial index for active lines. |
| .gitattributes | Enforces LF for shell scripts. |
| .env.example | Updates local defaults for compose host DB + placeholder API key. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| -- Index: support listing all credit lines by status (e.g. ACTIVE / SUSPENDED) | ||
| CREATE INDEX IF NOT EXISTS idx_credit_lines_status | ||
| ON credit_lines (status); | ||
|
|
||
| -- Partial index: only ACTIVE credit lines (most frequent filter in dashboard queries) |
| "build": "tsc && cp src/openapi.yaml dist/openapi.yaml", | ||
| "start": "node dist/index.js", | ||
| "dev": "tsx watch src/index.ts", | ||
| "dev:bootstrap": "bash scripts/dev-bootstrap.sh", | ||
| "typecheck": "tsc --noEmit", |
- consistent-type-imports: app.ts, metrics.ts, PostgresTransactionRepository - prefer-const: dashboardSummaryService.test.ts (let -> const) - no-unused-vars: removed WALLET, beforeEach, vi, runHandlers - no-floating-promises: removed dead runHandlers recursive function
CI Status: Fork Approval RequiredAll three CI checks on this PR are stuck in
Root causeThis PR is from a fork ( Code is clean — verified locallyI checked out the PR head (
Action needed from a maintainerPlease approve the pending workflow runs here:
After approval, |
Fixes the baseline TypeScript errors blocking CI on all open PRs (#269, #270).
Changes
_dashboardSummaryServicefield,dashboardSummaryServicegetter,getCreditServicegettercontainer.dashboardSummaryServicecontainer.dashboardSummaryServicegetCreditServicenot found, wrong arg count, missing returncreditLine.balancewhich doesn't exist on typelogused without importconsole.warn()layer.routepossibly undefinedVerification
npm run typecheckexits 0 with zero errors