diff --git a/company/misc.go b/company/misc.go index a457d06..e867988 100644 --- a/company/misc.go +++ b/company/misc.go @@ -6,7 +6,7 @@ import ( ) type OID struct { - ID primitive.ObjectID `json:"id"` + ID primitive.ObjectID `json:"_id"` } type AlternateHR struct { diff --git a/opportunity/application.go b/opportunity/application.go index 2db2957..61a2e3c 100644 --- a/opportunity/application.go +++ b/opportunity/application.go @@ -5,15 +5,9 @@ import ( ) type Application struct { - ID primitive.ObjectID `json:"id,omitempty"` - Opportunity primitive.ObjectID `json:"opportunity,omitempty"` - Student primitive.ObjectID `json:"student,omitempty"` - Resume primitive.ObjectID `json:"resume,omitempty"` - DetailsRequested []DetailsRequested `json:"details_requested,omitempty"` -} - -type DetailsRequested struct { - Key string `json:"key,omitempty"` - Type string `json:"type,omitempty"` - Value string `json:"value,omitempty"` + ID primitive.ObjectID `bson:"_id" json:"_id,omitempty"` + Opportunity primitive.ObjectID `bson:"opportunity" json:"opportunity,omitempty"` + Student primitive.ObjectID `bson:"student" json:"student,omitempty"` + Resume primitive.ObjectID `bson:"resume" json:"resume,omitempty"` + DetailsRequestedSchema map[string]interface{} `bson:"detailsRequestedSchema" json:"detailsRequestedSchema"` } diff --git a/opportunity/criteria.go b/opportunity/criteria.go index 405e3b7..d89f706 100644 --- a/opportunity/criteria.go +++ b/opportunity/criteria.go @@ -6,7 +6,7 @@ import ( ) type Criteria struct { - ID primitive.ObjectID `bson:"id" json:"id,omitempty"` + ID primitive.ObjectID `bson:"_id" json:"_id,omitempty"` Xth float32 `bson:"xth" json:"xth,omitempty"` XIIth float32 `bson:"xiith" json:"xiith,omitempty"` CGPA float32 `bson:"cgpa" json:"cgpa,omitempty"` diff --git a/opportunity/opportunity.go b/opportunity/opportunity.go index 18768f1..1b7fe3d 100644 --- a/opportunity/opportunity.go +++ b/opportunity/opportunity.go @@ -13,7 +13,7 @@ const ( ) type Opportunity struct { - ID primitive.ObjectID `bson:"id" json:"id,omitempty"` + ID primitive.ObjectID `bson:"_id" json:"_id,omitempty"` Company primitive.ObjectID `bson:"company" json:"company,omitempty"` Profiles []primitive.ObjectID `bson:"profile" json:"profile,omitempty"` DetailsRequestedSchema map[string]interface{} `bson:"detailsRequestedSchema" json:"detailsRequestedSchema"` diff --git a/opportunity/slot.go b/opportunity/slot.go index 71be3c6..7d0a94b 100644 --- a/opportunity/slot.go +++ b/opportunity/slot.go @@ -3,6 +3,7 @@ package opportunity import "go.mongodb.org/mongo-driver/bson/primitive" type Slot struct { + ID primitive.ObjectID `bson:"_id" json:"_id,omitempty"` Day primitive.DateTime `bson:"day" json:"day,omitempty"` StartDate primitive.DateTime `bson:"start_date" json:"start_date,omitempty"` EndDate primitive.DateTime `bson:"end_date" json:"end_date,omitempty"` @@ -11,4 +12,8 @@ type Slot struct { MaxInterviews int `bson:"max_interviews" json:"max_interviews,omitempty"` PreferenceStartTime primitive.DateTime `bson:"preference_start_time" json:"preference_start_time,omitempty"` PreferenceEndTime primitive.DateTime `bson:"preference_end_time" json:"preference_end_time,omitempty"` + + // metadata + CreatedAt primitive.DateTime `bson:"createdAt" json:"createdAt,omitempty"` + UpdatedAt primitive.DateTime `bson:"updatedAt" json:"updatedAt,omitempty"` }