49 lines
1.1 KiB
Go
49 lines
1.1 KiB
Go
package domain
|
|
|
|
import "time"
|
|
|
|
type Raffle struct {
|
|
ID int32
|
|
CompanyID int32
|
|
Name string
|
|
CreatedAt time.Time
|
|
ExpiresAt time.Time
|
|
Type string
|
|
Status string
|
|
}
|
|
|
|
type RaffleTicket struct {
|
|
ID int32
|
|
RaffleID int32
|
|
UserID int32
|
|
IsActive bool
|
|
}
|
|
|
|
type RaffleTicketRes struct {
|
|
TicketID int32
|
|
UserID int32
|
|
Name string
|
|
Type string
|
|
ExpiresAt time.Time
|
|
Status string
|
|
}
|
|
|
|
type CreateRaffle struct {
|
|
CompanyID int32 `json:"company_id" validate:"required"`
|
|
Name string `json:"name" validate:"required"`
|
|
ExpiresAt *time.Time `json:"expires_at" validate:"required"`
|
|
Type string `json:"type" validate:"required"`
|
|
}
|
|
|
|
type CreateRaffleTicket struct {
|
|
RaffleID int32 `json:"raffle_id" validate:"required"`
|
|
UserID int32 `json:"user_id" validate:"required"`
|
|
}
|
|
|
|
// aside from ID, atleast one of the fields should be required
|
|
type UpdateRaffleParams struct {
|
|
ID int32 `json:"id" validate:"required"`
|
|
Name string `json:"name" validate:"required_without_all=ExpiresAt"`
|
|
ExpiresAt *time.Time `json:"expires_at" validate:"required_without_all=Name"`
|
|
}
|