Add Tiers and Game Prize
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
type CreateTierRequest struct {
|
||||
Name string `json:"name" validate:"required"`
|
||||
MinPoints int64 `json:"min_points" validate:"min=0"`
|
||||
Benefits map[string]interface{} `json:"benefits"`
|
||||
}
|
||||
|
||||
type UpdateTierRequest struct {
|
||||
Name *string `json:"name,omitempty" validate:"omitempty,required"`
|
||||
MinPoints *int64 `json:"min_points,omitempty" validate:"omitempty,min=0"`
|
||||
Benefits map[string]interface{} `json:"benefits,omitempty"`
|
||||
}
|
||||
|
||||
type TierResponse struct {
|
||||
ID uuid.UUID `json:"id"`
|
||||
Name string `json:"name"`
|
||||
MinPoints int64 `json:"min_points"`
|
||||
Benefits map[string]interface{} `json:"benefits"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
type ListTiersQuery struct {
|
||||
Page int `query:"page" validate:"min=1"`
|
||||
Limit int `query:"limit" validate:"min=1,max=100"`
|
||||
Search string `query:"search"`
|
||||
SortBy string `query:"sort_by" validate:"omitempty,oneof=name min_points created_at updated_at"`
|
||||
SortOrder string `query:"sort_order" validate:"omitempty,oneof=asc desc"`
|
||||
}
|
||||
Reference in New Issue
Block a user