package announcement

import "time"

type AnnouncementDTO struct {
	ID          uint64     `json:"id"`
	Title       string     `json:"title"`
	Content     string     `json:"content"`
	Category    string     `json:"category"`
	Priority    int        `json:"priority"`
	IsPinned    bool       `json:"is_pinned"`
	IsImportant bool       `json:"is_important"`
	ViewCount   int        `json:"view_count"`
	Status      string     `json:"status"`
	PublishedAt *time.Time `json:"published_at"`
	CreatedAt   time.Time  `json:"created_at"`
	UpdatedAt   time.Time  `json:"updated_at"`
}

type AnnouncementListQuery struct {
	Category string
	Status   string
	Page     int
	PageSize int
}

type PaginatedResult struct {
	Items    interface{} `json:"items"`
	Total    int64       `json:"total"`
	Page     int         `json:"page"`
	PageSize int         `json:"page_size"`
}

type CreateAnnouncementRequest struct {
	Title       string `json:"title" binding:"required,max=255"`
	Content     string `json:"content" binding:"required"`
	Category    string `json:"category" binding:"required,oneof=notice tutorial rule faq"`
	Priority    int    `json:"priority"`
	IsPinned    bool   `json:"is_pinned"`
	IsImportant bool   `json:"is_important"`
}

type UpdateAnnouncementRequest struct {
	Title       string `json:"title" binding:"max=255"`
	Content     string `json:"content"`
	Category    string `json:"category" binding:"omitempty,oneof=notice tutorial rule faq"`
	Priority    int    `json:"priority"`
	IsPinned    bool   `json:"is_pinned"`
	IsImportant bool   `json:"is_important"`
}
