package Models import ( "github.com/gofrs/uuid" ) type ConversationDetail struct { Base Name string `gorm:"not null" json:"name"` // Stored encrypted Users []ConversationDetailUser ` json:"users"` } type ConversationDetailUser struct { Base ConversationDetailID uuid.UUID `gorm:"not null" json:"conversation_detail_id"` ConversationDetail ConversationDetail `gorm:"not null" json:"conversation"` UserID string `gorm:"not null" json:"user_id"` // Stored encrypted Username string `gorm:"not null" json:"username"` // Stored encrypted Admin string `gorm:"not null" json:"admin"` // Stored encrypted AssociationKey string `gorm:"not null" json:"association_key"` // Stored encrypted PublicKey string `gorm:"not null" json:"public_key"` // Stored encrypted } // Used to link the current user to their conversations type UserConversation struct { Base UserID uuid.UUID `gorm:"type:uuid;column:user_id;not null;" json:"user_id"` User User ` json:"user"` ConversationDetailID string `gorm:"not null" json:"conversation_detail_id"` // Stored encrypted Admin string `gorm:"not null" json:"admin"` // Bool if user is admin of thread, stored encrypted SymmetricKey string `gorm:"not null" json:"symmetric_key"` // Stored encrypted // TODO: Add association_key here }