Interface: Scan
@arolariu/website / types / Scan
Interface: Scan
Defined in: types/scans/Scan.ts:138
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 uploaduserIdentifier: 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:
- Created during upload with status
UPLOADING - Status changes to
READYon successful upload - Status changes to
PROCESSINGwhen creating invoice - Status changes to
ARCHIVEDafter 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
readonlyid:string
Defined in: types/scans/Scan.ts:143
Unique identifier for the scan (UUIDv7). Assigned at upload time and immutable.
userIdentifier
readonlyuserIdentifier:string
Defined in: types/scans/Scan.ts:149
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:155
Human-readable name for the scan. Defaults to original filename, can be edited by user.
blobUrl
readonlyblobUrl:string
Defined in: types/scans/Scan.ts:161
Full URL to the scan in Azure Blob Storage. Format: https://cdn.arolariu.ro/scans/{userIdentifier}/{scanId}_{timestamp}.{ext}
mimeType
readonlymimeType:string
Defined in: types/scans/Scan.ts:167
MIME type of the uploaded file. Examples: "image/jpeg", "image/png", "application/pdf"
sizeInBytes
readonlysizeInBytes:number
Defined in: types/scans/Scan.ts:172
File size in bytes.
scanType
readonlyscanType:ScanType
Defined in: types/scans/Scan.ts:178
Document format classification. Derived from mimeType during upload.
uploadedAt
readonlyuploadedAt:Date
Defined in: types/scans/Scan.ts:183
Timestamp when the scan was uploaded.
status
status:
ScanStatus
Defined in: types/scans/Scan.ts:188
Current lifecycle status of the scan.
metadata
metadata:
Record<string,string>
Defined in: types/scans/Scan.ts:194
Additional metadata stored with the blob. Can include OCR hints, original dimensions, etc.