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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
50 changes: 50 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,56 @@ To ensure reliable communication with Soroban contract provider APIs, this backe

---

## Invoice Status State Machine

To enforce a deterministic lifecycle, invoice statuses follow a strict state machine.

### Allowed Statuses
- `draft`: Initial upload, not yet verified.
- `pending_verification`: Undergoing manual or automated review.
- `approved`: Validated and available on the platform for funding.
- `funded`: Funds allocated/escrowed from buyer or investors.
- `settled`: Completed transaction on Stellar.
- `closed`: Terminal state for cancellation or completion.

### Valid Transitions
| Current Status | Allowed Next Status(es) |
|---|---|
| `draft` | `pending_verification` |
| `pending_verification` | `approved` |
| `approved` | `funded` |
| `funded` | `settled` |
| `settled` | `closed` |
| `closed` | *(Terminal, no transitions permitted)* |

### Example API Request
To transition an invoice status, send a `PATCH` request to:
**`PATCH /api/invoices/:id/status`**

```json
// Request Body
{
"currentStatus": "draft",
"nextStatus": "pending_verification"
}

// Sucessful Response (200 OK)
{
"data": {
"id": "123",
"status": "pending_verification"
},
"message": "Invoice status successfully transitioned"
}

// Invalid Transition Response (400 Bad Request)
{
"error": "Invalid status transition from draft to funded"
}
```

---

## Invoice Filtering & Sorting

Endpoint: GET /invoices
Expand Down
1 change: 0 additions & 1 deletion node_modules/.bin/acorn

This file was deleted.

1 change: 0 additions & 1 deletion node_modules/.bin/baseline-browser-mapping

This file was deleted.

1 change: 0 additions & 1 deletion node_modules/.bin/browserslist

This file was deleted.

1 change: 0 additions & 1 deletion node_modules/.bin/eslint

This file was deleted.

1 change: 0 additions & 1 deletion node_modules/.bin/esparse

This file was deleted.

1 change: 0 additions & 1 deletion node_modules/.bin/esvalidate

This file was deleted.

1 change: 0 additions & 1 deletion node_modules/.bin/glob

This file was deleted.

1 change: 0 additions & 1 deletion node_modules/.bin/import-local-fixture

This file was deleted.

1 change: 0 additions & 1 deletion node_modules/.bin/jest

This file was deleted.

1 change: 0 additions & 1 deletion node_modules/.bin/js-yaml

This file was deleted.

1 change: 0 additions & 1 deletion node_modules/.bin/jsesc

This file was deleted.

1 change: 0 additions & 1 deletion node_modules/.bin/json5

This file was deleted.

1 change: 0 additions & 1 deletion node_modules/.bin/mime

This file was deleted.

1 change: 0 additions & 1 deletion node_modules/.bin/napi-postinstall

This file was deleted.

1 change: 0 additions & 1 deletion node_modules/.bin/node-which

This file was deleted.

1 change: 0 additions & 1 deletion node_modules/.bin/parser

This file was deleted.

1 change: 0 additions & 1 deletion node_modules/.bin/regexp-tree

This file was deleted.

1 change: 0 additions & 1 deletion node_modules/.bin/semver

This file was deleted.

1 change: 0 additions & 1 deletion node_modules/.bin/update-browserslist-db

This file was deleted.

Loading
Loading