Skip to main content
Version: 1.2.0

fix-missing-fileid

🐛 Bug Fixes​

Require Bcyip-Agent and fileId on document create​

Goal: A deposit without an agent header must not create a document. Tower may still omit fileId. Every other agent must link a RemoteFile.

Solution: Reject POST /api/v2/documents with 400 when Bcyip-Agent is missing or blank. Any non-empty header value is accepted; it is not looked up in agent_codes. fileId stays optional only for iptower (case-insensitive) and required otherwise. Neo does not create RemoteFiles; upload stays on the legacy API. Do not change auto-attribute injection or folder filters.

Features:

  • Missing or blank Bcyip-Agent → 400
  • Bcyip-Agent: iptower → fileId optional
  • Any other agent, including ipmagicbox → fileId required (400 if missing)
  • Provided fileId still must exist, belong to the job, match the hash, and not already be linked

Files Modified:

  • src/domains/document/document.service.ts - Required header and fileId rule
  • src/domains/document/document.controller.ts - OpenAPI ingest description