120 lines
4.2 KiB
Go
120 lines
4.2 KiB
Go
package domain
|
|
|
|
import "encoding/json"
|
|
|
|
type SEO struct {
|
|
Title string `json:"title,omitempty"`
|
|
Description string `json:"description,omitempty"`
|
|
H1 string `json:"h1,omitempty"`
|
|
}
|
|
|
|
type Service struct {
|
|
ID int64 `json:"id"`
|
|
ParentID *int64 `json:"parent_id,omitempty"`
|
|
Slug string `json:"slug"`
|
|
Path string `json:"path"`
|
|
Name string `json:"name"`
|
|
ShortName string `json:"short_name,omitempty"`
|
|
Lead string `json:"lead,omitempty"`
|
|
Icon string `json:"icon,omitempty"`
|
|
Image string `json:"image,omitempty"`
|
|
Blocks json.RawMessage `json:"blocks,omitempty"`
|
|
SEO SEO `json:"seo"`
|
|
Children []*Service `json:"children,omitempty"`
|
|
|
|
// Заполняется только для карточки услуги.
|
|
PriceFrom *float64 `json:"price_from,omitempty"`
|
|
Prices []PriceItem `json:"prices,omitempty"`
|
|
Doctors []Doctor `json:"doctors,omitempty"`
|
|
}
|
|
|
|
type Specialty struct {
|
|
ID int64 `json:"id"`
|
|
Slug string `json:"slug"`
|
|
Name string `json:"name"`
|
|
NamePlural string `json:"name_plural"`
|
|
Count int `json:"count,omitempty"`
|
|
}
|
|
|
|
type Doctor struct {
|
|
ID int64 `json:"id"`
|
|
Slug string `json:"slug"`
|
|
LastName string `json:"last_name"`
|
|
FirstName string `json:"first_name"`
|
|
MiddleName string `json:"middle_name,omitempty"`
|
|
FullName string `json:"full_name"`
|
|
Position string `json:"position,omitempty"`
|
|
Category string `json:"category,omitempty"`
|
|
Degree string `json:"degree,omitempty"`
|
|
Experience *int `json:"experience_years,omitempty"`
|
|
Photo string `json:"photo,omitempty"`
|
|
Quote string `json:"quote,omitempty"`
|
|
Bio string `json:"bio,omitempty"`
|
|
Languages []string `json:"languages,omitempty"`
|
|
KidsFrom *int `json:"accepts_kids_from,omitempty"`
|
|
Booking Booking `json:"booking"`
|
|
Absent bool `json:"absent"`
|
|
// Рейтинг может быть задан в админке; иначе считается по опубликованным отзывам.
|
|
Rating *float64 `json:"rating,omitempty"`
|
|
ReviewCount int `json:"review_count"`
|
|
Specialties []Specialty `json:"specialties,omitempty"`
|
|
SEO SEO `json:"seo"`
|
|
|
|
BioEntries []BioEntry `json:"bio_entries,omitempty"`
|
|
Services []DoctorService `json:"services,omitempty"`
|
|
Branches []DoctorBranch `json:"branches,omitempty"`
|
|
}
|
|
|
|
// DoctorBranch — филиал, где принимает врач; адрес показывается в карточке.
|
|
type DoctorBranch struct {
|
|
Slug string `json:"slug"`
|
|
Name string `json:"name"`
|
|
Address string `json:"address"`
|
|
}
|
|
|
|
// DoctorService — услуга, которую ведёт врач; для вкладки «Услуги» в карточке.
|
|
type DoctorService struct {
|
|
Name string `json:"name"`
|
|
Path string `json:"path"`
|
|
Lead string `json:"lead,omitempty"`
|
|
}
|
|
|
|
type Booking struct {
|
|
Provider string `json:"provider"` // none | native
|
|
}
|
|
|
|
type BioEntry struct {
|
|
Kind string `json:"kind"`
|
|
YearFrom *int `json:"year_from,omitempty"`
|
|
YearTo *int `json:"year_to,omitempty"`
|
|
Title string `json:"title"`
|
|
Description string `json:"description,omitempty"`
|
|
}
|
|
|
|
type PriceSection struct {
|
|
ID int64 `json:"id"`
|
|
ParentID *int64 `json:"parent_id,omitempty"`
|
|
Slug string `json:"slug"`
|
|
Name string `json:"name"`
|
|
Items []PriceItem `json:"items,omitempty"`
|
|
Children []*PriceSection `json:"children,omitempty"`
|
|
}
|
|
|
|
type PriceItem struct {
|
|
ID int64 `json:"id"`
|
|
Name string `json:"name"`
|
|
Price float64 `json:"price"`
|
|
Unit string `json:"unit,omitempty"`
|
|
From bool `json:"from,omitempty"`
|
|
ServiceID *int64 `json:"service_id,omitempty"`
|
|
}
|
|
|
|
// PriceSectionBrief — раздел прайса без позиций: для меню в шапке,
|
|
// где нужны только название, адрес и число услуг.
|
|
type PriceSectionBrief struct {
|
|
ID int64 `json:"id"`
|
|
Slug string `json:"slug"`
|
|
Name string `json:"name"`
|
|
Count int `json:"count"`
|
|
}
|