2025-06-06 21:14:28 +07:00

80 lines
3.4 KiB
Go

package response
// UndianListResponse represents the response for undian list API
type UndianListResponse struct {
Events []UndianEventResponse `json:"events"`
}
// UndianEventResponse represents an undian event with customer's vouchers and prizes
type UndianEventResponse struct {
ID int64 `json:"id"`
Title string `json:"title"`
Description *string `json:"description"`
ImageURL *string `json:"image_url"`
Status string `json:"status"`
StartDate string `json:"start_date"`
EndDate string `json:"end_date"`
DrawDate string `json:"draw_date"`
MinimumPurchase float64 `json:"minimum_purchase"`
DrawCompleted bool `json:"draw_completed"`
DrawCompletedAt *string `json:"draw_completed_at"`
TermsConditions *string `json:"terms_and_conditions"`
Prefix *string `json:"prefix"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
VoucherCount int `json:"voucher_count"`
TotalPrizes int `json:"total_prizes"`
Vouchers []UndianVoucherResponse `json:"vouchers"`
Prizes []UndianPrizeResponse `json:"prizes"`
}
// UndianVoucherResponse represents a customer's voucher
type UndianVoucherResponse struct {
ID int64 `json:"id"`
VoucherCode string `json:"voucher_code"`
VoucherNumber *int `json:"voucher_number"`
IsWinner bool `json:"is_winner"`
PrizeRank *int `json:"prize_rank"`
WonAt *string `json:"won_at"`
CreatedAt string `json:"created_at"`
}
// UndianPrizeResponse represents a prize in the undian event
type UndianPrizeResponse struct {
ID int64 `json:"id"`
Rank int `json:"rank"`
PrizeName string `json:"prize_name"`
PrizeValue *float64 `json:"prize_value"`
PrizeDescription *string `json:"prize_description"`
PrizeType string `json:"prize_type"`
PrizeImageURL *string `json:"prize_image_url"`
WinningVoucherID *int64 `json:"winning_voucher_id,omitempty"`
WinnerUserID *int64 `json:"winner_user_id,omitempty"`
IsWon bool `json:"is_won"`
Amount *int64 `json:"amount"`
}
// ActiveEventsResponse represents the response for active events API (without customer data)
type ActiveEventsResponse struct {
Events []ActiveEventResponse `json:"events"`
}
// ActiveEventResponse represents an active undian event (without customer-specific data)
type ActiveEventResponse struct {
ID int64 `json:"id"`
Title string `json:"title"`
Description *string `json:"description"`
ImageURL *string `json:"image_url"`
Status string `json:"status"`
StartDate string `json:"start_date"`
EndDate string `json:"end_date"`
DrawDate string `json:"draw_date"`
MinimumPurchase float64 `json:"minimum_purchase"`
DrawCompleted bool `json:"draw_completed"`
DrawCompletedAt *string `json:"draw_completed_at"`
TermsConditions *string `json:"terms_and_conditions"`
Prefix *string `json:"prefix"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
}