// Package media manages uploaded files (images/videos) and abstracts the // storage backend behind a Storage interface so the admin can switch // between local disk and any S3-compatible bucket via configuration only. package media import ( "time" "github.com/google/uuid" ) type Media struct { ID uuid.UUID `gorm:"type:uuid;primaryKey"` Filename string `gorm:"not null"` StorageKey string `gorm:"not null"` URL string `gorm:"not null"` MimeType string `gorm:"not null"` SizeBytes int64 `gorm:"not null"` AltText string `gorm:"not null;default:''"` // ProductID isolates each media file to the single product it was // uploaded for (nil for media not tied to any product, e.g. contact // link icons) -- there is no shared cross-product media library. ProductID *uuid.UUID `gorm:"type:uuid;index"` CreatedAt time.Time UpdatedAt time.Time } func (Media) TableName() string { return "media" }