@skysoftware-co/bayan-hr-widgets-ui 1.0.19 → 1.0.21
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/fesm2022/skysoftware-co-bayan-hr-widgets-ui.mjs +208 -5
- package/fesm2022/skysoftware-co-bayan-hr-widgets-ui.mjs.map +1 -1
- package/lib/services/hr-self-widgets.service.d.ts +12 -2
- package/lib/shared/services/entitlements-cache.service.d.ts +22 -0
- package/lib/shared/services/qualifications-cache.service.d.ts +16 -0
- package/lib/shared/types/common.d.ts +64 -0
- package/package.json +1 -1
|
@@ -824,6 +824,63 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
824
824
|
}]
|
|
825
825
|
}] });
|
|
826
826
|
|
|
827
|
+
class EntitlementsCacheService {
|
|
828
|
+
baseUrl = '';
|
|
829
|
+
vacationDetails$ = null;
|
|
830
|
+
indemnityDetails$ = null;
|
|
831
|
+
ticketDetails$ = null;
|
|
832
|
+
medicalInsuranceDetails$ = null;
|
|
833
|
+
getVacationDetails(baseUrl) {
|
|
834
|
+
return this.baseUrl === baseUrl ? this.vacationDetails$ : null;
|
|
835
|
+
}
|
|
836
|
+
setVacationDetails(baseUrl, value) {
|
|
837
|
+
this.ensureBaseUrl(baseUrl);
|
|
838
|
+
this.vacationDetails$ = value;
|
|
839
|
+
}
|
|
840
|
+
getIndemnityDetails(baseUrl) {
|
|
841
|
+
return this.baseUrl === baseUrl ? this.indemnityDetails$ : null;
|
|
842
|
+
}
|
|
843
|
+
setIndemnityDetails(baseUrl, value) {
|
|
844
|
+
this.ensureBaseUrl(baseUrl);
|
|
845
|
+
this.indemnityDetails$ = value;
|
|
846
|
+
}
|
|
847
|
+
getTicketDetails(baseUrl) {
|
|
848
|
+
return this.baseUrl === baseUrl ? this.ticketDetails$ : null;
|
|
849
|
+
}
|
|
850
|
+
setTicketDetails(baseUrl, value) {
|
|
851
|
+
this.ensureBaseUrl(baseUrl);
|
|
852
|
+
this.ticketDetails$ = value;
|
|
853
|
+
}
|
|
854
|
+
getMedicalInsuranceDetails(baseUrl) {
|
|
855
|
+
return this.baseUrl === baseUrl ? this.medicalInsuranceDetails$ : null;
|
|
856
|
+
}
|
|
857
|
+
setMedicalInsuranceDetails(baseUrl, value) {
|
|
858
|
+
this.ensureBaseUrl(baseUrl);
|
|
859
|
+
this.medicalInsuranceDetails$ = value;
|
|
860
|
+
}
|
|
861
|
+
clear() {
|
|
862
|
+
this.baseUrl = '';
|
|
863
|
+
this.vacationDetails$ = null;
|
|
864
|
+
this.indemnityDetails$ = null;
|
|
865
|
+
this.ticketDetails$ = null;
|
|
866
|
+
this.medicalInsuranceDetails$ = null;
|
|
867
|
+
}
|
|
868
|
+
ensureBaseUrl(baseUrl) {
|
|
869
|
+
if (this.baseUrl && this.baseUrl !== baseUrl) {
|
|
870
|
+
this.clear();
|
|
871
|
+
}
|
|
872
|
+
this.baseUrl = baseUrl;
|
|
873
|
+
}
|
|
874
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: EntitlementsCacheService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
875
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: EntitlementsCacheService, providedIn: 'root' });
|
|
876
|
+
}
|
|
877
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: EntitlementsCacheService, decorators: [{
|
|
878
|
+
type: Injectable,
|
|
879
|
+
args: [{
|
|
880
|
+
providedIn: 'root'
|
|
881
|
+
}]
|
|
882
|
+
}] });
|
|
883
|
+
|
|
827
884
|
class JobInformationCacheService {
|
|
828
885
|
baseUrl = '';
|
|
829
886
|
mainDetails$ = null;
|
|
@@ -947,17 +1004,60 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
947
1004
|
}]
|
|
948
1005
|
}] });
|
|
949
1006
|
|
|
1007
|
+
class QualificationsCacheService {
|
|
1008
|
+
baseUrl = '';
|
|
1009
|
+
degrees$ = null;
|
|
1010
|
+
experiences$ = null;
|
|
1011
|
+
getDegrees(baseUrl) {
|
|
1012
|
+
return this.baseUrl === baseUrl ? this.degrees$ : null;
|
|
1013
|
+
}
|
|
1014
|
+
setDegrees(baseUrl, value) {
|
|
1015
|
+
this.ensureBaseUrl(baseUrl);
|
|
1016
|
+
this.degrees$ = value;
|
|
1017
|
+
}
|
|
1018
|
+
getExperiences(baseUrl) {
|
|
1019
|
+
return this.baseUrl === baseUrl ? this.experiences$ : null;
|
|
1020
|
+
}
|
|
1021
|
+
setExperiences(baseUrl, value) {
|
|
1022
|
+
this.ensureBaseUrl(baseUrl);
|
|
1023
|
+
this.experiences$ = value;
|
|
1024
|
+
}
|
|
1025
|
+
clear() {
|
|
1026
|
+
this.baseUrl = '';
|
|
1027
|
+
this.degrees$ = null;
|
|
1028
|
+
this.experiences$ = null;
|
|
1029
|
+
}
|
|
1030
|
+
ensureBaseUrl(baseUrl) {
|
|
1031
|
+
if (this.baseUrl && this.baseUrl !== baseUrl) {
|
|
1032
|
+
this.clear();
|
|
1033
|
+
}
|
|
1034
|
+
this.baseUrl = baseUrl;
|
|
1035
|
+
}
|
|
1036
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: QualificationsCacheService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1037
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: QualificationsCacheService, providedIn: 'root' });
|
|
1038
|
+
}
|
|
1039
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: QualificationsCacheService, decorators: [{
|
|
1040
|
+
type: Injectable,
|
|
1041
|
+
args: [{
|
|
1042
|
+
providedIn: 'root'
|
|
1043
|
+
}]
|
|
1044
|
+
}] });
|
|
1045
|
+
|
|
950
1046
|
class HRSelfWidgetsService {
|
|
951
1047
|
http;
|
|
952
1048
|
bankInformationCacheService;
|
|
1049
|
+
entitlementsCacheService;
|
|
953
1050
|
jobInformationCacheService;
|
|
954
1051
|
personalInformationCacheService;
|
|
1052
|
+
qualificationsCacheService;
|
|
955
1053
|
headers = { 'api-version': '1' };
|
|
956
|
-
constructor(http, bankInformationCacheService, jobInformationCacheService, personalInformationCacheService) {
|
|
1054
|
+
constructor(http, bankInformationCacheService, entitlementsCacheService, jobInformationCacheService, personalInformationCacheService, qualificationsCacheService) {
|
|
957
1055
|
this.http = http;
|
|
958
1056
|
this.bankInformationCacheService = bankInformationCacheService;
|
|
1057
|
+
this.entitlementsCacheService = entitlementsCacheService;
|
|
959
1058
|
this.jobInformationCacheService = jobInformationCacheService;
|
|
960
1059
|
this.personalInformationCacheService = personalInformationCacheService;
|
|
1060
|
+
this.qualificationsCacheService = qualificationsCacheService;
|
|
961
1061
|
}
|
|
962
1062
|
getMainDetails(baseUrl) {
|
|
963
1063
|
return this.http.get(`${baseUrl}/hr/widgets/me/main-details`, {
|
|
@@ -1174,7 +1274,110 @@ class HRSelfWidgetsService {
|
|
|
1174
1274
|
headers: this.headers
|
|
1175
1275
|
});
|
|
1176
1276
|
}
|
|
1177
|
-
|
|
1277
|
+
getEntitlementsVacations(baseUrl, forceRefresh = false) {
|
|
1278
|
+
if (!forceRefresh) {
|
|
1279
|
+
const cachedRequest$ = this.entitlementsCacheService.getVacationDetails(baseUrl);
|
|
1280
|
+
if (cachedRequest$) {
|
|
1281
|
+
return cachedRequest$;
|
|
1282
|
+
}
|
|
1283
|
+
}
|
|
1284
|
+
const request$ = this.http
|
|
1285
|
+
.get(`${baseUrl}/hr/widgets/me/profile/entitlements/vacations`, {
|
|
1286
|
+
headers: this.headers
|
|
1287
|
+
})
|
|
1288
|
+
.pipe(map((response) => response?.ResponseData ?? null), shareReplay(1), catchError((error) => {
|
|
1289
|
+
this.entitlementsCacheService.clear();
|
|
1290
|
+
return throwError(() => error);
|
|
1291
|
+
}));
|
|
1292
|
+
this.entitlementsCacheService.setVacationDetails(baseUrl, request$);
|
|
1293
|
+
return request$;
|
|
1294
|
+
}
|
|
1295
|
+
getEntitlementsIndemnity(baseUrl, forceRefresh = false) {
|
|
1296
|
+
if (!forceRefresh) {
|
|
1297
|
+
const cachedRequest$ = this.entitlementsCacheService.getIndemnityDetails(baseUrl);
|
|
1298
|
+
if (cachedRequest$) {
|
|
1299
|
+
return cachedRequest$;
|
|
1300
|
+
}
|
|
1301
|
+
}
|
|
1302
|
+
const request$ = this.http
|
|
1303
|
+
.get(`${baseUrl}/hr/widgets/me/profile/entitlements/indemnity`, {
|
|
1304
|
+
headers: this.headers
|
|
1305
|
+
})
|
|
1306
|
+
.pipe(map((response) => response?.ResponseData ?? null), shareReplay(1), catchError((error) => {
|
|
1307
|
+
this.entitlementsCacheService.clear();
|
|
1308
|
+
return throwError(() => error);
|
|
1309
|
+
}));
|
|
1310
|
+
this.entitlementsCacheService.setIndemnityDetails(baseUrl, request$);
|
|
1311
|
+
return request$;
|
|
1312
|
+
}
|
|
1313
|
+
getEntitlementsTicket(baseUrl, forceRefresh = false) {
|
|
1314
|
+
if (!forceRefresh) {
|
|
1315
|
+
const cachedRequest$ = this.entitlementsCacheService.getTicketDetails(baseUrl);
|
|
1316
|
+
if (cachedRequest$) {
|
|
1317
|
+
return cachedRequest$;
|
|
1318
|
+
}
|
|
1319
|
+
}
|
|
1320
|
+
const request$ = this.http
|
|
1321
|
+
.get(`${baseUrl}/hr/widgets/me/profile/entitlements/ticket`, {
|
|
1322
|
+
headers: this.headers
|
|
1323
|
+
})
|
|
1324
|
+
.pipe(map((response) => response?.ResponseData ?? null), shareReplay(1), catchError((error) => {
|
|
1325
|
+
this.entitlementsCacheService.clear();
|
|
1326
|
+
return throwError(() => error);
|
|
1327
|
+
}));
|
|
1328
|
+
this.entitlementsCacheService.setTicketDetails(baseUrl, request$);
|
|
1329
|
+
return request$;
|
|
1330
|
+
}
|
|
1331
|
+
getEntitlementsMedicalInsurance(baseUrl, forceRefresh = false) {
|
|
1332
|
+
if (!forceRefresh) {
|
|
1333
|
+
const cachedRequest$ = this.entitlementsCacheService.getMedicalInsuranceDetails(baseUrl);
|
|
1334
|
+
if (cachedRequest$) {
|
|
1335
|
+
return cachedRequest$;
|
|
1336
|
+
}
|
|
1337
|
+
}
|
|
1338
|
+
const request$ = this.http
|
|
1339
|
+
.get(`${baseUrl}/hr/widgets/me/profile/entitlements/medical-insurance`, {
|
|
1340
|
+
headers: this.headers
|
|
1341
|
+
})
|
|
1342
|
+
.pipe(map((response) => response?.ResponseData ?? null), shareReplay(1), catchError((error) => {
|
|
1343
|
+
this.entitlementsCacheService.clear();
|
|
1344
|
+
return throwError(() => error);
|
|
1345
|
+
}));
|
|
1346
|
+
this.entitlementsCacheService.setMedicalInsuranceDetails(baseUrl, request$);
|
|
1347
|
+
return request$;
|
|
1348
|
+
}
|
|
1349
|
+
getEmployeeDegrees(baseUrl, forceRefresh = false) {
|
|
1350
|
+
if (!forceRefresh) {
|
|
1351
|
+
const cachedRequest$ = this.qualificationsCacheService.getDegrees(baseUrl);
|
|
1352
|
+
if (cachedRequest$) {
|
|
1353
|
+
return cachedRequest$;
|
|
1354
|
+
}
|
|
1355
|
+
}
|
|
1356
|
+
const request$ = this.http
|
|
1357
|
+
.get(`${baseUrl}/hr/widgets/me/profile/personal-information/degrees`, { headers: this.headers })
|
|
1358
|
+
.pipe(map((response) => response?.ResponseData ?? []), shareReplay(1), catchError((error) => {
|
|
1359
|
+
this.qualificationsCacheService.clear();
|
|
1360
|
+
return throwError(() => error);
|
|
1361
|
+
}));
|
|
1362
|
+
this.qualificationsCacheService.setDegrees(baseUrl, request$);
|
|
1363
|
+
return request$;
|
|
1364
|
+
}
|
|
1365
|
+
getEmployeeExperiences(baseUrl, forceRefresh = false) {
|
|
1366
|
+
if (!forceRefresh) {
|
|
1367
|
+
const cached = this.qualificationsCacheService.getExperiences(baseUrl);
|
|
1368
|
+
if (cached)
|
|
1369
|
+
return cached;
|
|
1370
|
+
}
|
|
1371
|
+
const request$ = this.http
|
|
1372
|
+
.get(`${baseUrl}/hr/widgets/me/profile/qualifications/experiences`, { headers: this.headers })
|
|
1373
|
+
.pipe(map(res => res?.ResponseData ?? []), shareReplay(1), catchError((error) => {
|
|
1374
|
+
this.qualificationsCacheService.clear();
|
|
1375
|
+
return throwError(() => error);
|
|
1376
|
+
}));
|
|
1377
|
+
this.qualificationsCacheService.setExperiences(baseUrl, request$);
|
|
1378
|
+
return request$;
|
|
1379
|
+
}
|
|
1380
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: HRSelfWidgetsService, deps: [{ token: i1.HttpClient }, { token: BankInformationCacheService }, { token: EntitlementsCacheService }, { token: JobInformationCacheService }, { token: PersonalInformationCacheService }, { token: QualificationsCacheService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1178
1381
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: HRSelfWidgetsService, providedIn: 'root' });
|
|
1179
1382
|
}
|
|
1180
1383
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: HRSelfWidgetsService, decorators: [{
|
|
@@ -1182,7 +1385,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
1182
1385
|
args: [{
|
|
1183
1386
|
providedIn: 'root'
|
|
1184
1387
|
}]
|
|
1185
|
-
}], ctorParameters: () => [{ type: i1.HttpClient }, { type: BankInformationCacheService }, { type: JobInformationCacheService }, { type: PersonalInformationCacheService }] });
|
|
1388
|
+
}], ctorParameters: () => [{ type: i1.HttpClient }, { type: BankInformationCacheService }, { type: EntitlementsCacheService }, { type: JobInformationCacheService }, { type: PersonalInformationCacheService }, { type: QualificationsCacheService }] });
|
|
1186
1389
|
|
|
1187
1390
|
class HRConstantsService {
|
|
1188
1391
|
defaultVacationBalanceColor = '#727070';
|
|
@@ -2251,11 +2454,11 @@ class HRInfoFieldComponent {
|
|
|
2251
2454
|
valueClass = 'fs-14 fw-medium';
|
|
2252
2455
|
fallbackValue = '—';
|
|
2253
2456
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: HRInfoFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2254
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.20", type: HRInfoFieldComponent, isStandalone: true, selector: "hr-info-field", inputs: { labelKey: "labelKey", value: "value", labelClass: "labelClass", valueClass: "valueClass", fallbackValue: "fallbackValue" }, ngImport: i0, template: "<div [ngClass]=\"labelClass\">{{labelKey | HRTranslate}}</div>\r\n<div [ngClass]=\"valueClass\">{{value || fallbackValue}}</div>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: HRTranslatePipe, name: "HRTranslate" }] });
|
|
2457
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.20", type: HRInfoFieldComponent, isStandalone: true, selector: "hr-info-field", inputs: { labelKey: "labelKey", value: "value", labelClass: "labelClass", valueClass: "valueClass", fallbackValue: "fallbackValue" }, ngImport: i0, template: "<div [ngClass]=\"labelClass\">{{labelKey | HRTranslate}}</div>\r\n<div [ngClass]=\"valueClass\" [title]=\"value|| fallbackValue\">{{value || fallbackValue}}</div>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: HRTranslatePipe, name: "HRTranslate" }] });
|
|
2255
2458
|
}
|
|
2256
2459
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: HRInfoFieldComponent, decorators: [{
|
|
2257
2460
|
type: Component,
|
|
2258
|
-
args: [{ selector: 'hr-info-field', standalone: true, imports: [CommonModule, HRTranslatePipe], template: "<div [ngClass]=\"labelClass\">{{labelKey | HRTranslate}}</div>\r\n<div [ngClass]=\"valueClass\">{{value || fallbackValue}}</div>\r\n" }]
|
|
2461
|
+
args: [{ selector: 'hr-info-field', standalone: true, imports: [CommonModule, HRTranslatePipe], template: "<div [ngClass]=\"labelClass\">{{labelKey | HRTranslate}}</div>\r\n<div [ngClass]=\"valueClass\" [title]=\"value|| fallbackValue\">{{value || fallbackValue}}</div>\r\n" }]
|
|
2259
2462
|
}], propDecorators: { labelKey: [{
|
|
2260
2463
|
type: Input,
|
|
2261
2464
|
args: [{ required: true }]
|