Chore/phase 1 cleanup - #1
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR performs a “phase 1 cleanup” by removing the backend’s mock AI-related modules/services and wiring in basic HTTP performance/security middleware (compression + rate limiting) at the app level.
Changes:
- Removed AI module routing/controllers/models and related mock services (smart approval path + risk scoring).
- Removed an old SQL migration (
001_init_users.sql) in favor of the newer schema approach. - Added
compressionandexpress-rate-limitto the backend and enabled them inbackend/src/app.js.
Reviewed changes
Copilot reviewed 10 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| backend/src/services/smartApproval.service.js | Removes mock smart-approval path helper. |
| backend/src/services/riskScoring.service.js | Removes mock expense risk scoring helper. |
| backend/src/services/ocr.service.js | Removes mock OCR receipt parsing service implementation. |
| backend/src/routes/index.js | Removes /ai route registration. |
| backend/src/modules/ai/ai.routes.js | Deletes AI routing module. |
| backend/src/modules/ai/ai.model.js | Deletes AI model stub. |
| backend/src/modules/ai/ai.controller.js | Deletes AI controller. |
| backend/src/db/migrations/001_init_users.sql | Deletes legacy user/company schema migration. |
| backend/src/app.js | Adds compression + rate limiting middleware. |
| backend/package.json | Adds compression and express-rate-limit dependencies. |
| backend/package-lock.json | Locks new dependency tree for added middleware packages. |
Files not reviewed (1)
- backend/package-lock.json: Generated file
Comments suppressed due to low confidence (1)
backend/src/services/ocr.service.js:1
parseReceiptWithOcris still imported and used by the expenses module (e.g.,backend/src/modules/expenses/expenses.controller.js), but this PR removes the implementation fromocr.service.js. That will cause a runtime/module resolution (or missing export) failure when starting the backend or calling/expenses/ocr. Either keep this service (even as a stub) or remove/update the expenses OCR endpoint and its import.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+4
to
+5
| import compression from "compression"; | ||
| import rateLimit from "express-rate-limit"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 1 cleanup done