Skip to main content

Type Alias: InvoiceScan

@arolariu/website


@arolariu/website / types/invoices/Invoice / InvoiceScan

Type Alias: InvoiceScan

InvoiceScan = object

Defined in: types/invoices/Invoice.ts:241

Represents a document scan (image or PDF) attached to an invoice.

Remarks

Invoice scans are the source documents from which invoice data is extracted. An invoice can have multiple scans (e.g., front and back of a receipt, or multi-page documents).

Storage: Scans are stored in Azure Blob Storage with the location property containing the full CDN URL (https://cdn.arolariu.ro/...).

Metadata: The metadata object stores scan-specific information such as:

  • Canonical scan metadata (scanId, ownerId, status, timestamps as strings)
  • OCR confidence scores (as objects)
  • Page numbers (for multi-page documents)
  • Extraction timestamps
  • Original file dimensions (as objects)

Immutability: Once created, scan locations are immutable. To replace a scan, delete the old one and create a new scan entry.

Example

const scan: InvoiceScan = {
scanType: InvoiceScanType.JPEG,
location: "https://cdn.arolariu.ro/invoices/user123/scan-001.jpg",
metadata: {
// Canonical scan metadata (string values)
scanId: "scan-001",
status: "attached",
uploadedAt: "2026-01-01T00:00:00.000Z",
// Legacy nested structures (object values)
ocrConfidence: { score: 0.95 },
dimensions: { width: 1920, height: 2560 }
}
};

See

Properties

scanType

scanType: InvoiceScanType

Defined in: types/invoices/Invoice.ts:243

The type of the invoice scan.


location

location: string

Defined in: types/invoices/Invoice.ts:245

The location (URL or path) of the invoice scan.


metadata

metadata: Record<string, InvoiceScanMetadataValue>

Defined in: types/invoices/Invoice.ts:247

Additional metadata associated with the invoice scan (supports both string and object values).

// was this page useful?