Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/node_modules
/coverage
.env
test_output.txt
.gitignore
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,18 @@ The middleware authenticates the token against the `JWT_SECRET` environment vari

---

## Invoice Verification Pipeline

When setting up new invoices via `POST /api/invoices`, the system runs the payload through a strict verification hook (`src/services/invoiceVerification.js`).
This pipeline performs fraud checks and business validations before the invoice is officially approved:
- Assesses for strict type safety (e.g., positive numerical amounts, well-structured strings).
- Validates data against predefined business logic rules (rejecting amounts above a global maximum, forcing manual review for threshold amounts).
- Enforces security assumptions by checking payload content for common injection patterns (like XSS signatures in customer names).

The resulting invoice maintains a verifiable status of `VERIFIED`, `REJECTED`, or `MANUAL_REVIEW`, as well as an associated `verificationReason` for failed or suspicious uploads.

---

## Rate Limiting

The API implements request throttling to prevent abuse:
Expand Down
217 changes: 164 additions & 53 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading