model

package
v0.0.0-...-b248145 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 20, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound        = errors.New("not found")
	ErrIDMismatch      = errors.New("id mismached")
	ErrNoPollDisplayed = errors.New("not displayed")
	ErrRunOutOfIndex   = errors.New("poll run out of index")
)

Functions

This section is empty.

Types

type CreatePresentionRequestDTO

type CreatePresentionRequestDTO struct {
	Polls []Poll `json:"polls"`
}

CreatePresentationRequest represents the request model for creating a presentation.

type CreateVoteRequestDTO

type CreateVoteRequestDTO struct {
	PollID   uuid.UUID `json:"poll_id" binding:"required"`
	Key      string    `json:"key" binding:"required"`
	ClientId string    `json:"client_id" binding:"required"`
}

CreateVoteRequest represents the request model for creating a vote.

type CurrentPoll

type CurrentPoll struct {
	ID string `json:"id"`
	Poll
}

type Option

type Option struct {
	Key   string `json:"key" db:"optionKey" binding:"required"`
	Value string `json:"value" db:"optionValue" binding:"required"`
}

type Poll

type Poll struct {
	Question string   `json:"question" binding:"required"`
	Options  []Option `json:"options" binding:"required,dive"`
}

type PresentationResponsePoll

type PresentationResponsePoll struct {
	Question string          `json:"question" binding:"required"`
	Options  json.RawMessage `json:"options" binding:"required,dive"`
}

type PresentionResponseDTO

type PresentionResponseDTO struct {
	CurrentPollIndex int32                      `json:"current_poll_index"`
	Polls            []PresentationResponsePoll `json:"polls"`
}

PresentionResponseDTO represents the request model for creating a presentation.

type Vote

type Vote struct {
	PollID         uuid.UUID
	PresentationID uuid.UUID
	Options        []string
	VoteCount      int
}

type VoteResponse

type VoteResponse struct {
	Key      string `json:"key"`
	ClientId string `json:"client_id"`
}

VoteResponse represents the response model for a vote.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL