package models import "time" // ChunkedUpload tracks a multi-part upload session. Chunks are stored as // individual files and merged when the client calls the complete endpoint. type ChunkedUpload struct { ID string `gorm:"type:uuid;primaryKey;default:gen_random_uuid()" json:"id"` SessionID string `gorm:"type:uuid;not null;index" json:"sessionId"` UserID string `gorm:"type:uuid;not null;index" json:"userId"` ClientID string `gorm:"size:120" json:"clientId"` Kind string `gorm:"size:20;not null" json:"kind"` FileName string `gorm:"size:255;not null" json:"fileName"` MIMEType string `gorm:"size:120" json:"mimeType"` TotalSize int64 `gorm:"not null" json:"totalSize"` ChunkSize int `gorm:"not null" json:"chunkSize"` TotalChunks int `gorm:"not null" json:"totalChunks"` UploadedChunks int `gorm:"default:0" json:"uploadedChunks"` StorageDir string `gorm:"size:1000;not null" json:"-"` Status string `gorm:"size:20;default:'pending'" json:"status"` // pending, completed, expired CreatedAt time.Time `gorm:"autoCreateTime" json:"createdAt"` ExpiresAt time.Time `gorm:"not null" json:"expiresAt"` }