Photo metadata storage for user galleries
{ userId: string, // User who owns the photo filename: string, // Storage filename (S3 key) photoUrl: string, // Public URL for access requestId: string, // Original capture request ID appId: string, // App that triggered capture uploadDate: Date, // Upload timestamp metadata?: { // Optional photo details originalFilename?: string, size?: number, mimeType?: string, width?: number, height?: number, deviceInfo?: string } }
photos/{userId}/{timestamp}-{random}.jpg
// Get user's photo gallery const photos = await GalleryPhoto.findByUserId('user@example.com'); // Returns photos sorted by uploadDate (newest first)
// Delete photo if user owns it const deleted = await GalleryPhoto.findAndDeleteById(photoId, userId); // Also triggers S3 deletion