@skysoftware-co/bayan-hr-widgets-ui 2.0.18 → 2.0.20
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/ng-package.json +9 -0
- package/package.json +3 -15
- package/src/assets/i18n/ar.json +166 -0
- package/src/assets/i18n/en.json +166 -0
- package/src/assets/i18n/fr.json +166 -0
- package/src/lib/my-calendar-widget/my-calendar-widget.component.html +25 -0
- package/src/lib/my-calendar-widget/my-calendar-widget.component.ts +220 -0
- package/src/lib/my-main-details-widget/my-main-details-widget.component.html +157 -0
- package/src/lib/my-main-details-widget/my-main-details-widget.component.ts +179 -0
- package/src/lib/my-next-week-vacation-insights-widget/components/next-week-vacation-insights-popup/next-week-vacation-insights-popup.component.html +131 -0
- package/src/lib/my-next-week-vacation-insights-widget/components/next-week-vacation-insights-popup/next-week-vacation-insights-popup.component.ts +119 -0
- package/src/lib/my-next-week-vacation-insights-widget/my-next-week-vacation-insights-widget.component.html +35 -0
- package/src/lib/my-next-week-vacation-insights-widget/my-next-week-vacation-insights-widget.component.ts +110 -0
- package/src/lib/my-profile/address-widget/my-profile-address-widget.component.html +57 -0
- package/src/lib/my-profile/address-widget/my-profile-address-widget.component.ts +70 -0
- package/src/lib/my-profile/bank-info-widget/my-profile-bank-info-widget.component.html +101 -0
- package/src/lib/my-profile/bank-info-widget/my-profile-bank-info-widget.component.ts +89 -0
- package/src/lib/my-profile/contact-widget/my-profile-contact-widget.component.html +89 -0
- package/src/lib/my-profile/contact-widget/my-profile-contact-widget.component.ts +78 -0
- package/src/lib/my-profile/contract-widget/my-profile-contract-widget.component.html +63 -0
- package/src/lib/my-profile/contract-widget/my-profile-contract-widget.component.ts +73 -0
- package/src/lib/my-profile/degrees-widget/my-profile-degrees-widget-component.html +86 -0
- package/src/lib/my-profile/degrees-widget/my-profile-degrees-widget-component.ts +98 -0
- package/src/lib/my-profile/dependents-documents-widget/my-profile-dependents-documents-widget.html +83 -0
- package/src/lib/my-profile/dependents-documents-widget/my-profile-dependents-documents-widget.ts +126 -0
- package/src/lib/my-profile/documents-widgets/components/document-card/document-card.component.html +53 -0
- package/src/lib/my-profile/documents-widgets/components/document-card/document-card.component.ts +50 -0
- package/src/lib/my-profile/documents-widgets/components/document-row/document-row.component.html +48 -0
- package/src/lib/my-profile/documents-widgets/components/document-row/document-row.component.ts +44 -0
- package/src/lib/my-profile/documents-widgets/components/document-tablet-card/document-tablet-card.component.html +46 -0
- package/src/lib/my-profile/documents-widgets/components/document-tablet-card/document-tablet-card.component.ts +47 -0
- package/src/lib/my-profile/employee-dependents-widget/my-profile-employee-dependents-component.html +50 -0
- package/src/lib/my-profile/employee-dependents-widget/my-profile-employee-dependents-component.ts +63 -0
- package/src/lib/my-profile/entitlements-others-widget/my-profile-entitlements-others-widget.component.html +26 -0
- package/src/lib/my-profile/entitlements-others-widget/my-profile-entitlements-others-widget.component.ts +66 -0
- package/src/lib/my-profile/experiences-widget/my-profile-experiences-widget-component.html +93 -0
- package/src/lib/my-profile/experiences-widget/my-profile-experiences-widget-component.ts +102 -0
- package/src/lib/my-profile/indemnity-widget/my-profile-indemnity-widget.component.html +49 -0
- package/src/lib/my-profile/indemnity-widget/my-profile-indemnity-widget.component.ts +79 -0
- package/src/lib/my-profile/job-info-widget/my-profile-job-info-widget.component.html +71 -0
- package/src/lib/my-profile/job-info-widget/my-profile-job-info-widget.component.ts +73 -0
- package/src/lib/my-profile/languages-widget/my-profile-languages-widget.component.html +23 -0
- package/src/lib/my-profile/languages-widget/my-profile-languages-widget.component.ts +70 -0
- package/src/lib/my-profile/medical-insurance-widget/components/medical-insurance-card/medical-insurance-card.component.html +18 -0
- package/src/lib/my-profile/medical-insurance-widget/components/medical-insurance-card/medical-insurance-card.component.ts +29 -0
- package/src/lib/my-profile/medical-insurance-widget/my-profile-medical-insurance-widget.component.html +52 -0
- package/src/lib/my-profile/medical-insurance-widget/my-profile-medical-insurance-widget.component.ts +103 -0
- package/src/lib/my-profile/official-documents-widget/my-profile-official-documents-widget.html +82 -0
- package/src/lib/my-profile/official-documents-widget/my-profile-official-documents-widget.ts +119 -0
- package/src/lib/my-profile/other-nationalities-widget/my-profile-other-nationalities-widget.component.html +23 -0
- package/src/lib/my-profile/other-nationalities-widget/my-profile-other-nationalities-widget.component.ts +70 -0
- package/src/lib/my-profile/personal-info-main-widget/my-profile-personal-info-main-widget.component.html +115 -0
- package/src/lib/my-profile/personal-info-main-widget/my-profile-personal-info-main-widget.component.ts +75 -0
- package/src/lib/my-profile/salary-widget/my-profile-salary-widget.component.html +37 -0
- package/src/lib/my-profile/salary-widget/my-profile-salary-widget.component.ts +85 -0
- package/src/lib/my-profile/service-charge-widget/my-profile-service-charge-widget.component.html +16 -0
- package/src/lib/my-profile/service-charge-widget/my-profile-service-charge-widget.component.ts +101 -0
- package/src/lib/my-profile/ticket-widget/components/ticket-card/ticket-card.component.html +23 -0
- package/src/lib/my-profile/ticket-widget/components/ticket-card/ticket-card.component.ts +26 -0
- package/src/lib/my-profile/ticket-widget/my-profile-ticket-widget.component.html +68 -0
- package/src/lib/my-profile/ticket-widget/my-profile-ticket-widget.component.ts +93 -0
- package/src/lib/my-profile/vacations-widget/my-profile-vacations-widget.component.html +34 -0
- package/src/lib/my-profile/vacations-widget/my-profile-vacations-widget.component.ts +66 -0
- package/src/lib/my-team-subordinates-popup-widget/components/employee-main-info-card/employee-information-card.component.ts +65 -0
- package/src/lib/my-team-subordinates-popup-widget/components/employee-main-info-card/employee-main-info-card.component.html +57 -0
- package/src/lib/my-team-subordinates-popup-widget/components/my-team-subordinates-popup/my-team-popup.component.html +109 -0
- package/src/lib/my-team-subordinates-popup-widget/components/my-team-subordinates-popup/my-team-popup.component.ts +297 -0
- package/src/lib/my-upcoming-events-widget/components/event-item/event-item.component.html +53 -0
- package/src/lib/my-upcoming-events-widget/components/event-item/event-item.component.ts +42 -0
- package/src/lib/my-upcoming-events-widget/components/event-tab-bar/event-tab-bar.component.html +21 -0
- package/src/lib/my-upcoming-events-widget/components/event-tab-bar/event-tab-bar.component.ts +44 -0
- package/src/lib/my-upcoming-events-widget/components/events-popup/events-popup.component.html +67 -0
- package/src/lib/my-upcoming-events-widget/components/events-popup/events-popup.component.ts +74 -0
- package/src/lib/my-upcoming-events-widget/my-upcoming-events-widget.component.html +74 -0
- package/src/lib/my-upcoming-events-widget/my-upcoming-events-widget.component.ts +199 -0
- package/src/lib/services/hr-self-widgets.service.ts +624 -0
- package/src/lib/shared/components/card-header/card-header.component.html +4 -0
- package/src/lib/shared/components/card-header/card-header.component.ts +18 -0
- package/src/lib/shared/components/hr-employee-calendar/hr-employee-calendar.component.html +47 -0
- package/src/lib/shared/components/hr-employee-calendar/hr-employee-calendar.component.ts +193 -0
- package/src/lib/shared/components/info-field/info-field.component.html +2 -0
- package/src/lib/shared/components/info-field/info-field.component.ts +20 -0
- package/src/lib/shared/components/widget-card/widget-card-component.html +3 -0
- package/src/lib/shared/components/widget-card/widget-card-component.ts +17 -0
- package/src/lib/shared/pipes/translate.pipe.ts +34 -0
- package/src/lib/shared/services/bank-information-cache.service.ts +29 -0
- package/src/lib/shared/services/common-methods.service.ts +33 -0
- package/src/lib/shared/services/constants.service.ts +12 -0
- package/src/lib/shared/services/entitlements-cache.service.ts +94 -0
- package/src/lib/shared/services/job-information-cache.service.ts +72 -0
- package/src/lib/shared/services/my-team-popup.service.ts +34 -0
- package/src/lib/shared/services/personal-information-cache.service.ts +77 -0
- package/src/lib/shared/services/profile-documents-cache-service.ts +44 -0
- package/src/lib/shared/services/profile-employee-dependents-cach.ts +37 -0
- package/src/lib/shared/services/qualifications-cache.service.ts +45 -0
- package/src/lib/shared/services/translate.service.ts +35 -0
- package/src/lib/shared/types/common.ts +359 -0
- package/src/public-api.ts +35 -0
- package/tsconfig.lib.json +11 -0
- package/tsconfig.lib.prod.json +9 -0
- package/tsconfig.spec.json +8 -0
- package/fesm2022/skysoftware-co-bayan-hr-widgets-ui.mjs +0 -4785
- package/fesm2022/skysoftware-co-bayan-hr-widgets-ui.mjs.map +0 -1
- package/types/skysoftware-co-bayan-hr-widgets-ui.d.ts +0 -1305
|
@@ -0,0 +1,624 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
import { HttpClient, HttpParams } from '@angular/common/http';
|
|
3
|
+
import { Observable, catchError, map, shareReplay, throwError } from 'rxjs';
|
|
4
|
+
import {
|
|
5
|
+
Degree,
|
|
6
|
+
Dependent,
|
|
7
|
+
DependentDocumentGroup,
|
|
8
|
+
DocumentRow,
|
|
9
|
+
EntitlementsIndemnity,
|
|
10
|
+
EntitlementsMedicalInsurance,
|
|
11
|
+
EntitlementsTicket,
|
|
12
|
+
EntitlementsVacation,
|
|
13
|
+
EventOption,
|
|
14
|
+
Experience,
|
|
15
|
+
JobInformationContract,
|
|
16
|
+
JobInformationMain,
|
|
17
|
+
JobInformationSalary,
|
|
18
|
+
JobInformationServiceCharge,
|
|
19
|
+
MyBankInfo,
|
|
20
|
+
PersonalInfoAddressDetails,
|
|
21
|
+
PersonalInfoContactDetails,
|
|
22
|
+
PersonalInfoMainDetails,
|
|
23
|
+
} from '../shared/types/common';
|
|
24
|
+
import { BankInformationCacheService } from '../shared/services/bank-information-cache.service';
|
|
25
|
+
import { EntitlementsCacheService } from '../shared/services/entitlements-cache.service';
|
|
26
|
+
import { JobInformationCacheService } from '../shared/services/job-information-cache.service';
|
|
27
|
+
import { PersonalInformationCacheService } from '../shared/services/personal-information-cache.service';
|
|
28
|
+
import { QualificationsCacheService } from '../shared/services/qualifications-cache.service';
|
|
29
|
+
import { ProfileEmployeeDependentsCach } from '../shared/services/profile-employee-dependents-cach';
|
|
30
|
+
import { ProfileDocumentsCacheService } from '../shared/services/profile-documents-cache-service';
|
|
31
|
+
|
|
32
|
+
@Injectable({
|
|
33
|
+
providedIn: 'root',
|
|
34
|
+
})
|
|
35
|
+
export class HRSelfWidgetsService {
|
|
36
|
+
private readonly headers = { 'api-version': '1' };
|
|
37
|
+
|
|
38
|
+
constructor(
|
|
39
|
+
private http: HttpClient,
|
|
40
|
+
private readonly bankInformationCacheService: BankInformationCacheService,
|
|
41
|
+
private readonly entitlementsCacheService: EntitlementsCacheService,
|
|
42
|
+
private readonly jobInformationCacheService: JobInformationCacheService,
|
|
43
|
+
private readonly personalInformationCacheService: PersonalInformationCacheService,
|
|
44
|
+
private readonly qualificationsCacheService: QualificationsCacheService,
|
|
45
|
+
private readonly profileEmployeeDependentsCachService: ProfileEmployeeDependentsCach,
|
|
46
|
+
private readonly profileDocumentsCacheService: ProfileDocumentsCacheService,
|
|
47
|
+
) {}
|
|
48
|
+
|
|
49
|
+
getMainDetails(baseUrl: string): Observable<any> {
|
|
50
|
+
return this.http.get<any>(`${baseUrl}/hr/widgets/me/main-details`, {
|
|
51
|
+
headers: this.headers,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
getUpcomingEvents(baseUrl: string, eventOption: EventOption): Observable<any> {
|
|
56
|
+
const params = new HttpParams().set('EventOption', eventOption);
|
|
57
|
+
return this.http.get<any>(`${baseUrl}/hr/widgets/me/upcoming-events`, {
|
|
58
|
+
params,
|
|
59
|
+
headers: this.headers,
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
getCalendar(baseUrl: string, month: number, year: number, monthsCount: number): Observable<any> {
|
|
64
|
+
const params = new HttpParams().set('Month', month).set('Year', year).set('MonthsCount', monthsCount);
|
|
65
|
+
|
|
66
|
+
return this.http.get<any>(`${baseUrl}/hr/widgets/me/calendar`, {
|
|
67
|
+
params,
|
|
68
|
+
headers: this.headers,
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
getBankInformation(baseUrl: string, forceRefresh = false): Observable<MyBankInfo[]> {
|
|
73
|
+
if (!forceRefresh) {
|
|
74
|
+
const cachedRequest$ = this.bankInformationCacheService.get(baseUrl);
|
|
75
|
+
if (cachedRequest$) {
|
|
76
|
+
return cachedRequest$;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const request$ = this.http
|
|
81
|
+
.get<{ ResponseData: MyBankInfo[] }>(`${baseUrl}/hr/widgets/me/profile/banks`, {
|
|
82
|
+
headers: this.headers,
|
|
83
|
+
})
|
|
84
|
+
.pipe(
|
|
85
|
+
map(response => response?.ResponseData ?? []),
|
|
86
|
+
shareReplay(1),
|
|
87
|
+
catchError(error => {
|
|
88
|
+
this.bankInformationCacheService.clear();
|
|
89
|
+
return throwError(() => error);
|
|
90
|
+
}),
|
|
91
|
+
);
|
|
92
|
+
|
|
93
|
+
this.bankInformationCacheService.set(baseUrl, request$);
|
|
94
|
+
return request$;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
getPersonalInfoMainDetails(baseUrl: string, forceRefresh = false): Observable<PersonalInfoMainDetails> {
|
|
98
|
+
if (!forceRefresh) {
|
|
99
|
+
const cachedRequest$ = this.personalInformationCacheService.getMainDetails(baseUrl);
|
|
100
|
+
if (cachedRequest$) {
|
|
101
|
+
return cachedRequest$;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const request$ = this.http
|
|
106
|
+
.get<{ ResponseData: PersonalInfoMainDetails }>(`${baseUrl}/hr/widgets/me/profile/personal-information/main`, {
|
|
107
|
+
headers: this.headers,
|
|
108
|
+
})
|
|
109
|
+
.pipe(
|
|
110
|
+
map(response => response?.ResponseData ?? (response as unknown as PersonalInfoMainDetails)),
|
|
111
|
+
shareReplay(1),
|
|
112
|
+
catchError(error => {
|
|
113
|
+
this.personalInformationCacheService.clear();
|
|
114
|
+
return throwError(() => error);
|
|
115
|
+
}),
|
|
116
|
+
);
|
|
117
|
+
|
|
118
|
+
this.personalInformationCacheService.setMainDetails(baseUrl, request$);
|
|
119
|
+
return request$;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
getPersonalInfoContactDetails(baseUrl: string, forceRefresh = false): Observable<PersonalInfoContactDetails> {
|
|
123
|
+
if (!forceRefresh) {
|
|
124
|
+
const cachedRequest$ = this.personalInformationCacheService.getContactDetails(baseUrl);
|
|
125
|
+
if (cachedRequest$) {
|
|
126
|
+
return cachedRequest$;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
const request$ = this.http
|
|
131
|
+
.get<{ ResponseData: PersonalInfoContactDetails }>(
|
|
132
|
+
`${baseUrl}/hr/widgets/me/profile/personal-information/contact`,
|
|
133
|
+
{
|
|
134
|
+
headers: this.headers,
|
|
135
|
+
},
|
|
136
|
+
)
|
|
137
|
+
.pipe(
|
|
138
|
+
map(response => response?.ResponseData ?? (response as unknown as PersonalInfoContactDetails)),
|
|
139
|
+
shareReplay(1),
|
|
140
|
+
catchError(error => {
|
|
141
|
+
this.personalInformationCacheService.clear();
|
|
142
|
+
return throwError(() => error);
|
|
143
|
+
}),
|
|
144
|
+
);
|
|
145
|
+
|
|
146
|
+
this.personalInformationCacheService.setContactDetails(baseUrl, request$);
|
|
147
|
+
return request$;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
getPersonalInfoAddressDetails(baseUrl: string, forceRefresh = false): Observable<PersonalInfoAddressDetails> {
|
|
151
|
+
if (!forceRefresh) {
|
|
152
|
+
const cachedRequest$ = this.personalInformationCacheService.getAddressDetails(baseUrl);
|
|
153
|
+
if (cachedRequest$) {
|
|
154
|
+
return cachedRequest$;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
const request$ = this.http
|
|
159
|
+
.get<{ ResponseData: PersonalInfoAddressDetails }>(
|
|
160
|
+
`${baseUrl}/hr/widgets/me/profile/personal-information/address`,
|
|
161
|
+
{
|
|
162
|
+
headers: this.headers,
|
|
163
|
+
},
|
|
164
|
+
)
|
|
165
|
+
.pipe(
|
|
166
|
+
map(response => response?.ResponseData ?? (response as unknown as PersonalInfoAddressDetails)),
|
|
167
|
+
shareReplay(1),
|
|
168
|
+
catchError(error => {
|
|
169
|
+
this.personalInformationCacheService.clear();
|
|
170
|
+
return throwError(() => error);
|
|
171
|
+
}),
|
|
172
|
+
);
|
|
173
|
+
|
|
174
|
+
this.personalInformationCacheService.setAddressDetails(baseUrl, request$);
|
|
175
|
+
return request$;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
getPersonalInfoLanguages(baseUrl: string, forceRefresh = false): Observable<string[]> {
|
|
179
|
+
if (!forceRefresh) {
|
|
180
|
+
const cachedRequest$ = this.personalInformationCacheService.getLanguages(baseUrl);
|
|
181
|
+
if (cachedRequest$) {
|
|
182
|
+
return cachedRequest$;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
const request$ = this.http
|
|
187
|
+
.get<{ ResponseData: string[] }>(`${baseUrl}/hr/widgets/me/profile/personal-information/languages`, {
|
|
188
|
+
headers: this.headers,
|
|
189
|
+
})
|
|
190
|
+
.pipe(
|
|
191
|
+
map(response => response?.ResponseData ?? (response as unknown as string[]) ?? []),
|
|
192
|
+
shareReplay(1),
|
|
193
|
+
catchError(error => {
|
|
194
|
+
this.personalInformationCacheService.clear();
|
|
195
|
+
return throwError(() => error);
|
|
196
|
+
}),
|
|
197
|
+
);
|
|
198
|
+
|
|
199
|
+
this.personalInformationCacheService.setLanguages(baseUrl, request$);
|
|
200
|
+
return request$;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
getPersonalInfoOtherNationalities(baseUrl: string, forceRefresh = false): Observable<string[]> {
|
|
204
|
+
if (!forceRefresh) {
|
|
205
|
+
const cachedRequest$ = this.personalInformationCacheService.getOtherNationalities(baseUrl);
|
|
206
|
+
if (cachedRequest$) {
|
|
207
|
+
return cachedRequest$;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
const request$ = this.http
|
|
212
|
+
.get<{ ResponseData: string[] }>(`${baseUrl}/hr/widgets/me/profile/personal-information/other-nationalities`, {
|
|
213
|
+
headers: this.headers,
|
|
214
|
+
})
|
|
215
|
+
.pipe(
|
|
216
|
+
map(response => response?.ResponseData ?? (response as unknown as string[]) ?? []),
|
|
217
|
+
shareReplay(1),
|
|
218
|
+
catchError(error => {
|
|
219
|
+
this.personalInformationCacheService.clear();
|
|
220
|
+
return throwError(() => error);
|
|
221
|
+
}),
|
|
222
|
+
);
|
|
223
|
+
|
|
224
|
+
this.personalInformationCacheService.setOtherNationalities(baseUrl, request$);
|
|
225
|
+
return request$;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
getJobInformationMain(baseUrl: string, forceRefresh = false): Observable<JobInformationMain | null> {
|
|
229
|
+
if (!forceRefresh) {
|
|
230
|
+
const cachedRequest$ = this.jobInformationCacheService.getMainDetails(baseUrl);
|
|
231
|
+
if (cachedRequest$) {
|
|
232
|
+
return cachedRequest$;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
const request$ = this.http
|
|
237
|
+
.get<{ ResponseData: JobInformationMain }>(`${baseUrl}/hr/widgets/me/profile/job-information/main`, {
|
|
238
|
+
headers: this.headers,
|
|
239
|
+
})
|
|
240
|
+
.pipe(
|
|
241
|
+
map(response => response?.ResponseData ?? null),
|
|
242
|
+
shareReplay(1),
|
|
243
|
+
catchError(error => {
|
|
244
|
+
this.jobInformationCacheService.clear();
|
|
245
|
+
return throwError(() => error);
|
|
246
|
+
}),
|
|
247
|
+
);
|
|
248
|
+
|
|
249
|
+
this.jobInformationCacheService.setMainDetails(baseUrl, request$);
|
|
250
|
+
return request$;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
getJobInformationContract(baseUrl: string, forceRefresh = false): Observable<JobInformationContract | null> {
|
|
254
|
+
if (!forceRefresh) {
|
|
255
|
+
const cachedRequest$ = this.jobInformationCacheService.getContractDetails(baseUrl);
|
|
256
|
+
if (cachedRequest$) {
|
|
257
|
+
return cachedRequest$;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
const request$ = this.http
|
|
262
|
+
.get<{ ResponseData: JobInformationContract }>(`${baseUrl}/hr/widgets/me/profile/job-information/contract`, {
|
|
263
|
+
headers: this.headers,
|
|
264
|
+
})
|
|
265
|
+
.pipe(
|
|
266
|
+
map(response => response?.ResponseData ?? null),
|
|
267
|
+
shareReplay(1),
|
|
268
|
+
catchError(error => {
|
|
269
|
+
this.jobInformationCacheService.clear();
|
|
270
|
+
return throwError(() => error);
|
|
271
|
+
}),
|
|
272
|
+
);
|
|
273
|
+
|
|
274
|
+
this.jobInformationCacheService.setContractDetails(baseUrl, request$);
|
|
275
|
+
return request$;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
getJobInformationSalary(baseUrl: string, forceRefresh = false): Observable<JobInformationSalary | null> {
|
|
279
|
+
if (!forceRefresh) {
|
|
280
|
+
const cachedRequest$ = this.jobInformationCacheService.getSalaryDetails(baseUrl);
|
|
281
|
+
if (cachedRequest$) {
|
|
282
|
+
return cachedRequest$;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
const request$ = this.http
|
|
287
|
+
.get<{ ResponseData: JobInformationSalary }>(`${baseUrl}/hr/widgets/me/profile/job-information/salary`, {
|
|
288
|
+
headers: this.headers,
|
|
289
|
+
})
|
|
290
|
+
.pipe(
|
|
291
|
+
map(response => response?.ResponseData ?? null),
|
|
292
|
+
shareReplay(1),
|
|
293
|
+
catchError(error => {
|
|
294
|
+
this.jobInformationCacheService.clear();
|
|
295
|
+
return throwError(() => error);
|
|
296
|
+
}),
|
|
297
|
+
);
|
|
298
|
+
|
|
299
|
+
this.jobInformationCacheService.setSalaryDetails(baseUrl, request$);
|
|
300
|
+
return request$;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
getJobInformationServiceCharge(
|
|
304
|
+
baseUrl: string,
|
|
305
|
+
forceRefresh = false,
|
|
306
|
+
): Observable<JobInformationServiceCharge | null> {
|
|
307
|
+
if (!forceRefresh) {
|
|
308
|
+
const cachedRequest$ = this.jobInformationCacheService.getServiceChargeDetails(baseUrl);
|
|
309
|
+
if (cachedRequest$) {
|
|
310
|
+
return cachedRequest$;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
const request$ = this.http
|
|
315
|
+
.get<{ ResponseData: JobInformationServiceCharge }>(
|
|
316
|
+
`${baseUrl}/hr/widgets/me/profile/job-information/service-charge`,
|
|
317
|
+
{
|
|
318
|
+
headers: this.headers,
|
|
319
|
+
},
|
|
320
|
+
)
|
|
321
|
+
.pipe(
|
|
322
|
+
map(response => response?.ResponseData ?? null),
|
|
323
|
+
shareReplay(1),
|
|
324
|
+
catchError(error => {
|
|
325
|
+
this.jobInformationCacheService.clear();
|
|
326
|
+
return throwError(() => error);
|
|
327
|
+
}),
|
|
328
|
+
);
|
|
329
|
+
|
|
330
|
+
this.jobInformationCacheService.setServiceChargeDetails(baseUrl, request$);
|
|
331
|
+
return request$;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
clearPersonalInformationCache(): void {
|
|
335
|
+
this.personalInformationCacheService.clear();
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
clearJobInformationCache(): void {
|
|
339
|
+
this.jobInformationCacheService.clear();
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
getVacationSummary(baseUrl: string): Observable<any> {
|
|
343
|
+
const params = new HttpParams().set('ShowDirectSubordinatesOnly', 'false');
|
|
344
|
+
return this.http.get<any>(`${baseUrl}/hr/widgets/me/team/next-week-vacation-insights/summary`, {
|
|
345
|
+
params,
|
|
346
|
+
headers: this.headers,
|
|
347
|
+
});
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
getEntitlementsVacations(baseUrl: string, forceRefresh = false): Observable<EntitlementsVacation[] | null> {
|
|
351
|
+
if (!forceRefresh) {
|
|
352
|
+
const cachedRequest$ = this.entitlementsCacheService.getVacationDetails(baseUrl);
|
|
353
|
+
if (cachedRequest$) {
|
|
354
|
+
return cachedRequest$;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
const request$ = this.http
|
|
359
|
+
.get<{ ResponseData: EntitlementsVacation[] | null }>(`${baseUrl}/hr/widgets/me/profile/entitlements/vacations`, {
|
|
360
|
+
headers: this.headers,
|
|
361
|
+
})
|
|
362
|
+
.pipe(
|
|
363
|
+
map(response => response?.ResponseData ?? null),
|
|
364
|
+
shareReplay(1),
|
|
365
|
+
catchError(error => {
|
|
366
|
+
this.entitlementsCacheService.clear();
|
|
367
|
+
return throwError(() => error);
|
|
368
|
+
}),
|
|
369
|
+
);
|
|
370
|
+
|
|
371
|
+
this.entitlementsCacheService.setVacationDetails(baseUrl, request$);
|
|
372
|
+
return request$;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
getEntitlementsIndemnity(baseUrl: string, forceRefresh = false): Observable<EntitlementsIndemnity | null> {
|
|
376
|
+
if (!forceRefresh) {
|
|
377
|
+
const cachedRequest$ = this.entitlementsCacheService.getIndemnityDetails(baseUrl);
|
|
378
|
+
if (cachedRequest$) {
|
|
379
|
+
return cachedRequest$;
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
const request$ = this.http
|
|
384
|
+
.get<{ ResponseData: EntitlementsIndemnity | null }>(`${baseUrl}/hr/widgets/me/profile/entitlements/indemnity`, {
|
|
385
|
+
headers: this.headers,
|
|
386
|
+
})
|
|
387
|
+
.pipe(
|
|
388
|
+
map(response => response?.ResponseData ?? null),
|
|
389
|
+
shareReplay(1),
|
|
390
|
+
catchError(error => {
|
|
391
|
+
this.entitlementsCacheService.clear();
|
|
392
|
+
return throwError(() => error);
|
|
393
|
+
}),
|
|
394
|
+
);
|
|
395
|
+
|
|
396
|
+
this.entitlementsCacheService.setIndemnityDetails(baseUrl, request$);
|
|
397
|
+
return request$;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
getEntitlementsTicket(baseUrl: string, forceRefresh = false): Observable<EntitlementsTicket | null> {
|
|
401
|
+
if (!forceRefresh) {
|
|
402
|
+
const cachedRequest$ = this.entitlementsCacheService.getTicketDetails(baseUrl);
|
|
403
|
+
if (cachedRequest$) {
|
|
404
|
+
return cachedRequest$;
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
const request$ = this.http
|
|
409
|
+
.get<{ ResponseData: EntitlementsTicket | null }>(`${baseUrl}/hr/widgets/me/profile/entitlements/ticket`, {
|
|
410
|
+
headers: this.headers,
|
|
411
|
+
})
|
|
412
|
+
.pipe(
|
|
413
|
+
map(response => response?.ResponseData ?? null),
|
|
414
|
+
shareReplay(1),
|
|
415
|
+
catchError(error => {
|
|
416
|
+
this.entitlementsCacheService.clear();
|
|
417
|
+
return throwError(() => error);
|
|
418
|
+
}),
|
|
419
|
+
);
|
|
420
|
+
|
|
421
|
+
this.entitlementsCacheService.setTicketDetails(baseUrl, request$);
|
|
422
|
+
return request$;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
getEntitlementsMedicalInsurance(
|
|
426
|
+
baseUrl: string,
|
|
427
|
+
forceRefresh = false,
|
|
428
|
+
): Observable<EntitlementsMedicalInsurance | null> {
|
|
429
|
+
if (!forceRefresh) {
|
|
430
|
+
const cachedRequest$ = this.entitlementsCacheService.getMedicalInsuranceDetails(baseUrl);
|
|
431
|
+
if (cachedRequest$) {
|
|
432
|
+
return cachedRequest$;
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
const request$ = this.http
|
|
437
|
+
.get<{ ResponseData: EntitlementsMedicalInsurance | null }>(
|
|
438
|
+
`${baseUrl}/hr/widgets/me/profile/entitlements/medical-insurance`,
|
|
439
|
+
{
|
|
440
|
+
headers: this.headers,
|
|
441
|
+
},
|
|
442
|
+
)
|
|
443
|
+
.pipe(
|
|
444
|
+
map(response => response?.ResponseData ?? null),
|
|
445
|
+
shareReplay(1),
|
|
446
|
+
catchError(error => {
|
|
447
|
+
this.entitlementsCacheService.clear();
|
|
448
|
+
return throwError(() => error);
|
|
449
|
+
}),
|
|
450
|
+
);
|
|
451
|
+
|
|
452
|
+
this.entitlementsCacheService.setMedicalInsuranceDetails(baseUrl, request$);
|
|
453
|
+
return request$;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
getEntitlementsOvertime(baseUrl: string, forceRefresh = false): Observable<any> {
|
|
457
|
+
if (!forceRefresh) {
|
|
458
|
+
const cachedRequest$ = this.entitlementsCacheService.getOvertimeDetails(baseUrl);
|
|
459
|
+
if (cachedRequest$) {
|
|
460
|
+
return cachedRequest$;
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
const request$ = this.http
|
|
465
|
+
.get<any>(`${baseUrl}/hr/widgets/me/profile/entitlements/overtime`, {
|
|
466
|
+
headers: this.headers,
|
|
467
|
+
})
|
|
468
|
+
.pipe(
|
|
469
|
+
shareReplay(1),
|
|
470
|
+
catchError(error => {
|
|
471
|
+
this.entitlementsCacheService.clear();
|
|
472
|
+
return throwError(() => error);
|
|
473
|
+
}),
|
|
474
|
+
);
|
|
475
|
+
|
|
476
|
+
this.entitlementsCacheService.setOvertimeDetails(baseUrl, request$);
|
|
477
|
+
return request$;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
getEntitlementsSocialSecurity(baseUrl: string, forceRefresh = false): Observable<any> {
|
|
481
|
+
if (!forceRefresh) {
|
|
482
|
+
const cachedRequest$ = this.entitlementsCacheService.getSocialSecurityDetails(baseUrl);
|
|
483
|
+
if (cachedRequest$) {
|
|
484
|
+
return cachedRequest$;
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
const request$ = this.http
|
|
489
|
+
.get<any>(`${baseUrl}/hr/widgets/me/profile/entitlements/social-security`, {
|
|
490
|
+
headers: this.headers,
|
|
491
|
+
})
|
|
492
|
+
.pipe(
|
|
493
|
+
shareReplay(1),
|
|
494
|
+
catchError(error => {
|
|
495
|
+
this.entitlementsCacheService.clear();
|
|
496
|
+
return throwError(() => error);
|
|
497
|
+
}),
|
|
498
|
+
);
|
|
499
|
+
|
|
500
|
+
this.entitlementsCacheService.setSocialSecurityDetails(baseUrl, request$);
|
|
501
|
+
return request$;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
getEmployeeDegrees(baseUrl: string, forceRefresh = false): Observable<Degree[]> {
|
|
505
|
+
if (!forceRefresh) {
|
|
506
|
+
const cachedRequest$ = this.qualificationsCacheService.getDegrees(baseUrl);
|
|
507
|
+
if (cachedRequest$) {
|
|
508
|
+
return cachedRequest$;
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
const request$ = this.http
|
|
513
|
+
.get<{
|
|
514
|
+
ResponseData: Degree[];
|
|
515
|
+
}>(`${baseUrl}/hr/widgets/me/profile/qualifications/degrees`, { headers: this.headers })
|
|
516
|
+
.pipe(
|
|
517
|
+
map(response => response?.ResponseData ?? []),
|
|
518
|
+
shareReplay(1),
|
|
519
|
+
catchError(error => {
|
|
520
|
+
this.qualificationsCacheService.clear();
|
|
521
|
+
return throwError(() => error);
|
|
522
|
+
}),
|
|
523
|
+
);
|
|
524
|
+
|
|
525
|
+
this.qualificationsCacheService.setDegrees(baseUrl, request$);
|
|
526
|
+
|
|
527
|
+
return request$;
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
getEmployeeDependents(baseUrl: string, forceRefresh = false): Observable<Dependent[]> {
|
|
531
|
+
if (!forceRefresh) {
|
|
532
|
+
const cachedRequest$ = this.profileEmployeeDependentsCachService.getDependents(baseUrl);
|
|
533
|
+
if (cachedRequest$) {
|
|
534
|
+
return cachedRequest$;
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
const request$ = this.http
|
|
539
|
+
.get<{ ResponseData: Dependent[] }>(`${baseUrl}/hr/widgets/me/profile/dependents`, { headers: this.headers })
|
|
540
|
+
.pipe(
|
|
541
|
+
map(response => response?.ResponseData ?? []),
|
|
542
|
+
shareReplay(1),
|
|
543
|
+
catchError(error => {
|
|
544
|
+
this.profileEmployeeDependentsCachService.clear();
|
|
545
|
+
return throwError(() => error);
|
|
546
|
+
}),
|
|
547
|
+
);
|
|
548
|
+
|
|
549
|
+
this.profileEmployeeDependentsCachService.setDependents(baseUrl, request$);
|
|
550
|
+
|
|
551
|
+
return request$;
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
getEmployeeExperiences(baseUrl: string, forceRefresh = false): Observable<Experience[]> {
|
|
555
|
+
if (!forceRefresh) {
|
|
556
|
+
const cached = this.qualificationsCacheService.getExperiences(baseUrl);
|
|
557
|
+
if (cached) return cached;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
const request$ = this.http
|
|
561
|
+
.get<{
|
|
562
|
+
ResponseData: Experience[];
|
|
563
|
+
}>(`${baseUrl}/hr/widgets/me/profile/qualifications/experiences`, { headers: this.headers })
|
|
564
|
+
.pipe(
|
|
565
|
+
map(res => res?.ResponseData ?? []),
|
|
566
|
+
shareReplay(1),
|
|
567
|
+
catchError(error => {
|
|
568
|
+
this.qualificationsCacheService.clear();
|
|
569
|
+
return throwError(() => error);
|
|
570
|
+
}),
|
|
571
|
+
);
|
|
572
|
+
|
|
573
|
+
this.qualificationsCacheService.setExperiences(baseUrl, request$);
|
|
574
|
+
|
|
575
|
+
return request$;
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
getDependentDocuments(baseUrl: string, forceRefresh = false): Observable<DependentDocumentGroup[]> {
|
|
579
|
+
if (!forceRefresh) {
|
|
580
|
+
const cached$ = this.profileDocumentsCacheService.getDependentDocuments(baseUrl);
|
|
581
|
+
if (cached$) return cached$;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
const request$ = this.http
|
|
585
|
+
.get<{
|
|
586
|
+
ResponseData: DependentDocumentGroup[];
|
|
587
|
+
}>(`${baseUrl}/hr/widgets/me/profile/documents/dependents`, { headers: this.headers })
|
|
588
|
+
.pipe(
|
|
589
|
+
map(res => res?.ResponseData ?? []),
|
|
590
|
+
shareReplay(1),
|
|
591
|
+
catchError(error => {
|
|
592
|
+
this.profileDocumentsCacheService.clear();
|
|
593
|
+
return throwError(() => error);
|
|
594
|
+
}),
|
|
595
|
+
);
|
|
596
|
+
|
|
597
|
+
this.profileDocumentsCacheService.setDependentDocuments(baseUrl, request$);
|
|
598
|
+
|
|
599
|
+
return request$;
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
getPersonalDocuments(baseUrl: string, forceRefresh = false): Observable<DocumentRow[]> {
|
|
603
|
+
if (!forceRefresh) {
|
|
604
|
+
const cached$ = this.profileDocumentsCacheService.getPersonalDocuments(baseUrl);
|
|
605
|
+
if (cached$) return cached$;
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
const request$ = this.http
|
|
609
|
+
.get<{
|
|
610
|
+
ResponseData: DocumentRow[];
|
|
611
|
+
}>(`${baseUrl}/hr/widgets/me/profile/documents/personal`, { headers: this.headers })
|
|
612
|
+
.pipe(
|
|
613
|
+
map(res => res?.ResponseData ?? []),
|
|
614
|
+
shareReplay(1),
|
|
615
|
+
catchError(error => {
|
|
616
|
+
this.profileDocumentsCacheService.clear();
|
|
617
|
+
return throwError(() => error);
|
|
618
|
+
}),
|
|
619
|
+
);
|
|
620
|
+
|
|
621
|
+
this.profileDocumentsCacheService.setPersonalDocuments(baseUrl, request$);
|
|
622
|
+
return request$;
|
|
623
|
+
}
|
|
624
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component, input } from '@angular/core';
|
|
2
|
+
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
|
3
|
+
import { IconDefinition } from '@fortawesome/fontawesome-svg-core';
|
|
4
|
+
|
|
5
|
+
@Component({
|
|
6
|
+
selector: 'hr-card-header',
|
|
7
|
+
standalone: true,
|
|
8
|
+
imports: [FontAwesomeModule],
|
|
9
|
+
templateUrl: './card-header.component.html',
|
|
10
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
11
|
+
})
|
|
12
|
+
export class HRCardHeaderComponent {
|
|
13
|
+
readonly icon = input.required<IconDefinition>();
|
|
14
|
+
readonly title = input.required<string>();
|
|
15
|
+
readonly containerClass = input<string>('d-flex align-items-center mb-2');
|
|
16
|
+
readonly iconClass = input<string>('fs-6 text-primary pe-2');
|
|
17
|
+
readonly titleClass = input<string>('text-center table-header-lg fw-medium');
|
|
18
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<div [class]="legendContainerClass()">
|
|
2
|
+
<div [class]="legendRowClass()">
|
|
3
|
+
<div [class]="legendItemClass() + ' me-4'">
|
|
4
|
+
<div [class]="legendDotClass() + ' ' + publicHolidayDotClass()"></div>
|
|
5
|
+
<div [class]="legendLabelClass()">
|
|
6
|
+
<p>{{ 'PublicHoliday' | translate }}</p>
|
|
7
|
+
</div>
|
|
8
|
+
</div>
|
|
9
|
+
<div [class]="legendItemClass()">
|
|
10
|
+
<div [class]="legendDotClass() + ' ' + dayOffDotClass()"></div>
|
|
11
|
+
<div [class]="legendLabelClass()">
|
|
12
|
+
<p>{{ 'DayOff' | translate }}</p>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
@if (showEvents()) {
|
|
16
|
+
<div [class]="legendItemClass() + ' ms-4'">
|
|
17
|
+
<div [class]="legendDotClass() + ' ' + eventsDotClass()"></div>
|
|
18
|
+
<div [class]="legendLabelClass()">
|
|
19
|
+
<p>{{ 'Events' | translate }}</p>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
}
|
|
23
|
+
</div>
|
|
24
|
+
@if (showUpComingVacations()) {
|
|
25
|
+
<div [class]="vacationsContainerClass()">
|
|
26
|
+
<div [class]="vacationsItemClass()">
|
|
27
|
+
<fa-icon [icon]="squreCheckIcon" [class]="vacationsIconClass()"></fa-icon>
|
|
28
|
+
<div [class]="legendLabelClass()">
|
|
29
|
+
<p>{{ 'ScheduledVacations' | translate }}</p>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
}
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
<div [class]="calendarContainerClass()">
|
|
37
|
+
<dx-calendar
|
|
38
|
+
#calendar
|
|
39
|
+
[class]="calendarClass()"
|
|
40
|
+
[selectionMode]="'multiple'"
|
|
41
|
+
[cellTemplate]="customCellTemplate"
|
|
42
|
+
[showWeekNumbers]="false"
|
|
43
|
+
[min]="minDate()"
|
|
44
|
+
[max]="maxDate()"
|
|
45
|
+
(onValueChanged)="preventInteraction($event)"
|
|
46
|
+
></dx-calendar>
|
|
47
|
+
</div>
|