-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclub.go
104 lines (93 loc) · 5.4 KB
/
club.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
package models
import "go.mongodb.org/mongo-driver/bson/primitive"
// Object represents groups that users can join to organize around the sports they like
type Club struct {
ID primitive.ObjectID `json:"id,omitempty" bson:"_id,omitempty"`
Parent *OrganizationDao `json:"parent,omitempty" bson:"parent,omitempty"`
Name string `json:"name,omitempty" bson:"name,omitempty"`
Description string `json:"description,omitempty" bson:"description,omitempty"`
Sports []string `json:"sports,omitempty" bson:"sports,omitempty"`
City string `json:"city,omitempty" bson:"city,omitempty"`
State string `json:"state,omitempty" bson:"state,omitempty"`
Country string `json:"country,omitempty" bson:"country,omitempty"`
Logo string `json:"logo,omitempty" bson:"logo,omitempty"`
Banner string `json:"banner,omitempty" bson:"banner,omitempty"`
Visibility string `json:"visibility,omitempty" bson:"visibility,omitempty"`
Members []Member `json:"members,omitempty" bson:"members,omitempty"`
PinnedPosts []primitive.ObjectID `json:"pinned_posts,omitempty" bson:"pinned_posts,omitempty"`
BlackList []string `json:"black_list,omitempty" bson:"black_list,omitempty"`
Rules []string `json:"rules,omitempty" bson:"rules,omitempty"`
IsVerified bool `json:"is_verified,omitempty" bson:"is_verified,omitempty"`
CreatedAt int64 `json:"created_at,omitempty" bson:"created_at,omitempty"`
}
// Data access object for the Clubs
type ClubDao struct {
ID *primitive.ObjectID `json:"id,omitempty" bson:"_id,omitempty"`
ParentID *primitive.ObjectID `json:"parent_id,omitempty" bson:"parent_id,omitempty"`
Name *string `json:"name,omitempty" bson:"name,omitempty"`
Description *string `json:"description,omitempty" bson:"description,omitempty"`
Sports *[]string `json:"sports,omitempty" bson:"sports,omitempty"`
City *string `json:"city,omitempty" bson:"city,omitempty"`
State *string `json:"state,omitempty" bson:"state,omitempty"`
Country *string `json:"country,omitempty" bson:"country,omitempty"`
Logo *string `json:"logo,omitempty" bson:"logo,omitempty"`
Banner *string `json:"banner,omitempty" bson:"banner,omitempty"`
Visibility *string `json:"visibility,omitempty" bson:"visibility,omitempty"`
Members *[]MemberDao `json:"members,omitempty" bson:"members,omitempty"`
PinnedPosts *[]primitive.ObjectID `json:"pinned_posts,omitempty" bson:"pinned_posts,omitempty"`
BlackList *[]string `json:"black_list,omitempty" bson:"black_list,omitempty"`
Rules *[]string `json:"rules,omitempty" bson:"rules,omitempty"`
IsVerified *bool `json:"is_verified,omitempty" bson:"is_verified,omitempty"`
CreatedAt *int64 `json:"created_at,omitempty" bson:"created_at,omitempty"`
}
// Wrapper around the response for club objects
type ClubsResponse struct {
TotalClubs int `json:"total_clubs"`
Clubs []Club `json:"clubs"`
}
// Object to handle club invitations
type ClubInvite struct {
ID primitive.ObjectID `json:"id"`
Club *Club `json:"club,omitempty"`
Sender *UserData `json:"sender,omitempty"`
Status string `json:"status"`
CreatedAt int64 `json:"created_at"`
}
// Data access object for club invites
type ClubInviteDao struct {
ID *primitive.ObjectID `json:"id,omitempty" bson:"_id,omitempty"`
Recipient *string `json:"recipient,omitempty" bson:"recipient,omitempty"`
Sender *string `json:"sender,omitempty" bson:"sender,omitempty"`
ClubID *string `json:"club_id,omitempty" bson:"club_id,omitempty"`
Status *string `json:"status,omitempty" bson:"status,omitempty"`
CreatedAt *int64 `json:"created_at,omitempty" bson:"created_at,omitempty"`
}
// Wrapper around the response for the club invite objects
type ClubInvitesResponse struct {
TotalInvites int `json:"total_invites"`
Invites []ClubInvite `json:"invites"`
}
// Object to handle club applications
type ClubApplication struct {
ID primitive.ObjectID `json:"id" bson:"_id"`
Applicant *UserData `json:"applicant,omitempty"`
Status string `json:"status"`
CreatedAt int64 `json:"created_at" bson:"created_at"`
}
// Data access object for club applications
type ClubApplicationDao struct {
ID *primitive.ObjectID `json:"id,omitempty" bson:"_id,omitempty"`
Applicant *string `json:"applicant,omitempty" bson:"applicant,omitempty"`
ClubID *primitive.ObjectID `json:"club_id,omitempty" bson:"club_id,omitempty"`
Status *string `json:"status,omitempty" bson:"status,omitempty"`
CreatedAt *int64 `json:"created_at,omitempty" bson:"created_at,omitempty"`
}
// Wrapper around the response for club applications
type ClubApplicationsResponse struct {
TotalApplications int `json:"total_applications"`
Applications []ClubApplication `json:"club_applications"`
}
// Object to handle role change requests
type ChangeRoleRequest struct {
Role string `json:"role"`
}