domain

package
v0.0.0-...-2033fae Latest Latest
Warning

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

Go to latest
Published: May 15, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alternative

type Alternative struct {
	gorm.Model
	Text   string
	PollID uint
}

type Poll

type Poll struct {
	gorm.Model
	Question     string
	UserID       uint
	Alternatives []Alternative
	Code         string
	Votes        []Vote
}

type PollRepository

type PollRepository interface {
	Create(poll Poll) (Poll, error)
	GetAll() ([]Poll, error)
	GetByCode(code string) (Poll, error)
	GetResults(id uint) (Poll, error)
}

type Vote

type Vote struct {
	gorm.Model
	PollID        uint
	AlternativeID uint
	UserID        uint
}

type VoteRepository

type VoteRepository interface {
	Create(vote Vote) (Vote, error)
}

Jump to

Keyboard shortcuts

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