-
Notifications
You must be signed in to change notification settings - Fork 0
/
collections.go
164 lines (133 loc) · 6.59 KB
/
collections.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
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
package hrms
import (
"strings"
"go.mongodb.org/mongo-driver/mongo"
)
const ORG_COLLECTION_ORGANIZATION = "organization"
const ORG_COLLECTION_DEPARTMENTS = "org-departments"
const ORG_COLLECTION_DOCUMENTS = "org-documents"
const ORG_COLLECTION_EMPLOYEE_TYPE = "org-employee-types"
const ORG_COLLECTION_PERMISSIONS = "org-permissions"
const ORG_COLLECTION_AUTH = "auth"
const ORG_COLLECTION_ATTENDANCE_CONF = "org-attendance-conf"
const ORG_COLLECTION_HOLIDAYS = "org-holidays"
const ORG_COLLECTION_LEAVES_CONF = "org-leaves-conf"
const ORG_COLLECTION_MARQUE = "org-marque"
const ORG_COLLECTION_POST = "org-post"
const ORG_COLLECTION_ROLES = "org-roles"
const DEPARTMENT_COLLECTION_DESIGNATIONS = "department-designations"
const DEPARTMENT_COLLECTION_ATTENDANCE_CONF = "department-attendance-conf"
const EMPLOYEE_COLLECTION_PERSONAL = "employee-personal"
const EMPLOYEE_COLLECTION_PROFESSIONAL = "employee-professional"
const EMPLOYEE_COLLECTION_DOCUMENTS = "employee-documents"
const EMPLOYEE_COLLECTION_SUMMARY = "employee-summary"
const EMPLOYEE_COLLECTION_ATTENDANCE_CONF = "employee-attendance-conf"
const EMPLOYEE_COLLECTION_ATTENDANCE = "employee-attendance"
const EMPLOYEE_COLLECTION_DAILY_ATN_OBJECT = "employee-daily-atn-object"
const EMPLOYEE_COLLECTION_LEAVES = "employee-leaves"
const EMPLOYEE_COLLECTION_LEAVE_STATUS = "employee-leave-status"
const EMPLOYEE_COLLECTION_QUALIFICATION = "employee-qualification"
func GetOrgCollection(client *mongo.Client, domain string) *mongo.Collection {
db := client.Database(strings.Replace(domain, ".", "_", -1))
return db.Collection(ORG_COLLECTION_ORGANIZATION)
}
func GetDailyAttendanceObjectCollection(client *mongo.Client, domain string) *mongo.Collection {
db := client.Database(strings.Replace(domain, ".", "_", -1))
return db.Collection(EMPLOYEE_COLLECTION_DAILY_ATN_OBJECT)
}
func GetOrgAuthCollection(client *mongo.Client, domain string) *mongo.Collection {
db := client.Database(strings.Replace(domain, ".", "_", -1))
return db.Collection(ORG_COLLECTION_AUTH)
}
func GetOrgLeaveConfCollection(client *mongo.Client, domain string) *mongo.Collection {
db := client.Database(strings.Replace(domain, ".", "_", -1))
return db.Collection(ORG_COLLECTION_LEAVES_CONF)
}
func GetOrgDepartmentCollection(client *mongo.Client, domain string) *mongo.Collection {
db := client.Database(strings.Replace(domain, ".", "_", -1))
return db.Collection(ORG_COLLECTION_DEPARTMENTS)
}
func GetOrgDocumentCollection(client *mongo.Client, domain string) *mongo.Collection {
db := client.Database(strings.Replace(domain, ".", "_", -1))
return db.Collection(ORG_COLLECTION_DOCUMENTS)
}
func GetOrgHolidayCollection(client *mongo.Client, domain string) *mongo.Collection {
db := client.Database(strings.Replace(domain, ".", "_", -1))
return db.Collection(ORG_COLLECTION_HOLIDAYS)
}
func GetOrgRolesCollection(client *mongo.Client, domain string) *mongo.Collection {
db := client.Database(strings.Replace(domain, ".", "_", -1))
return db.Collection(ORG_COLLECTION_ROLES)
}
func GetOrgPermissionsCollection(client *mongo.Client, domain string) *mongo.Collection {
db := client.Database(strings.Replace(domain, ".", "_", -1))
return db.Collection(ORG_COLLECTION_PERMISSIONS)
}
func GetOrgEmployeeTypeCollection(client *mongo.Client, domain string) *mongo.Collection {
db := client.Database(strings.Replace(domain, ".", "_", -1))
return db.Collection(ORG_COLLECTION_EMPLOYEE_TYPE)
}
func GetOrgAttendanceConfCollection(client *mongo.Client, domain string) *mongo.Collection {
db := client.Database(strings.Replace(domain, ".", "_", -1))
return db.Collection(ORG_COLLECTION_ATTENDANCE_CONF)
}
func GetEmpPersonalCollection(client *mongo.Client, domain string) *mongo.Collection {
db := client.Database(strings.Replace(domain, ".", "_", -1))
return db.Collection(EMPLOYEE_COLLECTION_PERSONAL)
}
func GetEmpProfessionalCollection(client *mongo.Client, domain string) *mongo.Collection {
db := client.Database(strings.Replace(domain, ".", "_", -1))
return db.Collection(EMPLOYEE_COLLECTION_PROFESSIONAL)
}
func GetEmpDocumentCollection(client *mongo.Client, domain string) *mongo.Collection {
db := client.Database(strings.Replace(domain, ".", "_", -1))
return db.Collection(EMPLOYEE_COLLECTION_DOCUMENTS)
}
func GetEmpSummaryCollection(client *mongo.Client, domain string) *mongo.Collection {
db := client.Database(strings.Replace(domain, ".", "_", -1))
return db.Collection(EMPLOYEE_COLLECTION_SUMMARY)
}
func GetEmpAttendanceConfCollection(client *mongo.Client, domain string) *mongo.Collection {
db := client.Database(strings.Replace(domain, ".", "_", -1))
return db.Collection(EMPLOYEE_COLLECTION_ATTENDANCE_CONF)
}
func GetEmpAttendanceCollection(client *mongo.Client, domain string) *mongo.Collection {
db := client.Database(strings.Replace(domain, ".", "_", -1))
return db.Collection(EMPLOYEE_COLLECTION_ATTENDANCE)
}
func GetEmpLeavesCollection(client *mongo.Client, domain string) *mongo.Collection {
db := client.Database(strings.Replace(domain, ".", "_", -1))
return db.Collection(EMPLOYEE_COLLECTION_LEAVES)
}
func GetDocumentCollection(client *mongo.Client, domain string) *mongo.Collection {
db := client.Database(strings.Replace(domain, ".", "_", -1))
return db.Collection(EMPLOYEE_COLLECTION_DOCUMENTS)
}
func GetDepDesignationCollection(client *mongo.Client, domain string) *mongo.Collection {
db := client.Database(strings.Replace(domain, ".", "_", -1))
return db.Collection(DEPARTMENT_COLLECTION_DESIGNATIONS)
}
func GetDepAttendanceConfCollection(client *mongo.Client, domain string) *mongo.Collection {
db := client.Database(strings.Replace(domain, ".", "_", -1))
return db.Collection(DEPARTMENT_COLLECTION_ATTENDANCE_CONF)
}
func GetOrgHolidaysCollection(client *mongo.Client, domain string) *mongo.Collection {
db := client.Database(strings.Replace(domain, ".", "_", -1))
return db.Collection(ORG_COLLECTION_HOLIDAYS)
}
func GetEmpLeaveStatusCollection(client *mongo.Client, domain string) *mongo.Collection {
db := client.Database(strings.Replace(domain, ".", "_", -1))
return db.Collection(EMPLOYEE_COLLECTION_LEAVE_STATUS)
}
func GetOrgMarqueCollection(client *mongo.Client, domain string) *mongo.Collection {
db := client.Database(strings.Replace(domain, ".", "_", -1))
return db.Collection(ORG_COLLECTION_MARQUE)
}
func GetOrgPostCollection(client *mongo.Client, domain string) *mongo.Collection {
db := client.Database(strings.Replace(domain, ".", "_", -1))
return db.Collection(ORG_COLLECTION_POST)
}
func GetEmpQualificationCollection(client *mongo.Client, domain string) *mongo.Collection {
db := client.Database(strings.Replace(domain, ".", "_", -1))
return db.Collection(EMPLOYEE_COLLECTION_QUALIFICATION)
}