Skip to main content

Interface: Scan

@arolariu/website


@arolariu/website / types/scans/Scan / Scan

Interface: Scan

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

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:159

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


userIdentifier​

readonly userIdentifier: string

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

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:171

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:177

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:183

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


sizeInBytes​

readonly sizeInBytes: number

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

File size in bytes.


scanType​

readonly scanType: ScanType

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

Document format classification. Derived from mimeType during upload.


uploadedAt​

readonly uploadedAt: Date

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

Timestamp when the scan was uploaded.


status​

status: ScanStatus

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

Current lifecycle status of the scan.


metadata​

metadata: ScanMetadata

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

Canonical typed metadata stored with the blob. Contains lifecycle tracking, document classification, and ownership information.

// was this page useful?