api.routes.internal.invoice¶
Attributes¶
Functions¶
|
Receive and process an invoice PDF file from Surplus or Equipnet. |
Module Contents¶
- api.routes.internal.invoice.logger¶
- api.routes.internal.invoice.router¶
- async api.routes.internal.invoice.upload_invoice_pdf(file: fastapi.UploadFile = File(...), source: Literal['surplus', 'equipnet'] | None = None)¶
Receive and process an invoice PDF file from Surplus or Equipnet.
- Parameters:
file – The PDF file to process (must have .pdf extension)
source – The source of the invoice - either ‘surplus’ or ‘equipnet’ (required)
- Returns:
- A dictionary containing:
file_info: Dictionary with filename, content_type, size, and source
file_location: The hash used as the directory name for file storage
equipements: List of extracted equipment data (from the appropriate parser)
- Return type:
dict
- Raises:
HTTPException –
400 if file is not a PDF or source parameter is missing