rubis/bruno/05-Invoices/01 List.bru
ordinarthur 27cfa9ac13 docs(bruno): collection complète des routes API + environnement local
Collection Bruno (.bru text files, comme Postman mais file-based versionable) qui couvre l'API V1 actuelle. Open Collection → bruno/ → sélectionner l'environnement "local".

Domaines couverts (22 requêtes) :
- 00-Auth : Signup, Login, Logout
- 01-Account : Get/Update profile
- 02-Organizations : Get/Update my org
- 03-Clients : List, List+stats, Search, Create, Create duplicate (409), Create without email (422), Get detail, Update
- 04-Plans : List, Get by slug, Update (steps remplacés)
- 05-Invoices : List, List+filters, Counts, Create, Get detail, Mark paid

Environnement local (bruno/environments/local.bru) :
- baseUrl, email/password/fullName en dur
- token, userId, organizationId, clientId, invoiceId remplis automatiquement par les script:post-response

Chaque requête a :
- assertions Chai (statut, shape de la réponse)
- bloc docs avec sémantique métier + erreurs typiques
- inheritance auth Bearer via folder.bru pour ne pas répéter le header

Mise à jour de docs/tech/dev-setup.md pour pointer vers la collection.

Le parcours recommandé Signup → Update org → Create client → Create invoice → Mark paid couvre le happy path et permet de checker rubisCount qui s'incrémente.
2026-05-06 14:40:55 +02:00

31 lines
602 B
Plaintext

meta {
name: 01 List
type: http
seq: 1
}
get {
url: {{baseUrl}}/api/v1/invoices
body: none
auth: inherit
}
tests {
test("200 OK", function () {
expect(res.getStatus()).to.equal(200);
});
test("meta has total + page", function () {
const meta = res.getBody().meta;
expect(meta).to.have.property("total");
expect(meta).to.have.property("page");
});
}
docs {
GET /api/v1/invoices
Liste paginée (50/page). Tri actionnable :
`awaiting_user_confirmation` → `in_relance` → `pending` → `litigation`
→ `paid` → `cancelled`, puis `dueDate` croissant.
}