package domain import ( "time" ) // SiteOperatingBusiness is the junction table model for many-to-many relationship // between sites and organizations type SiteOperatingBusiness struct { SiteID string `gorm:"primaryKey;type:text"` OrganizationID string `gorm:"primaryKey;type:text"` // Optional: Additional relationship metadata StartDate *time.Time `gorm:"type:timestamp with time zone"` EndDate *time.Time `gorm:"type:timestamp with time zone"` Role string `gorm:"type:varchar(100)"` // tenant, partner, operator // Timestamps CreatedAt time.Time `gorm:"autoCreateTime"` UpdatedAt time.Time `gorm:"autoUpdateTime"` // Associations Site Site `gorm:"foreignKey:SiteID"` Organization Organization `gorm:"foreignKey:OrganizationID"` } // TableName specifies the table name for GORM func (SiteOperatingBusiness) TableName() string { return "site_operating_businesses" }