Skip to main content
A Source is a named origin an Entity uses to group documents it pulls from external systems: for example, an SII feed, a supplier email inbox, or a CSV import. A Source is a bucket; the Source Feeds attached to it are what actually fetch data.
Source: apps/erp-backend/src/source/source.controller.ts. Base path: /api/entities/:entityId/sources.

GET /sources

List every Source for the Entity, each annotated with the count of Invoices it has produced.
  • Response: array of sourceWithInvoiceCountSchema.

POST /sources

Create a Source.
  • Body: CreateSourceDto.
  • Response: sourceWithInvoiceCountSchema.

PATCH /sources/:sourceId

Rename a Source. The controller method is renameSource; other attributes are not updated here.
  • Body: UpdateSourceDto.
  • Response: sourceWithInvoiceCountSchema.

DELETE /sources/:sourceId

Delete a Source. Sources referenced by existing Invoices or attached Source Feeds are refused.
  • Response: sourceWithInvoiceCountSchema.

Status codes

Unverified: fields on CreateSourceDto and UpdateSourceDto (likely id, name). Refer to the DTOs and @sintropix/api-contract for authoritative shapes.