forked from codejam-io/codejam
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathstructs.go
More file actions
139 lines (125 loc) · 5.22 KB
/
structs.go
File metadata and controls
139 lines (125 loc) · 5.22 KB
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
package database
import (
"github.com/jackc/pgx/v5/pgtype"
)
type DBTeam struct {
Id pgtype.UUID `db:"id"`
EventId pgtype.UUID `db:"event_id"`
Name string `db:"name"`
Visibility string `db:"visibility"`
Timezone string `db:"timezone"`
Technologies string `db:"technologies"`
Availability string `db:"availability"`
Description string `db:"description"`
CreatedOn pgtype.Timestamptz `db:"created_on"`
InviteCode string `db:"invite_code"`
}
type CreateTeamMember struct {
UserId pgtype.UUID `db:"user_id"`
TeamId pgtype.UUID `db:"team_id"`
TeamRole string `db:"team_role"`
}
// has all the user info & role to pass to be read client-side
type DBTeamMemberInfo struct {
DBUser // embed the DBUser fields into the struct
TeamRole string `db:"team_role"`
}
type DBTeamMember struct {
TeamId pgtype.UUID `db:"team_id"`
UserId pgtype.UUID `db:"user_id"`
TeamRole string `db:"team_role"`
CreatedOn pgtype.Timestamp `db:"user_created_on"`
}
type DBUserTeams struct {
DBTeam
DisplayName string `db:"display_name"`
TeamRole string `db:"team_role"`
AvatarId string `db:"avatar_id"`
}
type DBTeamAndTeamMember struct {
Id pgtype.UUID `db:"id"`
EventId pgtype.UUID `db:"event_id"`
Name string `db:"name"`
Visibility string `db:"visibility"`
Timezone string `db:"timezone"`
Technologies string `db:"technologies"`
Availability string `db:"availability"`
Description string `db:"description"`
CreatedOn pgtype.Timestamptz `db:"team_created_on"`
InviteCode string `db:"invite_code"`
MembershipCreatedOn pgtype.Timestamptz `db:"membership_created_on"`
TeamId pgtype.UUID `db:"team_id"`
UserId pgtype.UUID `db:"user_id"`
TeamRole string `db:"team_role"`
DisplayName string `db:"display_name"`
AvatarId string `db:"avatar_id"`
ServiceUserId string `db:"service_user_id"`
}
type UITeam struct {
Id pgtype.UUID `db:"id"`
EventId pgtype.UUID `db:"event_id"`
Name string `db:"name"`
Visibility string `db:"visibility"`
Timezone string `db:"timezone"`
Technologies string `db:"technologies"`
Availability string `db:"availability"`
Description string `db:"description"`
CreatedOn pgtype.Timestamptz `db:"team_created_on"`
InviteCode string `db:"invite_code"`
}
type UITeamMember struct {
TeamId pgtype.UUID `db:"team_id"`
UserId pgtype.UUID `db:"user_id"`
MembershipCreatedOn pgtype.Timestamptz `db:"membership_created_on"`
TeamRole string `db:"team_role"`
}
type TeamMember struct {
UITeamMember
DisplayName string `db:"display_name"`
AvatarId string `db:"avatar_id"`
ServiceUserId string `db:"service_user_id"`
}
type TeamAndMembers struct {
UITeam
TeamMembers []TeamMember
}
type UserTeamMember struct {
UserId pgtype.UUID `json:"UserId"`
DisplayName string `json:"DisplayName"`
TeamRole string `json:"TeamRole"`
AvatarId string `json:"AvatarId"`
ServiceUserId string `json:"ServiceUserId"`
UserCreatedOn pgtype.Timestamptz `json:"UserCreatedOn"`
}
type UserTeam struct {
Id pgtype.UUID `json:"Id"`
EventId pgtype.UUID `json:"EventId"`
Name string `json:"Name"`
Description string `json:"Description"`
Visibility string `json:"Visibility"`
Technologies string `json:"Technologies"`
Availability string `json:"Availability"`
TeamCreatedOn pgtype.Timestamptz `json:"TeamCreatedOn"`
InviteCode string `json:"InviteCode"`
TeamMembers []UserTeamMember `json:"TeamMembers"`
}
type UserTeamAndMembers struct {
Id pgtype.UUID `db:"id"`
EventId pgtype.UUID `db:"event_id"`
Name string `db:"name"`
Visibility string `db:"visibility"`
Timezone string `db:"timezone"`
Technologies string `db:"technologies"`
Availability string `db:"availability"`
Description string `db:"description"`
TeamCreatedOn pgtype.Timestamptz `db:"team_created_on"`
InviteCode string `db:"invite_code"`
TeamId pgtype.UUID `db:"team_id"`
UserId pgtype.UUID `db:"user_id"`
TeamRole string `db:"team_role"`
MembershipCreatedOn pgtype.Timestamptz `db:"membership_created_on"`
DisplayName string `db:"display_name"`
AvatarId string `db:"avatar_id"`
ServiceUserId string `db:"service_user_id"`
CurrentUserRole string `db:"current_user_role"`
}