package service

type ContentType string

const (
	ContentTypeNews    ContentType = "news"
	ContentTypeArticle ContentType = "article"
	ContentTypeVideo   ContentType = "video"
	ContentTypeAudio   ContentType = "audio"
	ContentTypeGraphic ContentType = "graphic"
	ContentTypeEvent   ContentType = "event"
)

type ContentStatus string

const (
	ContentStatusDraft      ContentStatus = "Черновик"
	ContentStatusModeration ContentStatus = "На модерации"
	ContentStatusReview     ContentStatus = "На проверке"
	ContentStatusPublished  ContentStatus = "Опубликовано"
	ContentStatusReturned   ContentStatus = "Возвращен"
	ContentStatusArchived   ContentStatus = "Архив"
)

type Visibility string

const (
	VisibilityPublic        Visibility = "Публично"
	VisibilityAuthenticated Visibility = "После входа"
	VisibilityRole          Visibility = "По роли"
)

type RoleCode string

const (
	RoleAdministrator RoleCode = "администратор"
	RoleEditor        RoleCode = "редактор"
	RoleManager       RoleCode = "менеджер"
	RoleUser          RoleCode = "пользователь"
)

type ContentItem struct {
	ID               string        `json:"id"`
	Title            string        `json:"title"`
	Lead             string        `json:"lead"`
	Body             string        `json:"body"`
	Excerpt          string        `json:"excerpt,omitempty"`
	Content          string        `json:"content,omitempty"`
	Type             ContentType   `json:"type"`
	Category         string        `json:"category"`
	Tags             []string      `json:"tags"`
	Author           string        `json:"author"`
	PublishedAt      string        `json:"publishedAt"`
	Duration         string        `json:"duration,omitempty"`
	Visibility       Visibility    `json:"visibility"`
	Status           ContentStatus `json:"status"`
	Views            int           `json:"views"`
	ImageTone        string        `json:"imageTone"`
	MediaURL         string        `json:"mediaUrl,omitempty"`
	MediaKind        string        `json:"mediaKind,omitempty"`
	MimeType         string        `json:"mimeType,omitempty"`
	FileName         string        `json:"fileName,omitempty"`
	FileSize         int64         `json:"fileSize,omitempty"`
	ModeratorComment string        `json:"moderatorComment,omitempty"`
	ReviewComment    string        `json:"reviewComment,omitempty"`
	Rating           int           `json:"rating,omitempty"`
	RatingAverage    float64       `json:"ratingAverage,omitempty"`
	RatingCount      int           `json:"ratingCount,omitempty"`
	MyRating         int           `json:"myRating,omitempty"`
}

type StoredFile struct {
	ID       string
	Name     string
	MimeType string
	Size     int64
	Data     []byte
}

type Speaker struct {
	ID          string   `json:"id"`
	Name        string   `json:"name"`
	Role        string   `json:"role"`
	Topics      []string `json:"topics"`
	Materials   int      `json:"materials"`
	Subscribers int      `json:"subscribers"`
}

type UserProfile struct {
	ID            string     `json:"id"`
	Name          string     `json:"name"`
	Login         string     `json:"login"`
	PasswordHash  string     `json:"-"`
	Roles         []RoleCode `json:"roles"`
	Subscriptions []string   `json:"subscriptions"`
}

type NotificationItem struct {
	ID          string `json:"id"`
	Title       string `json:"title"`
	Description string `json:"description"`
	Read        bool   `json:"read"`
	CreatedAt   string `json:"createdAt"`
}

type CommentItem struct {
	ID        string `json:"id"`
	ContentID string `json:"contentId"`
	Author    string `json:"author"`
	Text      string `json:"text"`
	CreatedAt string `json:"createdAt"`
}

type AuditItem struct {
	ID        string `json:"id"`
	Actor     string `json:"actor"`
	Action    string `json:"action"`
	Target    string `json:"target"`
	CreatedAt string `json:"createdAt"`
}
