@acorex/connectivity 20.3.0-next.21 → 20.3.0-next.23
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/acorex-connectivity-mock.mjs +159 -64
- package/fesm2022/acorex-connectivity-mock.mjs.map +1 -1
- package/mock/index.d.ts +14 -0
- package/package.json +6 -6
- package/fesm2022/acorex-connectivity-mock-employee-structure.queries-CFwYZ_sW.mjs +0 -66
- package/fesm2022/acorex-connectivity-mock-employee-structure.queries-CFwYZ_sW.mjs.map +0 -1
|
@@ -28,7 +28,7 @@ import { provideQuerySetups, AXPCommandService, provideCommandSetups, AXPQuerySe
|
|
|
28
28
|
import { AXMDistributionServiceImpl, AXMDocumentService, AXMDistributionInteractionService, RootConfig as RootConfig$7, AXMFolderServiceImpl, AXMDocumentServiceImpl, AXMReviewService, AXMReviewServiceImpl, AXMDistributionInteractionServiceImpl, AXMFolderService, AXMDistributionService } from '@acorex/modules/document-management';
|
|
29
29
|
import { AXDataSource } from '@acorex/cdk/common';
|
|
30
30
|
import { AXPWidgetsCatalog } from '@acorex/platform/layout/widget-core';
|
|
31
|
-
import { RootConfig as RootConfig$9 } from '@acorex/modules/human-capital-management';
|
|
31
|
+
import { RootConfig as RootConfig$9, AXMHumanCapitalManagementEmployeeSkillEntityService, AXMHumanCapitalManagementSkillLevelEntityService } from '@acorex/modules/human-capital-management';
|
|
32
32
|
import { RootConfig as RootConfig$a } from '@acorex/modules/locale-management';
|
|
33
33
|
import { AXP_REPORT_CATEGORY_PROVIDER, AXP_REPORT_DEFINITION_PROVIDER, RootConfig as RootConfig$j, AXPReportDefinitionService } from '@acorex/modules/report-management';
|
|
34
34
|
import { AXPWidgetsList } from '@acorex/modules/common';
|
|
@@ -21219,12 +21219,8 @@ const EMPLOYEE_SKILLS_REPORT = {
|
|
|
21219
21219
|
options: {
|
|
21220
21220
|
valueField: 'id',
|
|
21221
21221
|
textField: 'title',
|
|
21222
|
-
dataSource:
|
|
21223
|
-
|
|
21224
|
-
{
|
|
21225
|
-
rule: 'required',
|
|
21226
|
-
},
|
|
21227
|
-
],
|
|
21222
|
+
dataSource: 'skills',
|
|
21223
|
+
//multiple: true,
|
|
21228
21224
|
},
|
|
21229
21225
|
},
|
|
21230
21226
|
},
|
|
@@ -21237,7 +21233,8 @@ const EMPLOYEE_SKILLS_REPORT = {
|
|
|
21237
21233
|
options: {
|
|
21238
21234
|
valueField: 'id',
|
|
21239
21235
|
textField: 'title',
|
|
21240
|
-
dataSource:
|
|
21236
|
+
dataSource: 'skill-levels',
|
|
21237
|
+
//multiple: true,
|
|
21241
21238
|
},
|
|
21242
21239
|
},
|
|
21243
21240
|
},
|
|
@@ -21246,7 +21243,10 @@ const EMPLOYEE_SKILLS_REPORT = {
|
|
|
21246
21243
|
title: 'Min Years',
|
|
21247
21244
|
widget: {
|
|
21248
21245
|
type: AXPWidgetsList.Editors.NumberBox,
|
|
21249
|
-
options: {
|
|
21246
|
+
options: {
|
|
21247
|
+
minValue: 0,
|
|
21248
|
+
maxValue: 50,
|
|
21249
|
+
},
|
|
21250
21250
|
},
|
|
21251
21251
|
},
|
|
21252
21252
|
{
|
|
@@ -21361,6 +21361,28 @@ const EMPLOYEE_SKILLS_REPORT = {
|
|
|
21361
21361
|
dataSource: {
|
|
21362
21362
|
type: 'query',
|
|
21363
21363
|
name: 'reports.employee-skills.skill-percentages',
|
|
21364
|
+
inputs: [
|
|
21365
|
+
{
|
|
21366
|
+
parameterKey: 'skillId',
|
|
21367
|
+
bindTo: 'skillId',
|
|
21368
|
+
},
|
|
21369
|
+
{
|
|
21370
|
+
parameterKey: 'levelId',
|
|
21371
|
+
bindTo: 'levelId',
|
|
21372
|
+
},
|
|
21373
|
+
{
|
|
21374
|
+
parameterKey: 'minYears',
|
|
21375
|
+
bindTo: 'minYears',
|
|
21376
|
+
},
|
|
21377
|
+
{
|
|
21378
|
+
parameterKey: 'startDate',
|
|
21379
|
+
bindTo: 'startDate',
|
|
21380
|
+
},
|
|
21381
|
+
{
|
|
21382
|
+
parameterKey: 'endDate',
|
|
21383
|
+
bindTo: 'endDate',
|
|
21384
|
+
},
|
|
21385
|
+
]
|
|
21364
21386
|
},
|
|
21365
21387
|
export: { ...BASE_EXPORT_OPTIONS$1 },
|
|
21366
21388
|
},
|
|
@@ -21386,6 +21408,28 @@ const EMPLOYEE_SKILLS_REPORT = {
|
|
|
21386
21408
|
dataSource: {
|
|
21387
21409
|
type: 'query',
|
|
21388
21410
|
name: 'reports.employee-skills.level-percentages',
|
|
21411
|
+
inputs: [
|
|
21412
|
+
{
|
|
21413
|
+
parameterKey: 'skillId',
|
|
21414
|
+
bindTo: 'skillId',
|
|
21415
|
+
},
|
|
21416
|
+
{
|
|
21417
|
+
parameterKey: 'levelId',
|
|
21418
|
+
bindTo: 'levelId',
|
|
21419
|
+
},
|
|
21420
|
+
{
|
|
21421
|
+
parameterKey: 'minYears',
|
|
21422
|
+
bindTo: 'minYears',
|
|
21423
|
+
},
|
|
21424
|
+
{
|
|
21425
|
+
parameterKey: 'startDate',
|
|
21426
|
+
bindTo: 'startDate',
|
|
21427
|
+
},
|
|
21428
|
+
{
|
|
21429
|
+
parameterKey: 'endDate',
|
|
21430
|
+
bindTo: 'endDate',
|
|
21431
|
+
},
|
|
21432
|
+
]
|
|
21389
21433
|
},
|
|
21390
21434
|
export: { ...BASE_EXPORT_OPTIONS$1 },
|
|
21391
21435
|
},
|
|
@@ -21415,6 +21459,28 @@ const EMPLOYEE_SKILLS_REPORT = {
|
|
|
21415
21459
|
dataSource: {
|
|
21416
21460
|
type: 'query',
|
|
21417
21461
|
name: 'reports.employee-skills.levels',
|
|
21462
|
+
inputs: [
|
|
21463
|
+
{
|
|
21464
|
+
parameterKey: 'skillId',
|
|
21465
|
+
bindTo: 'skillId',
|
|
21466
|
+
},
|
|
21467
|
+
{
|
|
21468
|
+
parameterKey: 'levelId',
|
|
21469
|
+
bindTo: 'levelId',
|
|
21470
|
+
},
|
|
21471
|
+
{
|
|
21472
|
+
parameterKey: 'minYears',
|
|
21473
|
+
bindTo: 'minYears',
|
|
21474
|
+
},
|
|
21475
|
+
{
|
|
21476
|
+
parameterKey: 'startDate',
|
|
21477
|
+
bindTo: 'startDate',
|
|
21478
|
+
},
|
|
21479
|
+
{
|
|
21480
|
+
parameterKey: 'endDate',
|
|
21481
|
+
bindTo: 'endDate',
|
|
21482
|
+
},
|
|
21483
|
+
]
|
|
21418
21484
|
},
|
|
21419
21485
|
export: { ...BASE_EXPORT_OPTIONS$1 },
|
|
21420
21486
|
},
|
|
@@ -21535,27 +21601,6 @@ class AXCHumanCapitalManagementMockModule {
|
|
|
21535
21601
|
key: 'reports.employee-skills.level-percentages',
|
|
21536
21602
|
loader: () => Promise.resolve().then(function () { return employeeSkills_queries; }).then((m) => m.AXQEmployeeSkillsLevelPercentagesQuery),
|
|
21537
21603
|
},
|
|
21538
|
-
// structure/manager/position helpers (placeholders for now)
|
|
21539
|
-
{
|
|
21540
|
-
key: 'employee.active-position',
|
|
21541
|
-
loader: () => import('./acorex-connectivity-mock-employee-structure.queries-CFwYZ_sW.mjs').then((m) => m.AXQEmployeeActivePositionQuery),
|
|
21542
|
-
},
|
|
21543
|
-
{
|
|
21544
|
-
key: 'employee.direct-manager',
|
|
21545
|
-
loader: () => import('./acorex-connectivity-mock-employee-structure.queries-CFwYZ_sW.mjs').then((m) => m.AXQEmployeeDirectManagerQuery),
|
|
21546
|
-
},
|
|
21547
|
-
{
|
|
21548
|
-
key: 'department.manager',
|
|
21549
|
-
loader: () => import('./acorex-connectivity-mock-employee-structure.queries-CFwYZ_sW.mjs').then((m) => m.AXQDepartmentManagerQuery),
|
|
21550
|
-
},
|
|
21551
|
-
{
|
|
21552
|
-
key: 'division.manager',
|
|
21553
|
-
loader: () => import('./acorex-connectivity-mock-employee-structure.queries-CFwYZ_sW.mjs').then((m) => m.AXQDivisionManagerQuery),
|
|
21554
|
-
},
|
|
21555
|
-
{
|
|
21556
|
-
key: 'branch.manager',
|
|
21557
|
-
loader: () => import('./acorex-connectivity-mock-employee-structure.queries-CFwYZ_sW.mjs').then((m) => m.AXQBranchManagerQuery),
|
|
21558
|
-
},
|
|
21559
21604
|
]),
|
|
21560
21605
|
] }); }
|
|
21561
21606
|
}
|
|
@@ -21599,51 +21644,39 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImpor
|
|
|
21599
21644
|
key: 'reports.employee-skills.level-percentages',
|
|
21600
21645
|
loader: () => Promise.resolve().then(function () { return employeeSkills_queries; }).then((m) => m.AXQEmployeeSkillsLevelPercentagesQuery),
|
|
21601
21646
|
},
|
|
21602
|
-
// structure/manager/position helpers (placeholders for now)
|
|
21603
|
-
{
|
|
21604
|
-
key: 'employee.active-position',
|
|
21605
|
-
loader: () => import('./acorex-connectivity-mock-employee-structure.queries-CFwYZ_sW.mjs').then((m) => m.AXQEmployeeActivePositionQuery),
|
|
21606
|
-
},
|
|
21607
|
-
{
|
|
21608
|
-
key: 'employee.direct-manager',
|
|
21609
|
-
loader: () => import('./acorex-connectivity-mock-employee-structure.queries-CFwYZ_sW.mjs').then((m) => m.AXQEmployeeDirectManagerQuery),
|
|
21610
|
-
},
|
|
21611
|
-
{
|
|
21612
|
-
key: 'department.manager',
|
|
21613
|
-
loader: () => import('./acorex-connectivity-mock-employee-structure.queries-CFwYZ_sW.mjs').then((m) => m.AXQDepartmentManagerQuery),
|
|
21614
|
-
},
|
|
21615
|
-
{
|
|
21616
|
-
key: 'division.manager',
|
|
21617
|
-
loader: () => import('./acorex-connectivity-mock-employee-structure.queries-CFwYZ_sW.mjs').then((m) => m.AXQDivisionManagerQuery),
|
|
21618
|
-
},
|
|
21619
|
-
{
|
|
21620
|
-
key: 'branch.manager',
|
|
21621
|
-
loader: () => import('./acorex-connectivity-mock-employee-structure.queries-CFwYZ_sW.mjs').then((m) => m.AXQBranchManagerQuery),
|
|
21622
|
-
},
|
|
21623
21647
|
]),
|
|
21624
21648
|
],
|
|
21625
21649
|
}]
|
|
21626
21650
|
}] });
|
|
21627
21651
|
|
|
21628
21652
|
class AXQEmployeeSkillsListQuery {
|
|
21653
|
+
constructor() {
|
|
21654
|
+
this.employeeSkillService = inject(AXMHumanCapitalManagementEmployeeSkillEntityService);
|
|
21655
|
+
this.skillLevelService = inject(AXMHumanCapitalManagementSkillLevelEntityService);
|
|
21656
|
+
}
|
|
21629
21657
|
async fetch(input) {
|
|
21630
21658
|
const { skillId, levelId, minYears, startDate, endDate, skip = 0, take = 10 } = input ?? {};
|
|
21631
21659
|
const sDate = startDate ? new Date(startDate) : undefined;
|
|
21632
21660
|
const eDate = endDate ? new Date(endDate) : undefined;
|
|
21633
|
-
|
|
21661
|
+
// Load data from entity service
|
|
21662
|
+
const response = await this.employeeSkillService.query();
|
|
21663
|
+
const skillLevelsResponse = await this.skillLevelService.query();
|
|
21664
|
+
const skillLevels = skillLevelsResponse.items;
|
|
21665
|
+
let data = response.items.map((r) => ({
|
|
21634
21666
|
id: r.id,
|
|
21635
21667
|
employeeId: r.employeeId,
|
|
21636
21668
|
employeeName: r.employee?.party?.displayName,
|
|
21637
21669
|
skillId: r.skillId,
|
|
21638
21670
|
skillTitle: r.skill?.title ?? r.skillId,
|
|
21639
21671
|
level: r.level?.title ?? r.levelId,
|
|
21672
|
+
levelId: r.levelId,
|
|
21640
21673
|
yearsOfExperience: r.yearsOfExperience ?? 0,
|
|
21641
21674
|
lastUsedDate: r.lastUsedDate,
|
|
21642
21675
|
}));
|
|
21643
21676
|
if (skillId)
|
|
21644
21677
|
data = data.filter((x) => x.skillId === skillId);
|
|
21645
21678
|
if (levelId)
|
|
21646
|
-
data = data.filter((x) => x.level === (
|
|
21679
|
+
data = data.filter((x) => x.levelId === levelId || x.level === (skillLevels.find(l => l.id === levelId)?.title ?? levelId));
|
|
21647
21680
|
if (minYears != null)
|
|
21648
21681
|
data = data.filter((x) => (x.yearsOfExperience ?? 0) >= Number(minYears));
|
|
21649
21682
|
if (sDate)
|
|
@@ -21664,15 +21697,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImpor
|
|
|
21664
21697
|
}]
|
|
21665
21698
|
}] });
|
|
21666
21699
|
class AXQEmployeeSkillsStatsQuery {
|
|
21700
|
+
constructor() {
|
|
21701
|
+
this.employeeSkillService = inject(AXMHumanCapitalManagementEmployeeSkillEntityService);
|
|
21702
|
+
}
|
|
21667
21703
|
async fetch(input) {
|
|
21668
|
-
const { skillId, levelId, minYears } = input ?? {};
|
|
21669
|
-
|
|
21704
|
+
const { skillId, levelId, minYears, startDate, endDate } = input ?? {};
|
|
21705
|
+
const sDate = startDate ? new Date(startDate) : undefined;
|
|
21706
|
+
const eDate = endDate ? new Date(endDate) : undefined;
|
|
21707
|
+
// Load data from entity service
|
|
21708
|
+
const response = await this.employeeSkillService.query();
|
|
21709
|
+
let data = response.items;
|
|
21710
|
+
// Apply filters
|
|
21670
21711
|
if (skillId)
|
|
21671
21712
|
data = data.filter((x) => x.skillId === skillId);
|
|
21672
21713
|
if (levelId)
|
|
21673
21714
|
data = data.filter((x) => x.levelId === levelId);
|
|
21674
21715
|
if (minYears != null)
|
|
21675
21716
|
data = data.filter((x) => (x.yearsOfExperience ?? 0) >= Number(minYears));
|
|
21717
|
+
if (sDate)
|
|
21718
|
+
data = data.filter((x) => x.lastUsedDate && new Date(x.lastUsedDate) >= sDate);
|
|
21719
|
+
if (eDate)
|
|
21720
|
+
data = data.filter((x) => x.lastUsedDate && new Date(x.lastUsedDate) <= eDate);
|
|
21676
21721
|
const grouped = data.reduce((acc, cur) => {
|
|
21677
21722
|
const key = cur.skill?.title ?? cur.skillId;
|
|
21678
21723
|
acc[key] = (acc[key] ?? 0) + 1;
|
|
@@ -21690,14 +21735,30 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImpor
|
|
|
21690
21735
|
}]
|
|
21691
21736
|
}] });
|
|
21692
21737
|
class AXQEmployeeSkillsLevelsQuery {
|
|
21738
|
+
constructor() {
|
|
21739
|
+
this.employeeSkillService = inject(AXMHumanCapitalManagementEmployeeSkillEntityService);
|
|
21740
|
+
this.skillLevelService = inject(AXMHumanCapitalManagementSkillLevelEntityService);
|
|
21741
|
+
}
|
|
21693
21742
|
async fetch(input) {
|
|
21694
|
-
const { skillId, minYears } = input ?? {};
|
|
21695
|
-
|
|
21743
|
+
const { skillId, levelId, minYears, startDate, endDate } = input ?? {};
|
|
21744
|
+
const sDate = startDate ? new Date(startDate) : undefined;
|
|
21745
|
+
const eDate = endDate ? new Date(endDate) : undefined;
|
|
21746
|
+
// Load data from entity services
|
|
21747
|
+
const response = await this.employeeSkillService.query();
|
|
21748
|
+
let data = response.items;
|
|
21749
|
+
const skillLevelsResponse = await this.skillLevelService.query();
|
|
21750
|
+
const levels = skillLevelsResponse.items.map(l => ({ id: l.id, title: l.title }));
|
|
21751
|
+
// Apply filters
|
|
21696
21752
|
if (skillId)
|
|
21697
21753
|
data = data.filter((x) => x.skillId === skillId);
|
|
21754
|
+
if (levelId)
|
|
21755
|
+
data = data.filter((x) => x.levelId === levelId);
|
|
21698
21756
|
if (minYears != null)
|
|
21699
21757
|
data = data.filter((x) => (x.yearsOfExperience ?? 0) >= Number(minYears));
|
|
21700
|
-
|
|
21758
|
+
if (sDate)
|
|
21759
|
+
data = data.filter((x) => x.lastUsedDate && new Date(x.lastUsedDate) >= sDate);
|
|
21760
|
+
if (eDate)
|
|
21761
|
+
data = data.filter((x) => x.lastUsedDate && new Date(x.lastUsedDate) <= eDate);
|
|
21701
21762
|
const grouped = data.reduce((acc, cur) => {
|
|
21702
21763
|
const key = cur.levelId && levels.find((x) => x.id === cur.levelId)?.title || 'Unknown';
|
|
21703
21764
|
acc[key] = (acc[key] ?? 0) + 1;
|
|
@@ -21717,11 +21778,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImpor
|
|
|
21717
21778
|
}]
|
|
21718
21779
|
}] });
|
|
21719
21780
|
class AXQEmployeeSkillsTrendQuery {
|
|
21781
|
+
constructor() {
|
|
21782
|
+
this.employeeSkillService = inject(AXMHumanCapitalManagementEmployeeSkillEntityService);
|
|
21783
|
+
}
|
|
21720
21784
|
async fetch(input) {
|
|
21721
21785
|
const { startDate, endDate, skillId, levelId } = input ?? {};
|
|
21722
21786
|
const sDate = startDate ? new Date(startDate) : undefined;
|
|
21723
21787
|
const eDate = endDate ? new Date(endDate) : undefined;
|
|
21724
|
-
|
|
21788
|
+
// Load data from entity service
|
|
21789
|
+
const response = await this.employeeSkillService.query();
|
|
21790
|
+
// Apply filters
|
|
21791
|
+
let data = response.items
|
|
21725
21792
|
.filter((x) => (skillId ? x.skillId === skillId : true))
|
|
21726
21793
|
.filter((x) => (levelId ? x.levelId === levelId : true))
|
|
21727
21794
|
.filter((x) => (sDate ? (x.lastUsedDate && new Date(x.lastUsedDate) >= sDate) : true))
|
|
@@ -21750,15 +21817,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImpor
|
|
|
21750
21817
|
}] });
|
|
21751
21818
|
//#region ---- Percentage Queries ----
|
|
21752
21819
|
class AXQEmployeeSkillsSkillPercentagesQuery {
|
|
21820
|
+
constructor() {
|
|
21821
|
+
this.employeeSkillService = inject(AXMHumanCapitalManagementEmployeeSkillEntityService);
|
|
21822
|
+
}
|
|
21753
21823
|
async fetch(input) {
|
|
21754
|
-
const { skillId, levelId, minYears } = input ?? {};
|
|
21755
|
-
|
|
21824
|
+
const { skillId, levelId, minYears, startDate, endDate } = input ?? {};
|
|
21825
|
+
const sDate = startDate ? new Date(startDate) : undefined;
|
|
21826
|
+
const eDate = endDate ? new Date(endDate) : undefined;
|
|
21827
|
+
// Load data from entity service
|
|
21828
|
+
const response = await this.employeeSkillService.query();
|
|
21829
|
+
let data = response.items;
|
|
21830
|
+
// Apply filters
|
|
21756
21831
|
if (skillId)
|
|
21757
21832
|
data = data.filter((x) => x.skillId === skillId);
|
|
21758
21833
|
if (levelId)
|
|
21759
21834
|
data = data.filter((x) => x.levelId === levelId);
|
|
21760
21835
|
if (minYears != null)
|
|
21761
21836
|
data = data.filter((x) => (x.yearsOfExperience ?? 0) >= Number(minYears));
|
|
21837
|
+
if (sDate)
|
|
21838
|
+
data = data.filter((x) => x.lastUsedDate && new Date(x.lastUsedDate) >= sDate);
|
|
21839
|
+
if (eDate)
|
|
21840
|
+
data = data.filter((x) => x.lastUsedDate && new Date(x.lastUsedDate) <= eDate);
|
|
21762
21841
|
const counts = data.reduce((acc, cur) => {
|
|
21763
21842
|
const key = cur.skill?.title ?? cur.skillId;
|
|
21764
21843
|
acc[key] = (acc[key] ?? 0) + 1;
|
|
@@ -21781,14 +21860,30 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImpor
|
|
|
21781
21860
|
}]
|
|
21782
21861
|
}] });
|
|
21783
21862
|
class AXQEmployeeSkillsLevelPercentagesQuery {
|
|
21863
|
+
constructor() {
|
|
21864
|
+
this.employeeSkillService = inject(AXMHumanCapitalManagementEmployeeSkillEntityService);
|
|
21865
|
+
this.skillLevelService = inject(AXMHumanCapitalManagementSkillLevelEntityService);
|
|
21866
|
+
}
|
|
21784
21867
|
async fetch(input) {
|
|
21785
|
-
const { skillId, minYears } = input ?? {};
|
|
21786
|
-
|
|
21868
|
+
const { skillId, levelId, minYears, startDate, endDate } = input ?? {};
|
|
21869
|
+
const sDate = startDate ? new Date(startDate) : undefined;
|
|
21870
|
+
const eDate = endDate ? new Date(endDate) : undefined;
|
|
21871
|
+
// Load data from entity services
|
|
21872
|
+
const response = await this.employeeSkillService.query();
|
|
21873
|
+
let data = response.items;
|
|
21874
|
+
const skillLevelsResponse = await this.skillLevelService.query();
|
|
21875
|
+
const levels = skillLevelsResponse.items.map(l => ({ id: l.id, title: l.title }));
|
|
21876
|
+
// Apply filters
|
|
21787
21877
|
if (skillId)
|
|
21788
21878
|
data = data.filter((x) => x.skillId === skillId);
|
|
21879
|
+
if (levelId)
|
|
21880
|
+
data = data.filter((x) => x.levelId === levelId);
|
|
21789
21881
|
if (minYears != null)
|
|
21790
21882
|
data = data.filter((x) => (x.yearsOfExperience ?? 0) >= Number(minYears));
|
|
21791
|
-
|
|
21883
|
+
if (sDate)
|
|
21884
|
+
data = data.filter((x) => x.lastUsedDate && new Date(x.lastUsedDate) >= sDate);
|
|
21885
|
+
if (eDate)
|
|
21886
|
+
data = data.filter((x) => x.lastUsedDate && new Date(x.lastUsedDate) <= eDate);
|
|
21792
21887
|
const counts = data.reduce((acc, cur) => {
|
|
21793
21888
|
const key = cur.levelId && levels.find((x) => x.id === cur.levelId)?.title || 'Unknown';
|
|
21794
21889
|
acc[key] = (acc[key] ?? 0) + 1;
|