modified: "main_dc/yalarba/api_yal/internal/models/\320\276bject.go"

upgare object.go 1
This commit is contained in:
2026-02-15 12:06:55 +05:00
parent b11abaa16f
commit 1a14dd965e
@@ -11,14 +11,41 @@ type Object struct {
Owner Account `gorm:"foreignKey:OwnerID;references:ID" json:"owner"` Owner Account `gorm:"foreignKey:OwnerID;references:ID" json:"owner"`
// Основная информация // Основная информация
// короткое название
ShortName string `gorm:"not null" json:"short_name"` ShortName string `gorm:"not null" json:"short_name"`
// длинное название
LongName string `json:"long_name"` LongName string `json:"long_name"`
// тип места отдыха
Type string `json:"type"` Type string `json:"type"`
// контактные данные
Phone string `json:"phone"` Phone string `json:"phone"`
Email string `json:"email"` Email string `json:"email"`
Site string `json:"site"`
Description string `json:"description"`
Address string `json:"address"`
RatingID uint `json:"rating_id"` // ссылка на сайт
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"`
} }