model

package
v0.0.0-...-796e6c5 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterModels

func RegisterModels() []string

Types

type Address

type Address struct {
	Street     string `bson:"street,omitempty" json:"street,omitempty"`
	City       string `bson:"city" json:"city"`
	State      string `bson:"state" json:"state"`
	PostalCode string `bson:"postalCode" json:"postalCode"`
	Country    string `bson:"country" json:"country"`
}

type CoursePreferences

type CoursePreferences struct {
	PreferredLearningMode string   `bson:"preferredLearningMode" json:"preferredLearningMode"`
	Availability          []string `bson:"availability" json:"availability"`
	PreferredInstructors  []string `bson:"preferredInstructors,omitempty" json:"preferredInstructors,omitempty"` // this may change when Instructor model is implemented
}

type Model

type Model struct {
	Model interface{}
}

type MusicalInfo

type MusicalInfo struct {
	ID                   primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"`
	UserID               primitive.ObjectID `bson:"userID" json:"userID"` // Reference to the User
	SkillLevel           string             `bson:"skillLevel" json:"skillLevel"`
	PrimaryInstrument    string             `bson:"primaryInstrument" json:"primaryInstrument"`
	SecondaryInstruments []string           `bson:"secondaryInstruments,omitempty" json:"secondaryInstruments,omitempty"`
	Genres               []string           `bson:"genres" json:"genres"`
	FavoriteArtists      []string           `bson:"favoriteArtists,omitempty" json:"favoriteArtists,omitempty"`
	LearningGoals        []string           `bson:"learningGoals,omitempty" json:"learningGoals,omitempty"`
}

MusicalInfo struct for user's musical details

type User

type User struct {
	ID             primitive.ObjectID `bson:"_id,omitempty" json:"id"`
	FirstName      string             `bson:"firstName" json:"firstName"`
	LastName       string             `bson:"lastName" json:"lastName"`
	Email          string             `bson:"email" json:"email"`
	Password       string             `bson:"password" json:"password"`
	RememberToken  string             `bson:"rememberToken,omitempty" json:"rememberToken,omitempty"`
	Phone          string             `bson:"phone" json:"phone"`
	Birthday       time.Time          `bson:"birthday,omitempty" json:"birthday,omitempty"`
	Gender         string             `bson:"gender,omitempty" json:"gender,omitempty"`
	Nationality    string             `bson:"nationality,omitempty" json:"nationality,omitempty"`
	Bio            string             `bson:"bio,omitempty" json:"bio,omitempty"`
	ProfilePicture string             `bson:"profilePicture,omitempty" json:"profilePicture,omitempty"`
	Address        Address            `bson:"address,omitempty" json:"address,omitempty"`

	MusicalInfoID primitive.ObjectID `bson:"musicalInfoID,omitempty" json:"musicalInfoID,omitempty"` // Reference to MusicalInformation
	CoursePrefs   CoursePreferences  `bson:"coursePreferences" json:"coursePreferences"`             // Using embedded approach for now, will be change when Instructor model is implemented

	CreatedAt time.Time  `bson:"createdAt" json:"createdAt"`
	UpdatedAt time.Time  `bson:"updatedAt" json:"updatedAt"`
	DeletedAt *time.Time `bson:"deletedAt,omitempty" json:"deletedAt,omitempty"`
}

func (*User) SoftDelete

func (u *User) SoftDelete()

SoftDelete sets the DeletedAt field to the current time to mark an entry as deleted.

Jump to

Keyboard shortcuts

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