package schema

import (
	"github.guxuan/haibei/pkg/util"
)

// Defining the `ActivityDetail` struct.
type ActivityDetail struct {
	util.BaseModel
	ActivityID uint   `json:"activityId" gorm:"index;"`
	CustomerID uint   `json:"customerId" gorm:"index;"`
	Status     string `json:"status" gorm:"size:20;index;comment:状态"`
}

// Defining the query parameters for the `ActivityDetail` struct.
type ActivityDetailQueryParam struct {
	util.PaginationParam
	ActivityID uint   `form:"activityId" `
	CustomerID uint   `form:"customerId" `
	Status     string `form:"status" `
}

// Defining the query options for the `ActivityDetail` struct.
type ActivityDetailQueryOptions struct {
	util.QueryOptions
}

// Defining the query result for the `ActivityDetail` struct.
type ActivityDetailQueryResult struct {
	Data       ActivityDetails
	PageResult *util.PaginationResult
}

// Defining the slice of `ActivityDetail` struct.
type ActivityDetails []*ActivityDetail

// Defining the data structure for creating a `ActivityDetail` struct.
type ActivityDetailForm struct {
	ActivityID uint   `json:"activityId" `
	CustomerID uint   `json:"customerId" `
	Status     string `json:"status" `
}

// A validation function for the `ActivityDetailForm` struct.
func (a *ActivityDetailForm) Validate() error {
	return nil
}

// Convert `ActivityDetailForm` to `ActivityDetail` object.
func (a *ActivityDetailForm) FillTo(activityDetail *ActivityDetail) error {
	activityDetail.ActivityID = a.ActivityID
	activityDetail.CustomerID = a.CustomerID
	activityDetail.Status = a.Status
	return nil
}
