Skip to content

Commit

Permalink
add a new version field and a proto student model for initial login
Browse files Browse the repository at this point in the history
  • Loading branch information
shalearkane committed Jan 28, 2024
1 parent f61d451 commit 169b78f
Showing 1 changed file with 26 additions and 8 deletions.
34 changes: 26 additions & 8 deletions student/student.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ type EducationDetails struct {

type Academics struct {
JEERank RankDetails `json:"jeeRank" bson:"jeeRank"`
GATERank RankDetails `json:"gateRank" bson:"gateRank"`
GATERank RankDetails `json:"gateRank,omitempty" bson:"gateRank,omitempty"`
XthClass EducationDetails `json:"xClass" bson:"xClass"`
XIIthClass EducationDetails `json:"xiiClass" bson:"xiiClass"`
UnderGraduate EducationDetails `json:"underGraduate,omitempty" bson:"underGraduate,omitempty"`
Expand Down Expand Up @@ -85,8 +85,8 @@ type SocialProfiles struct {
}

type Batch struct {
StartYear int `json:"startYear,omitempty" bson:"startYear"`
EndYear int `json:"endYear,omitempty" bson:"endYear"`
StartYear int `json:"startYear" bson:"startYear"`
EndYear int `json:"endYear" bson:"endYear"`
}

type ParentsDetails struct {
Expand Down Expand Up @@ -121,13 +121,13 @@ type Student struct {
InstituteEmail string `json:"instituteEmail" bson:"instituteEmail"`
Department string `json:"department" bson:"department"`
Course constant.Course `json:"course" bson:"course"`
Specialisation string `json:"specialisation" bson:"specialisation"`
Specialisation string `json:"specialisation,omitempty" bson:"specialisation,omitempty"`

FirstName string `json:"firstName" bson:"firstName"`
MiddleName string `json:"middleName" bson:"middleName"`
LastName string `json:"lastName" bson:"lastName"`

ProfilePicture misc.Attachment `json:"profilePicture" bson:"profilePicture"`
ProfilePicture misc.Attachment `json:"profilePicture,omitempty" bson:"profilePicture,omitempty"`
Gender constant.Gender `json:"gender" bson:"gender"`
DOB primitive.DateTime `json:"dob" bson:"dob"`
PermanentAddress string `json:"permanentAddress" bson:"permanentAddress"`
Expand All @@ -143,9 +143,27 @@ type Student struct {
SocialProfiles SocialProfiles `json:"socialProfiles" bson:"socialProfiles"`

// metadata
UpdatedAt primitive.DateTime `json:"updatedAt" bson:"updatedAt"`
CreatedAt primitive.DateTime `json:"createdAt" bson:"createdAt"`
RawKeyStore map[string]interface{} `json:"raw_key_store" bson:"raw_key_store"`
StructVersion int `json:"version,omitempty" bson:"version,omitempty"`
UpdatedAt primitive.DateTime `json:"updatedAt" bson:"updatedAt"`
CreatedAt primitive.DateTime `json:"createdAt" bson:"createdAt"`
RawKeyStore map[string]interface{} `json:"raw_key_store" bson:"raw_key_store"`
}

type StudentProto struct {
ID primitive.ObjectID `json:"_id" bson:"_id"`
Groups []primitive.ObjectID `json:"groups" bson:"groups"`
CompaniesAlloted []string `json:"companiesAlloted" bson:"companiesAlloted"`

Batch Batch `json:"batch" bson:"batch"`
RollNo int `json:"rollNo" bson:"rollNo"`
InstituteEmail string `json:"instituteEmail" bson:"instituteEmail"`
Department string `json:"department" bson:"department"`
Course constant.Course `json:"course" bson:"course"`

// metadata
StructVersion int `json:"version,omitempty" bson:"version,omitempty"`
UpdatedAt primitive.DateTime `json:"updatedAt" bson:"updatedAt"`
CreatedAt primitive.DateTime `json:"createdAt" bson:"createdAt"`
}

// at some point I expect to use * pointers to omit fields which are not necessary
Expand Down

0 comments on commit 169b78f

Please sign in to comment.