database

package
v0.0.0-...-8417315 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UpgradeTable dbutil.UpgradeTable

Functions

This section is empty.

Types

type Database

type Database struct {
	DB *dbutil.Database
}

func NewDatabase

func NewDatabase(db *dbutil.Database) *Database

func (*Database) AddTeamMember

func (d *Database) AddTeamMember(ctx context.Context, teamID uuid.UUID, name string, studentAge int, studentEmail string) error

func (*Database) CheckInStudent

func (d *Database) CheckInStudent(ctx context.Context, email string) error

func (*Database) ConfirmStudent

func (d *Database) ConfirmStudent(ctx context.Context, email string, dietaryRestrictions, parentEmail string) error

func (*Database) DecrementEmailAllowance

func (d *Database) DecrementEmailAllowance(ctx context.Context, email string) error

func (*Database) GetAdminTeamsWithTeacherName

func (d *Database) GetAdminTeamsWithTeacherName(ctx context.Context) ([]*TeamWithTeacherName, error)

func (*Database) GetAllDietaryRestrictions

func (d *Database) GetAllDietaryRestrictions(ctx context.Context) ([]string, error)

func (*Database) GetStudentByEmail

func (d *Database) GetStudentByEmail(ctx context.Context, email string) (*Student, error)

func (*Database) GetTeacherByEmail

func (d *Database) GetTeacherByEmail(ctx context.Context, email string) (*Teacher, error)

func (*Database) GetTeacherForTeam

func (d *Database) GetTeacherForTeam(ctx context.Context, teamID uuid.UUID) (*Teacher, error)

func (*Database) GetTeacherTeams

func (d *Database) GetTeacherTeams(ctx context.Context, email string) ([]*Team, error)

func (*Database) GetTeam

func (d *Database) GetTeam(ctx context.Context, email string, teamID uuid.UUID) (*Team, error)

func (*Database) GetTeamNoMembers

func (d *Database) GetTeamNoMembers(ctx context.Context, teamID uuid.UUID) (*Team, error)

func (*Database) IsEmailAdmin

func (d *Database) IsEmailAdmin(ctx context.Context, email string) (bool, error)

func (*Database) IsEmailVolunteer

func (d *Database) IsEmailVolunteer(ctx context.Context, email string) (bool, error)

func (*Database) MarkQRCodeSent

func (d *Database) MarkQRCodeSent(ctx context.Context, email string) error

func (*Database) NewTeacher

func (d *Database) NewTeacher(ctx context.Context, name, email string) error

func (*Database) RemoveTeamMember

func (d *Database) RemoveTeamMember(ctx context.Context, teamID uuid.UUID, studentEmail string) error

func (*Database) SetEmailConfirmed

func (d *Database) SetEmailConfirmed(ctx context.Context, email string) error

func (*Database) SetTeacherSchoolInfo

func (d *Database) SetTeacherSchoolInfo(ctx context.Context, email, schoolName, schoolCity, schoolState string) error

func (*Database) SignFormsForStudent

func (d *Database) SignFormsForStudent(ctx context.Context, email, signatory string) error

func (*Database) UpsertTeam

func (d *Database) UpsertTeam(ctx context.Context, teacherEmail string, teamID uuid.UUID, name string) error

type Division

type Division string

type Student

type Student struct {
	TeamID       uuid.UUID
	Email        string
	Name         string
	Age          int
	ParentEmail  string
	Signatory    string
	CTFdPassword string
	// PreviouslyParticipated  bool
	LiabilitySigned         bool
	ComputerUseWaiverSigned bool
	EmailConfirmed          bool

	// CampusTour          bool
	DietaryRestrictions string

	QRCodeSent bool
	CheckedIn  bool
}

type Teacher

type Teacher struct {
	Name           string
	Email          string
	EmailConfirmed bool
	EmailAllowance int
	SchoolName     string
	SchoolCity     string
	SchoolState    string
}

type Team

type Team struct {
	ID           uuid.UUID
	TeacherEmail string
	Name         string
	// Division            Division
	// DivisionExplanation string
	// InPerson       bool
	Members        []Student
	SchoolName     string
	RegistrationTS time.Time
}

type TeamWithTeacherName

type TeamWithTeacherName struct {
	*Team
	TeacherName string
}

Jump to

Keyboard shortcuts

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