model

package
v0.0.0-...-07862d9 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Room

type Room struct {
	gorm.Model
	ID         uuid.UUID `gorm:"type:uuid;default:uuid_generate_v4()"`
	Name       string
	JiraUrl    string
	Tickets    []Ticket
	UserEmails []string `gorm:"-"`
	JiraToken  string   `gorm:"-"`
}

type Ticket

type Ticket struct {
	gorm.Model
	ID          uuid.UUID `gorm:"type:uuid;default:uuid_generate_v4()"`
	RoomId      uuid.UUID
	UserId      uuid.UUID
	JiraID      string
	Description string
	Revealed    bool
	JiraPoints  int
	Votes       []Vote `gorm:"constraint:OnDelete:CASCADE;"`
}

func (*Ticket) AfterFind

func (t *Ticket) AfterFind(tx *gorm.DB) (err error)

type User

type User struct {
	gorm.Model
	ID    uuid.UUID `gorm:"type:uuid;default:uuid_generate_v4()"`
	Email string    `gorm:"unique"`
	Rooms []Room    `gorm:"many2many:user_rooms;"`
	Votes []Vote
}

type UserRoom

type UserRoom struct {
	UserID    uuid.UUID
	RoomId    uuid.UUID
	JiraToken string
}

type Vote

type Vote struct {
	gorm.Model
	ID        uuid.UUID `gorm:"type:uuid;default:uuid_generate_v4()"`
	UserID    uuid.UUID `gorm:"index:idx_one_vote_per_ticket,unique"`
	TicketID  uuid.UUID `gorm:"index:idx_one_vote_per_ticket,unique"`
	Points    int
	UserEmail string `gorm:"-"`
}

Jump to

Keyboard shortcuts

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