Skip to content

Commit

Permalink
fix ID in different structs
Browse files Browse the repository at this point in the history
  • Loading branch information
shalearkane committed Jan 22, 2024
1 parent d7d6997 commit 5c3aaaf
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion company/misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
)

type OID struct {
ID primitive.ObjectID `json:"id"`
ID primitive.ObjectID `json:"_id"`
}

type AlternateHR struct {
Expand Down
16 changes: 5 additions & 11 deletions opportunity/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}
2 changes: 1 addition & 1 deletion opportunity/criteria.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
2 changes: 1 addition & 1 deletion opportunity/opportunity.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
5 changes: 5 additions & 0 deletions opportunity/slot.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand All @@ -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"`
}

0 comments on commit 5c3aaaf

Please sign in to comment.