Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TeamActivityOverview ¶
TeamActivityOverview returns a list of teams and their activity
Types ¶
type Instance ¶
type Instance struct {
ID string `bun:",pk,type:varchar(36)" json:"id"`
Name string `bun:",type:varchar(255)" json:"name"`
UserId string `bun:",type:varchar(36)" json:"user_id"`
User User `bun:"rel:has-one,join:user_id=user_id" json:"user"`
Teams Teams `bun:"rel:has-many,join:id=instance_id" json:"teams"`
Locations Locations `bun:"rel:has-many,join:id=instance_id" json:"locations"`
Scans Scans `bun:"rel:has-many,join:id=instance_id" json:"scans"`
// contains filtered or unexported fields
}
Instance represents a single planned activity belonging to a user Instance is used to match users, teams, locations, and scans
func FindInstanceByID ¶
FindInstanceByID finds an instance by ID
func (*Instance) GeneratePosters ¶
func (*Instance) ZipPosters ¶
func (*Instance) ZipQRCodes ¶
type Instances ¶
type Instances []Instance
func FindAllInstances ¶
FindAllInstances finds all instances
type Location ¶
type Location struct {
Code string `bun:",unique,pk" json:"code"`
Lat float64 `bun:",type:float" json:"lat"`
Lng float64 `bun:",type:float" json:"lng"`
Name string `bun:",type:varchar(255)" json:"name"`
Content string `bun:",type:text" json:"content"`
TotalVisits int `bun:",type:int" json:"total_visits"`
CurrentCount int `bun:",type:int" json:"current_count"`
AvgDuration float64 `bun:",type:float" json:"avg_duration"`
MustScanOut bool `bun:"default:false" json:"must_scan_out"`
// contains filtered or unexported fields
}
func FindLocationByCode ¶
FindLocationByCode returns a location by code
func (*Location) GenerateQRCode ¶
func (*Location) LogScanOut ¶
type Locations ¶
type Locations []*Location
func FindLocationsByCodes ¶
FindLocationsByCodes returns a list of locations by code
type Scan ¶
type Scan struct {
TeamID string `bun:",pk,type:string" json:"team_id"`
LocationID string `bun:",pk,type:string" json:"location_id"`
TimeIn time.Time `bun:",type:datetime" json:"time_in"`
TimeOut time.Time `bun:",type:datetime" json:"time_out"`
Location Location `bun:"rel:has-one,join:location_id=code" json:"location"`
// contains filtered or unexported fields
}
type Team ¶
type Team struct {
Code string `bun:",unique,pk" json:"code"`
Scans Scans `bun:"rel:has-many,join:code=team_id" json:"scans"`
MustScanOut string `bun:"" json:"must_scan_out"`
BlockingLocation Location `bun:"rel:has-one,join:must_scan_out=code" json:"blocking_location"`
// contains filtered or unexported fields
}
func FindTeamByCode ¶
FindTeamByCode returns a team by code
func FindTeamByCodeAndInstance ¶
FindTeamByCodeAndInstance returns a team by code
func (*Team) HasVisited ¶
HasVisited returns true if the team has visited the given location
func (*Team) SuggestNextLocations ¶
SuggestNextLocation returns the next location to scan in
type User ¶
type User struct {
UserID string `bun:",pk,type:varchar(36)" json:"user_id"`
Email string `bun:",unique,pk" json:"email"`
Password string `bun:",type:varchar(255)" json:"password"`
Instances Instances `bun:"rel:has-many,join:user_id=user_id" json:"instances"`
// contains filtered or unexported fields
}
func AuthenticateUser ¶
AuthenticateUser checks the user's credentials and returns the user if they are valid
func FindUserByEmail ¶
FindUserByEmail finds a user by their email address