package models import () type Object struct { /*ID, CreatedAt, UpdatedAt, DeletedAt (Update's history)*/ Base `gorm:"embedded"` // owner account ID OwnerID uint `json:"owner_id"` Owner Account `gorm:"foreignKey:OwnerID;references:ID" json:"owner"` // Основная информация // короткое название ShortName string `gorm:"not null" json:"short_name"` // длинное название LongName string `json:"long_name"` // тип места отдыха Type string `json:"type"` // контактные данные Phone string `json:"phone"` Email string `json:"email"` // ссылка на сайт Site string `json:"site"` // короткое описание ShortDescription string `json:"short_description"` // полное описание Description string `json:"description"` // адресс Address string `json:"address"` // Геолокация долгота и широта Latitude float64 `json:"latitude"` Longitude float64 `json:"longitude"` // Статус объекта IsActive bool `gorm:"default:true;index" json:"is_active"` IsVerified bool `gorm:"default:false" json:"is_verified"` // Связи с рейтингами (для разных платформ) TouristRating *Rating `gorm:"foreignKey:ObjectID;references:ID;where:platform='tourist'" json:"tourist_rating,omitempty"` EntrepreneurRating *Rating `gorm:"foreignKey:ObjectID;references:ID;where:platform='entrepreneur'" json:"entrepreneur_rating,omitempty"` // Все рейтинги объекта (если нужно получить оба сразу) Ratings []Rating `gorm:"foreignKey:ObjectID" json:"ratings,omitempty"` // Связи с отзывами Feedbacks []Feedback `gorm:"foreignKey:ObjectID" json:"feedbacks,omitempty"` FeedbackCount int `gorm:"default:0" json:"feedback_count"` }