npm_microservice 1.0.38 → 1.0.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config.js +26 -5
- package/dist/service.js +251 -8
- package/dist/services/BaseService.js +26 -5
- package/dist/services/SettingService.js +26 -5
- package/dist/services/app/AppTestService.js +26 -5
- package/dist/services/app/BannerService.js +26 -5
- package/dist/services/app/CategoryService.js +26 -5
- package/dist/services/app/NewService.js +26 -5
- package/dist/services/app/RecommendedCourseService.js +26 -5
- package/dist/services/app/SettingAppService.js +26 -5
- package/dist/services/app/TargetService.js +26 -5
- package/dist/services/authorization/RoleService.js +480 -0
- package/dist/services/call_center/CategoryService.js +26 -5
- package/dist/services/call_center/TicketActivityService.js +26 -5
- package/dist/services/call_center/TicketService.js +26 -5
- package/dist/services/call_center/TicketTemplateService.js +26 -5
- package/dist/services/call_center/TicketTopicService.js +26 -5
- package/dist/services/course/CategoryService.js +26 -5
- package/dist/services/course/CourseLessonService.js +26 -5
- package/dist/services/course/StudentService.js +26 -5
- package/dist/services/crm/ContactsService.js +26 -5
- package/dist/services/crm/DeviceService.js +26 -5
- package/dist/services/crm/OpportunitiesService.js +26 -5
- package/dist/services/finance/InvoicesCancelService.js +26 -5
- package/dist/services/finance/InvoicesDetailService.js +26 -5
- package/dist/services/finance/InvoicesLogsAssignService.js +26 -5
- package/dist/services/finance/InvoicesService.js +26 -5
- package/dist/services/finance/PaymentRequestService.js +26 -5
- package/dist/services/finance/PaymentService.js +26 -5
- package/dist/services/finance/VouchersCategoryService.js +26 -5
- package/dist/services/finance/VouchersService.js +26 -5
- package/dist/services/finance/WalletTransactionService.js +26 -5
- package/dist/services/finance/WalletsService.js +26 -5
- package/dist/services/hr/AllowanceService.js +26 -5
- package/dist/services/hr/AnnualLeaveService.js +26 -5
- package/dist/services/hr/CategoryService.js +27 -6
- package/dist/services/hr/ConfigurationsService.js +461 -0
- package/dist/services/hr/DepartmentService.js +27 -6
- package/dist/services/hr/DeviceService.js +27 -6
- package/dist/services/hr/DocumentExtendService.js +461 -0
- package/dist/services/hr/DocumentService.js +26 -5
- package/dist/services/hr/EmployeeAttrTypeService.js +461 -0
- package/dist/services/hr/EmployeeContractService.js +461 -0
- package/dist/services/hr/EmployeeExtendService.js +26 -5
- package/dist/services/hr/EmployeeExtendTempService.js +26 -5
- package/dist/services/hr/EmployeeLeaveService.js +26 -5
- package/dist/services/hr/EmployeeQuitService.js +26 -5
- package/dist/services/hr/EmployeeService.js +26 -5
- package/dist/services/hr/EmployeeShiftService.js +26 -5
- package/dist/services/hr/GroupService.js +461 -0
- package/dist/services/hr/HolidayService.js +26 -5
- package/dist/services/hr/JobTitleService.js +26 -5
- package/dist/services/hr/LeaveService.js +461 -0
- package/dist/services/hr/OffsetLeaveService.js +461 -0
- package/dist/services/hr/PositionService.js +26 -5
- package/dist/services/hr/ReasonTypeService.js +26 -5
- package/dist/services/hr/ResignationService.js +26 -5
- package/dist/services/hr/SalaryService.js +26 -5
- package/dist/services/hr/SalaryTypeService.js +461 -0
- package/dist/services/hr/ScheduleAutomationService.js +461 -0
- package/dist/services/hr/ScheduleDateService.js +461 -0
- package/dist/services/hr/ScheduleOnlineService.js +26 -5
- package/dist/services/hr/ScheduleService.js +26 -5
- package/dist/services/hr/SettingCompensationService.js +461 -0
- package/dist/services/hr/SettingDocumentService.js +26 -5
- package/dist/services/hr/SettingProfileService.js +461 -0
- package/dist/services/hr/SettingShiftsService.js +461 -0
- package/dist/services/hr/ShiftService.js +26 -5
- package/dist/services/hr/ShiftsCustomerCareService.js +26 -5
- package/dist/services/hr/TicketExtendService.js +26 -5
- package/dist/services/hr/TicketService.js +26 -5
- package/dist/services/hr/TicketTypeService.js +26 -5
- package/dist/services/hr/TrackingConfirmService.js +26 -5
- package/dist/services/hr/TrackingErrorService.js +26 -5
- package/dist/services/hr/TrackingService.js +461 -0
- package/dist/services/inventory/InventoryService.js +26 -5
- package/dist/services/inventory/LogService.js +26 -5
- package/dist/services/inventory/ProductService.js +26 -5
- package/dist/services/inventory/ProductShipmentService.js +26 -5
- package/dist/services/inventory/StoreService.js +26 -5
- package/dist/services/inventory/SupplierService.js +26 -5
- package/dist/services/inventory/TransactionDetailService.js +26 -5
- package/dist/services/inventory/TransactionService.js +26 -5
- package/dist/services/lms/AlbumCategoryService.js +26 -5
- package/dist/services/lms/AlbumFileService.js +26 -5
- package/dist/services/lms/AlbumService.js +26 -5
- package/dist/services/lms/ClassScheduleService.js +26 -5
- package/dist/services/lms/ClassesService.js +26 -5
- package/dist/services/lms/CourseLessonService.js +26 -5
- package/dist/services/lms/CoursePriceService.js +26 -5
- package/dist/services/lms/CourseProductService.js +26 -5
- package/dist/services/lms/CourseService.js +26 -5
- package/dist/services/lms/DocumentCategoryService.js +26 -5
- package/dist/services/lms/DocumentService.js +26 -5
- package/dist/services/lms/LicenseService.js +26 -5
- package/dist/services/lms/PracticeResultService.js +26 -5
- package/dist/services/lms/PracticeService.js +26 -5
- package/dist/services/lms/StudentAgainService.js +26 -5
- package/dist/services/lms/StudentDocumentService.js +26 -5
- package/dist/services/lms/StudentExamTimeService.js +26 -5
- package/dist/services/lms/StudentReviewService.js +26 -5
- package/dist/services/lms/StudentScoreService.js +26 -5
- package/dist/services/lms/StudentService.js +26 -5
- package/dist/services/lms/StudentSettingReviewService.js +26 -5
- package/dist/services/lms/StudentTrackingService.js +26 -5
- package/dist/services/lms/StudentTrialService.js +26 -5
- package/dist/services/notification/AppService.js +26 -5
- package/dist/services/notification/NotificationService.js +26 -5
- package/dist/services/online/CourseLessonService.js +26 -5
- package/dist/services/online/CourseService.js +26 -5
- package/dist/services/online/StudentService.js +26 -5
- package/dist/services/org/BranchRequestService.js +26 -5
- package/dist/services/org/BranchService.js +26 -5
- package/dist/services/org/BranchToMacsService.js +26 -5
- package/dist/services/org/BrandService.js +26 -5
- package/dist/services/org/CitiesService.js +26 -5
- package/dist/services/org/LegalEntityService.js +26 -5
- package/dist/services/pm/NoteService.js +26 -5
- package/dist/services/pm/TaskService.js +26 -5
- package/dist/services/support/CommentService.js +26 -5
- package/dist/services/test/EduTestService.js +26 -5
- package/package.json +1 -1
|
@@ -0,0 +1,461 @@
|
|
|
1
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
2
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
3
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
4
|
+
};
|
|
5
|
+
|
|
6
|
+
// src/config.js
|
|
7
|
+
var require_config = __commonJS({
|
|
8
|
+
"src/config.js"(exports2, module2) {
|
|
9
|
+
require("dotenv").config({ quiet: true, override: true });
|
|
10
|
+
var Redis = require("ioredis");
|
|
11
|
+
var redis = new Redis({
|
|
12
|
+
host: process.env.REDIS_HOST || "128.199.195.180",
|
|
13
|
+
port: process.env.REDIS_PORT || 6379,
|
|
14
|
+
password: process.env.REDIS_PASSWORD || "WZyB5Z7BRRgvrzuGzRwB"
|
|
15
|
+
});
|
|
16
|
+
var baseUrl = process.env.API_MICROSERVICE_URL;
|
|
17
|
+
var configRouteService = {
|
|
18
|
+
BASE_URL: baseUrl,
|
|
19
|
+
Finance: {
|
|
20
|
+
InvoicesService: `${baseUrl}/finance/invoices`,
|
|
21
|
+
InvoicesCancelService: `${baseUrl}/finance/invoice_detail_cancel`,
|
|
22
|
+
InvoicesDetailService: `${baseUrl}/finance/invoices-detail`,
|
|
23
|
+
InvoicesLogsAssignService: `${baseUrl}/finance/invoices-logs-assign`,
|
|
24
|
+
PaymentService: `${baseUrl}/finance/payments`,
|
|
25
|
+
PaymentRequestService: `${baseUrl}/finance/payments-request`,
|
|
26
|
+
VouchersService: `${baseUrl}/finance/vouchers`,
|
|
27
|
+
VouchersCategoryService: `${baseUrl}/finance/vouchers-category`,
|
|
28
|
+
WalletsService: `${baseUrl}/finance/wallets`,
|
|
29
|
+
WalletTransactionService: `${baseUrl}/finance/wallet-transaction`
|
|
30
|
+
},
|
|
31
|
+
CallCenter: {
|
|
32
|
+
CategoryService: `${baseUrl}/call-center/ticket-categories`,
|
|
33
|
+
TicketService: `${baseUrl}/call-center/ticket`,
|
|
34
|
+
TicketActivityService: `${baseUrl}/call-center/ticket-activities`,
|
|
35
|
+
TicketTemplateService: `${baseUrl}/call-center/ticket-template`,
|
|
36
|
+
TicketTopicService: `${baseUrl}/call-center/ticket-topics`,
|
|
37
|
+
CallService: `${baseUrl}/call-center/calls`
|
|
38
|
+
},
|
|
39
|
+
Inventory: {
|
|
40
|
+
InventoryService: `${baseUrl}/inventory/inventory-products`,
|
|
41
|
+
LogService: `${baseUrl}/inventory/logs`,
|
|
42
|
+
ProductService: `${baseUrl}/inventory/products`,
|
|
43
|
+
ProductShipmentService: `${baseUrl}/inventory/products_shipment`,
|
|
44
|
+
StoreService: `${baseUrl}/inventory/stores`,
|
|
45
|
+
SupplierService: `${baseUrl}/inventory/supplier`,
|
|
46
|
+
TransactionService: `${baseUrl}/inventory/transaction`,
|
|
47
|
+
TransactionDetailService: `${baseUrl}/inventory/transaction_detail`
|
|
48
|
+
},
|
|
49
|
+
App: {
|
|
50
|
+
CategoryService: `${baseUrl}/app/category`,
|
|
51
|
+
NewService: `${baseUrl}/app/news`,
|
|
52
|
+
BannerService: `${baseUrl}/app/banner`,
|
|
53
|
+
AppTestService: `${baseUrl}/app/test`,
|
|
54
|
+
RecommendedCourseService: `${baseUrl}/app/recommended_level`,
|
|
55
|
+
SettingAppService: `${baseUrl}/app/setting`,
|
|
56
|
+
TargetAppService: `${baseUrl}/app/target`
|
|
57
|
+
},
|
|
58
|
+
Course: {
|
|
59
|
+
CategoryService: `${baseUrl}/course/category`,
|
|
60
|
+
CourseService: `${baseUrl}/course/course`,
|
|
61
|
+
CourseLessonService: `${baseUrl}/course/course_schedule`,
|
|
62
|
+
StudentService: `${baseUrl}/course/students`
|
|
63
|
+
},
|
|
64
|
+
Asset: {
|
|
65
|
+
AllocationDetailService: `${baseUrl}/asset/asset-allocation-detail`,
|
|
66
|
+
BroadcastService: `${baseUrl}/asset/broadcast`,
|
|
67
|
+
EntityAssetService: `${baseUrl}/asset/entity-asset`,
|
|
68
|
+
SubAssetService: `${baseUrl}/asset/sub-asset`
|
|
69
|
+
},
|
|
70
|
+
Test: {
|
|
71
|
+
TestService: `${baseUrl}/tests/tests`
|
|
72
|
+
},
|
|
73
|
+
Pm: {
|
|
74
|
+
NoteService: `${baseUrl}/pm/notes`,
|
|
75
|
+
TaskService: `${baseUrl}/pm/tasks`
|
|
76
|
+
},
|
|
77
|
+
Crm: {
|
|
78
|
+
ContactService: `${baseUrl}/crm/contacts`,
|
|
79
|
+
AccountsService: `${baseUrl}/crm/accounts`,
|
|
80
|
+
CalendarContactService: `${baseUrl}/crm/calendar-contact`,
|
|
81
|
+
CalendarsService: `${baseUrl}/crm/calendars`,
|
|
82
|
+
CampaignService: `${baseUrl}/crm/campaigns`,
|
|
83
|
+
CompanyService: `${baseUrl}/crm/company`,
|
|
84
|
+
ContactDocumentService: `${baseUrl}/crm/contact-document`,
|
|
85
|
+
ContactToCampaignService: `${baseUrl}/crm/contacts-campaign`,
|
|
86
|
+
DeviceService: `${baseUrl}/crm/devices`,
|
|
87
|
+
LeadsService: `${baseUrl}/crm/leads`,
|
|
88
|
+
NotificationService: `${baseUrl}/crm/notifications`,
|
|
89
|
+
NotificationContactService: `${baseUrl}/crm/notification-to-contact`,
|
|
90
|
+
OpportunitiesService: `${baseUrl}/crm/opportunities`,
|
|
91
|
+
SegmentsService: `${baseUrl}/crm/segments`
|
|
92
|
+
},
|
|
93
|
+
Notification: {
|
|
94
|
+
AppService: `${baseUrl}/notification/type/app`,
|
|
95
|
+
MailService: `${baseUrl}/notification/type/mail`,
|
|
96
|
+
SmsService: `${baseUrl}/notification/type/sms`,
|
|
97
|
+
ZnsService: `${baseUrl}/notification/type/zns`,
|
|
98
|
+
NotificationContactService: `${baseUrl}/notification/notification_contact`,
|
|
99
|
+
NotificationEmployeeService: `${baseUrl}/notification/notification_employee`,
|
|
100
|
+
NotificationService: `${baseUrl}/notification`,
|
|
101
|
+
TemplateService: `${baseUrl}/notification/template`
|
|
102
|
+
},
|
|
103
|
+
Org: {
|
|
104
|
+
BranchService: `${baseUrl}/org/branch`,
|
|
105
|
+
BranchRequestService: `${baseUrl}/org/branch_request`,
|
|
106
|
+
BranchToMacsService: `${baseUrl}/org/branch_to_mac`,
|
|
107
|
+
BrandService: `${baseUrl}/org/brand`,
|
|
108
|
+
CitiesService: `${baseUrl}/org/city`,
|
|
109
|
+
LegalEntityService: `${baseUrl}/org/legal_entities`
|
|
110
|
+
},
|
|
111
|
+
Lms: {
|
|
112
|
+
AlbumService: `${baseUrl}/lms/album`,
|
|
113
|
+
AlbumCategoryService: `${baseUrl}/lms/cate_album`,
|
|
114
|
+
AlbumFileService: `${baseUrl}/lms/album_file`,
|
|
115
|
+
ClassesService: `${baseUrl}/lms/classes`,
|
|
116
|
+
ClassScheduleService: `${baseUrl}/lms/class-schedules`,
|
|
117
|
+
CourseLessonService: `${baseUrl}/lms/course-lessons`,
|
|
118
|
+
CoursePriceService: `${baseUrl}/lms/course-prices`,
|
|
119
|
+
CourseProductService: `${baseUrl}/lms/course-product`,
|
|
120
|
+
CourseService: `${baseUrl}/lms/courses`,
|
|
121
|
+
DocumentService: `${baseUrl}/lms/documents`,
|
|
122
|
+
DocumentCategoryService: `${baseUrl}/lms/document-categories`,
|
|
123
|
+
LicenseService: `${baseUrl}/lms/license`,
|
|
124
|
+
PracticeResultService: `${baseUrl}/lms/practices-result`,
|
|
125
|
+
PracticeService: `${baseUrl}/lms/practices`,
|
|
126
|
+
StudentAgainService: `${baseUrl}/lms/students-agains`,
|
|
127
|
+
StudentDocumentService: `${baseUrl}/lms/students-documents`,
|
|
128
|
+
StudentExamTimeService: `${baseUrl}/lms/student-exam-time`,
|
|
129
|
+
StudentReviewService: `${baseUrl}/lms/students-reviews`,
|
|
130
|
+
StudentService: `${baseUrl}/lms/students`,
|
|
131
|
+
StudentScoreService: `${baseUrl}/lms/students-scores`,
|
|
132
|
+
StudentSettingReviewService: `${baseUrl}/lms/setting-reviews`,
|
|
133
|
+
StudentTrackingService: `${baseUrl}/lms/students-tracking`,
|
|
134
|
+
StudentTrialService: `${baseUrl}/lms/students-trial`
|
|
135
|
+
},
|
|
136
|
+
Hr: {
|
|
137
|
+
ConfigurationsService: `${baseUrl}/hr/configurations`,
|
|
138
|
+
GroupService: `${baseUrl}/hr/groups`,
|
|
139
|
+
AllowanceService: `${baseUrl}/hr/allowance`,
|
|
140
|
+
LeaveService: `${baseUrl}/hr/leave`,
|
|
141
|
+
AnnualLeaveService: `${baseUrl}/hr/annual_leave`,
|
|
142
|
+
EmployeeLeaveService: `${baseUrl}/hr/employee_leave`,
|
|
143
|
+
EmployeeService: `${baseUrl}/hr/employees`,
|
|
144
|
+
DepartmentService: `${baseUrl}/hr/departments`,
|
|
145
|
+
DeviceService: `${baseUrl}/hr/device`,
|
|
146
|
+
DocumentService: `${baseUrl}/hr/documents`,
|
|
147
|
+
DocumentExtendService: `${baseUrl}/hr/document_extend`,
|
|
148
|
+
EmployeeExtendService: `${baseUrl}/hr/employees/extend`,
|
|
149
|
+
EmployeeExtendTempService: `${baseUrl}/hr/employees/extend/temp`,
|
|
150
|
+
EmployeeNotificationService: `${baseUrl}/hr/notification-employee`,
|
|
151
|
+
EmployeeQuitService: `${baseUrl}/hr/employee_quit`,
|
|
152
|
+
EmployeeShiftService: `${baseUrl}/hr/employee_shift`,
|
|
153
|
+
HolidayService: `${baseUrl}/hr/holidays`,
|
|
154
|
+
PositionService: `${baseUrl}/hr/positions`,
|
|
155
|
+
ResignationService: `${baseUrl}/hr/resignations`,
|
|
156
|
+
SalaryService: `${baseUrl}/hr/employee_salary`,
|
|
157
|
+
ScheduleService: `${baseUrl}/hr/schedule`,
|
|
158
|
+
ScheduleOnlineService: `${baseUrl}/hr/schedule_online`,
|
|
159
|
+
EmployeeAttrTypeService: `${baseUrl}/hr/setting/employee_attr_type`,
|
|
160
|
+
ReasonTypeService: `${baseUrl}/hr/setting/reason_type`,
|
|
161
|
+
CategoryService: `${baseUrl}/hr/setting/category`,
|
|
162
|
+
JobTitleService: `${baseUrl}/hr/setting/job_title`,
|
|
163
|
+
ShiftService: `${baseUrl}/hr/setting/shifts`,
|
|
164
|
+
ShiftsCustomerCareService: `${baseUrl}/hr/setting/shifts-customer-care`,
|
|
165
|
+
SettingProfileService: `${baseUrl}/hr/setting/profile`,
|
|
166
|
+
SettingCompensationService: `${baseUrl}/hr/setting/compensation`,
|
|
167
|
+
SettingDocumentService: `${baseUrl}/hr/setting_document`,
|
|
168
|
+
SettingShiftsService: `${baseUrl}/hr/setting-shifts`,
|
|
169
|
+
TicketService: `${baseUrl}/hr/ticket`,
|
|
170
|
+
TicketExtendService: `${baseUrl}/hr/ticket/extend`,
|
|
171
|
+
TicketTypeService: `${baseUrl}/hr/ticket-type`,
|
|
172
|
+
TrackingConfirmService: `${baseUrl}/hr/tracking_confirm`,
|
|
173
|
+
TrackingService: `${baseUrl}/hr/tracking`,
|
|
174
|
+
TrackingErrorService: `${baseUrl}/hr/tracking-error`,
|
|
175
|
+
ScheduleDateService: `${baseUrl}/hr/schedule_date`,
|
|
176
|
+
SalaryTypeService: `${baseUrl}/hr/salary-type`,
|
|
177
|
+
ScheduleAutomationService: `${baseUrl}/hr/schedule_automation`,
|
|
178
|
+
OffsetLeaveService: `${baseUrl}/hr/offset_leave`,
|
|
179
|
+
EmployeeContractService: `${baseUrl}/hr/employee_contract`
|
|
180
|
+
},
|
|
181
|
+
Support: {
|
|
182
|
+
CommentService: `${baseUrl}/support/comment`
|
|
183
|
+
},
|
|
184
|
+
Authorization: {
|
|
185
|
+
RoleService: `${baseUrl}/authorization/roles`,
|
|
186
|
+
PermissionService: `${baseUrl}/authorization/permissions`,
|
|
187
|
+
EmployeePermissionService: `${baseUrl}/authorization/employee/permission`,
|
|
188
|
+
EmployeeService: `${baseUrl}/authorization/employee/services`,
|
|
189
|
+
EmployeeDetailService: `${baseUrl}/authorization/employee/detail`
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
module2.exports = {
|
|
193
|
+
AUTHENTICATOR_PUBLIC_KEY: process.env.AUTHENTICATOR_PUBLIC_KEY || "",
|
|
194
|
+
API_MICROSERVICE_URL: process.env.API_MICROSERVICE_URL || "",
|
|
195
|
+
API_MICROSERVICE_TOKEN: process.env.API_MICROSERVICE_TOKEN || "",
|
|
196
|
+
CONFIG_ROUTER_SERVICE: configRouteService,
|
|
197
|
+
CONFIG_REDIS: redis
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
// src/services/CacheService.js
|
|
203
|
+
var require_CacheService = __commonJS({
|
|
204
|
+
"src/services/CacheService.js"(exports2, module2) {
|
|
205
|
+
var qs = require("qs");
|
|
206
|
+
var CacheService = class {
|
|
207
|
+
isCache = false;
|
|
208
|
+
// bật/tắt cache mặc định
|
|
209
|
+
service = null;
|
|
210
|
+
// nhớ gán ở subclass
|
|
211
|
+
module = null;
|
|
212
|
+
// module
|
|
213
|
+
configService = "microservice";
|
|
214
|
+
// module
|
|
215
|
+
timeCache = 3600;
|
|
216
|
+
// cache 60p
|
|
217
|
+
redis = null;
|
|
218
|
+
buildCacheKeyUrl(path, params = {}) {
|
|
219
|
+
const q = qs.stringify(params, { arrayFormat: "brackets", encode: true });
|
|
220
|
+
const full = `${path}${q ? "?" + q : ""}`;
|
|
221
|
+
return `${this.configService}.${this.service || "unknown"}.${this.module || "unknown"}.urls:${full}`;
|
|
222
|
+
}
|
|
223
|
+
// Lấy cache theo id
|
|
224
|
+
async getCacheByKey(key) {
|
|
225
|
+
const data = await this.redis.get(key);
|
|
226
|
+
return data ? JSON.parse(data) : null;
|
|
227
|
+
}
|
|
228
|
+
// Lấy cache theo id
|
|
229
|
+
async getCacheById(id) {
|
|
230
|
+
if (!this.isCache || !this.redis) return null;
|
|
231
|
+
const key = `${this.configService}.${this.service || "unknown"}.${this.module || "unknown"}.id:${id}`;
|
|
232
|
+
const data = await this.redis.get(key);
|
|
233
|
+
return data ? JSON.parse(data) : null;
|
|
234
|
+
}
|
|
235
|
+
// Lấy cache theo nhiều ids
|
|
236
|
+
async getCacheByIds(ids = []) {
|
|
237
|
+
const validIds = (ids || []).filter(
|
|
238
|
+
(id) => id !== null && id !== void 0 && id !== ""
|
|
239
|
+
);
|
|
240
|
+
if (!this.isCache || !this.redis || !validIds.length) return [];
|
|
241
|
+
const keys = validIds.map(
|
|
242
|
+
(id) => `${this.configService}.${this.service || "unknown"}.${this.module || "unknown"}.id:${id}`
|
|
243
|
+
);
|
|
244
|
+
const results = await this.redis.mget(keys);
|
|
245
|
+
return results.map((r) => r ? JSON.parse(r) : null).filter(Boolean);
|
|
246
|
+
}
|
|
247
|
+
// Set cache
|
|
248
|
+
async setCache(key, value, ttl = this.timeCache) {
|
|
249
|
+
if (!this.isCache || !this.redis) return;
|
|
250
|
+
await this.redis.set(key, JSON.stringify(value), "EX", ttl);
|
|
251
|
+
}
|
|
252
|
+
// Ví dụ set cache theo id
|
|
253
|
+
async setCacheById(id, value, ttl) {
|
|
254
|
+
const key = `${this.configService}.${this.service || "unknown"}.${this.module || "unknown"}.id:${id}`;
|
|
255
|
+
await this.setCache(key, value, ttl);
|
|
256
|
+
}
|
|
257
|
+
async deleteById(id) {
|
|
258
|
+
const key = `${this.configService}.${this.service || "unknown"}.${this.module || "unknown"}.id:${id}`;
|
|
259
|
+
await this.deleteCache(key);
|
|
260
|
+
}
|
|
261
|
+
async deleteByIds(ids = []) {
|
|
262
|
+
if (!this.isCache || !this.redis) return;
|
|
263
|
+
const keys = ids.map(
|
|
264
|
+
(id) => `${this.configService}.${this.service || "unknown"}.${this.module || "unknown"}.id:${id}`
|
|
265
|
+
);
|
|
266
|
+
if (keys.length) {
|
|
267
|
+
await this.redis.del(...keys);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
// Xóa cache theo key
|
|
271
|
+
async deleteCache(key) {
|
|
272
|
+
if (!this.isCache || !this.redis) return;
|
|
273
|
+
await this.redis.del(key);
|
|
274
|
+
}
|
|
275
|
+
};
|
|
276
|
+
module2.exports = CacheService;
|
|
277
|
+
}
|
|
278
|
+
});
|
|
279
|
+
|
|
280
|
+
// src/services/BaseService.js
|
|
281
|
+
var require_BaseService = __commonJS({
|
|
282
|
+
"src/services/BaseService.js"(exports2, module2) {
|
|
283
|
+
var axios = require("axios");
|
|
284
|
+
var qs = require("qs");
|
|
285
|
+
var { API_MICROSERVICE_TOKEN, CONFIG_REDIS } = require_config();
|
|
286
|
+
var CacheService = require_CacheService();
|
|
287
|
+
var BaseService2 = class extends CacheService {
|
|
288
|
+
baseUrl = "";
|
|
289
|
+
headers = {};
|
|
290
|
+
constructor(baseUrl = "", defaultHeaders = {}) {
|
|
291
|
+
super(baseUrl, defaultHeaders);
|
|
292
|
+
this.baseUrl = baseUrl;
|
|
293
|
+
this.setHeader(defaultHeaders);
|
|
294
|
+
this.redis = CONFIG_REDIS;
|
|
295
|
+
this.http = axios.create({
|
|
296
|
+
baseURL: this.baseUrl,
|
|
297
|
+
headers: this.headers,
|
|
298
|
+
paramsSerializer: (params) => qs.stringify(params, { arrayFormat: "brackets", encode: true })
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* Set header cho request
|
|
303
|
+
* - headers: object { Authorization: "Bearer x" }
|
|
304
|
+
* - string: "Bearer x"
|
|
305
|
+
* - không truyền: dùng token từ ENV
|
|
306
|
+
*/
|
|
307
|
+
setHeader(headers = {}) {
|
|
308
|
+
let Authorization = `Bearer ${API_MICROSERVICE_TOKEN}`;
|
|
309
|
+
if (typeof headers === "string") {
|
|
310
|
+
Authorization = headers;
|
|
311
|
+
} else if (headers && headers.Authorization) {
|
|
312
|
+
Authorization = headers.Authorization;
|
|
313
|
+
}
|
|
314
|
+
this.headers = {
|
|
315
|
+
...this.headers || {},
|
|
316
|
+
Authorization
|
|
317
|
+
};
|
|
318
|
+
return this;
|
|
319
|
+
}
|
|
320
|
+
async request(method, url, options = {}, cacheOption = {}) {
|
|
321
|
+
var _a, _b;
|
|
322
|
+
const isGet = method.toLowerCase() === "get";
|
|
323
|
+
const enableCache = cacheOption.isCache ?? false;
|
|
324
|
+
if (isGet && enableCache) {
|
|
325
|
+
let cacheKey = (cacheOption == null ? void 0 : cacheOption.cacheKey) ?? this.buildCacheKeyUrl(url, options.params);
|
|
326
|
+
const cached = await this.getCacheByKey(cacheKey);
|
|
327
|
+
if (cached) return cached;
|
|
328
|
+
}
|
|
329
|
+
try {
|
|
330
|
+
if (isGet) {
|
|
331
|
+
console.log(`[HTTP GET] ${this.buildGET(url, options.params || {})}`);
|
|
332
|
+
}
|
|
333
|
+
const startTime = Date.now();
|
|
334
|
+
const res = await this.http.request({
|
|
335
|
+
method,
|
|
336
|
+
url,
|
|
337
|
+
headers: this.headers,
|
|
338
|
+
...options
|
|
339
|
+
});
|
|
340
|
+
const data = res.data;
|
|
341
|
+
if (isGet && enableCache) {
|
|
342
|
+
let cacheKey = cacheOption.cacheKey ?? this.buildCacheKeyUrl(url, options.params);
|
|
343
|
+
const ttl = cacheOption.timeCache || this.timeCache;
|
|
344
|
+
await this.setCache(cacheKey, data, ttl);
|
|
345
|
+
console.log(`[CACHE SET] ${cacheKey} - TTL ${ttl}s`);
|
|
346
|
+
}
|
|
347
|
+
const duration = (Date.now() - startTime) / 1e3;
|
|
348
|
+
if (duration > 5) {
|
|
349
|
+
console.log(
|
|
350
|
+
`[SLOW ${method.toUpperCase()}] ${url} - ${duration.toFixed(2)}s`
|
|
351
|
+
);
|
|
352
|
+
if (options.params) console.log("Query:", options.params);
|
|
353
|
+
if (options.data) console.log("Body:", options.data);
|
|
354
|
+
}
|
|
355
|
+
return data;
|
|
356
|
+
} catch (error) {
|
|
357
|
+
const safeError = {
|
|
358
|
+
statusCode: ((_a = error.response) == null ? void 0 : _a.status) || 500,
|
|
359
|
+
...(_b = error.response) == null ? void 0 : _b.data
|
|
360
|
+
};
|
|
361
|
+
if (safeError.statusCode === 404) {
|
|
362
|
+
const q = qs.stringify(options.params || {}, {
|
|
363
|
+
arrayFormat: "brackets",
|
|
364
|
+
encode: true
|
|
365
|
+
});
|
|
366
|
+
return {
|
|
367
|
+
statusCode: 404,
|
|
368
|
+
status: "error",
|
|
369
|
+
message: `[HTTP ${method.toUpperCase()}] ${url}${q ? "?" + q : ""} not found`
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
console.error(`[${method.toUpperCase()}] ${url} failed:`, safeError);
|
|
373
|
+
return { error: true, ...safeError };
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
buildGET(url, params = {}) {
|
|
377
|
+
const queryString = qs.stringify(params, {
|
|
378
|
+
arrayFormat: "brackets",
|
|
379
|
+
encode: true
|
|
380
|
+
});
|
|
381
|
+
return `${url}${queryString ? "?" + queryString : ""}`;
|
|
382
|
+
}
|
|
383
|
+
async all(query = {}, cacheOption = {}) {
|
|
384
|
+
let { filter = {} } = query;
|
|
385
|
+
const useCache = this.isCache && filter && filter._id && Object.keys(filter).length === 1;
|
|
386
|
+
if (useCache) {
|
|
387
|
+
let ids = Array.isArray(filter._id) ? filter._id : [filter._id];
|
|
388
|
+
return this.details(ids);
|
|
389
|
+
}
|
|
390
|
+
if (query.order_by && Array.isArray(query.order_by)) {
|
|
391
|
+
query.order_by = query.order_by.slice(0, 2);
|
|
392
|
+
if (query.order_by[1] && !["asc", "desc"].includes(query.order_by[1])) {
|
|
393
|
+
query.order_by[1] = "asc";
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
return this.request("get", this.baseUrl, { params: query }, cacheOption);
|
|
397
|
+
}
|
|
398
|
+
async details(ids = [], options = {}, cacheOption = {}) {
|
|
399
|
+
const enableCache = cacheOption.isCache ?? this.isCache;
|
|
400
|
+
let dataCache = [];
|
|
401
|
+
if (enableCache) {
|
|
402
|
+
dataCache = await this.getCacheByIds(ids);
|
|
403
|
+
const cachedIds = dataCache.filter((item) => item && Object.keys(item).length > 0).map((item) => item._id);
|
|
404
|
+
ids = ids.filter((id) => !cachedIds.includes(id));
|
|
405
|
+
}
|
|
406
|
+
if (ids.length === 0) return dataCache;
|
|
407
|
+
let params = { params: { filter: { _id: ids }, limit: ids.length } };
|
|
408
|
+
const datas = await this.request("get", this.baseUrl, params, cacheOption);
|
|
409
|
+
const rows = [...dataCache];
|
|
410
|
+
if (enableCache && Array.isArray(datas) && datas.length) {
|
|
411
|
+
for (const item of datas) {
|
|
412
|
+
if (item && item._id) {
|
|
413
|
+
await this.setCacheById(item._id, item, this.timeCache);
|
|
414
|
+
rows.push(item);
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
return rows;
|
|
419
|
+
}
|
|
420
|
+
async detail(id, cacheOption = {}) {
|
|
421
|
+
const enableCache = cacheOption.isCache ?? this.isCache;
|
|
422
|
+
if (enableCache) {
|
|
423
|
+
let data = await this.getCacheById(id);
|
|
424
|
+
if (data) return data;
|
|
425
|
+
}
|
|
426
|
+
let url = `${this.baseUrl}/${id}`;
|
|
427
|
+
return this.request("get", url, {}, cacheOption);
|
|
428
|
+
}
|
|
429
|
+
async create(data) {
|
|
430
|
+
return this.request("post", this.baseUrl, { data });
|
|
431
|
+
}
|
|
432
|
+
async update(id, data) {
|
|
433
|
+
let response = this.request("put", `${this.baseUrl}/${id}`, { data });
|
|
434
|
+
if (response && (response == null ? void 0 : response.status) == "success" && this.isCache) {
|
|
435
|
+
this.deleteById(id);
|
|
436
|
+
}
|
|
437
|
+
return response;
|
|
438
|
+
}
|
|
439
|
+
async delete(id) {
|
|
440
|
+
let response = this.request("delete", `${this.baseUrl}/${id}`);
|
|
441
|
+
if (response && (response == null ? void 0 : response.status) == "success" && this.isCache) {
|
|
442
|
+
this.deleteById(id);
|
|
443
|
+
}
|
|
444
|
+
return response;
|
|
445
|
+
}
|
|
446
|
+
};
|
|
447
|
+
module2.exports = BaseService2;
|
|
448
|
+
}
|
|
449
|
+
});
|
|
450
|
+
|
|
451
|
+
// src/services/hr/EmployeeContractService.js
|
|
452
|
+
var BaseService = require_BaseService();
|
|
453
|
+
var { CONFIG_ROUTER_SERVICE } = require_config();
|
|
454
|
+
var EmployeeContractService = class extends BaseService {
|
|
455
|
+
constructor() {
|
|
456
|
+
super(CONFIG_ROUTER_SERVICE.Hr.EmployeeContractService);
|
|
457
|
+
this.service = "Hr.EmployeeContractService";
|
|
458
|
+
this.isCache = false;
|
|
459
|
+
}
|
|
460
|
+
};
|
|
461
|
+
module.exports = EmployeeContractService;
|
|
@@ -134,38 +134,59 @@ var require_config = __commonJS({
|
|
|
134
134
|
StudentTrialService: `${baseUrl}/lms/students-trial`
|
|
135
135
|
},
|
|
136
136
|
Hr: {
|
|
137
|
+
ConfigurationsService: `${baseUrl}/hr/configurations`,
|
|
138
|
+
GroupService: `${baseUrl}/hr/groups`,
|
|
137
139
|
AllowanceService: `${baseUrl}/hr/allowance`,
|
|
138
|
-
|
|
140
|
+
LeaveService: `${baseUrl}/hr/leave`,
|
|
139
141
|
AnnualLeaveService: `${baseUrl}/hr/annual_leave`,
|
|
142
|
+
EmployeeLeaveService: `${baseUrl}/hr/employee_leave`,
|
|
140
143
|
EmployeeService: `${baseUrl}/hr/employees`,
|
|
141
|
-
JobTitleService: `${baseUrl}/hr/setting/job_title`,
|
|
142
144
|
DepartmentService: `${baseUrl}/hr/departments`,
|
|
143
145
|
DeviceService: `${baseUrl}/hr/device`,
|
|
144
146
|
DocumentService: `${baseUrl}/hr/documents`,
|
|
147
|
+
DocumentExtendService: `${baseUrl}/hr/document_extend`,
|
|
145
148
|
EmployeeExtendService: `${baseUrl}/hr/employees/extend`,
|
|
146
149
|
EmployeeExtendTempService: `${baseUrl}/hr/employees/extend/temp`,
|
|
147
|
-
EmployeeLeaveService: `${baseUrl}/hr/employee_leave`,
|
|
148
150
|
EmployeeNotificationService: `${baseUrl}/hr/notification-employee`,
|
|
149
151
|
EmployeeQuitService: `${baseUrl}/hr/employee_quit`,
|
|
150
152
|
EmployeeShiftService: `${baseUrl}/hr/employee_shift`,
|
|
151
153
|
HolidayService: `${baseUrl}/hr/holidays`,
|
|
152
154
|
PositionService: `${baseUrl}/hr/positions`,
|
|
153
|
-
ReasonTypeService: `${baseUrl}/hr/setting/reason_type`,
|
|
154
155
|
ResignationService: `${baseUrl}/hr/resignations`,
|
|
155
156
|
SalaryService: `${baseUrl}/hr/employee_salary`,
|
|
156
157
|
ScheduleService: `${baseUrl}/hr/schedule`,
|
|
157
158
|
ScheduleOnlineService: `${baseUrl}/hr/schedule_online`,
|
|
159
|
+
EmployeeAttrTypeService: `${baseUrl}/hr/setting/employee_attr_type`,
|
|
160
|
+
ReasonTypeService: `${baseUrl}/hr/setting/reason_type`,
|
|
161
|
+
CategoryService: `${baseUrl}/hr/setting/category`,
|
|
162
|
+
JobTitleService: `${baseUrl}/hr/setting/job_title`,
|
|
158
163
|
ShiftService: `${baseUrl}/hr/setting/shifts`,
|
|
159
164
|
ShiftsCustomerCareService: `${baseUrl}/hr/setting/shifts-customer-care`,
|
|
165
|
+
SettingProfileService: `${baseUrl}/hr/setting/profile`,
|
|
166
|
+
SettingCompensationService: `${baseUrl}/hr/setting/compensation`,
|
|
167
|
+
SettingDocumentService: `${baseUrl}/hr/setting_document`,
|
|
168
|
+
SettingShiftsService: `${baseUrl}/hr/setting-shifts`,
|
|
160
169
|
TicketService: `${baseUrl}/hr/ticket`,
|
|
161
170
|
TicketExtendService: `${baseUrl}/hr/ticket/extend`,
|
|
162
171
|
TicketTypeService: `${baseUrl}/hr/ticket-type`,
|
|
163
172
|
TrackingConfirmService: `${baseUrl}/hr/tracking_confirm`,
|
|
173
|
+
TrackingService: `${baseUrl}/hr/tracking`,
|
|
164
174
|
TrackingErrorService: `${baseUrl}/hr/tracking-error`,
|
|
165
|
-
|
|
175
|
+
ScheduleDateService: `${baseUrl}/hr/schedule_date`,
|
|
176
|
+
SalaryTypeService: `${baseUrl}/hr/salary-type`,
|
|
177
|
+
ScheduleAutomationService: `${baseUrl}/hr/schedule_automation`,
|
|
178
|
+
OffsetLeaveService: `${baseUrl}/hr/offset_leave`,
|
|
179
|
+
EmployeeContractService: `${baseUrl}/hr/employee_contract`
|
|
166
180
|
},
|
|
167
181
|
Support: {
|
|
168
182
|
CommentService: `${baseUrl}/support/comment`
|
|
183
|
+
},
|
|
184
|
+
Authorization: {
|
|
185
|
+
RoleService: `${baseUrl}/authorization/roles`,
|
|
186
|
+
PermissionService: `${baseUrl}/authorization/permissions`,
|
|
187
|
+
EmployeePermissionService: `${baseUrl}/authorization/employee/permission`,
|
|
188
|
+
EmployeeService: `${baseUrl}/authorization/employee/services`,
|
|
189
|
+
EmployeeDetailService: `${baseUrl}/authorization/employee/detail`
|
|
169
190
|
}
|
|
170
191
|
};
|
|
171
192
|
module2.exports = {
|
|
@@ -134,38 +134,59 @@ var require_config = __commonJS({
|
|
|
134
134
|
StudentTrialService: `${baseUrl}/lms/students-trial`
|
|
135
135
|
},
|
|
136
136
|
Hr: {
|
|
137
|
+
ConfigurationsService: `${baseUrl}/hr/configurations`,
|
|
138
|
+
GroupService: `${baseUrl}/hr/groups`,
|
|
137
139
|
AllowanceService: `${baseUrl}/hr/allowance`,
|
|
138
|
-
|
|
140
|
+
LeaveService: `${baseUrl}/hr/leave`,
|
|
139
141
|
AnnualLeaveService: `${baseUrl}/hr/annual_leave`,
|
|
142
|
+
EmployeeLeaveService: `${baseUrl}/hr/employee_leave`,
|
|
140
143
|
EmployeeService: `${baseUrl}/hr/employees`,
|
|
141
|
-
JobTitleService: `${baseUrl}/hr/setting/job_title`,
|
|
142
144
|
DepartmentService: `${baseUrl}/hr/departments`,
|
|
143
145
|
DeviceService: `${baseUrl}/hr/device`,
|
|
144
146
|
DocumentService: `${baseUrl}/hr/documents`,
|
|
147
|
+
DocumentExtendService: `${baseUrl}/hr/document_extend`,
|
|
145
148
|
EmployeeExtendService: `${baseUrl}/hr/employees/extend`,
|
|
146
149
|
EmployeeExtendTempService: `${baseUrl}/hr/employees/extend/temp`,
|
|
147
|
-
EmployeeLeaveService: `${baseUrl}/hr/employee_leave`,
|
|
148
150
|
EmployeeNotificationService: `${baseUrl}/hr/notification-employee`,
|
|
149
151
|
EmployeeQuitService: `${baseUrl}/hr/employee_quit`,
|
|
150
152
|
EmployeeShiftService: `${baseUrl}/hr/employee_shift`,
|
|
151
153
|
HolidayService: `${baseUrl}/hr/holidays`,
|
|
152
154
|
PositionService: `${baseUrl}/hr/positions`,
|
|
153
|
-
ReasonTypeService: `${baseUrl}/hr/setting/reason_type`,
|
|
154
155
|
ResignationService: `${baseUrl}/hr/resignations`,
|
|
155
156
|
SalaryService: `${baseUrl}/hr/employee_salary`,
|
|
156
157
|
ScheduleService: `${baseUrl}/hr/schedule`,
|
|
157
158
|
ScheduleOnlineService: `${baseUrl}/hr/schedule_online`,
|
|
159
|
+
EmployeeAttrTypeService: `${baseUrl}/hr/setting/employee_attr_type`,
|
|
160
|
+
ReasonTypeService: `${baseUrl}/hr/setting/reason_type`,
|
|
161
|
+
CategoryService: `${baseUrl}/hr/setting/category`,
|
|
162
|
+
JobTitleService: `${baseUrl}/hr/setting/job_title`,
|
|
158
163
|
ShiftService: `${baseUrl}/hr/setting/shifts`,
|
|
159
164
|
ShiftsCustomerCareService: `${baseUrl}/hr/setting/shifts-customer-care`,
|
|
165
|
+
SettingProfileService: `${baseUrl}/hr/setting/profile`,
|
|
166
|
+
SettingCompensationService: `${baseUrl}/hr/setting/compensation`,
|
|
167
|
+
SettingDocumentService: `${baseUrl}/hr/setting_document`,
|
|
168
|
+
SettingShiftsService: `${baseUrl}/hr/setting-shifts`,
|
|
160
169
|
TicketService: `${baseUrl}/hr/ticket`,
|
|
161
170
|
TicketExtendService: `${baseUrl}/hr/ticket/extend`,
|
|
162
171
|
TicketTypeService: `${baseUrl}/hr/ticket-type`,
|
|
163
172
|
TrackingConfirmService: `${baseUrl}/hr/tracking_confirm`,
|
|
173
|
+
TrackingService: `${baseUrl}/hr/tracking`,
|
|
164
174
|
TrackingErrorService: `${baseUrl}/hr/tracking-error`,
|
|
165
|
-
|
|
175
|
+
ScheduleDateService: `${baseUrl}/hr/schedule_date`,
|
|
176
|
+
SalaryTypeService: `${baseUrl}/hr/salary-type`,
|
|
177
|
+
ScheduleAutomationService: `${baseUrl}/hr/schedule_automation`,
|
|
178
|
+
OffsetLeaveService: `${baseUrl}/hr/offset_leave`,
|
|
179
|
+
EmployeeContractService: `${baseUrl}/hr/employee_contract`
|
|
166
180
|
},
|
|
167
181
|
Support: {
|
|
168
182
|
CommentService: `${baseUrl}/support/comment`
|
|
183
|
+
},
|
|
184
|
+
Authorization: {
|
|
185
|
+
RoleService: `${baseUrl}/authorization/roles`,
|
|
186
|
+
PermissionService: `${baseUrl}/authorization/permissions`,
|
|
187
|
+
EmployeePermissionService: `${baseUrl}/authorization/employee/permission`,
|
|
188
|
+
EmployeeService: `${baseUrl}/authorization/employee/services`,
|
|
189
|
+
EmployeeDetailService: `${baseUrl}/authorization/employee/detail`
|
|
169
190
|
}
|
|
170
191
|
};
|
|
171
192
|
module2.exports = {
|
|
@@ -134,38 +134,59 @@ var require_config = __commonJS({
|
|
|
134
134
|
StudentTrialService: `${baseUrl}/lms/students-trial`
|
|
135
135
|
},
|
|
136
136
|
Hr: {
|
|
137
|
+
ConfigurationsService: `${baseUrl}/hr/configurations`,
|
|
138
|
+
GroupService: `${baseUrl}/hr/groups`,
|
|
137
139
|
AllowanceService: `${baseUrl}/hr/allowance`,
|
|
138
|
-
|
|
140
|
+
LeaveService: `${baseUrl}/hr/leave`,
|
|
139
141
|
AnnualLeaveService: `${baseUrl}/hr/annual_leave`,
|
|
142
|
+
EmployeeLeaveService: `${baseUrl}/hr/employee_leave`,
|
|
140
143
|
EmployeeService: `${baseUrl}/hr/employees`,
|
|
141
|
-
JobTitleService: `${baseUrl}/hr/setting/job_title`,
|
|
142
144
|
DepartmentService: `${baseUrl}/hr/departments`,
|
|
143
145
|
DeviceService: `${baseUrl}/hr/device`,
|
|
144
146
|
DocumentService: `${baseUrl}/hr/documents`,
|
|
147
|
+
DocumentExtendService: `${baseUrl}/hr/document_extend`,
|
|
145
148
|
EmployeeExtendService: `${baseUrl}/hr/employees/extend`,
|
|
146
149
|
EmployeeExtendTempService: `${baseUrl}/hr/employees/extend/temp`,
|
|
147
|
-
EmployeeLeaveService: `${baseUrl}/hr/employee_leave`,
|
|
148
150
|
EmployeeNotificationService: `${baseUrl}/hr/notification-employee`,
|
|
149
151
|
EmployeeQuitService: `${baseUrl}/hr/employee_quit`,
|
|
150
152
|
EmployeeShiftService: `${baseUrl}/hr/employee_shift`,
|
|
151
153
|
HolidayService: `${baseUrl}/hr/holidays`,
|
|
152
154
|
PositionService: `${baseUrl}/hr/positions`,
|
|
153
|
-
ReasonTypeService: `${baseUrl}/hr/setting/reason_type`,
|
|
154
155
|
ResignationService: `${baseUrl}/hr/resignations`,
|
|
155
156
|
SalaryService: `${baseUrl}/hr/employee_salary`,
|
|
156
157
|
ScheduleService: `${baseUrl}/hr/schedule`,
|
|
157
158
|
ScheduleOnlineService: `${baseUrl}/hr/schedule_online`,
|
|
159
|
+
EmployeeAttrTypeService: `${baseUrl}/hr/setting/employee_attr_type`,
|
|
160
|
+
ReasonTypeService: `${baseUrl}/hr/setting/reason_type`,
|
|
161
|
+
CategoryService: `${baseUrl}/hr/setting/category`,
|
|
162
|
+
JobTitleService: `${baseUrl}/hr/setting/job_title`,
|
|
158
163
|
ShiftService: `${baseUrl}/hr/setting/shifts`,
|
|
159
164
|
ShiftsCustomerCareService: `${baseUrl}/hr/setting/shifts-customer-care`,
|
|
165
|
+
SettingProfileService: `${baseUrl}/hr/setting/profile`,
|
|
166
|
+
SettingCompensationService: `${baseUrl}/hr/setting/compensation`,
|
|
167
|
+
SettingDocumentService: `${baseUrl}/hr/setting_document`,
|
|
168
|
+
SettingShiftsService: `${baseUrl}/hr/setting-shifts`,
|
|
160
169
|
TicketService: `${baseUrl}/hr/ticket`,
|
|
161
170
|
TicketExtendService: `${baseUrl}/hr/ticket/extend`,
|
|
162
171
|
TicketTypeService: `${baseUrl}/hr/ticket-type`,
|
|
163
172
|
TrackingConfirmService: `${baseUrl}/hr/tracking_confirm`,
|
|
173
|
+
TrackingService: `${baseUrl}/hr/tracking`,
|
|
164
174
|
TrackingErrorService: `${baseUrl}/hr/tracking-error`,
|
|
165
|
-
|
|
175
|
+
ScheduleDateService: `${baseUrl}/hr/schedule_date`,
|
|
176
|
+
SalaryTypeService: `${baseUrl}/hr/salary-type`,
|
|
177
|
+
ScheduleAutomationService: `${baseUrl}/hr/schedule_automation`,
|
|
178
|
+
OffsetLeaveService: `${baseUrl}/hr/offset_leave`,
|
|
179
|
+
EmployeeContractService: `${baseUrl}/hr/employee_contract`
|
|
166
180
|
},
|
|
167
181
|
Support: {
|
|
168
182
|
CommentService: `${baseUrl}/support/comment`
|
|
183
|
+
},
|
|
184
|
+
Authorization: {
|
|
185
|
+
RoleService: `${baseUrl}/authorization/roles`,
|
|
186
|
+
PermissionService: `${baseUrl}/authorization/permissions`,
|
|
187
|
+
EmployeePermissionService: `${baseUrl}/authorization/employee/permission`,
|
|
188
|
+
EmployeeService: `${baseUrl}/authorization/employee/services`,
|
|
189
|
+
EmployeeDetailService: `${baseUrl}/authorization/employee/detail`
|
|
169
190
|
}
|
|
170
191
|
};
|
|
171
192
|
module2.exports = {
|