Table of Contents

**@arolariu/website**


@arolariu/website / types / Scan

Interface: Scan

Defined in: types/scans/Scan.ts:136

Represents a standalone scan stored in Azure Blob Storage.

Remarks

Domain Concept: A scan is an uploaded document (image or PDF) that exists independently of any invoice. Users upload scans first, then later select them to create invoice objects. This decouples the upload and invoice creation flows.

Identity:

  • id: Immutable UUIDv7 string assigned at upload
  • userIdentifier: Owner's Clerk user ID (stored in blob metadata for filtering)

Storage: Scans are stored in Azure Blob Storage with naming convention: scans/{userIdentifier}/{scanId}_{timestamp}.{extension}

Lifecycle:

  1. Created during upload with status UPLOADING
  2. Status changes to READY on successful upload
  3. Status changes to PROCESSING when creating invoice
  4. Status changes to ARCHIVED after invoice creation

Example

const scan: Scan = {
  id: "019234ab-cdef-7890-abcd-ef1234567890",
  userIdentifier: "user_abc123",
  name: "receipt-001.jpg",
  blobUrl: "https://cdn.arolariu.ro/scans/user_abc123/019234ab_1704067200000.jpg",
  mimeType: "image/jpeg",
  sizeInBytes: 1048576,
  scanType: ScanType.JPEG,
  uploadedAt: new Date(),
  status: ScanStatus.READY,
  metadata: {}
};

Extended by

Properties

id

readonly id: string

Defined in: types/scans/Scan.ts:141

Unique identifier for the scan (UUIDv7). Assigned at upload time and immutable.


userIdentifier

readonly userIdentifier: string

Defined in: types/scans/Scan.ts:147

The user identifier of the scan owner. Stored in Azure Blob metadata for filtering by user.


name

name: string

Defined in: types/scans/Scan.ts:153

Human-readable name for the scan. Defaults to original filename, can be edited by user.


blobUrl

readonly blobUrl: string

Defined in: types/scans/Scan.ts:159

Full URL to the scan in Azure Blob Storage. Format: https://cdn.arolariu.ro/scans/{userIdentifier}/{scanId}_{timestamp}.{ext}


mimeType

readonly mimeType: string

Defined in: types/scans/Scan.ts:165

MIME type of the uploaded file. Examples: "image/jpeg", "image/png", "application/pdf"


sizeInBytes

readonly sizeInBytes: number

Defined in: types/scans/Scan.ts:170

File size in bytes.


scanType

readonly scanType: ScanType

Defined in: types/scans/Scan.ts:176

Document format classification. Derived from mimeType during upload.


uploadedAt

readonly uploadedAt: Date

Defined in: types/scans/Scan.ts:181

Timestamp when the scan was uploaded.


status

status: ScanStatus

Defined in: types/scans/Scan.ts:186

Current lifecycle status of the scan.


metadata

metadata: Record<string, string>

Defined in: types/scans/Scan.ts:192

Additional metadata stored with the blob. Can include OCR hints, original dimensions, etc.