Skip to content

Commit

Permalink
add exam models
Browse files Browse the repository at this point in the history
  • Loading branch information
shalearkane committed Jan 29, 2024
1 parent deaf5b3 commit 96240bd
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 4 deletions.
25 changes: 25 additions & 0 deletions exam/attendance.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package exam

import (
"go.mongodb.org/mongo-driver/bson/primitive"
)

type Coordinates struct {
Row int32 `json:"row" bson:"row"`
Column int32 `json:"column" bson:"column"`
}

type MarkData struct {
User primitive.ObjectID `json:"user" bson:"user"`
Time string `json:"time" bson:"time"`
}

type Attendance struct {
Id primitive.ObjectID `json:"_id" bson:"_id"`
ExaminationId primitive.ObjectID `json:"examinationId" bson:"examinationId"`
User primitive.ObjectID `json:"user" bson:"user"`
Venue primitive.ObjectID `json:"venue" bson:"venue"`
RawPosition Coordinates `json:"rawPosition" bson:"rawPosition"`
IsPresent bool `json:"isPresent" bson:"isPresent"`
MarkedData []MarkData `json:"markedData" bson:"markedData"`
}
11 changes: 11 additions & 0 deletions exam/common.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package exam

import (
"github.com/FrosTiK-SD/models/misc"
)

type StudentApplication struct {
StudentID misc.DBRef
ResumeID misc.DBRef
AppliedFor misc.DBRef
}
24 changes: 24 additions & 0 deletions exam/examination.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package exam

import (
"time"

"go.mongodb.org/mongo-driver/bson/primitive"
)

type Examination struct {
Id primitive.ObjectID `json:"_id" bson:"_id"`
Title string `json:"title" bson:"title"`
Description string `json:"description" bson:"description"`
LinkedIaf []primitive.ObjectID `json:"linkedIaf" bson:"linkedIaf"`
LinkedJaf []primitive.ObjectID `json:"linkedJaf" bson:"linkedJaf"`
Venues []primitive.ObjectID `json:"venues" bson:"venues"`
Attendance []primitive.ObjectID `json:"attendance" bson:"attendance"`
StartDate string `json:"startDate" bson:"startDate"`
EndDate string `json:"endDate" bson:"endDate"`
StartBuffer time.Duration `json:"startBuffer" bson:"startBuffer"`
EndBuffer time.Duration `json:"endBuffer" bson:"endBuffer"`
CreatedBy primitive.ObjectID `json:"createdBy" bson:"createdBy"`
WillingList []primitive.ObjectID `json:"willingList" bson:"willingList"`
IsActive bool `json:"isActive" bson:"isActive"`
}
11 changes: 11 additions & 0 deletions exam/venue.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package exam

import "go.mongodb.org/mongo-driver/bson/primitive"

type Venue struct {
Id primitive.ObjectID `json:"_id" bson:"_id"`
Title string `json:"title" bson:"title"`
Arrangement string `json:"arrangement" bson:"arrangement"`
Map [][]int32 `json:"map" bson:"map"`
Capacity int32 `json:"capacity" bson:"capacity"`
}
8 changes: 4 additions & 4 deletions student/student.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ type SocialProfile struct {
}

type SocialProfiles struct {
LinkedIn SocialProfile `json:"linkedIn,omitempty" bson:"linkedIn,omitempty"`
LinkedIn SocialProfile `json:"linkedIn" bson:"linkedIn"`
Github SocialProfile `json:"github,omitempty" bson:"github,omitempty"`
MicrosoftTeams SocialProfile `json:"microsoftTeams,omitempty" bson:"microsoftTeams,omitempty"`
Skype SocialProfile `json:"skype,omitempty" bson:"skype,omitempty"`
Expand All @@ -91,9 +91,9 @@ type Batch struct {

type ParentsDetails struct {
FatherName string `json:"fatherName" bson:"fatherName"`
FatherOccupation string `json:"fatherOccupation" bson:"fatherOccupation"`
FatherOccupation string `json:"fatherOccupation,omitempty" bson:"fatherOccupation,omitempty"`
MotherName string `json:"motherName" bson:"motherName"`
MotherOccupation string `json:"motherOccupation" bson:"motherOccupation"`
MotherOccupation string `json:"motherOccupation,omitempty" bson:"motherOccupation,omitempty"`
}

type Extras struct {
Expand All @@ -112,7 +112,7 @@ type WorkExperience struct {
}

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

Expand Down

0 comments on commit 96240bd

Please sign in to comment.