158 lines
5.4 KiB
Go
158 lines
5.4 KiB
Go
package domain
|
||
|
||
import (
|
||
"encoding/json"
|
||
"time"
|
||
)
|
||
|
||
// Post — новость, статья или акция. Различаются полем Kind.
|
||
type Post struct {
|
||
ID int64 `json:"id"`
|
||
Kind string `json:"kind"` // news | article | promo
|
||
Slug string `json:"slug"`
|
||
Title string `json:"title"`
|
||
Lead string `json:"lead,omitempty"`
|
||
Blocks json.RawMessage `json:"blocks,omitempty"`
|
||
Image string `json:"image,omitempty"`
|
||
StartsAt *time.Time `json:"starts_at,omitempty"`
|
||
EndsAt *time.Time `json:"ends_at,omitempty"`
|
||
PublishedAt time.Time `json:"published_at"`
|
||
SEO SEO `json:"seo"`
|
||
|
||
// Только у акций: размер скидки, условия и чек-ап, на который она действует.
|
||
DiscountPercent *int `json:"discount_percent,omitempty"`
|
||
Terms string `json:"terms,omitempty"`
|
||
CheckupSlug string `json:"checkup_slug,omitempty"`
|
||
}
|
||
|
||
type Review struct {
|
||
ID int64 `json:"id"`
|
||
AuthorName string `json:"author_name"`
|
||
AuthorPhoto string `json:"author_photo,omitempty"`
|
||
Rating *int `json:"rating,omitempty"`
|
||
Text string `json:"text"`
|
||
VideoURL string `json:"video_url,omitempty"`
|
||
DoctorSlug string `json:"doctor_slug,omitempty"`
|
||
DoctorName string `json:"doctor_name,omitempty"`
|
||
Source string `json:"source"`
|
||
Reply string `json:"reply,omitempty"`
|
||
CreatedAt time.Time `json:"created_at"`
|
||
}
|
||
|
||
type FAQItem struct {
|
||
ID int64 `json:"id"`
|
||
Question string `json:"question"`
|
||
Answer string `json:"answer"`
|
||
ServiceID *int64 `json:"service_id,omitempty"`
|
||
}
|
||
|
||
type Document struct {
|
||
ID int64 `json:"id"`
|
||
Kind string `json:"kind"` // license | certificate | supervisor | other
|
||
Title string `json:"title"`
|
||
Body string `json:"body,omitempty"`
|
||
File string `json:"file,omitempty"`
|
||
Preview string `json:"preview,omitempty"`
|
||
IssuedAt *time.Time `json:"issued_at,omitempty"`
|
||
}
|
||
|
||
type Partner struct {
|
||
ID int64 `json:"id"`
|
||
Name string `json:"name"`
|
||
URL string `json:"url,omitempty"`
|
||
Logo string `json:"logo,omitempty"`
|
||
}
|
||
|
||
type Vacancy struct {
|
||
ID int64 `json:"id"`
|
||
Slug string `json:"slug"`
|
||
Title string `json:"title"`
|
||
Description string `json:"description,omitempty"`
|
||
Duties string `json:"duties,omitempty"`
|
||
Requirements string `json:"requirements,omitempty"`
|
||
Conditions string `json:"conditions,omitempty"`
|
||
Salary string `json:"salary,omitempty"`
|
||
BranchID *int64 `json:"branch_id,omitempty"`
|
||
}
|
||
|
||
type Branch struct {
|
||
ID int64 `json:"id"`
|
||
Slug string `json:"slug"`
|
||
Name string `json:"name"`
|
||
Address string `json:"address"`
|
||
Phones []string `json:"phones"`
|
||
WorkHours []string `json:"work_hours"`
|
||
Lat *float64 `json:"lat,omitempty"`
|
||
Lon *float64 `json:"lon,omitempty"`
|
||
}
|
||
|
||
type Checkup struct {
|
||
ID int64 `json:"id"`
|
||
Slug string `json:"slug"`
|
||
Audience string `json:"audience"` // adults | kids
|
||
Name string `json:"name"`
|
||
Lead string `json:"lead,omitempty"`
|
||
Blocks json.RawMessage `json:"blocks,omitempty"`
|
||
Price *float64 `json:"price,omitempty"`
|
||
OldPrice *float64 `json:"old_price,omitempty"`
|
||
Image string `json:"image,omitempty"`
|
||
Featured bool `json:"featured"`
|
||
Items []string `json:"items,omitempty"`
|
||
SEO SEO `json:"seo"`
|
||
}
|
||
|
||
type Page struct {
|
||
ID int64 `json:"id"`
|
||
Slug string `json:"slug"`
|
||
Title string `json:"title"`
|
||
Blocks json.RawMessage `json:"blocks,omitempty"`
|
||
SEO SEO `json:"seo"`
|
||
}
|
||
|
||
type GalleryAlbum struct {
|
||
ID int64 `json:"id"`
|
||
Slug string `json:"slug"`
|
||
Title string `json:"title"`
|
||
Photos []GalleryPhoto `json:"photos,omitempty"`
|
||
}
|
||
|
||
type GalleryPhoto struct {
|
||
ID int64 `json:"id"`
|
||
Path string `json:"path"`
|
||
Caption string `json:"caption,omitempty"`
|
||
}
|
||
|
||
// --- формы и заявки ---
|
||
|
||
type Form struct {
|
||
ID int64 `json:"id"`
|
||
Code string `json:"code"`
|
||
Title string `json:"title"`
|
||
SuccessText string `json:"success_text,omitempty"`
|
||
Fields []FormField `json:"fields"`
|
||
}
|
||
|
||
type FormField struct {
|
||
Code string `json:"code"`
|
||
Label string `json:"label"`
|
||
Type string `json:"type"`
|
||
Required bool `json:"required"`
|
||
Options json.RawMessage `json:"options,omitempty"`
|
||
}
|
||
|
||
// LeadInput — то, что приходит с сайта при отправке формы.
|
||
type LeadInput struct {
|
||
FormCode string `json:"form"`
|
||
Name string `json:"name"`
|
||
Phone string `json:"phone"`
|
||
Email string `json:"email"`
|
||
ServiceID *int64 `json:"service_id"`
|
||
DoctorID *int64 `json:"doctor_id"`
|
||
BranchID *int64 `json:"branch_id"`
|
||
Message string `json:"message"`
|
||
Extra map[string]any `json:"extra"`
|
||
PageURL string `json:"page_url"`
|
||
UTM map[string]string `json:"utm"`
|
||
Consent bool `json:"consent"`
|
||
}
|