Includes MFA-capable authentication, session and CSRF security, password recovery, listing lifecycle and ownership rules, inventory image metadata, local ImageStorage, migrations, tests, and implementation status documentation. Verification: npm test (62 passing) and integration suite (14 passing).
22 lines
650 B
JavaScript
22 lines
650 B
JavaScript
function toIsoString(value) {
|
|
return value instanceof Date ? value.toISOString() : value;
|
|
}
|
|
|
|
export function toAdminInventoryImageDto(image) {
|
|
return {
|
|
id: image.id,
|
|
inventoryItemId: image.inventoryItemId,
|
|
storageKey: image.storageKey,
|
|
originalFilename: image.originalFilename,
|
|
mimeType: image.mimeType,
|
|
fileSize: image.fileSize,
|
|
width: image.width,
|
|
height: image.height,
|
|
altText: image.altText ?? null,
|
|
sortOrder: image.sortOrder,
|
|
isPrimary: image.isPrimary,
|
|
processingStatus: image.processingStatus,
|
|
createdAt: toIsoString(image.createdAt),
|
|
updatedAt: toIsoString(image.updatedAt),
|
|
};
|
|
} |