From 4cee5942400c74eb3adc4d07374e5f15fc571943 Mon Sep 17 00:00:00 2001 From: Soumik Dutta Date: Thu, 11 Apr 2024 18:26:28 +0530 Subject: [PATCH] add personalEmail, Mobile and Gender as required fields for registration --- handler/student.go | 3 +++ interfaces/student.go | 13 ++++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/handler/student.go b/handler/student.go index 9b333c7..9f93ccb 100644 --- a/handler/student.go +++ b/handler/student.go @@ -81,6 +81,9 @@ func (h *Handler) HandlerRegisterStudentDetails(ctx *gin.Context) { FirstName: newStudentDetails.FirstName, MiddleName: newStudentDetails.MiddleName, LastName: newStudentDetails.LastName, + PersonalEmail: newStudentDetails.PersonalEmail, + Mobile: newStudentDetails.Mobile, + Gender: newStudentDetails.Gender, } if result, err := db.InsertOne(h.MongikClient, constants.DB, constants.COLLECTION_STUDENT, newStudent); err != nil { diff --git a/interfaces/student.go b/interfaces/student.go index 86e1faa..f674e01 100644 --- a/interfaces/student.go +++ b/interfaces/student.go @@ -1,10 +1,15 @@ package interfaces import ( + Constant "github.com/FrosTiK-SD/models/constant" Student "github.com/FrosTiK-SD/models/student" ) type StudentRegistration struct { + FirstName string `json:"firstName" bson:"firstName"` + MiddleName *string `json:"middleName" bson:"middleName"` + LastName *string `json:"lastName" bson:"lastName"` + Batch Student.Batch `json:"batch" bson:"batch"` RollNo int `json:"rollNo" bson:"rollNo"` InstituteEmail string `json:"email" bson:"email"` @@ -12,7 +17,9 @@ type StudentRegistration struct { Course string `json:"course" bson:"course"` Specialisation *string `json:"specialisation" bson:"specialisation"` - FirstName string `json:"firstName" bson:"firstName"` - MiddleName *string `json:"middleName" bson:"middleName"` - LastName *string `json:"lastName" bson:"lastName"` + Mobile *string `json:"mobile" bson:"mobile"` + PersonalEmail string `json:"personalEmail" bson:"personalEmail"` + Gender *Constant.Gender `json:"gender" bson:"gender"` + + RawKeyStore map[string]interface{} `json:"raw_key_store" bson:"raw_key_store"` }