Infrastructure low complexity backend
3
Dependencies
0
Dependents
1
Entities
0
Integrations

Description

Next.js REST API route handler at /api/v1/receipts that accepts multipart POST requests from the Flutter mobile client, validates the uploaded file type and size, delegates to the upload service and storage infrastructure, and returns the created receipt record. Performs server-side threshold validation as a safeguard against client-side bypass.

Feature: Receipt Photo Upload

receipt-api-endpoint

Responsibilities

  • Accept and parse multipart/form-data POST requests for receipt uploads
  • Validate file type, size, and presence of required expense reference
  • Delegate file storage and record creation to upload service
  • Perform server-side threshold validation to reject incomplete claims
  • Return created receipt record with storage URL to mobile client

Interfaces

POST /api/v1/receipts
GET /api/v1/receipts/:receiptId
DELETE /api/v1/receipts/:receiptId
GET /api/v1/receipts?expenseId={id}
validateMultipartRequest(req)
enforceOrganizationScope(req, organizationId)

Relationships

Dependencies (3)

Components this component depends on

Related Data Entities (1)

Data entities managed by this component