@acorex/connectivity 21.0.0-next.57 → 21.0.0-next.63

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.
Files changed (19) hide show
  1. package/fesm2022/{acorex-connectivity-mock-acorex-connectivity-mock-DBwcu-v0.mjs → acorex-connectivity-mock-acorex-connectivity-mock-U3_OWcLL.mjs} +1893 -993
  2. package/fesm2022/acorex-connectivity-mock-acorex-connectivity-mock-U3_OWcLL.mjs.map +1 -0
  3. package/fesm2022/{acorex-connectivity-mock-assign-to-manager.activity-DtDwfWx9.mjs → acorex-connectivity-mock-assign-to-manager.activity-BRdgF2Nt.mjs} +2 -2
  4. package/fesm2022/{acorex-connectivity-mock-assign-to-manager.activity-DtDwfWx9.mjs.map → acorex-connectivity-mock-assign-to-manager.activity-BRdgF2Nt.mjs.map} +1 -1
  5. package/fesm2022/{acorex-connectivity-mock-chat-generate-image.command-DnennBRd.mjs → acorex-connectivity-mock-chat-generate-image.command-D6HSaQY0.mjs} +2 -2
  6. package/fesm2022/{acorex-connectivity-mock-chat-generate-image.command-DnennBRd.mjs.map → acorex-connectivity-mock-chat-generate-image.command-D6HSaQY0.mjs.map} +1 -1
  7. package/fesm2022/{acorex-connectivity-mock-chat-synthesize-speech.command-B9NWKlAu.mjs → acorex-connectivity-mock-chat-synthesize-speech.command-DkSFKM1o.mjs} +2 -2
  8. package/fesm2022/{acorex-connectivity-mock-chat-synthesize-speech.command-B9NWKlAu.mjs.map → acorex-connectivity-mock-chat-synthesize-speech.command-DkSFKM1o.mjs.map} +1 -1
  9. package/fesm2022/{acorex-connectivity-mock-chat-transcribe-speech.command-Dmp8i9Vc.mjs → acorex-connectivity-mock-chat-transcribe-speech.command-CGB_ud93.mjs} +2 -2
  10. package/fesm2022/{acorex-connectivity-mock-chat-transcribe-speech.command-Dmp8i9Vc.mjs.map → acorex-connectivity-mock-chat-transcribe-speech.command-CGB_ud93.mjs.map} +1 -1
  11. package/fesm2022/{acorex-connectivity-mock-entity-create.activity-Ca19tIj4.mjs → acorex-connectivity-mock-entity-create.activity-CdoUzUvF.mjs} +10 -3
  12. package/fesm2022/acorex-connectivity-mock-entity-create.activity-CdoUzUvF.mjs.map +1 -0
  13. package/fesm2022/{acorex-connectivity-mock-user-roles-for-list-column.query-DSr7jDGu.mjs → acorex-connectivity-mock-user-roles-for-list-column.query-1lSQeAEv.mjs} +2 -2
  14. package/fesm2022/{acorex-connectivity-mock-user-roles-for-list-column.query-DSr7jDGu.mjs.map → acorex-connectivity-mock-user-roles-for-list-column.query-1lSQeAEv.mjs.map} +1 -1
  15. package/fesm2022/acorex-connectivity-mock.mjs +1 -1
  16. package/package.json +2 -2
  17. package/types/acorex-connectivity-mock.d.ts +57 -40
  18. package/fesm2022/acorex-connectivity-mock-acorex-connectivity-mock-DBwcu-v0.mjs.map +0 -1
  19. package/fesm2022/acorex-connectivity-mock-entity-create.activity-Ca19tIj4.mjs.map +0 -1
@@ -3,7 +3,7 @@ import * as i2$2 from '@acorex/platform/auth';
3
3
  import { AXPSessionService, AXP_PERMISSION_DEFINITION_PROVIDER, AXPPermissionDefinitionService, AXP_APPLICATION_LOADER, AXP_FEATURE_LOADER, AXP_PERMISSION_LOADER, AXP_TENANT_LOADER, AXP_PERMISSION_CHECKER, AXP_FEATURE_CHECKER, AXPLoginChallengeComponentBase, AXPLoginChallengeProvider, AXPAuthStrategy, AXPAuthModule, AXP_LOGIN_CHALLENGE_PROVIDER } from '@acorex/platform/auth';
4
4
  import * as i1 from '@acorex/platform/core';
5
5
  import { AXPDataGenerator, AXP_DISTRIBUTED_EVENT_LISTENER_PROVIDER, AXPIconLogoConfig, AXPModuleManifestRegistry, AXPActivityLogProvider, AXP_ACTIVITY_LOG_PROVIDER, AXP_DATASOURCE_DEFINITION_PROVIDER, AXPDataSourceDefinitionProviderService, AXPPlatformScope, AXPExpressionEvaluatorService, provideLazyProvider } from '@acorex/platform/core';
6
- import { runEntityQuery, filterSortEntityRows, computeEntityAggregates, AXP_ENTITY_STORAGE_BACKEND, AXPEntityStorageService, isAXPMiddlewareAbortError, AXPEntityResolver, collectEntityQuickSearchFieldPaths, AXP_ENTITY_DEFINITION_CRUD_SERVICE, AXPEntityService, AXP_ENTITY_DEFINITION_LOADER, axpCreateEntityAiToolInputDefaults, AXPMiddlewareAbortError, AXP_DATA_SEEDER_TOKEN, AXP_ENTITY_STORAGE_MIDDLEWARE, AXPEntityDefinitionRegistryService, eventDispatchMiddleware, AXPDataSeederService } from '@acorex/platform/layout/entity';
6
+ import { runEntityQuery, filterSortEntityRows, computeEntityAggregates, AXP_ENTITY_STORAGE_BACKEND, AXPEntityStorageService, isAXPMiddlewareAbortError, AXPEntityResolver, collectEntityQuickSearchFieldPaths, AXP_ENTITY_DEFINITION_CRUD_SERVICE, AXPEntityService, AXP_ENTITY_DEFINITION_LOADER, axpCreateEntityAiToolInputDefaults, AXPMiddlewareAbortError, AXP_DATA_SEEDER_TOKEN, AXP_ENTITY_STORAGE_MIDDLEWARE, AXPEntityDefinitionRegistryService, eventDispatchMiddleware, buildAXPRecordWorkflowInfo, AXPDataSeederService } from '@acorex/platform/layout/entity';
7
7
  import * as i0 from '@angular/core';
8
8
  import { InjectionToken, inject, Injectable, NgModule, isDevMode, Injector, Inject, signal, Component } from '@angular/core';
9
9
  import { AXP_MENU_PROVIDER, AXPFileStorageService, AXPSettingsService, AXPSystemStatusType, AXPAppVersionService, AXPFileStorageStatus, AXVChangeType as AXVChangeType$1, AXP_SEARCH_PROVIDER, AXPLockService, AXPVersioningService, AXPSystemStatuses, AXPStatusDefinitionProviderService } from '@acorex/platform/common';
@@ -28,10 +28,10 @@ import { AXPHumanCapitalManagementFeatureKeys, AXMPermissionsKeys as AXMPermissi
28
28
  import { RootConfig as RootConfig$5 } from '@acorex/modules/locale-management';
29
29
  import { AXMPermissionsKeys as AXMPermissionsKeys$1, AXMSubscriptionManagementSubscriptionEntityService, AXMSubscriptionManagementSubscriptionPlanItemEntityService, RootConfig as RootConfig$x } from '@acorex/modules/subscription-management';
30
30
  import { AXPSecurityManagementPermissionKeys, AXMUserAccessState, resolveAXMUserEffectiveState, RootConfig as RootConfig$6, AXMPolicyService } from '@acorex/modules/security-management';
31
- import { AXMTenantManagementPermissionsKeys, AXMTenantService, AXMTenantManagementTenantUserEntityService, RootConfig as RootConfig$A } from '@acorex/modules/tenant-management';
31
+ import { AXMTenantManagementPermissionsKeys, AXMTenantService, AXMTenantManagementTenantUserEntityService, RootConfig as RootConfig$y } from '@acorex/modules/tenant-management';
32
32
  import { AXMPermissionsKeys as AXMPermissionsKeys$5, RootConfig as RootConfig$e, AXMDocumentTypeServiceImpl, AXPDocumentManagementService } from '@acorex/modules/document-management';
33
33
  import { AXMSettingsManagementPermissionKeys } from '@acorex/modules/settings-management';
34
- import { AXMPermissionsKeys as AXMPermissionsKeys$3, RootConfig as RootConfig$z, AXPWorkflowTaskProvider, matchesTaskBoardAssigneeFilter } from '@acorex/modules/task-management';
34
+ import { AXMPermissionsKeys as AXMPermissionsKeys$3, RootConfig as RootConfig$A, AXPWorkflowTaskProvider, matchesTaskBoardAssigneeFilter } from '@acorex/modules/task-management';
35
35
  import { AXMPermissionsKeys as AXMPermissionsKeys$4, AXMChatConversationApi, AXMChatMessageApi, axmAssistFollowUpItemsFromUnknown, axmAssistUserFacingPayloadLine, axmBuildAssistTranscriptLinePayload, AXM_ASSIST_TRANSCRIPT_LINE_PAYLOAD_TYPE, AXMChatRealtimeApi, AXMChatUserApi, axmIsAssistPeerParticipant, RootConfig as RootConfig$a } from '@acorex/modules/conversation';
36
36
  import { RootConfig as RootConfig$7 } from '@acorex/modules/business-core';
37
37
  import { RootConfig as RootConfig$8 } from '@acorex/modules/calendar-management';
@@ -78,7 +78,7 @@ import { RootConfig as RootConfig$v } from '@acorex/modules/project-management';
78
78
  import { RootConfig as RootConfig$w } from '@acorex/modules/reservation-management';
79
79
  import { AXMSessionStatusTypes, AXMDeviceSessionsServiceImpl, AXMDeviceSessionsService, AXM_AUTH_CONFIG_TOKEN } from '@acorex/modules/auth';
80
80
  import * as i1$3 from '@acorex/components/dialog';
81
- import { RootConfig as RootConfig$y } from '@acorex/modules/supplier-management';
81
+ import { RootConfig as RootConfig$z } from '@acorex/modules/supplier-management';
82
82
  import { AXPLayoutBuilderService } from '@acorex/platform/layout/builder';
83
83
  import { Router } from '@angular/router';
84
84
  import { AXPWorkflowManager, AXPWorkflowDefinitionService, AXPActivityDefinitionService, AXP_WORKFLOW_PROVIDER, WorkflowExpressionScopeService, AXPWorkflowEngineError, AXP_WORKFLOW_ERROR_CODES, AXP_WORKFLOW_ENGINE } from '@acorex/platform/workflow';
@@ -4869,6 +4869,7 @@ function createDefaultContactEmergencyMenuDefinition() {
4869
4869
  icon: 'fa-light fa-siren',
4870
4870
  priority: 20,
4871
4871
  entityListRef: { module: 'ContactCore', entity: 'EmergencyService' },
4872
+ policyFeatures: ['ContactCore'],
4872
4873
  policyPermissions: ['ContactCore:Permission:EmergencyService.Management'],
4873
4874
  categoryIds: ['ContactCore'],
4874
4875
  categories: [{ id: 'ContactCore', title: 'Contact Core' }],
@@ -4914,6 +4915,17 @@ async function ensureDefaultMenuDefinitionsSeeded(crud) {
4914
4915
  const existing = await crud.getMenu(id);
4915
4916
  if (!existing) {
4916
4917
  await crud.createMenu(id, factory());
4918
+ continue;
4919
+ }
4920
+ if (id === DEFAULT_CONTACT_EMERGENCY_MENU_ID) {
4921
+ const expected = factory();
4922
+ const hasFeaturePolicy = existing.policyFeatures?.includes('ContactCore');
4923
+ if (!hasFeaturePolicy) {
4924
+ await crud.updateMenu(id, {
4925
+ ...existing,
4926
+ policyFeatures: expected.policyFeatures,
4927
+ });
4928
+ }
4917
4929
  }
4918
4930
  }
4919
4931
  }
@@ -5593,6 +5605,43 @@ const COMMAND_REGISTRY_SEED = [
5593
5605
  ]
5594
5606
  }
5595
5607
  },
5608
+ {
5609
+ "id": "cmd_a7f3e2b91c04",
5610
+ "definition": {
5611
+ "name": "AssessmentManagement.AssessmentSession:ViewOutcomes",
5612
+ "active": true,
5613
+ "description": "ViewSessionOutcomesCommand opens a dialog with stored session.outcomes snapshots (no re-evaluation) for ViewSessionOutcomesCommandInput.sessionId.",
5614
+ "inputOptionDefinitions": [
5615
+ {
5616
+ "name": "sessionId",
5617
+ "title": "Session ID",
5618
+ "interface": {
5619
+ "name": "text-editor",
5620
+ "title": "Session ID",
5621
+ "options": {}
5622
+ },
5623
+ "description": "Assessment Session ID to view stored outcome results for.",
5624
+ "validations": [
5625
+ {
5626
+ "rule": "required"
5627
+ }
5628
+ ]
5629
+ }
5630
+ ],
5631
+ "outputOptionDefinitions": [],
5632
+ "catalogTitle": "View session outcome results",
5633
+ "executionMode": "frontend",
5634
+ "outcomesDefinitionJson": "{\n \"mode\": \"static\",\n \"values\": [\n \"completed\"\n ]\n}",
5635
+ "aiMetadataJson": "{\n \"tags\": [\n \"assessment\",\n \"session\",\n \"outcomes\"\n ]\n}",
5636
+ "categories": [
5637
+ {
5638
+ "name": "assessment",
5639
+ "order": 11,
5640
+ "title": "Assessment"
5641
+ }
5642
+ ]
5643
+ }
5644
+ },
5596
5645
  {
5597
5646
  "id": "cmd_77791c191333",
5598
5647
  "definition": {
@@ -14545,7 +14594,7 @@ const AI_ASSIST_MOCK = [
14545
14594
  {
14546
14595
  id: AXMAiDemisAssistId,
14547
14596
  name: 'demis-payment-guide',
14548
- title: M$19('Magfa Assistant', 'دستیار هوشمند مرکز کسترش فناوری اطلاعات'),
14597
+ title: M$19('Magfa Assistant', 'دستیار هوشمند مرکز گسترش فناوری اطلاعات'),
14549
14598
  metadata: {
14550
14599
  agent_uuid: AXMAiDemisAssistAgentUuid,
14551
14600
  },
@@ -21445,7 +21494,7 @@ class AXCAiManagementMockModule {
21445
21494
  provideCommandSetups([
21446
21495
  {
21447
21496
  key: 'AiManagement:ChatGenerateImage',
21448
- command: () => import('./acorex-connectivity-mock-chat-generate-image.command-DnennBRd.mjs').then((c) => c.AiManagementChatGenerateImageCommand),
21497
+ command: () => import('./acorex-connectivity-mock-chat-generate-image.command-D6HSaQY0.mjs').then((c) => c.AiManagementChatGenerateImageCommand),
21449
21498
  },
21450
21499
  {
21451
21500
  key: 'AiManagement:ExtractDocumentText',
@@ -21457,11 +21506,11 @@ class AXCAiManagementMockModule {
21457
21506
  },
21458
21507
  {
21459
21508
  key: 'AiManagement:ChatTranscribeSpeech',
21460
- command: () => import('./acorex-connectivity-mock-chat-transcribe-speech.command-Dmp8i9Vc.mjs').then((c) => c.AiManagementChatTranscribeSpeechCommand),
21509
+ command: () => import('./acorex-connectivity-mock-chat-transcribe-speech.command-CGB_ud93.mjs').then((c) => c.AiManagementChatTranscribeSpeechCommand),
21461
21510
  },
21462
21511
  {
21463
21512
  key: 'AiManagement:ChatSynthesizeSpeech',
21464
- command: () => import('./acorex-connectivity-mock-chat-synthesize-speech.command-B9NWKlAu.mjs').then((c) => c.AiManagementChatSynthesizeSpeechCommand),
21513
+ command: () => import('./acorex-connectivity-mock-chat-synthesize-speech.command-DkSFKM1o.mjs').then((c) => c.AiManagementChatSynthesizeSpeechCommand),
21465
21514
  },
21466
21515
  ]),
21467
21516
  ] }); }
@@ -21514,7 +21563,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
21514
21563
  provideCommandSetups([
21515
21564
  {
21516
21565
  key: 'AiManagement:ChatGenerateImage',
21517
- command: () => import('./acorex-connectivity-mock-chat-generate-image.command-DnennBRd.mjs').then((c) => c.AiManagementChatGenerateImageCommand),
21566
+ command: () => import('./acorex-connectivity-mock-chat-generate-image.command-D6HSaQY0.mjs').then((c) => c.AiManagementChatGenerateImageCommand),
21518
21567
  },
21519
21568
  {
21520
21569
  key: 'AiManagement:ExtractDocumentText',
@@ -21526,11 +21575,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
21526
21575
  },
21527
21576
  {
21528
21577
  key: 'AiManagement:ChatTranscribeSpeech',
21529
- command: () => import('./acorex-connectivity-mock-chat-transcribe-speech.command-Dmp8i9Vc.mjs').then((c) => c.AiManagementChatTranscribeSpeechCommand),
21578
+ command: () => import('./acorex-connectivity-mock-chat-transcribe-speech.command-CGB_ud93.mjs').then((c) => c.AiManagementChatTranscribeSpeechCommand),
21530
21579
  },
21531
21580
  {
21532
21581
  key: 'AiManagement:ChatSynthesizeSpeech',
21533
- command: () => import('./acorex-connectivity-mock-chat-synthesize-speech.command-B9NWKlAu.mjs').then((c) => c.AiManagementChatSynthesizeSpeechCommand),
21582
+ command: () => import('./acorex-connectivity-mock-chat-synthesize-speech.command-DkSFKM1o.mjs').then((c) => c.AiManagementChatSynthesizeSpeechCommand),
21534
21583
  },
21535
21584
  ]),
21536
21585
  ],
@@ -21785,6 +21834,7 @@ const APPLICATION_TREE = [
21785
21834
  'TenantManagement',
21786
21835
  'SubscriptionManagement',
21787
21836
  'AiManagement',
21837
+ 'PlatformDevTools',
21788
21838
  'Common',
21789
21839
  AXPCommonFeatureKeys.GlobalSearch,
21790
21840
  ],
@@ -22120,7 +22170,25 @@ class AXCEditionDataSeeder {
22120
22170
  this.storageService = inject(AXPEntityStorageService);
22121
22171
  }
22122
22172
  async seed() {
22123
- await this.storageService.initial(`${RootConfig$2.module.name}.${RootConfig$2.entities.edition.name}`, EDITIONS);
22173
+ const entityName = `${RootConfig$2.module.name}.${RootConfig$2.entities.edition.name}`;
22174
+ await this.storageService.initial(entityName, EDITIONS);
22175
+ await this.syncPlatformConsoleEditionModules(entityName);
22176
+ }
22177
+ /** Keeps Platform Console edition modules aligned when featureKeys change in mock data. */
22178
+ async syncPlatformConsoleEditionModules(editionsEntityName) {
22179
+ const storedEditions = await this.storageService.getAll(editionsEntityName);
22180
+ const stored = storedEditions.find((edition) => edition.id === PLATFORM_CONSOLE.id);
22181
+ if (!stored?.id || !PLATFORM_CONSOLE.modulesAndFeatures) {
22182
+ return;
22183
+ }
22184
+ const storedModules = [...(stored.modulesAndFeatures?.modules ?? [])].sort().join(',');
22185
+ const expectedModules = [...(PLATFORM_CONSOLE.modulesAndFeatures.modules ?? [])].sort().join(',');
22186
+ if (storedModules === expectedModules) {
22187
+ return;
22188
+ }
22189
+ await this.storageService.updateOne(editionsEntityName, stored.id, {
22190
+ modulesAndFeatures: PLATFORM_CONSOLE.modulesAndFeatures,
22191
+ });
22124
22192
  }
22125
22193
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXCEditionDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
22126
22194
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXCEditionDataSeeder }); }
@@ -23949,7 +24017,7 @@ function teamLeadScaleItem(name, titleEn, titleFa, questionEn, questionFa, categ
23949
24017
  }
23950
24018
  //#endregion
23951
24019
  /**
23952
- * Company-wide team-lead competency bank items (software context). Variable names use the `tls_` prefix for calculations.
24020
+ * Company-wide team-lead competency bank items (software context). Variable names use the `tls_` prefix for outcomes.
23953
24021
  */
23954
24022
  const teamLeadCompetenciesQuestionBankItems = [
23955
24023
  //#region ---- Technical & professional ----
@@ -24404,6 +24472,61 @@ const QPM = () => pickQuestionnaireCategory('Plant Maintenance');
24404
24472
  const QCP = () => pickQuestionnaireCategory('Compliance & Permits');
24405
24473
  /** Questionnaires folder for team lead / supervisor evaluations. */
24406
24474
  const QTLE = () => pickQuestionnaireCategory('Team Lead Evaluation');
24475
+ /** Wraps outcome items in the default single-section shape used by questionnaire mocks. */
24476
+ function createQuestionnaireOutcomesSection(items, title = createMultiLanguageString('Outcomes', 'نتایج')) {
24477
+ return {
24478
+ sections: items.length
24479
+ ? [
24480
+ {
24481
+ name: 'outcomes',
24482
+ title,
24483
+ order: 0,
24484
+ items,
24485
+ },
24486
+ ]
24487
+ : [],
24488
+ };
24489
+ }
24490
+ //#endregion
24491
+
24492
+ //#region ---- Imports ----
24493
+ //#endregion
24494
+ //#region ---- Compliance — Governance ----
24495
+ const CP_GOVERNANCE_OUTCOMES = [
24496
+ {
24497
+ id: AXPDataGenerator.uuid(),
24498
+ name: 'comp_resilience_index',
24499
+ title: createMultiLanguageString('Resilience index', 'شاخص تاب‌آوری'),
24500
+ description: createMultiLanguageString('Governance strength minus drill decay', 'قدرت حاکمیتی منهای کهنگی مانور'),
24501
+ resultKind: 'number',
24502
+ expression: "fn.ROUND(fn.MIN(100, fn.MAX(0, Number(answer.eval('comp_governance')) * 18 - Number(answer.eval('comp_months_drill')) * 3 + 10)), 0)",
24503
+ },
24504
+ {
24505
+ id: AXPDataGenerator.uuid(),
24506
+ name: 'comp_resilience_status',
24507
+ title: createMultiLanguageString('Resilience status', 'وضعیت تاب‌آوری'),
24508
+ resultKind: 'string',
24509
+ expression: "Number(outcome.eval('comp_resilience_index')) >= 70 ? 'Strong' : Number(outcome.eval('comp_resilience_index')) >= 45 ? 'Moderate' : 'Improve'",
24510
+ },
24511
+ ];
24512
+ //#endregion
24513
+ //#region ---- Compliance — Permits ----
24514
+ const CP_PERMITS_OUTCOMES = [
24515
+ {
24516
+ id: AXPDataGenerator.uuid(),
24517
+ name: 'comp_readiness_score',
24518
+ title: createMultiLanguageString('Readiness score', 'امتیاز آمادگی'),
24519
+ resultKind: 'number',
24520
+ expression: "fn.ROUND(fn.MIN(100, (answer.eval('comp_audit_ready') === 'yes' ? 42 : 8) + (answer.eval('comp_permit_valid') === 'yes' ? 42 : 12) + Number(answer.eval('comp_training_current')) * 3.2), 0)",
24521
+ },
24522
+ {
24523
+ id: AXPDataGenerator.uuid(),
24524
+ name: 'comp_readiness_next_step',
24525
+ title: createMultiLanguageString('Next step', 'گام بعدی'),
24526
+ resultKind: 'string',
24527
+ expression: "Number(outcome.eval('comp_readiness_score')) >= 75 ? 'Keep cadence' : 'Schedule remediation workshop'",
24528
+ },
24529
+ ];
24407
24530
  //#endregion
24408
24531
 
24409
24532
  //#region ---- Imports ----
@@ -24430,7 +24553,7 @@ const compliancePermitsQuestionnaires = [
24430
24553
  post: {
24431
24554
  reviewEnabled: false,
24432
24555
  summaryEnabled: true,
24433
- showCalculationResults: true,
24556
+ showOutcomeResults: true,
24434
24557
  summaryContent: {
24435
24558
  'en-US': '<p><strong>Summary</strong></p>' +
24436
24559
  '<p>Resilience index: <strong>{{comp_resilience_index}}</strong> / 100</p>' +
@@ -24485,6 +24608,7 @@ const compliancePermitsQuestionnaires = [
24485
24608
  },
24486
24609
  ],
24487
24610
  },
24611
+ outcomes: createQuestionnaireOutcomesSection(CP_GOVERNANCE_OUTCOMES),
24488
24612
  scoringType: 'none',
24489
24613
  timeLimit: 720,
24490
24614
  allowPause: true,
@@ -24504,7 +24628,7 @@ const compliancePermitsQuestionnaires = [
24504
24628
  post: {
24505
24629
  reviewEnabled: false,
24506
24630
  summaryEnabled: true,
24507
- showCalculationResults: true,
24631
+ showOutcomeResults: true,
24508
24632
  summaryContent: {
24509
24633
  'en-US': '<p><strong>Summary</strong></p>' +
24510
24634
  '<p>Readiness score: <strong>{{comp_readiness_score}}</strong> / 100</p>' +
@@ -24573,6 +24697,7 @@ const compliancePermitsQuestionnaires = [
24573
24697
  },
24574
24698
  ],
24575
24699
  },
24700
+ outcomes: createQuestionnaireOutcomesSection(CP_PERMITS_OUTCOMES),
24576
24701
  scoringType: 'none',
24577
24702
  timeLimit: 900,
24578
24703
  allowPause: true,
@@ -24585,10 +24710,51 @@ const compliancePermitsQuestionnaires = [
24585
24710
  ];
24586
24711
  //#endregion
24587
24712
 
24713
+ //#region ---- Imports ----
24714
+ //#endregion
24715
+ //#region ---- General — Team alignment ----
24716
+ const GENERAL_TEAM_PULSE_OUTCOMES = [
24717
+ {
24718
+ id: AXPDataGenerator.uuid(),
24719
+ name: 'gen_alignment_index',
24720
+ title: createMultiLanguageString('Alignment index', 'شاخص هم‌ترازی'),
24721
+ description: createMultiLanguageString('0–100 from two 1–5 ratings', '۰–۱۰۰ از دو امتیاز ۱–۵'),
24722
+ resultKind: 'number',
24723
+ expression: "fn.ROUND(((Number(answer.eval('gen_priority_clarity')) + Number(answer.eval('gen_manager_support'))) / 2 - 1) / 4 * 100, 0)",
24724
+ },
24725
+ {
24726
+ id: AXPDataGenerator.uuid(),
24727
+ name: 'gen_alignment_band',
24728
+ title: createMultiLanguageString('Alignment band', 'باند هم‌ترازی'),
24729
+ resultKind: 'string',
24730
+ expression: "Number(outcome.eval('gen_alignment_index')) >= 70 ? 'Aligned' : Number(outcome.eval('gen_alignment_index')) >= 40 ? 'Mixed' : 'At risk'",
24731
+ },
24732
+ ];
24733
+ //#endregion
24734
+ //#region ---- General — Office workplace quality ----
24735
+ const GENERAL_OFFICE_QUALITY_OUTCOMES = [
24736
+ {
24737
+ id: AXPDataGenerator.uuid(),
24738
+ name: 'office_quality_index',
24739
+ title: createMultiLanguageString('Office quality index', 'شاخص کیفیت محیط اداری'),
24740
+ description: createMultiLanguageString('0–100 from seven 1–5 ratings (ergonomics through amenities)', '۰–۱۰۰ از هفت امتیاز ۱–۵ (ارگونومی تا امکانات)'),
24741
+ resultKind: 'number',
24742
+ expression: "fn.ROUND(((Number(answer.eval('off_ergo')) + Number(answer.eval('off_light')) + Number(answer.eval('off_noise')) + Number(answer.eval('off_climate')) + Number(answer.eval('off_space')) + Number(answer.eval('off_focus')) + Number(answer.eval('off_amenities'))) / 7 - 1) / 4 * 100, 0)",
24743
+ },
24744
+ {
24745
+ id: AXPDataGenerator.uuid(),
24746
+ name: 'office_quality_band',
24747
+ title: createMultiLanguageString('Office quality band', 'باند کیفیت محیط اداری'),
24748
+ resultKind: 'string',
24749
+ expression: "Number(outcome.eval('office_quality_index')) >= 75 ? 'Good' : Number(outcome.eval('office_quality_index')) >= 50 ? 'Fair' : 'Poor'",
24750
+ },
24751
+ ];
24752
+ //#endregion
24753
+
24588
24754
  //#region ---- Imports ----
24589
24755
  //#endregion
24590
24756
  const q$6 = mockQuestionBankItemByName;
24591
- /** Stable id for mock calculations and automations that reference this questionnaire. */
24757
+ /** Stable id for mock outcomes and automations that reference this questionnaire. */
24592
24758
  const QUESTIONNAIRE_ID_GENERAL_SITE_BRIEF = AXPDataGenerator.uuid();
24593
24759
  const QUESTIONNAIRE_ID_GENERAL_TEAM_PULSE = AXPDataGenerator.uuid();
24594
24760
  const QUESTIONNAIRE_ID_GENERAL_OFFICE_QUALITY = AXPDataGenerator.uuid();
@@ -24611,7 +24777,7 @@ const generalQuestionnaires = [
24611
24777
  post: {
24612
24778
  reviewEnabled: true,
24613
24779
  summaryEnabled: true,
24614
- showCalculationResults: false,
24780
+ showOutcomeResults: false,
24615
24781
  },
24616
24782
  display: {
24617
24783
  viewMode: 'page-per-group',
@@ -24682,7 +24848,7 @@ const generalQuestionnaires = [
24682
24848
  post: {
24683
24849
  reviewEnabled: true,
24684
24850
  summaryEnabled: true,
24685
- showCalculationResults: true,
24851
+ showOutcomeResults: true,
24686
24852
  summaryContent: {
24687
24853
  'en-US': '<p><strong>Summary</strong></p>' +
24688
24854
  '<p>Alignment index: <strong>{{gen_alignment_index}}</strong> / 100</p>' +
@@ -24737,6 +24903,7 @@ const generalQuestionnaires = [
24737
24903
  },
24738
24904
  ],
24739
24905
  },
24906
+ outcomes: createQuestionnaireOutcomesSection(GENERAL_TEAM_PULSE_OUTCOMES),
24740
24907
  scoringType: 'none',
24741
24908
  timeLimit: 600,
24742
24909
  allowPause: true,
@@ -24763,7 +24930,7 @@ const generalQuestionnaires = [
24763
24930
  post: {
24764
24931
  reviewEnabled: true,
24765
24932
  summaryEnabled: true,
24766
- showCalculationResults: true,
24933
+ showOutcomeResults: true,
24767
24934
  summaryContent: {
24768
24935
  'en-US': '<p><strong>Summary</strong></p>' +
24769
24936
  '<p>Workplace quality index: <strong>{{office_quality_index}}</strong> / 100</p>' +
@@ -24821,6 +24988,7 @@ const generalQuestionnaires = [
24821
24988
  },
24822
24989
  ],
24823
24990
  },
24991
+ outcomes: createQuestionnaireOutcomesSection(GENERAL_OFFICE_QUALITY_OUTCOMES),
24824
24992
  scoringType: 'none',
24825
24993
  timeLimit: 900,
24826
24994
  allowPause: true,
@@ -24833,10 +25001,81 @@ const generalQuestionnaires = [
24833
25001
  ];
24834
25002
  //#endregion
24835
25003
 
25004
+ //#region ---- Imports ----
25005
+ //#endregion
25006
+ //#region ---- Team lead — competency pillars ----
25007
+ const TEAM_LEAD_COMPANY_WIDE_OUTCOMES = [
25008
+ {
25009
+ id: AXPDataGenerator.uuid(),
25010
+ name: 'tls_pillar_technical_index',
25011
+ title: createMultiLanguageString('Technical pillar index', 'شاخص ستون فنی'),
25012
+ description: createMultiLanguageString('0–100 from nine 1–5 ratings (technical & professional)', '۰–۱۰۰ از نه امتیاز ۱–۵ (فنی و حرفه‌ای)'),
25013
+ resultKind: 'number',
25014
+ expression: "fn.ROUND(((Number(answer.eval('tls_tp_stack_tools')) + Number(answer.eval('tls_tp_code_quality')) + Number(answer.eval('tls_tp_complex_problems')) + Number(answer.eval('tls_tp_architecture_decisions')) + Number(answer.eval('tls_tp_best_practices')) + Number(answer.eval('tls_tp_code_review_feedback')) + Number(answer.eval('tls_tp_debugging')) + Number(answer.eval('tls_tp_knowledge_currency')) + Number(answer.eval('tls_tp_mentoring_transfer'))) / 9 - 1) / 4 * 100, 0)",
25015
+ },
25016
+ {
25017
+ id: AXPDataGenerator.uuid(),
25018
+ name: 'tls_pillar_behavioral_index',
25019
+ title: createMultiLanguageString('Behavioral pillar index', 'شاخص ستون رفتاری'),
25020
+ description: createMultiLanguageString('0–100 from seven 1–5 ratings', '۰–۱۰۰ از هفت امتیاز ۱–۵'),
25021
+ resultKind: 'number',
25022
+ expression: "fn.ROUND(((Number(answer.eval('tls_bc_team_communication')) + Number(answer.eval('tls_bc_meetings_participation')) + Number(answer.eval('tls_bc_listening_inclusion')) + Number(answer.eval('tls_bc_feedback_tone')) + Number(answer.eval('tls_bc_disagreement_handling')) + Number(answer.eval('tls_bc_pressure_composure')) + Number(answer.eval('tls_bc_trust_collaboration'))) / 7 - 1) / 4 * 100, 0)",
25023
+ },
25024
+ {
25025
+ id: AXPDataGenerator.uuid(),
25026
+ name: 'tls_pillar_management_index',
25027
+ title: createMultiLanguageString('Management pillar index', 'شاخص ستون مدیریتی'),
25028
+ description: createMultiLanguageString('0–100 from ten 1–5 ratings', '۰–۱۰۰ از ده امتیاز ۱–۵'),
25029
+ resultKind: 'number',
25030
+ expression: "fn.ROUND(((Number(answer.eval('tls_ml_work_distribution')) + Number(answer.eval('tls_ml_backlog_priorities')) + Number(answer.eval('tls_ml_agile_meetings')) + Number(answer.eval('tls_ml_task_breakdown')) + Number(answer.eval('tls_ml_progress_tracking')) + Number(answer.eval('tls_ml_blockers')) + Number(answer.eval('tls_ml_timely_decisions')) + Number(answer.eval('tls_ml_growth_coaching')) + Number(answer.eval('tls_ml_delivery_timing')) + Number(answer.eval('tls_ml_crisis_leadership'))) / 10 - 1) / 4 * 100, 0)",
25031
+ },
25032
+ {
25033
+ id: AXPDataGenerator.uuid(),
25034
+ name: 'tls_pillar_business_index',
25035
+ title: createMultiLanguageString('Business pillar index', 'شاخص ستون کسب‌وکار'),
25036
+ description: createMultiLanguageString('0–100 from eight 1–5 ratings', '۰–۱۰۰ از هشت امتیاز ۱–۵'),
25037
+ resultKind: 'number',
25038
+ expression: "fn.ROUND(((Number(answer.eval('tls_bo_product_user_understanding')) + Number(answer.eval('tls_bo_business_impact')) + Number(answer.eval('tls_bo_quality_time_cost')) + Number(answer.eval('tls_bo_value_prioritization')) + Number(answer.eval('tls_bo_product_owner_sync')) + Number(answer.eval('tls_bo_requirements_handoff')) + Number(answer.eval('tls_bo_roadmap_awareness')) + Number(answer.eval('tls_bo_customer_value'))) / 8 - 1) / 4 * 100, 0)",
25039
+ },
25040
+ {
25041
+ id: AXPDataGenerator.uuid(),
25042
+ name: 'tls_overall_competency_index',
25043
+ title: createMultiLanguageString('Overall competency index', 'شاخص شایستگی کلی'),
25044
+ description: createMultiLanguageString('0–100 across all 34 items (same weight per question)', '۰–۱۰۰ روی هر ۳۴ سوال (وزن یکسان)'),
25045
+ resultKind: 'number',
25046
+ expression: "fn.ROUND(((Number(answer.eval('tls_tp_stack_tools')) + Number(answer.eval('tls_tp_code_quality')) + Number(answer.eval('tls_tp_complex_problems')) + Number(answer.eval('tls_tp_architecture_decisions')) + Number(answer.eval('tls_tp_best_practices')) + Number(answer.eval('tls_tp_code_review_feedback')) + Number(answer.eval('tls_tp_debugging')) + Number(answer.eval('tls_tp_knowledge_currency')) + Number(answer.eval('tls_tp_mentoring_transfer')) + Number(answer.eval('tls_bc_team_communication')) + Number(answer.eval('tls_bc_meetings_participation')) + Number(answer.eval('tls_bc_listening_inclusion')) + Number(answer.eval('tls_bc_feedback_tone')) + Number(answer.eval('tls_bc_disagreement_handling')) + Number(answer.eval('tls_bc_pressure_composure')) + Number(answer.eval('tls_bc_trust_collaboration')) + Number(answer.eval('tls_ml_work_distribution')) + Number(answer.eval('tls_ml_backlog_priorities')) + Number(answer.eval('tls_ml_agile_meetings')) + Number(answer.eval('tls_ml_task_breakdown')) + Number(answer.eval('tls_ml_progress_tracking')) + Number(answer.eval('tls_ml_blockers')) + Number(answer.eval('tls_ml_timely_decisions')) + Number(answer.eval('tls_ml_growth_coaching')) + Number(answer.eval('tls_ml_delivery_timing')) + Number(answer.eval('tls_ml_crisis_leadership')) + Number(answer.eval('tls_bo_product_user_understanding')) + Number(answer.eval('tls_bo_business_impact')) + Number(answer.eval('tls_bo_quality_time_cost')) + Number(answer.eval('tls_bo_value_prioritization')) + Number(answer.eval('tls_bo_product_owner_sync')) + Number(answer.eval('tls_bo_requirements_handoff')) + Number(answer.eval('tls_bo_roadmap_awareness')) + Number(answer.eval('tls_bo_customer_value'))) / 34 - 1) / 4 * 100, 0)",
25047
+ },
25048
+ {
25049
+ id: AXPDataGenerator.uuid(),
25050
+ name: 'tls_competency_band',
25051
+ title: createMultiLanguageString('Overall competency band', 'باند شایستگی کلی'),
25052
+ description: createMultiLanguageString('Interpretation of tls_overall_competency_index', 'تفسیر شاخص شایستگی کلی'),
25053
+ resultKind: 'string',
25054
+ expression: "Number(outcome.eval('tls_overall_competency_index')) >= 80 ? 'Leading' : Number(outcome.eval('tls_overall_competency_index')) >= 65 ? 'Strong' : Number(outcome.eval('tls_overall_competency_index')) >= 50 ? 'Solid' : Number(outcome.eval('tls_overall_competency_index')) >= 35 ? 'Developing' : 'Priority focus'",
25055
+ },
25056
+ {
25057
+ id: AXPDataGenerator.uuid(),
25058
+ name: 'tls_pillar_balance_spread',
25059
+ title: createMultiLanguageString('Pillar balance spread', 'پراکندگی تعادل ستون‌ها'),
25060
+ description: createMultiLanguageString('Difference between strongest and weakest pillar index (0–100)', 'تفاوت بین بالاترین و پایین‌ترین شاخص ستون (۰–۱۰۰)'),
25061
+ resultKind: 'number',
25062
+ expression: "fn.ROUND(fn.MAX(fn.MAX(Number(outcome.eval('tls_pillar_technical_index')), Number(outcome.eval('tls_pillar_behavioral_index'))), fn.MAX(Number(outcome.eval('tls_pillar_management_index')), Number(outcome.eval('tls_pillar_business_index')))) - fn.MIN(fn.MIN(Number(outcome.eval('tls_pillar_technical_index')), Number(outcome.eval('tls_pillar_behavioral_index'))), fn.MIN(Number(outcome.eval('tls_pillar_management_index')), Number(outcome.eval('tls_pillar_business_index')))), 0)",
25063
+ },
25064
+ {
25065
+ id: AXPDataGenerator.uuid(),
25066
+ name: 'tls_priority_focus_pillar',
25067
+ title: createMultiLanguageString('Priority focus pillar', 'ستون تمرکز اولویت'),
25068
+ description: createMultiLanguageString('Pillar with the lowest index (coaching hint)', 'ستونی با کمترین شاخص (راهنمای کوچینگ)'),
25069
+ resultKind: 'string',
25070
+ expression: "Number(outcome.eval('tls_pillar_technical_index')) <= Number(outcome.eval('tls_pillar_behavioral_index')) && Number(outcome.eval('tls_pillar_technical_index')) <= Number(outcome.eval('tls_pillar_management_index')) && Number(outcome.eval('tls_pillar_technical_index')) <= Number(outcome.eval('tls_pillar_business_index')) ? 'Technical & professional' : Number(outcome.eval('tls_pillar_behavioral_index')) <= Number(outcome.eval('tls_pillar_technical_index')) && Number(outcome.eval('tls_pillar_behavioral_index')) <= Number(outcome.eval('tls_pillar_management_index')) && Number(outcome.eval('tls_pillar_behavioral_index')) <= Number(outcome.eval('tls_pillar_business_index')) ? 'Behavioral & communication' : Number(outcome.eval('tls_pillar_management_index')) <= Number(outcome.eval('tls_pillar_technical_index')) && Number(outcome.eval('tls_pillar_management_index')) <= Number(outcome.eval('tls_pillar_behavioral_index')) && Number(outcome.eval('tls_pillar_management_index')) <= Number(outcome.eval('tls_pillar_business_index')) ? 'Management & leadership' : 'Business & organizational'",
25071
+ },
25072
+ ];
25073
+ //#endregion
25074
+
24836
25075
  //#region ---- Imports ----
24837
25076
  //#endregion
24838
25077
  const q$5 = mockQuestionBankItemByName;
24839
- /** Stable id for mock calculations or automations that reference this questionnaire. */
25078
+ /** Stable id for mock outcomes or automations that reference this questionnaire. */
24840
25079
  const QUESTIONNAIRE_ID_TEAM_LEAD_COMPANY_WIDE = AXPDataGenerator.uuid();
24841
25080
  //#region ---- Mock Data ----
24842
25081
  const teamLeadCompetenciesQuestionnaires = [
@@ -24859,7 +25098,7 @@ const teamLeadCompetenciesQuestionnaires = [
24859
25098
  post: {
24860
25099
  reviewEnabled: true,
24861
25100
  summaryEnabled: true,
24862
- showCalculationResults: true,
25101
+ showOutcomeResults: true,
24863
25102
  summaryContent: {
24864
25103
  'en-US': '<p><strong>Competency summary</strong></p>' +
24865
25104
  '<p>Overall index (0–100): <strong>{{tls_overall_competency_index}}</strong> — <strong>{{tls_competency_band}}</strong></p>' +
@@ -25104,6 +25343,7 @@ const teamLeadCompetenciesQuestionnaires = [
25104
25343
  },
25105
25344
  ],
25106
25345
  },
25346
+ outcomes: createQuestionnaireOutcomesSection(TEAM_LEAD_COMPANY_WIDE_OUTCOMES),
25107
25347
  scoringType: 'weighted',
25108
25348
  passingScore: 3,
25109
25349
  timeLimit: 2400,
@@ -25117,6 +25357,245 @@ const teamLeadCompetenciesQuestionnaires = [
25117
25357
  ];
25118
25358
  //#endregion
25119
25359
 
25360
+ //#region ---- Theme display color helper ----
25361
+ /**
25362
+ * Theme color chooser value: `"foreground background border"` utility classes
25363
+ * (same shape as `AXPColorChooserWidgetEditComponent` stores on `color`).
25364
+ */
25365
+ function outcomeThemeDisplayColor(semantic, variant = 'lightest') {
25366
+ return `ax-text-${semantic}-on-${variant} ax-bg-${semantic}-${variant} ax-border-${semantic}-${variant}`;
25367
+ }
25368
+ //#endregion
25369
+
25370
+ //#region ---- Imports ----
25371
+ //#endregion
25372
+ //#region ---- Health — BMI & eGFR ----
25373
+ const HEALTH_BMI_OUTCOMES = [
25374
+ {
25375
+ id: AXPDataGenerator.uuid(),
25376
+ name: 'bmi',
25377
+ title: createMultiLanguageString('BMI', 'شاخص تودهٔ بدنی'),
25378
+ description: createMultiLanguageString('Body mass index (kg/m²) from height (cm) and weight (kg)', 'شاخص تودهٔ بدنی (kg/m²) از قد (سانتی‌متر) و وزن (کیلوگرم)'),
25379
+ resultKind: 'number',
25380
+ expression: "fn.ROUND(Number(answer.eval('weight_kg')) / ((Number(answer.eval('height_cm')) / 100) ** 2), 1)",
25381
+ displayRules: [
25382
+ {
25383
+ id: 'bmi-underweight',
25384
+ order: 0,
25385
+ operator: 'lt',
25386
+ compareValue: 18.5,
25387
+ color: outcomeThemeDisplayColor('primary', 'lightest'),
25388
+ emphasis: 'medium',
25389
+ icon: 'fa-light fa-weight-scale',
25390
+ },
25391
+ {
25392
+ id: 'bmi-normal',
25393
+ order: 1,
25394
+ operator: 'lt',
25395
+ compareValue: 25,
25396
+ color: outcomeThemeDisplayColor('success', 'lightest'),
25397
+ emphasis: 'normal',
25398
+ icon: 'fa-light fa-circle-check',
25399
+ },
25400
+ {
25401
+ id: 'bmi-overweight',
25402
+ order: 2,
25403
+ operator: 'lt',
25404
+ compareValue: 30,
25405
+ color: outcomeThemeDisplayColor('warning', 'lightest'),
25406
+ emphasis: 'medium',
25407
+ icon: 'fa-light fa-triangle-exclamation',
25408
+ },
25409
+ {
25410
+ id: 'bmi-obese',
25411
+ order: 3,
25412
+ operator: 'gte',
25413
+ compareValue: 30,
25414
+ color: outcomeThemeDisplayColor('danger', 'lightest'),
25415
+ emphasis: 'bold',
25416
+ icon: 'fa-light fa-circle-exclamation',
25417
+ },
25418
+ ],
25419
+ },
25420
+ {
25421
+ id: AXPDataGenerator.uuid(),
25422
+ name: 'egfr_mdrd',
25423
+ title: createMultiLanguageString('eGFR (MDRD)', 'eGFR (MDRD)'),
25424
+ description: createMultiLanguageString('MDRD study equation (Scr mg/dL, age years); female multiplier 0.742.', 'معادلهٔ مطالعهٔ MDRD (کراتینین سرم mg/dL، سن به سال); ضریب ۰٫۷۴۲ برای زنان'),
25425
+ resultKind: 'number',
25426
+ expression: "fn.ROUND(175 * (Number(answer.eval('scr_mg_dl')) ** -1.154) * (Number(answer.eval('age_years')) ** -0.203) * (answer.eval('sex') === 'female' ? 0.742 : 1), 1)",
25427
+ displayRules: [
25428
+ {
25429
+ id: 'egfr-kidney-failure',
25430
+ order: 0,
25431
+ operator: 'lt',
25432
+ compareValue: 15,
25433
+ color: outcomeThemeDisplayColor('danger', 'lightest'),
25434
+ emphasis: 'bold',
25435
+ icon: 'fa-light fa-circle-exclamation',
25436
+ },
25437
+ {
25438
+ id: 'egfr-severe',
25439
+ order: 1,
25440
+ operator: 'lt',
25441
+ compareValue: 30,
25442
+ color: outcomeThemeDisplayColor('danger', 'lightest'),
25443
+ emphasis: 'medium',
25444
+ icon: 'fa-light fa-triangle-exclamation',
25445
+ },
25446
+ {
25447
+ id: 'egfr-moderate',
25448
+ order: 2,
25449
+ operator: 'lt',
25450
+ compareValue: 60,
25451
+ color: outcomeThemeDisplayColor('warning', 'lightest'),
25452
+ emphasis: 'medium',
25453
+ icon: 'fa-light fa-triangle-exclamation',
25454
+ },
25455
+ {
25456
+ id: 'egfr-mild',
25457
+ order: 3,
25458
+ operator: 'lt',
25459
+ compareValue: 90,
25460
+ color: outcomeThemeDisplayColor('primary', 'lightest'),
25461
+ emphasis: 'normal',
25462
+ icon: 'fa-light fa-droplet',
25463
+ },
25464
+ {
25465
+ id: 'egfr-normal',
25466
+ order: 4,
25467
+ operator: 'gte',
25468
+ compareValue: 90,
25469
+ color: outcomeThemeDisplayColor('success', 'lightest'),
25470
+ emphasis: 'normal',
25471
+ icon: 'fa-light fa-circle-check',
25472
+ },
25473
+ ],
25474
+ },
25475
+ {
25476
+ id: AXPDataGenerator.uuid(),
25477
+ name: 'bmi_category',
25478
+ title: createMultiLanguageString('BMI category', 'دستهٔ BMI'),
25479
+ description: createMultiLanguageString('WHO-style categories from computed BMI', 'دسته‌بندی سبک سازمان جهانی بهداشت بر اساس BMI محاسبه‌شده'),
25480
+ resultKind: 'string',
25481
+ expression: "fn.IF(!Number.isFinite(Number(outcome.eval('bmi'))), '', Number(outcome.eval('bmi')) < 18.5 ? 'Underweight' : Number(outcome.eval('bmi')) < 25 ? 'Normal' : Number(outcome.eval('bmi')) < 30 ? 'Overweight' : 'Obese')",
25482
+ displayRules: [
25483
+ {
25484
+ id: 'bmi-cat-underweight',
25485
+ order: 0,
25486
+ operator: 'eq',
25487
+ compareValue: 'Underweight',
25488
+ color: outcomeThemeDisplayColor('primary', 'lightest'),
25489
+ emphasis: 'medium',
25490
+ icon: 'fa-light fa-weight-scale',
25491
+ },
25492
+ {
25493
+ id: 'bmi-cat-normal',
25494
+ order: 1,
25495
+ operator: 'eq',
25496
+ compareValue: 'Normal',
25497
+ color: outcomeThemeDisplayColor('success', 'lightest'),
25498
+ emphasis: 'normal',
25499
+ icon: 'fa-light fa-circle-check',
25500
+ },
25501
+ {
25502
+ id: 'bmi-cat-overweight',
25503
+ order: 2,
25504
+ operator: 'eq',
25505
+ compareValue: 'Overweight',
25506
+ color: outcomeThemeDisplayColor('warning', 'lightest'),
25507
+ emphasis: 'medium',
25508
+ icon: 'fa-light fa-triangle-exclamation',
25509
+ },
25510
+ {
25511
+ id: 'bmi-cat-obese',
25512
+ order: 3,
25513
+ operator: 'eq',
25514
+ compareValue: 'Obese',
25515
+ color: outcomeThemeDisplayColor('danger', 'lightest'),
25516
+ emphasis: 'bold',
25517
+ icon: 'fa-light fa-circle-exclamation',
25518
+ },
25519
+ ],
25520
+ },
25521
+ {
25522
+ id: AXPDataGenerator.uuid(),
25523
+ name: 'egfr_category',
25524
+ title: createMultiLanguageString('eGFR category', 'دستهٔ eGFR'),
25525
+ description: createMultiLanguageString('KDIGO-style kidney function stage from computed eGFR (MDRD)', 'مرحلهٔ عملکرد کلیه بر اساس eGFR محاسبه‌شده (MDRD) به سبک KDIGO'),
25526
+ resultKind: 'string',
25527
+ expression: "fn.IF(!Number.isFinite(Number(outcome.eval('egfr_mdrd'))), '', Number(outcome.eval('egfr_mdrd')) >= 90 ? 'Normal' : Number(outcome.eval('egfr_mdrd')) >= 60 ? 'Mildly decreased' : Number(outcome.eval('egfr_mdrd')) >= 30 ? 'Moderately decreased' : Number(outcome.eval('egfr_mdrd')) >= 15 ? 'Severely decreased' : 'Kidney failure')",
25528
+ displayRules: [
25529
+ {
25530
+ id: 'egfr-cat-normal',
25531
+ order: 0,
25532
+ operator: 'eq',
25533
+ compareValue: 'Normal',
25534
+ color: outcomeThemeDisplayColor('success', 'lightest'),
25535
+ emphasis: 'normal',
25536
+ icon: 'fa-light fa-circle-check',
25537
+ },
25538
+ {
25539
+ id: 'egfr-cat-mild',
25540
+ order: 1,
25541
+ operator: 'eq',
25542
+ compareValue: 'Mildly decreased',
25543
+ color: outcomeThemeDisplayColor('primary', 'lightest'),
25544
+ emphasis: 'normal',
25545
+ icon: 'fa-light fa-droplet',
25546
+ },
25547
+ {
25548
+ id: 'egfr-cat-moderate',
25549
+ order: 2,
25550
+ operator: 'eq',
25551
+ compareValue: 'Moderately decreased',
25552
+ color: outcomeThemeDisplayColor('warning', 'lightest'),
25553
+ emphasis: 'medium',
25554
+ icon: 'fa-light fa-triangle-exclamation',
25555
+ },
25556
+ {
25557
+ id: 'egfr-cat-severe',
25558
+ order: 3,
25559
+ operator: 'eq',
25560
+ compareValue: 'Severely decreased',
25561
+ color: outcomeThemeDisplayColor('danger', 'lightest'),
25562
+ emphasis: 'medium',
25563
+ icon: 'fa-light fa-triangle-exclamation',
25564
+ },
25565
+ {
25566
+ id: 'egfr-cat-failure',
25567
+ order: 4,
25568
+ operator: 'eq',
25569
+ compareValue: 'Kidney failure',
25570
+ color: outcomeThemeDisplayColor('danger', 'lightest'),
25571
+ emphasis: 'bold',
25572
+ icon: 'fa-light fa-circle-exclamation',
25573
+ },
25574
+ ],
25575
+ },
25576
+ ];
25577
+ //#endregion
25578
+ //#region ---- Health — Lifestyle index ----
25579
+ const HEALTH_WELLBEING_OUTCOMES = [
25580
+ {
25581
+ id: AXPDataGenerator.uuid(),
25582
+ name: 'wellness_index',
25583
+ title: createMultiLanguageString('Lifestyle index', 'شاخص سبک زندگی'),
25584
+ description: createMultiLanguageString('Weighted 0–100 from sleep, inverse stress, exercise, hydration, energy', 'میانگین وزنی ۰–۱۰۰ از خواب، کاهش استرس، ورزش، آبرسانی و انرژی'),
25585
+ resultKind: 'number',
25586
+ expression: "fn.ROUND((fn.IF(Number(answer.eval('sleep_h')) > 10, 10, Number(answer.eval('sleep_h')))) / 10 * 20 + (6 - Number(answer.eval('stress_lv'))) / 5 * 20 + (fn.IF(Number(answer.eval('exercise_m')) > 300, 300, Number(answer.eval('exercise_m')))) / 300 * 20 + (fn.IF(Number(answer.eval('water_g')) > 12, 12, Number(answer.eval('water_g')))) / 12 * 20 + Number(answer.eval('energy_lv')) / 5 * 20, 0)",
25587
+ },
25588
+ {
25589
+ id: AXPDataGenerator.uuid(),
25590
+ name: 'wellness_band',
25591
+ title: createMultiLanguageString('Lifestyle band', 'باند سبک زندگی'),
25592
+ description: createMultiLanguageString('Interpretation of composite index', 'تفسیر شاخص ترکیبی'),
25593
+ resultKind: 'string',
25594
+ expression: "Number(outcome.eval('wellness_index')) >= 75 ? 'Thriving' : Number(outcome.eval('wellness_index')) >= 50 ? 'Balanced' : 'Plan support'",
25595
+ },
25596
+ ];
25597
+ //#endregion
25598
+
25120
25599
  //#region ---- Imports ----
25121
25600
  //#endregion
25122
25601
  const q$4 = mockQuestionBankItemByName;
@@ -25127,7 +25606,7 @@ const healthWellnessQuestionnaires = [
25127
25606
  {
25128
25607
  id: QUESTIONNAIRE_ID_HEALTH_BMI,
25129
25608
  title: createMultiLanguageString('Occupational health — BMI & eGFR', 'سلامت شغلی — BMI و eGFR'),
25130
- description: createMultiLanguageString('Height, weight, age, sex, and serum creatinine; calculations derive BMI, WHO-style category, and eGFR (MDRD).', 'قد، وزن، سن، جنس و کراتینین سرم؛ محاسبهٔ BMI، دستهٔ سازمان جهانی بهداشت و eGFR (MDRD).'),
25609
+ description: createMultiLanguageString('Height, weight, age, sex, and serum creatinine; outcomes derive BMI, WHO-style category, and eGFR (MDRD).', 'قد، وزن، سن، جنس و کراتینین سرم؛ محاسبهٔ BMI، دستهٔ سازمان جهانی بهداشت و eGFR (MDRD).'),
25131
25610
  type: 'questionnaire',
25132
25611
  categoryIds: [QHW().id],
25133
25612
  categories: [QHW()],
@@ -25141,15 +25620,15 @@ const healthWellnessQuestionnaires = [
25141
25620
  post: {
25142
25621
  reviewEnabled: true,
25143
25622
  summaryEnabled: true,
25144
- showCalculationResults: true,
25623
+ showOutcomeResults: true,
25145
25624
  summaryContent: {
25146
25625
  'en-US': '<p><strong>Summary</strong></p>' +
25147
25626
  '<p>BMI: <strong>{{bmi}}</strong> kg/m² — <strong>{{bmi_category}}</strong></p>' +
25148
- '<p>eGFR (MDRD): <strong>{{egfr_mdrd}}</strong> mL/min/1.73m²</p>' +
25627
+ '<p>eGFR (MDRD): <strong>{{egfr_mdrd}}</strong> mL/min/1.73m² — <strong>{{egfr_category}}</strong></p>' +
25149
25628
  '<p>Questions answered: <strong>{{answeredCount}}</strong> / <strong>{{totalQuestions}}</strong></p>',
25150
25629
  'fa-IR': '<p><strong>خلاصه</strong></p>' +
25151
25630
  '<p>BMI: <strong>{{bmi}}</strong> — <strong>{{bmi_category}}</strong></p>' +
25152
- '<p>eGFR (MDRD): <strong>{{egfr_mdrd}}</strong></p>',
25631
+ '<p>eGFR (MDRD): <strong>{{egfr_mdrd}}</strong> — <strong>{{egfr_category}}</strong></p>',
25153
25632
  },
25154
25633
  },
25155
25634
  display: {
@@ -25184,6 +25663,7 @@ const healthWellnessQuestionnaires = [
25184
25663
  },
25185
25664
  ],
25186
25665
  },
25666
+ outcomes: createQuestionnaireOutcomesSection(HEALTH_BMI_OUTCOMES),
25187
25667
  scoringType: 'none',
25188
25668
  timeLimit: 1200,
25189
25669
  allowPause: true,
@@ -25210,7 +25690,7 @@ const healthWellnessQuestionnaires = [
25210
25690
  post: {
25211
25691
  reviewEnabled: true,
25212
25692
  summaryEnabled: true,
25213
- showCalculationResults: true,
25693
+ showOutcomeResults: true,
25214
25694
  summaryContent: {
25215
25695
  'en-US': '<p><strong>Summary</strong></p>' +
25216
25696
  '<p>Lifestyle index: <strong>{{wellness_index}}</strong> / 100</p>' +
@@ -25266,6 +25746,7 @@ const healthWellnessQuestionnaires = [
25266
25746
  },
25267
25747
  ],
25268
25748
  },
25749
+ outcomes: createQuestionnaireOutcomesSection(HEALTH_WELLBEING_OUTCOMES),
25269
25750
  scoringType: 'none',
25270
25751
  timeLimit: 900,
25271
25752
  allowPause: true,
@@ -25278,10 +25759,256 @@ const healthWellnessQuestionnaires = [
25278
25759
  ];
25279
25760
  //#endregion
25280
25761
 
25762
+ //#region ---- Imports ----
25763
+ //#endregion
25764
+ //#region ---- Checklist expression helpers ----
25765
+ const hrInductionIntroKeys = ['hr_induction_welcome_workers', 'hr_induction_nature_structure_company'];
25766
+ const hrInductionEmploymentKeys = [
25767
+ 'hr_induction_job_description_responsibilities',
25768
+ 'hr_induction_award_workplace_agreement',
25769
+ 'hr_induction_work_times_meal_breaks',
25770
+ 'hr_induction_time_recording_procedures',
25771
+ 'hr_induction_leave_entitlements',
25772
+ 'hr_induction_sick_leave_notification',
25773
+ ];
25774
+ const hrInductionPayrollKeys = [
25775
+ 'hr_induction_pay_rates_allowances',
25776
+ 'hr_induction_pay_arrangement',
25777
+ 'hr_induction_date_next_pay',
25778
+ 'hr_induction_taxation_forms',
25779
+ 'hr_induction_superannuation_deductions',
25780
+ ];
25781
+ const hrInductionWorkplaceKeys = [
25782
+ 'hr_induction_wash_toilet_facilities',
25783
+ 'hr_induction_kitchen_lunch_room',
25784
+ 'hr_induction_first_aid_facilities',
25785
+ 'hr_induction_emergency_exits',
25786
+ 'hr_induction_fire_warden_contact',
25787
+ 'hr_induction_first_aider_contact',
25788
+ 'hr_induction_car_parking',
25789
+ ];
25790
+ const hrInductionWhsKeys = [
25791
+ 'hr_induction_safetyminder_app',
25792
+ 'hr_induction_whs_policy',
25793
+ 'hr_induction_whs_roles',
25794
+ 'hr_induction_whs_consultation',
25795
+ 'hr_induction_issue_resolution',
25796
+ 'hr_induction_emergency_plan',
25797
+ 'hr_induction_first_aid_arrangements',
25798
+ 'hr_induction_incident_injury_reporting',
25799
+ 'hr_induction_discrimination_bullying_harassment',
25800
+ 'hr_induction_drugs_alcohol',
25801
+ ];
25802
+ const hrInductionSecurityKeys = [
25803
+ 'hr_induction_building_work_site',
25804
+ 'hr_induction_personal_belongings',
25805
+ 'hr_induction_petty_cash',
25806
+ 'hr_induction_computer_password',
25807
+ ];
25808
+ const hrInductionTrainingKeys = [
25809
+ 'hr_induction_training_certificates_safetyminder',
25810
+ 'hr_induction_on_job_training',
25811
+ 'hr_induction_work_specific_hazards_training',
25812
+ ];
25813
+ const hrInductionAllKeys = [
25814
+ ...hrInductionIntroKeys,
25815
+ ...hrInductionEmploymentKeys,
25816
+ ...hrInductionPayrollKeys,
25817
+ ...hrInductionWorkplaceKeys,
25818
+ ...hrInductionWhsKeys,
25819
+ ...hrInductionSecurityKeys,
25820
+ ...hrInductionTrainingKeys,
25821
+ ];
25822
+ const hrSeparationKeys = [
25823
+ 'hr_separation_service_reports_invoices',
25824
+ 'hr_separation_last_timesheet_petty_cash',
25825
+ 'hr_separation_service_report_books',
25826
+ 'hr_separation_company_phone',
25827
+ 'hr_separation_workshop_client_keys',
25828
+ 'hr_separation_company_vehicle',
25829
+ 'hr_separation_fuel_card',
25830
+ 'hr_separation_first_aid_fire_extinguisher',
25831
+ 'hr_separation_company_store_cards',
25832
+ 'hr_separation_no_outstanding_repayments',
25833
+ 'hr_separation_rdos_in_credit',
25834
+ 'hr_separation_company_tools',
25835
+ 'hr_separation_security_passes',
25836
+ 'hr_separation_petty_cash_returned',
25837
+ ];
25838
+ const completedCountExpr = (keys) => `fn.SUM(${keys.map((k) => `(answer.eval('${k}') === true ? 1 : 0)`).join(', ')})`;
25839
+ const openCountExpr = (keys) => `fn.SUM(${keys.map((k) => `(answer.eval('${k}') !== true ? 1 : 0)`).join(', ')})`;
25840
+ const HR_INDUCTION_COMPLETED_COUNT_EXPR = completedCountExpr(hrInductionAllKeys);
25841
+ const HR_INDUCTION_OPEN_COUNT_EXPR = openCountExpr(hrInductionAllKeys);
25842
+ const HR_SEPARATION_COMPLETED_COUNT_EXPR = completedCountExpr(hrSeparationKeys);
25843
+ const HR_SEPARATION_OPEN_COUNT_EXPR = openCountExpr(hrSeparationKeys);
25844
+ //#endregion
25845
+ //#region ---- Organization HR — Employee induction ----
25846
+ const HR_INDUCTION_OUTCOMES = [
25847
+ {
25848
+ id: AXPDataGenerator.uuid(),
25849
+ name: 'hr_induction_completed_count',
25850
+ title: createMultiLanguageString('Topics completed', 'موضوعات تکمیل‌شده'),
25851
+ description: createMultiLanguageString('Checklist rows marked completed', 'سطرهای چک‌لیست علامت‌خورده به‌عنوان تکمیل‌شده'),
25852
+ resultKind: 'number',
25853
+ expression: HR_INDUCTION_COMPLETED_COUNT_EXPR,
25854
+ },
25855
+ {
25856
+ id: AXPDataGenerator.uuid(),
25857
+ name: 'hr_induction_open_count',
25858
+ title: createMultiLanguageString('Topics still open', 'موضوعات بازمانده'),
25859
+ description: createMultiLanguageString('Rows not yet marked completed', 'سطرهایی که هنوز تکمیل نشده‌اند'),
25860
+ resultKind: 'number',
25861
+ expression: HR_INDUCTION_OPEN_COUNT_EXPR,
25862
+ },
25863
+ {
25864
+ id: AXPDataGenerator.uuid(),
25865
+ name: 'hr_induction_completion_percent',
25866
+ title: createMultiLanguageString('Completion (%)', 'درصد تکمیل'),
25867
+ description: createMultiLanguageString('0–100 from 37 induction topics', '۰–۱۰۰ از ۳۷ موضوع آشنایی'),
25868
+ resultKind: 'number',
25869
+ expression: "fn.ROUND(Number(outcome.eval('hr_induction_completed_count')) / 37 * 100, 0)",
25870
+ displayRules: [
25871
+ {
25872
+ id: 'hr-induction-pct-low',
25873
+ order: 0,
25874
+ operator: 'lt',
25875
+ compareValue: 50,
25876
+ color: outcomeThemeDisplayColor('danger', 'lightest'),
25877
+ emphasis: 'bold',
25878
+ icon: 'fa-light fa-circle-exclamation',
25879
+ },
25880
+ {
25881
+ id: 'hr-induction-pct-mid',
25882
+ order: 1,
25883
+ operator: 'lt',
25884
+ compareValue: 100,
25885
+ color: outcomeThemeDisplayColor('warning', 'lightest'),
25886
+ emphasis: 'medium',
25887
+ icon: 'fa-light fa-triangle-exclamation',
25888
+ },
25889
+ {
25890
+ id: 'hr-induction-pct-done',
25891
+ order: 2,
25892
+ operator: 'gte',
25893
+ compareValue: 100,
25894
+ color: outcomeThemeDisplayColor('success', 'lightest'),
25895
+ emphasis: 'normal',
25896
+ icon: 'fa-light fa-circle-check',
25897
+ },
25898
+ ],
25899
+ },
25900
+ {
25901
+ id: AXPDataGenerator.uuid(),
25902
+ name: 'hr_induction_completion_band',
25903
+ title: createMultiLanguageString('Completion band', 'باند تکمیل'),
25904
+ description: createMultiLanguageString('Traffic-light summary for induction progress', 'خلاصه چراغ راهنمایی برای پیشرفت آشنایی'),
25905
+ resultKind: 'string',
25906
+ expression: "Number(outcome.eval('hr_induction_completion_percent')) >= 100 ? 'Complete — induction covered' : Number(outcome.eval('hr_induction_completion_percent')) >= 75 ? 'Nearly complete — finish remaining topics' : Number(outcome.eval('hr_induction_completion_percent')) >= 40 ? 'In progress — continue section by section' : 'Just started — schedule induction sessions'",
25907
+ },
25908
+ {
25909
+ id: AXPDataGenerator.uuid(),
25910
+ name: 'hr_induction_focus_message',
25911
+ title: createMultiLanguageString('Focus message', 'پیام تمرکز'),
25912
+ description: createMultiLanguageString('Which section to address next', 'کدام بخش را بعداً رسیدگی کنید'),
25913
+ resultKind: 'string',
25914
+ expression: `Number(outcome.eval('hr_induction_completion_percent')) >= 100 ? 'Induction checklist complete — file with HR' : ${openCountExpr(hrInductionIntroKeys)} > 0 ? 'Finish Introduction topics first' : ${openCountExpr(hrInductionEmploymentKeys)} > 0 ? 'Complete Employment Conditions' : ${openCountExpr(hrInductionPayrollKeys)} > 0 ? 'Complete Payroll topics' : ${openCountExpr(hrInductionWorkplaceKeys)} > 0 ? 'Complete General Workplace information' : ${openCountExpr(hrInductionWhsKeys)} > 0 ? 'Complete Health and Safety topics' : ${openCountExpr(hrInductionSecurityKeys)} > 0 ? 'Complete Security topics' : ${openCountExpr(hrInductionTrainingKeys)} > 0 ? 'Complete Training topics' : 'Review any optional comments before sign-off'`,
25915
+ },
25916
+ {
25917
+ id: AXPDataGenerator.uuid(),
25918
+ name: 'hr_induction_all_complete',
25919
+ title: createMultiLanguageString('All topics complete', 'همهٔ موضوعات تکمیل'),
25920
+ description: createMultiLanguageString('True when every induction row is checked', 'وقتی همهٔ سطرهای آشنایی تیک خورده باشد برابر true است'),
25921
+ resultKind: 'boolean',
25922
+ expression: "Number(outcome.eval('hr_induction_completed_count')) === 37",
25923
+ },
25924
+ ];
25925
+ //#endregion
25926
+ //#region ---- Organization HR — Employee separation ----
25927
+ const HR_SEPARATION_OUTCOMES = [
25928
+ {
25929
+ id: AXPDataGenerator.uuid(),
25930
+ name: 'hr_separation_completed_count',
25931
+ title: createMultiLanguageString('Items completed', 'موارد تکمیل‌شده'),
25932
+ description: createMultiLanguageString('Offboarding rows marked completed', 'سطرهای خروج علامت‌خورده به‌عنوان تکمیل‌شده'),
25933
+ resultKind: 'number',
25934
+ expression: HR_SEPARATION_COMPLETED_COUNT_EXPR,
25935
+ },
25936
+ {
25937
+ id: AXPDataGenerator.uuid(),
25938
+ name: 'hr_separation_open_count',
25939
+ title: createMultiLanguageString('Items still open', 'موارد بازمانده'),
25940
+ description: createMultiLanguageString('Rows not yet marked completed', 'سطرهایی که هنوز تکمیل نشده‌اند'),
25941
+ resultKind: 'number',
25942
+ expression: HR_SEPARATION_OPEN_COUNT_EXPR,
25943
+ },
25944
+ {
25945
+ id: AXPDataGenerator.uuid(),
25946
+ name: 'hr_separation_completion_percent',
25947
+ title: createMultiLanguageString('Completion (%)', 'درصد تکمیل'),
25948
+ description: createMultiLanguageString('0–100 from 14 separation checklist items', '۰–۱۰۰ از ۱۴ مورد چک‌لیست جدایی'),
25949
+ resultKind: 'number',
25950
+ expression: "fn.ROUND(Number(outcome.eval('hr_separation_completed_count')) / 14 * 100, 0)",
25951
+ displayRules: [
25952
+ {
25953
+ id: 'hr-separation-pct-low',
25954
+ order: 0,
25955
+ operator: 'lt',
25956
+ compareValue: 50,
25957
+ color: outcomeThemeDisplayColor('danger', 'lightest'),
25958
+ emphasis: 'bold',
25959
+ icon: 'fa-light fa-circle-exclamation',
25960
+ },
25961
+ {
25962
+ id: 'hr-separation-pct-mid',
25963
+ order: 1,
25964
+ operator: 'lt',
25965
+ compareValue: 100,
25966
+ color: outcomeThemeDisplayColor('warning', 'lightest'),
25967
+ emphasis: 'medium',
25968
+ icon: 'fa-light fa-triangle-exclamation',
25969
+ },
25970
+ {
25971
+ id: 'hr-separation-pct-done',
25972
+ order: 2,
25973
+ operator: 'gte',
25974
+ compareValue: 100,
25975
+ color: outcomeThemeDisplayColor('success', 'lightest'),
25976
+ emphasis: 'normal',
25977
+ icon: 'fa-light fa-circle-check',
25978
+ },
25979
+ ],
25980
+ },
25981
+ {
25982
+ id: AXPDataGenerator.uuid(),
25983
+ name: 'hr_separation_completion_band',
25984
+ title: createMultiLanguageString('Completion band', 'باند تکمیل'),
25985
+ description: createMultiLanguageString('Traffic-light summary for offboarding progress', 'خلاصه چراغ راهنمایی برای پیشرفت خروج'),
25986
+ resultKind: 'string',
25987
+ expression: "Number(outcome.eval('hr_separation_completion_percent')) >= 100 ? 'Complete — ready for final payroll' : Number(outcome.eval('hr_separation_completion_percent')) >= 75 ? 'Nearly complete — confirm remaining returns' : Number(outcome.eval('hr_separation_completion_percent')) >= 40 ? 'In progress — chase outstanding assets' : 'Just started — assign owner per line'",
25988
+ },
25989
+ {
25990
+ id: AXPDataGenerator.uuid(),
25991
+ name: 'hr_separation_focus_message',
25992
+ title: createMultiLanguageString('Focus message', 'پیام تمرکز'),
25993
+ description: createMultiLanguageString('Short guidance for remaining offboarding work', 'راهنمای کوتاه برای کارهای باقی‌ماندهٔ خروج'),
25994
+ resultKind: 'string',
25995
+ expression: "Number(outcome.eval('hr_separation_completion_percent')) >= 100 ? 'Separation checklist complete — proceed to exit interview' : Number(outcome.eval('hr_separation_open_count')) > 5 ? 'Prioritize asset returns and finance clearances' : Number(outcome.eval('hr_separation_open_count')) > 0 ? 'Complete remaining checklist rows and note N/A in comments' : 'Review comments and manager sign-off'",
25996
+ },
25997
+ {
25998
+ id: AXPDataGenerator.uuid(),
25999
+ name: 'hr_separation_all_complete',
26000
+ title: createMultiLanguageString('All items complete', 'همهٔ موارد تکمیل'),
26001
+ description: createMultiLanguageString('True when every separation row is checked', 'وقتی همهٔ سطرهای جدایی تیک خورده باشد برابر true است'),
26002
+ resultKind: 'boolean',
26003
+ expression: "Number(outcome.eval('hr_separation_completed_count')) === 14",
26004
+ },
26005
+ ];
26006
+ //#endregion
26007
+
25281
26008
  //#region ---- Imports ----
25282
26009
  //#endregion
25283
26010
  const q$3 = mockQuestionBankItemByName;
25284
- /** Stable id for mock calculations and automations that reference this questionnaire. */
26011
+ /** Stable id for mock outcomes and automations that reference this questionnaire. */
25285
26012
  const QUESTIONNAIRE_ID_EMPLOYEE_SEPARATION_CHECKLIST = AXPDataGenerator.uuid();
25286
26013
  //#region ---- Mock Data ----
25287
26014
  const employeeSeparationQuestionnaires = [
@@ -25297,8 +26024,20 @@ const employeeSeparationQuestionnaires = [
25297
26024
  },
25298
26025
  post: {
25299
26026
  reviewEnabled: false,
25300
- summaryEnabled: false,
25301
- showCalculationResults: false,
26027
+ summaryEnabled: true,
26028
+ showOutcomeResults: true,
26029
+ summaryContent: {
26030
+ 'en-US': '<p><strong>Separation summary</strong></p>' +
26031
+ '<p>Completion: <strong>{{hr_separation_completion_percent}}</strong>% — <strong>{{hr_separation_completion_band}}</strong></p>' +
26032
+ '<p>Items completed: <strong>{{hr_separation_completed_count}}</strong> / 14 · Still open: <strong>{{hr_separation_open_count}}</strong></p>' +
26033
+ '<p><strong>Focus:</strong> {{hr_separation_focus_message}}</p>' +
26034
+ '<p>Answered <strong>{{answeredCount}}</strong> / <strong>{{totalQuestions}}</strong></p>',
26035
+ 'fa-IR': '<p><strong>خلاصه جدایی</strong></p>' +
26036
+ '<p>تکمیل: <strong>{{hr_separation_completion_percent}}</strong>٪ — <strong>{{hr_separation_completion_band}}</strong></p>' +
26037
+ '<p>موارد تکمیل‌شده: <strong>{{hr_separation_completed_count}}</strong> / ۱۴ · بازمانده: <strong>{{hr_separation_open_count}}</strong></p>' +
26038
+ '<p><strong>تمرکز:</strong> {{hr_separation_focus_message}}</p>' +
26039
+ '<p>پاسخ‌داده‌شده <strong>{{answeredCount}}</strong> / <strong>{{totalQuestions}}</strong></p>',
26040
+ },
25302
26041
  },
25303
26042
  display: {
25304
26043
  viewMode: 'single-page',
@@ -25390,6 +26129,7 @@ const employeeSeparationQuestionnaires = [
25390
26129
  },
25391
26130
  ],
25392
26131
  },
26132
+ outcomes: createQuestionnaireOutcomesSection(HR_SEPARATION_OUTCOMES),
25393
26133
  scoringType: 'none',
25394
26134
  timeLimit: 3600,
25395
26135
  allowPause: true,
@@ -25405,7 +26145,7 @@ const employeeSeparationQuestionnaires = [
25405
26145
  //#region ---- Imports ----
25406
26146
  //#endregion
25407
26147
  const q$2 = mockQuestionBankItemByName;
25408
- /** Stable id for mock calculations and automations that reference this questionnaire. */
26148
+ /** Stable id for mock outcomes and automations that reference this questionnaire. */
25409
26149
  const QUESTIONNAIRE_ID_HR_EMPLOYEE_INDUCTION = AXPDataGenerator.uuid();
25410
26150
  //#region ---- Mock Data ----
25411
26151
  const organizationHrQuestionnaires = [
@@ -25421,8 +26161,20 @@ const organizationHrQuestionnaires = [
25421
26161
  },
25422
26162
  post: {
25423
26163
  reviewEnabled: false,
25424
- summaryEnabled: false,
25425
- showCalculationResults: false,
26164
+ summaryEnabled: true,
26165
+ showOutcomeResults: true,
26166
+ summaryContent: {
26167
+ 'en-US': '<p><strong>Induction summary</strong></p>' +
26168
+ '<p>Completion: <strong>{{hr_induction_completion_percent}}</strong>% — <strong>{{hr_induction_completion_band}}</strong></p>' +
26169
+ '<p>Topics completed: <strong>{{hr_induction_completed_count}}</strong> / 37 · Still open: <strong>{{hr_induction_open_count}}</strong></p>' +
26170
+ '<p><strong>Focus:</strong> {{hr_induction_focus_message}}</p>' +
26171
+ '<p>Answered <strong>{{answeredCount}}</strong> / <strong>{{totalQuestions}}</strong></p>',
26172
+ 'fa-IR': '<p><strong>خلاصه آشنایی</strong></p>' +
26173
+ '<p>تکمیل: <strong>{{hr_induction_completion_percent}}</strong>٪ — <strong>{{hr_induction_completion_band}}</strong></p>' +
26174
+ '<p>موضوعات تکمیل‌شده: <strong>{{hr_induction_completed_count}}</strong> / ۳۷ · بازمانده: <strong>{{hr_induction_open_count}}</strong></p>' +
26175
+ '<p><strong>تمرکز:</strong> {{hr_induction_focus_message}}</p>' +
26176
+ '<p>پاسخ‌داده‌شده <strong>{{answeredCount}}</strong> / <strong>{{totalQuestions}}</strong></p>',
26177
+ },
25426
26178
  },
25427
26179
  display: {
25428
26180
  viewMode: 'side-menu',
@@ -25677,6 +26429,7 @@ const organizationHrQuestionnaires = [
25677
26429
  },
25678
26430
  ],
25679
26431
  },
26432
+ outcomes: createQuestionnaireOutcomesSection(HR_INDUCTION_OUTCOMES),
25680
26433
  scoringType: 'none',
25681
26434
  timeLimit: 3600,
25682
26435
  allowPause: true,
@@ -25689,6 +26442,47 @@ const organizationHrQuestionnaires = [
25689
26442
  ];
25690
26443
  //#endregion
25691
26444
 
26445
+ //#region ---- Imports ----
26446
+ //#endregion
26447
+ //#region ---- Plant — Work order ----
26448
+ const PM_WORK_ORDER_OUTCOMES = [
26449
+ {
26450
+ id: AXPDataGenerator.uuid(),
26451
+ name: 'maint_backlog_priority',
26452
+ title: createMultiLanguageString('Backlog priority score', 'امتیاز اولویت انباشت کار'),
26453
+ description: createMultiLanguageString('Downtime × quality gap × LOTO factor', 'زمان توقف × شکاف کیفیت × ضریب LOTO'),
26454
+ resultKind: 'number',
26455
+ expression: "fn.ROUND(Number(answer.eval('maint_downtime_h')) * (6 - Number(answer.eval('maint_pm_quality'))) * (answer.eval('maint_loto') === 'yes' ? 1 : 1.5), 0)",
26456
+ },
26457
+ {
26458
+ id: AXPDataGenerator.uuid(),
26459
+ name: 'maint_backlog_tier',
26460
+ title: createMultiLanguageString('Backlog tier', 'سطح انباشت کار'),
26461
+ resultKind: 'string',
26462
+ expression: "Number(outcome.eval('maint_backlog_priority')) > 80 ? 'Escalate' : Number(outcome.eval('maint_backlog_priority')) > 25 ? 'Plan work' : 'Monitor'",
26463
+ },
26464
+ ];
26465
+ //#endregion
26466
+ //#region ---- Plant — Spares ----
26467
+ const PM_SPARES_OUTCOMES = [
26468
+ {
26469
+ id: AXPDataGenerator.uuid(),
26470
+ name: 'maint_logistics_risk',
26471
+ title: createMultiLanguageString('Logistics risk score', 'امتیاز ریسک تدارکات'),
26472
+ description: createMultiLanguageString('MTTR weighted when spares are not assured', 'MTTR وزن‌دار وقتی یدکی تضمین نشده است'),
26473
+ resultKind: 'number',
26474
+ expression: "fn.ROUND(Number(answer.eval('maint_mttr_h')) * (answer.eval('maint_spare_ok') === 'yes' ? 1 : 2.2), 0)",
26475
+ },
26476
+ {
26477
+ id: AXPDataGenerator.uuid(),
26478
+ name: 'maint_logistics_followup',
26479
+ title: createMultiLanguageString('Logistics follow-up', 'پیگیری تدارکات'),
26480
+ resultKind: 'string',
26481
+ expression: "Number(outcome.eval('maint_logistics_risk')) > 50 ? 'Source spares or expedite' : 'Monitor'",
26482
+ },
26483
+ ];
26484
+ //#endregion
26485
+
25692
26486
  //#region ---- Imports ----
25693
26487
  //#endregion
25694
26488
  const q$1 = mockQuestionBankItemByName;
@@ -25719,7 +26513,7 @@ const plantMaintenanceQuestionnaires = [
25719
26513
  post: {
25720
26514
  reviewEnabled: false,
25721
26515
  summaryEnabled: true,
25722
- showCalculationResults: true,
26516
+ showOutcomeResults: true,
25723
26517
  summaryContent: {
25724
26518
  'en-US': '<p><strong>Summary</strong></p>' +
25725
26519
  '<p>Backlog priority score: <strong>{{maint_backlog_priority}}</strong></p>' +
@@ -25780,6 +26574,7 @@ const plantMaintenanceQuestionnaires = [
25780
26574
  },
25781
26575
  ],
25782
26576
  },
26577
+ outcomes: createQuestionnaireOutcomesSection(PM_WORK_ORDER_OUTCOMES),
25783
26578
  scoringType: 'none',
25784
26579
  timeLimit: 900,
25785
26580
  allowPause: true,
@@ -25799,7 +26594,7 @@ const plantMaintenanceQuestionnaires = [
25799
26594
  post: {
25800
26595
  reviewEnabled: false,
25801
26596
  summaryEnabled: true,
25802
- showCalculationResults: true,
26597
+ showOutcomeResults: true,
25803
26598
  summaryContent: {
25804
26599
  'en-US': '<p><strong>Summary</strong></p>' +
25805
26600
  '<p>Logistics risk score: <strong>{{maint_logistics_risk}}</strong></p>' +
@@ -25848,6 +26643,7 @@ const plantMaintenanceQuestionnaires = [
25848
26643
  },
25849
26644
  ],
25850
26645
  },
26646
+ outcomes: createQuestionnaireOutcomesSection(PM_SPARES_OUTCOMES),
25851
26647
  scoringType: 'none',
25852
26648
  timeLimit: 600,
25853
26649
  allowPause: true,
@@ -25871,7 +26667,7 @@ const plantMaintenanceQuestionnaires = [
25871
26667
  post: {
25872
26668
  reviewEnabled: true,
25873
26669
  summaryEnabled: true,
25874
- showCalculationResults: false,
26670
+ showOutcomeResults: false,
25875
26671
  summaryContent: {
25876
26672
  'en-US': '<p><strong>Summary</strong></p>' +
25877
26673
  '<p>Answered <strong>{{answeredCount}}</strong> / <strong>{{totalQuestions}}</strong></p>',
@@ -26006,6 +26802,135 @@ const plantMaintenanceQuestionnaires = [
26006
26802
  ];
26007
26803
  //#endregion
26008
26804
 
26805
+ //#region ---- Imports ----
26806
+ //#endregion
26807
+ //#region ---- Take 5 checklist expressions ----
26808
+ const take5S1Keys = Array.from({ length: 9 }, (_, i) => `take5_1_${String(i + 1).padStart(2, '0')}`);
26809
+ const take5S2Keys = Array.from({ length: 9 }, (_, i) => `take5_2_${String(i + 1).padStart(2, '0')}`);
26810
+ const take5S3Keys = Array.from({ length: 8 }, (_, i) => `take5_3_${String(i + 1).padStart(2, '0')}`);
26811
+ /** Section 1: “no” = gap in pre-task readiness. */
26812
+ const TAKE5_PREP_GAP_COUNT_EXPR = `fn.SUM(${take5S1Keys.map((k) => `(answer.eval('${k}') === 'no' ? 1 : 0)`).join(', ')})`;
26813
+ /** Section 2: “yes” = hazard / exposure flagged. */
26814
+ const TAKE5_HAZARD_YES_COUNT_EXPR = `fn.SUM(${take5S2Keys.map((k) => `(answer.eval('${k}') === 'yes' ? 1 : 0)`).join(', ')})`;
26815
+ /** Section 3: “yes” = that permit type is required for this job. */
26816
+ const TAKE5_PERMIT_YES_COUNT_EXPR = `fn.SUM(${take5S3Keys.map((k) => `(answer.eval('${k}') === 'yes' ? 1 : 0)`).join(', ')})`;
26817
+ /** Favourable answers: S1 & S4 yes; S2 & S3 no (matches paper Take 5 polarity). */
26818
+ const TAKE5_FAVOURABLE_COUNT_EXPR = `fn.SUM(${[
26819
+ ...take5S1Keys.map((k) => `(answer.eval('${k}') === 'yes' ? 1 : 0)`),
26820
+ ...take5S2Keys.map((k) => `(answer.eval('${k}') === 'no' ? 1 : 0)`),
26821
+ ...take5S3Keys.map((k) => `(answer.eval('${k}') === 'no' ? 1 : 0)`),
26822
+ `(answer.eval('take5_4_01') === 'yes' ? 1 : 0)`,
26823
+ ].join(', ')})`;
26824
+ //#endregion
26825
+ //#region ---- Workplace Safety — Hazard ----
26826
+ const WS_HAZARD_OUTCOMES = [
26827
+ {
26828
+ id: AXPDataGenerator.uuid(),
26829
+ name: 'risk_points',
26830
+ title: createMultiLanguageString('Risk points', 'امتیاز ریسک'),
26831
+ description: createMultiLanguageString('People × days open × severity (1–5)', 'نفر × روزهای باز × شدت (۱–۵)'),
26832
+ resultKind: 'number',
26833
+ expression: "fn.ROUND(Number(answer.eval('exp_people')) * Number(answer.eval('exp_days')) * Number(answer.eval('sev')), 0)",
26834
+ },
26835
+ {
26836
+ id: AXPDataGenerator.uuid(),
26837
+ name: 'risk_priority',
26838
+ title: createMultiLanguageString('Action priority', 'اولویت اقدام'),
26839
+ description: createMultiLanguageString('Tiered follow-up from risk points', 'پیگیری چندلایه بر اساس امتیاز ریسک'),
26840
+ resultKind: 'string',
26841
+ expression: "Number(outcome.eval('risk_points')) > 100 ? 'Escalate immediately' : Number(outcome.eval('risk_points')) > 30 ? 'Schedule control' : 'Monitor'",
26842
+ },
26843
+ ];
26844
+ //#endregion
26845
+ //#region ---- Workplace Safety — PPE ----
26846
+ const WS_PPE_OUTCOMES = [
26847
+ {
26848
+ id: AXPDataGenerator.uuid(),
26849
+ name: 'ppe_compliance_score',
26850
+ title: createMultiLanguageString('PPE compliance score', 'امتیاز رعایت تجهیزات حفاظت فردی'),
26851
+ description: createMultiLanguageString('100 when PPE adequate; reduced when not', '۱۰۰ وقتی تجهیزات کافی است؛ در غیر این صورت کاهش می‌یابد'),
26852
+ resultKind: 'number',
26853
+ expression: "fn.ROUND(answer.eval('whs_ppe_ok') === 'yes' ? 100 : 35, 0)",
26854
+ },
26855
+ {
26856
+ id: AXPDataGenerator.uuid(),
26857
+ name: 'ppe_compliance_band',
26858
+ title: createMultiLanguageString('PPE band', 'باند تجهیزات حفاظت فردی'),
26859
+ description: createMultiLanguageString('Traffic-light style', 'سبک چراغ راهنمایی (قرمز/زرد/سبز)'),
26860
+ resultKind: 'string',
26861
+ expression: "Number(outcome.eval('ppe_compliance_score')) >= 80 ? 'Green' : Number(outcome.eval('ppe_compliance_score')) >= 50 ? 'Amber' : 'Red'",
26862
+ },
26863
+ ];
26864
+ //#endregion
26865
+ //#region ---- Workplace Safety — Take 5 Checklist ----
26866
+ const WS_TAKE5_OUTCOMES = [
26867
+ {
26868
+ id: AXPDataGenerator.uuid(),
26869
+ name: 'take5_prep_gap_count',
26870
+ title: createMultiLanguageString('Pre-task gaps (section 1)', 'شکاف‌های پیش از کار (بخش ۱)'),
26871
+ description: createMultiLanguageString('Count of section 1 answers that are “No” (readiness gap).', 'تعداد پاسخ‌های «خیر» در بخش ۱ (شکاف آمادگی).'),
26872
+ resultKind: 'number',
26873
+ expression: TAKE5_PREP_GAP_COUNT_EXPR,
26874
+ },
26875
+ {
26876
+ id: AXPDataGenerator.uuid(),
26877
+ name: 'take5_hazard_yes_count',
26878
+ title: createMultiLanguageString('Hazards flagged (section 2)', 'خطرهای علامت‌خورده (بخش ۲)'),
26879
+ description: createMultiLanguageString('Count of section 2 answers that are “Yes” (hazard or exposure applies).', 'تعداد پاسخ‌های «بله» در بخش ۲ (وجود خطر یا قرارگیری).'),
26880
+ resultKind: 'number',
26881
+ expression: TAKE5_HAZARD_YES_COUNT_EXPR,
26882
+ },
26883
+ {
26884
+ id: AXPDataGenerator.uuid(),
26885
+ name: 'take5_permit_yes_count',
26886
+ title: createMultiLanguageString('Permit types required (section 3)', 'انواع مجوز لازم (بخش ۳)'),
26887
+ description: createMultiLanguageString('Count of section 3 answers that are “Yes” (that permit pathway applies).', 'تعداد پاسخ‌های «بله» در بخش ۳ (مسیر مجوز مربوطه اعمال می‌شود).'),
26888
+ resultKind: 'number',
26889
+ expression: TAKE5_PERMIT_YES_COUNT_EXPR,
26890
+ },
26891
+ {
26892
+ id: AXPDataGenerator.uuid(),
26893
+ name: 'take5_favourable_count',
26894
+ title: createMultiLanguageString('Favourable answers (0–27)', 'پاسخ‌های مطلوب (۰–۲۷)'),
26895
+ description: createMultiLanguageString('Answers that match Take 5 “safe” polarity for each section.', 'پاسخ‌هایی که با قطبش «ایمن» فرم Take 5 برای هر بخش هم‌خوان است.'),
26896
+ resultKind: 'number',
26897
+ expression: TAKE5_FAVOURABLE_COUNT_EXPR,
26898
+ },
26899
+ {
26900
+ id: AXPDataGenerator.uuid(),
26901
+ name: 'take5_readiness_score',
26902
+ title: createMultiLanguageString('Readiness score', 'امتیاز آمادگی'),
26903
+ description: createMultiLanguageString('0–100 from favourable answers (27 questions, equal weight).', '۰–۱۰۰ از پاسخ‌های مطلوب (۲۷ سؤال، وزن یکسان).'),
26904
+ resultKind: 'number',
26905
+ expression: "fn.ROUND(Number(outcome.eval('take5_favourable_count')) / 27 * 100, 0)",
26906
+ },
26907
+ {
26908
+ id: AXPDataGenerator.uuid(),
26909
+ name: 'take5_readiness_band',
26910
+ title: createMultiLanguageString('Readiness band', 'باند آمادگی'),
26911
+ description: createMultiLanguageString('Traffic-light summary from readiness score.', 'خلاصه چراغ راهنمایی از امتیاز آمادگی.'),
26912
+ resultKind: 'string',
26913
+ expression: "Number(outcome.eval('take5_readiness_score')) >= 100 ? 'Green — all checks favourable' : Number(outcome.eval('take5_readiness_score')) >= 85 ? 'Amber — review gaps' : 'Red — stop and reassess'",
26914
+ },
26915
+ {
26916
+ id: AXPDataGenerator.uuid(),
26917
+ name: 'take5_focus_message',
26918
+ title: createMultiLanguageString('Focus message', 'پیام تمرکز'),
26919
+ description: createMultiLanguageString('Short guidance: which section to address first.', 'راهنمای کوتاه: کدام بخش را اول رسیدگی کنید.'),
26920
+ resultKind: 'string',
26921
+ expression: "Number(outcome.eval('take5_prep_gap_count')) > 0 ? 'Address section 1 pre-task gaps before starting' : Number(outcome.eval('take5_hazard_yes_count')) > 0 ? 'Control section 2 hazards before work' : Number(outcome.eval('take5_permit_yes_count')) > 0 ? 'Confirm section 3 permits are issued and signed on' : Number(outcome.eval('take5_readiness_score')) >= 100 ? 'Proceed — maintain controls in place' : 'Review answers with your supervisor'",
26922
+ },
26923
+ {
26924
+ id: AXPDataGenerator.uuid(),
26925
+ name: 'take5_all_checks_pass',
26926
+ title: createMultiLanguageString('All checks pass', 'همهٔ موارد قبول'),
26927
+ description: createMultiLanguageString('True when every line matches the favourable Yes/No pattern.', 'وقتی همهٔ سطرها با الگوی مطلوب بله/خیر هم‌خوان باشد برابر true است.'),
26928
+ resultKind: 'boolean',
26929
+ expression: "Number(outcome.eval('take5_favourable_count')) === 27",
26930
+ },
26931
+ ];
26932
+ //#endregion
26933
+
26009
26934
  //#region ---- Imports ----
26010
26935
  //#endregion
26011
26936
  const q = mockQuestionBankItemByName;
@@ -26024,7 +26949,7 @@ const workplaceSafetyQuestionnaires = [
26024
26949
  post: {
26025
26950
  reviewEnabled: false,
26026
26951
  summaryEnabled: true,
26027
- showCalculationResults: true,
26952
+ showOutcomeResults: true,
26028
26953
  summaryContent: {
26029
26954
  'en-US': '<p><strong>Summary</strong></p>' +
26030
26955
  '<p>Risk points: <strong>{{risk_points}}</strong></p>' +
@@ -26078,6 +27003,7 @@ const workplaceSafetyQuestionnaires = [
26078
27003
  },
26079
27004
  ],
26080
27005
  },
27006
+ outcomes: createQuestionnaireOutcomesSection(WS_HAZARD_OUTCOMES),
26081
27007
  scoringType: 'none',
26082
27008
  timeLimit: 600,
26083
27009
  allowPause: true,
@@ -26097,7 +27023,7 @@ const workplaceSafetyQuestionnaires = [
26097
27023
  post: {
26098
27024
  reviewEnabled: false,
26099
27025
  summaryEnabled: true,
26100
- showCalculationResults: true,
27026
+ showOutcomeResults: true,
26101
27027
  summaryContent: {
26102
27028
  'en-US': '<p><strong>Summary</strong></p>' +
26103
27029
  '<p>PPE compliance score: <strong>{{ppe_compliance_score}}</strong> / 100</p>' +
@@ -26140,6 +27066,7 @@ const workplaceSafetyQuestionnaires = [
26140
27066
  },
26141
27067
  ],
26142
27068
  },
27069
+ outcomes: createQuestionnaireOutcomesSection(WS_PPE_OUTCOMES),
26143
27070
  scoringType: 'none',
26144
27071
  timeLimit: 480,
26145
27072
  allowPause: true,
@@ -26159,7 +27086,7 @@ const workplaceSafetyQuestionnaires = [
26159
27086
  post: {
26160
27087
  reviewEnabled: false,
26161
27088
  summaryEnabled: true,
26162
- showCalculationResults: true,
27089
+ showOutcomeResults: true,
26163
27090
  summaryContent: {
26164
27091
  'en-US': '<p><strong>Take 5 complete</strong></p>' +
26165
27092
  '<p>Answered <strong>{{answeredCount}}</strong> / <strong>{{totalQuestions}}</strong></p>' +
@@ -26243,6 +27170,7 @@ const workplaceSafetyQuestionnaires = [
26243
27170
  },
26244
27171
  ],
26245
27172
  },
27173
+ outcomes: createQuestionnaireOutcomesSection(WS_TAKE5_OUTCOMES),
26246
27174
  scoringType: 'none',
26247
27175
  timeLimit: 900,
26248
27176
  allowPause: true,
@@ -26260,7 +27188,7 @@ const workplaceSafetyQuestionnaires = [
26260
27188
  //#region ---- Mock Data ----
26261
27189
  /**
26262
27190
  * Mock questionnaires by category (General → … → Compliance; team-lead competencies).
26263
- * Outcome rules use stable ids exported from each `questionnaires-*.mock.ts` file — see questionnaire-calculation.mock.ts.
27191
+ * Outcomes are embedded on each questionnaire via `outcomes.sections` in the matching `questionnaires-*.mock.ts` file.
26264
27192
  */
26265
27193
  const questionnaireMock = [
26266
27194
  ...generalQuestionnaires,
@@ -26361,458 +27289,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
26361
27289
  type: Injectable
26362
27290
  }] });
26363
27291
 
26364
- //#region ---- Imports ----
26365
- //#endregion
26366
- //#region ---- Take 5 checklist expressions ----
26367
- const take5S1Keys = Array.from({ length: 9 }, (_, i) => `take5_1_${String(i + 1).padStart(2, '0')}`);
26368
- const take5S2Keys = Array.from({ length: 9 }, (_, i) => `take5_2_${String(i + 1).padStart(2, '0')}`);
26369
- const take5S3Keys = Array.from({ length: 8 }, (_, i) => `take5_3_${String(i + 1).padStart(2, '0')}`);
26370
- /** Section 1: “no” = gap in pre-task readiness. */
26371
- const TAKE5_PREP_GAP_COUNT_EXPR = `fn.SUM(${take5S1Keys.map((k) => `(answer.eval('${k}') === 'no' ? 1 : 0)`).join(', ')})`;
26372
- /** Section 2: “yes” = hazard / exposure flagged. */
26373
- const TAKE5_HAZARD_YES_COUNT_EXPR = `fn.SUM(${take5S2Keys.map((k) => `(answer.eval('${k}') === 'yes' ? 1 : 0)`).join(', ')})`;
26374
- /** Section 3: “yes” = that permit type is required for this job. */
26375
- const TAKE5_PERMIT_YES_COUNT_EXPR = `fn.SUM(${take5S3Keys.map((k) => `(answer.eval('${k}') === 'yes' ? 1 : 0)`).join(', ')})`;
26376
- /** Favourable answers: S1 & S4 yes; S2 & S3 no (matches paper Take 5 polarity). */
26377
- const TAKE5_FAVOURABLE_COUNT_EXPR = `fn.SUM(${[
26378
- ...take5S1Keys.map((k) => `(answer.eval('${k}') === 'yes' ? 1 : 0)`),
26379
- ...take5S2Keys.map((k) => `(answer.eval('${k}') === 'no' ? 1 : 0)`),
26380
- ...take5S3Keys.map((k) => `(answer.eval('${k}') === 'no' ? 1 : 0)`),
26381
- `(answer.eval('take5_4_01') === 'yes' ? 1 : 0)`,
26382
- ].join(', ')})`;
26383
- const questionnaireCalculationMock = [
26384
- // Health — BMI and MDRD eGFR
26385
- {
26386
- id: AXPDataGenerator.uuid(),
26387
- questionnaireId: QUESTIONNAIRE_ID_HEALTH_BMI,
26388
- name: 'bmi',
26389
- title: createMultiLanguageString('BMI', 'شاخص تودهٔ بدنی'),
26390
- description: createMultiLanguageString('Body mass index (kg/m²) from height (cm) and weight (kg)', 'شاخص تودهٔ بدنی (kg/m²) از قد (سانتی‌متر) و وزن (کیلوگرم)'),
26391
- resultKind: 'number',
26392
- expression: "fn.ROUND(Number(answer.eval('weight_kg')) / ((Number(answer.eval('height_cm')) / 100) ** 2), 1)",
26393
- createdAt: new Date('2025-03-01'),
26394
- updatedAt: new Date('2025-03-01'),
26395
- },
26396
- {
26397
- id: AXPDataGenerator.uuid(),
26398
- questionnaireId: QUESTIONNAIRE_ID_HEALTH_BMI,
26399
- name: 'egfr_mdrd',
26400
- title: createMultiLanguageString('eGFR (MDRD)', 'eGFR (MDRD)'),
26401
- description: createMultiLanguageString('MDRD study equation (Scr mg/dL, age years); female multiplier 0.742.', 'معادلهٔ مطالعهٔ MDRD (کراتینین سرم mg/dL، سن به سال); ضریب ۰٫۷۴۲ برای زنان'),
26402
- resultKind: 'number',
26403
- expression: "fn.ROUND(175 * (Number(answer.eval('scr_mg_dl')) ** -1.154) * (Number(answer.eval('age_years')) ** -0.203) * (answer.eval('sex') === 'female' ? 0.742 : 1), 1)",
26404
- createdAt: new Date('2025-03-01'),
26405
- updatedAt: new Date('2025-03-01'),
26406
- },
26407
- {
26408
- id: AXPDataGenerator.uuid(),
26409
- questionnaireId: QUESTIONNAIRE_ID_HEALTH_BMI,
26410
- name: 'bmi_category',
26411
- title: createMultiLanguageString('BMI category', 'دستهٔ BMI'),
26412
- description: createMultiLanguageString('WHO-style categories from computed BMI', 'دسته‌بندی سبک سازمان جهانی بهداشت بر اساس BMI محاسبه‌شده'),
26413
- resultKind: 'string',
26414
- expression: "fn.IF(!Number.isFinite(Number(outcome.eval('bmi'))), '', Number(outcome.eval('bmi')) < 18.5 ? 'Underweight' : Number(outcome.eval('bmi')) < 25 ? 'Normal' : Number(outcome.eval('bmi')) < 30 ? 'Overweight' : 'Obese')",
26415
- createdAt: new Date('2025-03-01'),
26416
- updatedAt: new Date('2025-03-01'),
26417
- },
26418
- // Health — Lifestyle index
26419
- {
26420
- id: AXPDataGenerator.uuid(),
26421
- questionnaireId: QUESTIONNAIRE_ID_HEALTH_WELLBEING,
26422
- name: 'wellness_index',
26423
- title: createMultiLanguageString('Lifestyle index', 'شاخص سبک زندگی'),
26424
- description: createMultiLanguageString('Weighted 0–100 from sleep, inverse stress, exercise, hydration, energy', 'میانگین وزنی ۰–۱۰۰ از خواب، کاهش استرس، ورزش، آبرسانی و انرژی'),
26425
- resultKind: 'number',
26426
- expression: "fn.ROUND((fn.IF(Number(answer.eval('sleep_h')) > 10, 10, Number(answer.eval('sleep_h')))) / 10 * 20 + (6 - Number(answer.eval('stress_lv'))) / 5 * 20 + (fn.IF(Number(answer.eval('exercise_m')) > 300, 300, Number(answer.eval('exercise_m')))) / 300 * 20 + (fn.IF(Number(answer.eval('water_g')) > 12, 12, Number(answer.eval('water_g')))) / 12 * 20 + Number(answer.eval('energy_lv')) / 5 * 20, 0)",
26427
- createdAt: new Date('2025-03-15'),
26428
- updatedAt: new Date('2025-03-15'),
26429
- },
26430
- {
26431
- id: AXPDataGenerator.uuid(),
26432
- questionnaireId: QUESTIONNAIRE_ID_HEALTH_WELLBEING,
26433
- name: 'wellness_band',
26434
- title: createMultiLanguageString('Lifestyle band', 'باند سبک زندگی'),
26435
- description: createMultiLanguageString('Interpretation of composite index', 'تفسیر شاخص ترکیبی'),
26436
- resultKind: 'string',
26437
- expression: "Number(outcome.eval('wellness_index')) >= 75 ? 'Thriving' : Number(outcome.eval('wellness_index')) >= 50 ? 'Balanced' : 'Plan support'",
26438
- createdAt: new Date('2025-03-15'),
26439
- updatedAt: new Date('2025-03-15'),
26440
- },
26441
- // Workplace Safety — Hazard
26442
- {
26443
- id: AXPDataGenerator.uuid(),
26444
- questionnaireId: QUESTIONNAIRE_ID_WS_HAZARD,
26445
- name: 'risk_points',
26446
- title: createMultiLanguageString('Risk points', 'امتیاز ریسک'),
26447
- description: createMultiLanguageString('People × days open × severity (1–5)', 'نفر × روزهای باز × شدت (۱–۵)'),
26448
- resultKind: 'number',
26449
- expression: "fn.ROUND(Number(answer.eval('exp_people')) * Number(answer.eval('exp_days')) * Number(answer.eval('sev')), 0)",
26450
- createdAt: new Date('2025-04-01'),
26451
- updatedAt: new Date('2025-04-01'),
26452
- },
26453
- {
26454
- id: AXPDataGenerator.uuid(),
26455
- questionnaireId: QUESTIONNAIRE_ID_WS_HAZARD,
26456
- name: 'risk_priority',
26457
- title: createMultiLanguageString('Action priority', 'اولویت اقدام'),
26458
- description: createMultiLanguageString('Tiered follow-up from risk points', 'پیگیری چندلایه بر اساس امتیاز ریسک'),
26459
- resultKind: 'string',
26460
- expression: "Number(outcome.eval('risk_points')) > 100 ? 'Escalate immediately' : Number(outcome.eval('risk_points')) > 30 ? 'Schedule control' : 'Monitor'",
26461
- createdAt: new Date('2025-04-01'),
26462
- updatedAt: new Date('2025-04-01'),
26463
- },
26464
- // Workplace Safety — PPE
26465
- {
26466
- id: AXPDataGenerator.uuid(),
26467
- questionnaireId: QUESTIONNAIRE_ID_WS_PPE,
26468
- name: 'ppe_compliance_score',
26469
- title: createMultiLanguageString('PPE compliance score', 'امتیاز رعایت تجهیزات حفاظت فردی'),
26470
- description: createMultiLanguageString('100 when PPE adequate; reduced when not', '۱۰۰ وقتی تجهیزات کافی است؛ در غیر این صورت کاهش می‌یابد'),
26471
- resultKind: 'number',
26472
- expression: "fn.ROUND(answer.eval('whs_ppe_ok') === 'yes' ? 100 : 35, 0)",
26473
- createdAt: new Date('2025-04-08'),
26474
- updatedAt: new Date('2025-04-08'),
26475
- },
26476
- {
26477
- id: AXPDataGenerator.uuid(),
26478
- questionnaireId: QUESTIONNAIRE_ID_WS_PPE,
26479
- name: 'ppe_compliance_band',
26480
- title: createMultiLanguageString('PPE band', 'باند تجهیزات حفاظت فردی'),
26481
- description: createMultiLanguageString('Traffic-light style', 'سبک چراغ راهنمایی (قرمز/زرد/سبز)'),
26482
- resultKind: 'string',
26483
- expression: "Number(outcome.eval('ppe_compliance_score')) >= 80 ? 'Green' : Number(outcome.eval('ppe_compliance_score')) >= 50 ? 'Amber' : 'Red'",
26484
- createdAt: new Date('2025-04-08'),
26485
- updatedAt: new Date('2025-04-08'),
26486
- },
26487
- // Workplace Safety — Take 5 Checklist
26488
- {
26489
- id: AXPDataGenerator.uuid(),
26490
- questionnaireId: QUESTIONNAIRE_ID_WS_TAKE5,
26491
- name: 'take5_prep_gap_count',
26492
- title: createMultiLanguageString('Pre-task gaps (section 1)', 'شکاف‌های پیش از کار (بخش ۱)'),
26493
- description: createMultiLanguageString('Count of section 1 answers that are “No” (readiness gap).', 'تعداد پاسخ‌های «خیر» در بخش ۱ (شکاف آمادگی).'),
26494
- resultKind: 'number',
26495
- expression: TAKE5_PREP_GAP_COUNT_EXPR,
26496
- createdAt: new Date('2026-04-21'),
26497
- updatedAt: new Date('2026-04-21'),
26498
- },
26499
- {
26500
- id: AXPDataGenerator.uuid(),
26501
- questionnaireId: QUESTIONNAIRE_ID_WS_TAKE5,
26502
- name: 'take5_hazard_yes_count',
26503
- title: createMultiLanguageString('Hazards flagged (section 2)', 'خطرهای علامت‌خورده (بخش ۲)'),
26504
- description: createMultiLanguageString('Count of section 2 answers that are “Yes” (hazard or exposure applies).', 'تعداد پاسخ‌های «بله» در بخش ۲ (وجود خطر یا قرارگیری).'),
26505
- resultKind: 'number',
26506
- expression: TAKE5_HAZARD_YES_COUNT_EXPR,
26507
- createdAt: new Date('2026-04-21'),
26508
- updatedAt: new Date('2026-04-21'),
26509
- },
26510
- {
26511
- id: AXPDataGenerator.uuid(),
26512
- questionnaireId: QUESTIONNAIRE_ID_WS_TAKE5,
26513
- name: 'take5_permit_yes_count',
26514
- title: createMultiLanguageString('Permit types required (section 3)', 'انواع مجوز لازم (بخش ۳)'),
26515
- description: createMultiLanguageString('Count of section 3 answers that are “Yes” (that permit pathway applies).', 'تعداد پاسخ‌های «بله» در بخش ۳ (مسیر مجوز مربوطه اعمال می‌شود).'),
26516
- resultKind: 'number',
26517
- expression: TAKE5_PERMIT_YES_COUNT_EXPR,
26518
- createdAt: new Date('2026-04-21'),
26519
- updatedAt: new Date('2026-04-21'),
26520
- },
26521
- {
26522
- id: AXPDataGenerator.uuid(),
26523
- questionnaireId: QUESTIONNAIRE_ID_WS_TAKE5,
26524
- name: 'take5_favourable_count',
26525
- title: createMultiLanguageString('Favourable answers (0–27)', 'پاسخ‌های مطلوب (۰–۲۷)'),
26526
- description: createMultiLanguageString('Answers that match Take 5 “safe” polarity for each section.', 'پاسخ‌هایی که با قطبش «ایمن» فرم Take 5 برای هر بخش هم‌خوان است.'),
26527
- resultKind: 'number',
26528
- expression: TAKE5_FAVOURABLE_COUNT_EXPR,
26529
- createdAt: new Date('2026-04-21'),
26530
- updatedAt: new Date('2026-04-21'),
26531
- },
26532
- {
26533
- id: AXPDataGenerator.uuid(),
26534
- questionnaireId: QUESTIONNAIRE_ID_WS_TAKE5,
26535
- name: 'take5_readiness_score',
26536
- title: createMultiLanguageString('Readiness score', 'امتیاز آمادگی'),
26537
- description: createMultiLanguageString('0–100 from favourable answers (27 questions, equal weight).', '۰–۱۰۰ از پاسخ‌های مطلوب (۲۷ سؤال، وزن یکسان).'),
26538
- resultKind: 'number',
26539
- expression: "fn.ROUND(Number(outcome.eval('take5_favourable_count')) / 27 * 100, 0)",
26540
- createdAt: new Date('2026-04-21'),
26541
- updatedAt: new Date('2026-04-21'),
26542
- },
26543
- {
26544
- id: AXPDataGenerator.uuid(),
26545
- questionnaireId: QUESTIONNAIRE_ID_WS_TAKE5,
26546
- name: 'take5_readiness_band',
26547
- title: createMultiLanguageString('Readiness band', 'باند آمادگی'),
26548
- description: createMultiLanguageString('Traffic-light summary from readiness score.', 'خلاصه چراغ راهنمایی از امتیاز آمادگی.'),
26549
- resultKind: 'string',
26550
- expression: "Number(outcome.eval('take5_readiness_score')) >= 100 ? 'Green — all checks favourable' : Number(outcome.eval('take5_readiness_score')) >= 85 ? 'Amber — review gaps' : 'Red — stop and reassess'",
26551
- createdAt: new Date('2026-04-21'),
26552
- updatedAt: new Date('2026-04-21'),
26553
- },
26554
- {
26555
- id: AXPDataGenerator.uuid(),
26556
- questionnaireId: QUESTIONNAIRE_ID_WS_TAKE5,
26557
- name: 'take5_focus_message',
26558
- title: createMultiLanguageString('Focus message', 'پیام تمرکز'),
26559
- description: createMultiLanguageString('Short guidance: which section to address first.', 'راهنمای کوتاه: کدام بخش را اول رسیدگی کنید.'),
26560
- resultKind: 'string',
26561
- expression: "Number(outcome.eval('take5_prep_gap_count')) > 0 ? 'Address section 1 pre-task gaps before starting' : Number(outcome.eval('take5_hazard_yes_count')) > 0 ? 'Control section 2 hazards before work' : Number(outcome.eval('take5_permit_yes_count')) > 0 ? 'Confirm section 3 permits are issued and signed on' : Number(outcome.eval('take5_readiness_score')) >= 100 ? 'Proceed — maintain controls in place' : 'Review answers with your supervisor'",
26562
- createdAt: new Date('2026-04-21'),
26563
- updatedAt: new Date('2026-04-21'),
26564
- },
26565
- {
26566
- id: AXPDataGenerator.uuid(),
26567
- questionnaireId: QUESTIONNAIRE_ID_WS_TAKE5,
26568
- name: 'take5_all_checks_pass',
26569
- title: createMultiLanguageString('All checks pass', 'همهٔ موارد قبول'),
26570
- description: createMultiLanguageString('True when every line matches the favourable Yes/No pattern.', 'وقتی همهٔ سطرها با الگوی مطلوب بله/خیر هم‌خوان باشد برابر true است.'),
26571
- resultKind: 'boolean',
26572
- expression: "Number(outcome.eval('take5_favourable_count')) === 27",
26573
- createdAt: new Date('2026-04-21'),
26574
- updatedAt: new Date('2026-04-21'),
26575
- },
26576
- // General — Team alignment
26577
- {
26578
- id: AXPDataGenerator.uuid(),
26579
- questionnaireId: QUESTIONNAIRE_ID_GENERAL_TEAM_PULSE,
26580
- name: 'gen_alignment_index',
26581
- title: createMultiLanguageString('Alignment index', 'شاخص هم‌ترازی'),
26582
- description: createMultiLanguageString('0–100 from two 1–5 ratings', '۰–۱۰۰ از دو امتیاز ۱–۵'),
26583
- resultKind: 'number',
26584
- expression: "fn.ROUND(((Number(answer.eval('gen_priority_clarity')) + Number(answer.eval('gen_manager_support'))) / 2 - 1) / 4 * 100, 0)",
26585
- createdAt: new Date('2025-01-20'),
26586
- updatedAt: new Date('2025-01-20'),
26587
- },
26588
- {
26589
- id: AXPDataGenerator.uuid(),
26590
- questionnaireId: QUESTIONNAIRE_ID_GENERAL_TEAM_PULSE,
26591
- name: 'gen_alignment_band',
26592
- title: createMultiLanguageString('Alignment band', 'باند هم‌ترازی'),
26593
- resultKind: 'string',
26594
- expression: "Number(outcome.eval('gen_alignment_index')) >= 70 ? 'Aligned' : Number(outcome.eval('gen_alignment_index')) >= 40 ? 'Mixed' : 'At risk'",
26595
- createdAt: new Date('2025-01-20'),
26596
- updatedAt: new Date('2025-01-20'),
26597
- },
26598
- // General — Office workplace quality
26599
- {
26600
- id: AXPDataGenerator.uuid(),
26601
- questionnaireId: QUESTIONNAIRE_ID_GENERAL_OFFICE_QUALITY,
26602
- name: 'office_quality_index',
26603
- title: createMultiLanguageString('Office quality index', 'شاخص کیفیت محیط اداری'),
26604
- description: createMultiLanguageString('0–100 from seven 1–5 ratings (ergonomics through amenities)', '۰–۱۰۰ از هفت امتیاز ۱–۵ (ارگونومی تا امکانات)'),
26605
- resultKind: 'number',
26606
- expression: "fn.ROUND(((Number(answer.eval('off_ergo')) + Number(answer.eval('off_light')) + Number(answer.eval('off_noise')) + Number(answer.eval('off_climate')) + Number(answer.eval('off_space')) + Number(answer.eval('off_focus')) + Number(answer.eval('off_amenities'))) / 7 - 1) / 4 * 100, 0)",
26607
- createdAt: new Date('2025-02-05'),
26608
- updatedAt: new Date('2025-02-05'),
26609
- },
26610
- {
26611
- id: AXPDataGenerator.uuid(),
26612
- questionnaireId: QUESTIONNAIRE_ID_GENERAL_OFFICE_QUALITY,
26613
- name: 'office_quality_band',
26614
- title: createMultiLanguageString('Office quality band', 'باند کیفیت محیط اداری'),
26615
- resultKind: 'string',
26616
- expression: "Number(outcome.eval('office_quality_index')) >= 75 ? 'Good' : Number(outcome.eval('office_quality_index')) >= 50 ? 'Fair' : 'Poor'",
26617
- createdAt: new Date('2025-02-05'),
26618
- updatedAt: new Date('2025-02-05'),
26619
- },
26620
- // Plant — Work order
26621
- {
26622
- id: AXPDataGenerator.uuid(),
26623
- questionnaireId: QUESTIONNAIRE_ID_PM_WORK_ORDER,
26624
- name: 'maint_backlog_priority',
26625
- title: createMultiLanguageString('Backlog priority score', 'امتیاز اولویت انباشت کار'),
26626
- description: createMultiLanguageString('Downtime × quality gap × LOTO factor', 'زمان توقف × شکاف کیفیت × ضریب LOTO'),
26627
- resultKind: 'number',
26628
- expression: "fn.ROUND(Number(answer.eval('maint_downtime_h')) * (6 - Number(answer.eval('maint_pm_quality'))) * (answer.eval('maint_loto') === 'yes' ? 1 : 1.5), 0)",
26629
- createdAt: new Date('2025-03-10'),
26630
- updatedAt: new Date('2025-03-10'),
26631
- },
26632
- {
26633
- id: AXPDataGenerator.uuid(),
26634
- questionnaireId: QUESTIONNAIRE_ID_PM_WORK_ORDER,
26635
- name: 'maint_backlog_tier',
26636
- title: createMultiLanguageString('Backlog tier', 'سطح انباشت کار'),
26637
- resultKind: 'string',
26638
- expression: "Number(outcome.eval('maint_backlog_priority')) > 80 ? 'Escalate' : Number(outcome.eval('maint_backlog_priority')) > 25 ? 'Plan work' : 'Monitor'",
26639
- createdAt: new Date('2025-03-10'),
26640
- updatedAt: new Date('2025-03-10'),
26641
- },
26642
- // Plant — Spares
26643
- {
26644
- id: AXPDataGenerator.uuid(),
26645
- questionnaireId: QUESTIONNAIRE_ID_PM_SPARES,
26646
- name: 'maint_logistics_risk',
26647
- title: createMultiLanguageString('Logistics risk score', 'امتیاز ریسک تدارکات'),
26648
- description: createMultiLanguageString('MTTR weighted when spares are not assured', 'MTTR وزن‌دار وقتی یدکی تضمین نشده است'),
26649
- resultKind: 'number',
26650
- expression: "fn.ROUND(Number(answer.eval('maint_mttr_h')) * (answer.eval('maint_spare_ok') === 'yes' ? 1 : 2.2), 0)",
26651
- createdAt: new Date('2025-03-18'),
26652
- updatedAt: new Date('2025-03-18'),
26653
- },
26654
- {
26655
- id: AXPDataGenerator.uuid(),
26656
- questionnaireId: QUESTIONNAIRE_ID_PM_SPARES,
26657
- name: 'maint_logistics_followup',
26658
- title: createMultiLanguageString('Logistics follow-up', 'پیگیری تدارکات'),
26659
- resultKind: 'string',
26660
- expression: "Number(outcome.eval('maint_logistics_risk')) > 50 ? 'Source spares or expedite' : 'Monitor'",
26661
- createdAt: new Date('2025-03-18'),
26662
- updatedAt: new Date('2025-03-18'),
26663
- },
26664
- // Compliance — Governance
26665
- {
26666
- id: AXPDataGenerator.uuid(),
26667
- questionnaireId: QUESTIONNAIRE_ID_CP_GOVERNANCE,
26668
- name: 'comp_resilience_index',
26669
- title: createMultiLanguageString('Resilience index', 'شاخص تاب‌آوری'),
26670
- description: createMultiLanguageString('Governance strength minus drill decay', 'قدرت حاکمیتی منهای کهنگی مانور'),
26671
- resultKind: 'number',
26672
- expression: "fn.ROUND(fn.MIN(100, fn.MAX(0, Number(answer.eval('comp_governance')) * 18 - Number(answer.eval('comp_months_drill')) * 3 + 10)), 0)",
26673
- createdAt: new Date('2025-04-02'),
26674
- updatedAt: new Date('2025-04-02'),
26675
- },
26676
- {
26677
- id: AXPDataGenerator.uuid(),
26678
- questionnaireId: QUESTIONNAIRE_ID_CP_GOVERNANCE,
26679
- name: 'comp_resilience_status',
26680
- title: createMultiLanguageString('Resilience status', 'وضعیت تاب‌آوری'),
26681
- resultKind: 'string',
26682
- expression: "Number(outcome.eval('comp_resilience_index')) >= 70 ? 'Strong' : Number(outcome.eval('comp_resilience_index')) >= 45 ? 'Moderate' : 'Improve'",
26683
- createdAt: new Date('2025-04-02'),
26684
- updatedAt: new Date('2025-04-02'),
26685
- },
26686
- // Compliance — Permits
26687
- {
26688
- id: AXPDataGenerator.uuid(),
26689
- questionnaireId: QUESTIONNAIRE_ID_CP_PERMITS,
26690
- name: 'comp_readiness_score',
26691
- title: createMultiLanguageString('Readiness score', 'امتیاز آمادگی'),
26692
- resultKind: 'number',
26693
- expression: "fn.ROUND(fn.MIN(100, (answer.eval('comp_audit_ready') === 'yes' ? 42 : 8) + (answer.eval('comp_permit_valid') === 'yes' ? 42 : 12) + Number(answer.eval('comp_training_current')) * 3.2), 0)",
26694
- createdAt: new Date('2025-04-12'),
26695
- updatedAt: new Date('2025-04-12'),
26696
- },
26697
- {
26698
- id: AXPDataGenerator.uuid(),
26699
- questionnaireId: QUESTIONNAIRE_ID_CP_PERMITS,
26700
- name: 'comp_readiness_next_step',
26701
- title: createMultiLanguageString('Next step', 'گام بعدی'),
26702
- resultKind: 'string',
26703
- expression: "Number(outcome.eval('comp_readiness_score')) >= 75 ? 'Keep cadence' : 'Schedule remediation workshop'",
26704
- createdAt: new Date('2025-04-12'),
26705
- updatedAt: new Date('2025-04-12'),
26706
- },
26707
- // Team lead — competency pillars (1–5 answers → 0–100 index per pillar)
26708
- {
26709
- id: AXPDataGenerator.uuid(),
26710
- questionnaireId: QUESTIONNAIRE_ID_TEAM_LEAD_COMPANY_WIDE,
26711
- name: 'tls_pillar_technical_index',
26712
- title: createMultiLanguageString('Technical pillar index', 'شاخص ستون فنی'),
26713
- description: createMultiLanguageString('0–100 from nine 1–5 ratings (technical & professional)', '۰–۱۰۰ از نه امتیاز ۱–۵ (فنی و حرفه‌ای)'),
26714
- resultKind: 'number',
26715
- expression: "fn.ROUND(((Number(answer.eval('tls_tp_stack_tools')) + Number(answer.eval('tls_tp_code_quality')) + Number(answer.eval('tls_tp_complex_problems')) + Number(answer.eval('tls_tp_architecture_decisions')) + Number(answer.eval('tls_tp_best_practices')) + Number(answer.eval('tls_tp_code_review_feedback')) + Number(answer.eval('tls_tp_debugging')) + Number(answer.eval('tls_tp_knowledge_currency')) + Number(answer.eval('tls_tp_mentoring_transfer'))) / 9 - 1) / 4 * 100, 0)",
26716
- createdAt: new Date('2026-01-15'),
26717
- updatedAt: new Date('2026-01-15'),
26718
- },
26719
- {
26720
- id: AXPDataGenerator.uuid(),
26721
- questionnaireId: QUESTIONNAIRE_ID_TEAM_LEAD_COMPANY_WIDE,
26722
- name: 'tls_pillar_behavioral_index',
26723
- title: createMultiLanguageString('Behavioral pillar index', 'شاخص ستون رفتاری'),
26724
- description: createMultiLanguageString('0–100 from seven 1–5 ratings', '۰–۱۰۰ از هفت امتیاز ۱–۵'),
26725
- resultKind: 'number',
26726
- expression: "fn.ROUND(((Number(answer.eval('tls_bc_team_communication')) + Number(answer.eval('tls_bc_meetings_participation')) + Number(answer.eval('tls_bc_listening_inclusion')) + Number(answer.eval('tls_bc_feedback_tone')) + Number(answer.eval('tls_bc_disagreement_handling')) + Number(answer.eval('tls_bc_pressure_composure')) + Number(answer.eval('tls_bc_trust_collaboration'))) / 7 - 1) / 4 * 100, 0)",
26727
- createdAt: new Date('2026-01-15'),
26728
- updatedAt: new Date('2026-01-15'),
26729
- },
26730
- {
26731
- id: AXPDataGenerator.uuid(),
26732
- questionnaireId: QUESTIONNAIRE_ID_TEAM_LEAD_COMPANY_WIDE,
26733
- name: 'tls_pillar_management_index',
26734
- title: createMultiLanguageString('Management pillar index', 'شاخص ستون مدیریتی'),
26735
- description: createMultiLanguageString('0–100 from ten 1–5 ratings', '۰–۱۰۰ از ده امتیاز ۱–۵'),
26736
- resultKind: 'number',
26737
- expression: "fn.ROUND(((Number(answer.eval('tls_ml_work_distribution')) + Number(answer.eval('tls_ml_backlog_priorities')) + Number(answer.eval('tls_ml_agile_meetings')) + Number(answer.eval('tls_ml_task_breakdown')) + Number(answer.eval('tls_ml_progress_tracking')) + Number(answer.eval('tls_ml_blockers')) + Number(answer.eval('tls_ml_timely_decisions')) + Number(answer.eval('tls_ml_growth_coaching')) + Number(answer.eval('tls_ml_delivery_timing')) + Number(answer.eval('tls_ml_crisis_leadership'))) / 10 - 1) / 4 * 100, 0)",
26738
- createdAt: new Date('2026-01-15'),
26739
- updatedAt: new Date('2026-01-15'),
26740
- },
26741
- {
26742
- id: AXPDataGenerator.uuid(),
26743
- questionnaireId: QUESTIONNAIRE_ID_TEAM_LEAD_COMPANY_WIDE,
26744
- name: 'tls_pillar_business_index',
26745
- title: createMultiLanguageString('Business pillar index', 'شاخص ستون کسب‌وکار'),
26746
- description: createMultiLanguageString('0–100 from eight 1–5 ratings', '۰–۱۰۰ از هشت امتیاز ۱–۵'),
26747
- resultKind: 'number',
26748
- expression: "fn.ROUND(((Number(answer.eval('tls_bo_product_user_understanding')) + Number(answer.eval('tls_bo_business_impact')) + Number(answer.eval('tls_bo_quality_time_cost')) + Number(answer.eval('tls_bo_value_prioritization')) + Number(answer.eval('tls_bo_product_owner_sync')) + Number(answer.eval('tls_bo_requirements_handoff')) + Number(answer.eval('tls_bo_roadmap_awareness')) + Number(answer.eval('tls_bo_customer_value'))) / 8 - 1) / 4 * 100, 0)",
26749
- createdAt: new Date('2026-01-15'),
26750
- updatedAt: new Date('2026-01-15'),
26751
- },
26752
- {
26753
- id: AXPDataGenerator.uuid(),
26754
- questionnaireId: QUESTIONNAIRE_ID_TEAM_LEAD_COMPANY_WIDE,
26755
- name: 'tls_overall_competency_index',
26756
- title: createMultiLanguageString('Overall competency index', 'شاخص شایستگی کلی'),
26757
- description: createMultiLanguageString('0–100 across all 34 items (same weight per question)', '۰–۱۰۰ روی هر ۳۴ سوال (وزن یکسان)'),
26758
- resultKind: 'number',
26759
- expression: "fn.ROUND(((Number(answer.eval('tls_tp_stack_tools')) + Number(answer.eval('tls_tp_code_quality')) + Number(answer.eval('tls_tp_complex_problems')) + Number(answer.eval('tls_tp_architecture_decisions')) + Number(answer.eval('tls_tp_best_practices')) + Number(answer.eval('tls_tp_code_review_feedback')) + Number(answer.eval('tls_tp_debugging')) + Number(answer.eval('tls_tp_knowledge_currency')) + Number(answer.eval('tls_tp_mentoring_transfer')) + Number(answer.eval('tls_bc_team_communication')) + Number(answer.eval('tls_bc_meetings_participation')) + Number(answer.eval('tls_bc_listening_inclusion')) + Number(answer.eval('tls_bc_feedback_tone')) + Number(answer.eval('tls_bc_disagreement_handling')) + Number(answer.eval('tls_bc_pressure_composure')) + Number(answer.eval('tls_bc_trust_collaboration')) + Number(answer.eval('tls_ml_work_distribution')) + Number(answer.eval('tls_ml_backlog_priorities')) + Number(answer.eval('tls_ml_agile_meetings')) + Number(answer.eval('tls_ml_task_breakdown')) + Number(answer.eval('tls_ml_progress_tracking')) + Number(answer.eval('tls_ml_blockers')) + Number(answer.eval('tls_ml_timely_decisions')) + Number(answer.eval('tls_ml_growth_coaching')) + Number(answer.eval('tls_ml_delivery_timing')) + Number(answer.eval('tls_ml_crisis_leadership')) + Number(answer.eval('tls_bo_product_user_understanding')) + Number(answer.eval('tls_bo_business_impact')) + Number(answer.eval('tls_bo_quality_time_cost')) + Number(answer.eval('tls_bo_value_prioritization')) + Number(answer.eval('tls_bo_product_owner_sync')) + Number(answer.eval('tls_bo_requirements_handoff')) + Number(answer.eval('tls_bo_roadmap_awareness')) + Number(answer.eval('tls_bo_customer_value'))) / 34 - 1) / 4 * 100, 0)",
26760
- createdAt: new Date('2026-01-15'),
26761
- updatedAt: new Date('2026-01-15'),
26762
- },
26763
- {
26764
- id: AXPDataGenerator.uuid(),
26765
- questionnaireId: QUESTIONNAIRE_ID_TEAM_LEAD_COMPANY_WIDE,
26766
- name: 'tls_competency_band',
26767
- title: createMultiLanguageString('Overall competency band', 'باند شایستگی کلی'),
26768
- description: createMultiLanguageString('Interpretation of tls_overall_competency_index', 'تفسیر شاخص شایستگی کلی'),
26769
- resultKind: 'string',
26770
- expression: "Number(outcome.eval('tls_overall_competency_index')) >= 80 ? 'Leading' : Number(outcome.eval('tls_overall_competency_index')) >= 65 ? 'Strong' : Number(outcome.eval('tls_overall_competency_index')) >= 50 ? 'Solid' : Number(outcome.eval('tls_overall_competency_index')) >= 35 ? 'Developing' : 'Priority focus'",
26771
- createdAt: new Date('2026-01-15'),
26772
- updatedAt: new Date('2026-01-15'),
26773
- },
26774
- {
26775
- id: AXPDataGenerator.uuid(),
26776
- questionnaireId: QUESTIONNAIRE_ID_TEAM_LEAD_COMPANY_WIDE,
26777
- name: 'tls_pillar_balance_spread',
26778
- title: createMultiLanguageString('Pillar balance spread', 'پراکندگی تعادل ستون‌ها'),
26779
- description: createMultiLanguageString('Difference between strongest and weakest pillar index (0–100)', 'تفاوت بین بالاترین و پایین‌ترین شاخص ستون (۰–۱۰۰)'),
26780
- resultKind: 'number',
26781
- expression: "fn.ROUND(fn.MAX(fn.MAX(Number(outcome.eval('tls_pillar_technical_index')), Number(outcome.eval('tls_pillar_behavioral_index'))), fn.MAX(Number(outcome.eval('tls_pillar_management_index')), Number(outcome.eval('tls_pillar_business_index')))) - fn.MIN(fn.MIN(Number(outcome.eval('tls_pillar_technical_index')), Number(outcome.eval('tls_pillar_behavioral_index'))), fn.MIN(Number(outcome.eval('tls_pillar_management_index')), Number(outcome.eval('tls_pillar_business_index')))), 0)",
26782
- createdAt: new Date('2026-01-15'),
26783
- updatedAt: new Date('2026-01-15'),
26784
- },
26785
- {
26786
- id: AXPDataGenerator.uuid(),
26787
- questionnaireId: QUESTIONNAIRE_ID_TEAM_LEAD_COMPANY_WIDE,
26788
- name: 'tls_priority_focus_pillar',
26789
- title: createMultiLanguageString('Priority focus pillar', 'ستون تمرکز اولویت'),
26790
- description: createMultiLanguageString('Pillar with the lowest index (coaching hint)', 'ستونی با کمترین شاخص (راهنمای کوچینگ)'),
26791
- resultKind: 'string',
26792
- expression: "Number(outcome.eval('tls_pillar_technical_index')) <= Number(outcome.eval('tls_pillar_behavioral_index')) && Number(outcome.eval('tls_pillar_technical_index')) <= Number(outcome.eval('tls_pillar_management_index')) && Number(outcome.eval('tls_pillar_technical_index')) <= Number(outcome.eval('tls_pillar_business_index')) ? 'Technical & professional' : Number(outcome.eval('tls_pillar_behavioral_index')) <= Number(outcome.eval('tls_pillar_technical_index')) && Number(outcome.eval('tls_pillar_behavioral_index')) <= Number(outcome.eval('tls_pillar_management_index')) && Number(outcome.eval('tls_pillar_behavioral_index')) <= Number(outcome.eval('tls_pillar_business_index')) ? 'Behavioral & communication' : Number(outcome.eval('tls_pillar_management_index')) <= Number(outcome.eval('tls_pillar_technical_index')) && Number(outcome.eval('tls_pillar_management_index')) <= Number(outcome.eval('tls_pillar_behavioral_index')) && Number(outcome.eval('tls_pillar_management_index')) <= Number(outcome.eval('tls_pillar_business_index')) ? 'Management & leadership' : 'Business & organizational'",
26793
- createdAt: new Date('2026-01-15'),
26794
- updatedAt: new Date('2026-01-15'),
26795
- },
26796
- ];
26797
- //#endregion
26798
-
26799
- //#region ---- Imports ----
26800
- //#endregion
26801
- //#region ---- Seeder ----
26802
- class AXMQuestionnaireCalculationDataSeeder {
26803
- constructor() {
26804
- this.storage = inject(AXPEntityStorageService);
26805
- }
26806
- async seed() {
26807
- await this.storage.initial(`${RootConfig$3.module.name}.${RootConfig$3.entities.questionnaireCalculation.name}`, questionnaireCalculationMock);
26808
- }
26809
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMQuestionnaireCalculationDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
26810
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMQuestionnaireCalculationDataSeeder }); }
26811
- }
26812
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMQuestionnaireCalculationDataSeeder, decorators: [{
26813
- type: Injectable
26814
- }] });
26815
-
26816
27292
  class AXCAssessmentManagementMockModule {
26817
27293
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXCAssessmentManagementMockModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
26818
27294
  static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.9", ngImport: i0, type: AXCAssessmentManagementMockModule }); }
@@ -26840,12 +27316,6 @@ class AXCAssessmentManagementMockModule {
26840
27316
  useClass: AXMQuestionnaireDataSeeder,
26841
27317
  multi: true,
26842
27318
  },
26843
- // Then questionnaire calculations (reference questionnaires)
26844
- {
26845
- provide: AXP_DATA_SEEDER_TOKEN,
26846
- useClass: AXMQuestionnaireCalculationDataSeeder,
26847
- multi: true,
26848
- },
26849
27319
  // Then automations (reference questionnaires)
26850
27320
  {
26851
27321
  provide: AXP_DATA_SEEDER_TOKEN,
@@ -26884,12 +27354,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
26884
27354
  useClass: AXMQuestionnaireDataSeeder,
26885
27355
  multi: true,
26886
27356
  },
26887
- // Then questionnaire calculations (reference questionnaires)
26888
- {
26889
- provide: AXP_DATA_SEEDER_TOKEN,
26890
- useClass: AXMQuestionnaireCalculationDataSeeder,
26891
- multi: true,
26892
- },
26893
27357
  // Then automations (reference questionnaires)
26894
27358
  {
26895
27359
  provide: AXP_DATA_SEEDER_TOKEN,
@@ -30179,7 +30643,7 @@ if (locationMock.length >= 15) {
30179
30643
  }
30180
30644
  }
30181
30645
 
30182
- const uuid$o = AXPDataGenerator.uuid;
30646
+ const uuid$n = AXPDataGenerator.uuid;
30183
30647
  /**
30184
30648
  * Identifier rule `asset-system-type-code`: `ASYS-{seq:2}`. Seed uses a high sequence band (90+)
30185
30649
  * so `identifier.peek("asset-system-type-code")` on a fresh store (starts at ASYS-01) does not
@@ -30232,7 +30696,7 @@ const assetSystemTypeMock = [
30232
30696
  metaDataList: { groups: [] },
30233
30697
  },
30234
30698
  {
30235
- id: uuid$o(),
30699
+ id: uuid$n(),
30236
30700
  code: 'ASYS-94',
30237
30701
  title: ml$1('Power Distribution Subsystem Type', 'نوع زیرسیستم توزیع برق'),
30238
30702
  description: ml$1('Subsystem classification for electrical distribution and backup power.', 'طبقه‌بندی زیرسیستم برای توزیع برق و برق پشتیبان.'),
@@ -30246,7 +30710,7 @@ const assetSystemTypeMock = [
30246
30710
  },
30247
30711
  ];
30248
30712
 
30249
- const uuid$n = AXPDataGenerator.uuid;
30713
+ const uuid$m = AXPDataGenerator.uuid;
30250
30714
  const getLocationByCode$1 = (code) => locationMock.find((location) => location.code === code);
30251
30715
  const getAssetSystemTypeById = (id) => assetSystemTypeMock.find((item) => item.id === id);
30252
30716
  const toLocalized$1 = (enUS, faIR) => ({
@@ -30313,7 +30777,7 @@ const assetSystemMock = assetSystemEntries.map((entry) => {
30313
30777
  throw new Error(`Missing location for code: ${entry.locationCode}`);
30314
30778
  }
30315
30779
  return {
30316
- id: uuid$n(),
30780
+ id: uuid$m(),
30317
30781
  code: entry.code,
30318
30782
  title: toLocalized$1(entry.title, entry.titleFa),
30319
30783
  assetSystemTypeId: entry.assetSystemTypeId,
@@ -32634,10 +33098,10 @@ const POSITIONS_MOCK = (() => {
32634
33098
  })();
32635
33099
 
32636
33100
  const M$_ = createMultiLanguageString;
32637
- const uuid$m = AXPDataGenerator.uuid;
33101
+ const uuid$l = AXPDataGenerator.uuid;
32638
33102
  const BUSINESS_UNIT_TYPES_MOCK = [
32639
33103
  {
32640
- id: uuid$m(),
33104
+ id: uuid$l(),
32641
33105
  title: M$_('Division', 'بخش'),
32642
33106
  name: 'division',
32643
33107
  isLocationBased: true,
@@ -32646,7 +33110,7 @@ const BUSINESS_UNIT_TYPES_MOCK = [
32646
33110
  icon: 'fa-sitemap',
32647
33111
  },
32648
33112
  {
32649
- id: uuid$m(),
33113
+ id: uuid$l(),
32650
33114
  title: M$_('Department', 'دپارتمان'),
32651
33115
  name: 'department',
32652
33116
  isLocationBased: false,
@@ -32655,7 +33119,7 @@ const BUSINESS_UNIT_TYPES_MOCK = [
32655
33119
  icon: 'fa-building-user',
32656
33120
  },
32657
33121
  {
32658
- id: uuid$m(),
33122
+ id: uuid$l(),
32659
33123
  title: M$_('Branch', 'شعبه'),
32660
33124
  name: 'branch',
32661
33125
  isLocationBased: true,
@@ -32670,7 +33134,7 @@ const BUSINESS_UNIT_TYPES_MOCK = [
32670
33134
  * Aligns with SAP/Oracle-style “corporate / headquarters” org unit — not nullable on assignments.
32671
33135
  */
32672
33136
  const AXM_CORPORATE_BUSINESS_UNIT_ID = 'a1b2c3d4-e5f6-4789-a012-34567890abcd';
32673
- const uuid$l = AXPDataGenerator.uuid;
33137
+ const uuid$k = AXPDataGenerator.uuid;
32674
33138
  function pickHeadPositionId(bu) {
32675
33139
  const ids = bu.positionIds ?? [];
32676
33140
  if (!ids.length)
@@ -32733,7 +33197,7 @@ const BUSINESS_UNITS_MOCK = (() => {
32733
33197
  items.push(corporateHeadquarters);
32734
33198
  // Divisions under corporate root
32735
33199
  const divisionOps = {
32736
- id: uuid$l(),
33200
+ id: uuid$k(),
32737
33201
  code: 'BU-DIV-OPS',
32738
33202
  title: createMultiLanguageString('Operations Division', 'بخش عملیات'),
32739
33203
  description: createMultiLanguageString('Core operations across plants', 'عملیات اصلی در کارخانه‌ها'),
@@ -32753,7 +33217,7 @@ const BUSINESS_UNITS_MOCK = (() => {
32753
33217
  ]),
32754
33218
  };
32755
33219
  const divisionSales = {
32756
- id: uuid$l(),
33220
+ id: uuid$k(),
32757
33221
  code: 'BU-DIV-SALES',
32758
33222
  title: createMultiLanguageString('Sales Division', 'بخش فروش'),
32759
33223
  description: createMultiLanguageString('Global sales organization', 'سازمان فروش جهانی'),
@@ -32766,7 +33230,7 @@ const BUSINESS_UNITS_MOCK = (() => {
32766
33230
  ...positionsByTitles(['Sales Associate', 'Account Executive', 'Sales Manager', 'VP of Sales']),
32767
33231
  };
32768
33232
  const divisionEngineering = {
32769
- id: uuid$l(),
33233
+ id: uuid$k(),
32770
33234
  code: 'BU-DIV-ENG',
32771
33235
  title: createMultiLanguageString('Engineering Division', 'بخش مهندسی'),
32772
33236
  description: createMultiLanguageString('Product and platform engineering', 'مهندسی محصول و پلتفرم'),
@@ -32781,7 +33245,7 @@ const BUSINESS_UNITS_MOCK = (() => {
32781
33245
  items.push(divisionOps, divisionSales, divisionEngineering);
32782
33246
  // Departments under Operations
32783
33247
  const depHSE = {
32784
- id: uuid$l(),
33248
+ id: uuid$k(),
32785
33249
  code: 'BU-DEPT-HSE',
32786
33250
  title: createMultiLanguageString('Health, Safety & Environment', 'بهداشت، ایمنی و محیط زیست'),
32787
33251
  description: createMultiLanguageString('WHS/OHS', 'بهداشت و ایمنی شغلی'),
@@ -32792,7 +33256,7 @@ const BUSINESS_UNITS_MOCK = (() => {
32792
33256
  ...positionsByTitles(['HSE Officer', 'Safety Officer', 'Environmental Specialist', 'HSE Manager']),
32793
33257
  };
32794
33258
  const depQuality = {
32795
- id: uuid$l(),
33259
+ id: uuid$k(),
32796
33260
  code: 'BU-DEPT-QA',
32797
33261
  title: createMultiLanguageString('Quality Assurance', 'تضمین کیفیت'),
32798
33262
  description: createMultiLanguageString('QA and compliance', 'کنترل کیفیت و انطباق'),
@@ -32810,7 +33274,7 @@ const BUSINESS_UNITS_MOCK = (() => {
32810
33274
  ]),
32811
33275
  };
32812
33276
  const depMaintenance = {
32813
- id: uuid$l(),
33277
+ id: uuid$k(),
32814
33278
  code: 'BU-DEPT-MNT',
32815
33279
  title: createMultiLanguageString('Maintenance', 'نگهداری و تعمیرات'),
32816
33280
  description: createMultiLanguageString('Asset reliability and maintenance', 'قابلیت اطمینان دارایی و نگهداری'),
@@ -32823,7 +33287,7 @@ const BUSINESS_UNITS_MOCK = (() => {
32823
33287
  items.push(depHSE, depQuality, depMaintenance);
32824
33288
  // Departments under Engineering
32825
33289
  const depPlatform = {
32826
- id: uuid$l(),
33290
+ id: uuid$k(),
32827
33291
  code: 'BU-DEPT-PLAT',
32828
33292
  title: createMultiLanguageString('Platform Engineering', 'مهندسی پلتفرم'),
32829
33293
  description: createMultiLanguageString('Core platform teams', 'تیم‌های اصلی پلتفرم'),
@@ -32834,7 +33298,7 @@ const BUSINESS_UNITS_MOCK = (() => {
32834
33298
  ...positionsByTitles(['DevOps Engineer', 'Senior DevOps Engineer', 'Engineering Team Lead', 'Director of DevOps']),
32835
33299
  };
32836
33300
  const depProduct = {
32837
- id: uuid$l(),
33301
+ id: uuid$k(),
32838
33302
  code: 'BU-DEPT-PROD',
32839
33303
  title: createMultiLanguageString('Product Engineering', 'مهندسی محصول'),
32840
33304
  description: createMultiLanguageString('Product squads', 'اسکوادهای محصول'),
@@ -32847,7 +33311,7 @@ const BUSINESS_UNITS_MOCK = (() => {
32847
33311
  items.push(depPlatform, depProduct);
32848
33312
  // Branches (location-based) under cities
32849
33313
  const branchLA = {
32850
- id: uuid$l(),
33314
+ id: uuid$k(),
32851
33315
  code: 'BU-BR-LA',
32852
33316
  title: createMultiLanguageString('Los Angeles Branch', 'شعبه لس‌آنجلس'),
32853
33317
  description: createMultiLanguageString('US West Region', 'منطقه غرب آمریکا'),
@@ -32859,7 +33323,7 @@ const BUSINESS_UNITS_MOCK = (() => {
32859
33323
  geographicRegion: LA,
32860
33324
  };
32861
33325
  const branchSF = {
32862
- id: uuid$l(),
33326
+ id: uuid$k(),
32863
33327
  code: 'BU-BR-SF',
32864
33328
  title: createMultiLanguageString('San Francisco Branch', 'شعبه سان‌فرانسیسکو'),
32865
33329
  description: createMultiLanguageString('Bay Area', 'منطقه خلیج'),
@@ -32871,7 +33335,7 @@ const BUSINESS_UNITS_MOCK = (() => {
32871
33335
  geographicRegion: SF,
32872
33336
  };
32873
33337
  const branchSydney = {
32874
- id: uuid$l(),
33338
+ id: uuid$k(),
32875
33339
  code: 'BU-BR-SYD',
32876
33340
  title: createMultiLanguageString('Sydney Branch', 'شعبه سیدنی'),
32877
33341
  description: createMultiLanguageString('ANZ Region', 'منطقه استرالیا و نیوزیلند'),
@@ -33084,25 +33548,45 @@ const personTitleMocks = [
33084
33548
 
33085
33549
  //#region ---- Tenant ID Constants ----
33086
33550
  /**
33087
- * Tenant ID constants for use across mock data.
33088
- * These are generated once and exported to ensure consistency.
33551
+ * Stable tenant primary keys for mock data (not generated per process) so IndexedDB seeds,
33552
+ * tenant-user links, and subscriptions stay aligned across reloads and user switches.
33089
33553
  */
33090
- const PLATFORM_TENANT_ID = AXPDataGenerator.uuid();
33091
- const TIMEPLICITY_TENANT_ID = AXPDataGenerator.uuid();
33092
- const LASER_PLUMBING_TENANT_ID = AXPDataGenerator.uuid();
33554
+ const PLATFORM_TENANT_ID = 'f0000002-0000-4000-a000-000000000001';
33555
+ const TIMEPLICITY_TENANT_ID = 'f0000002-0000-4000-a000-000000000002';
33556
+ const LASER_PLUMBING_TENANT_ID = 'f0000002-0000-4000-a000-000000000003';
33093
33557
  /** MAGFA — Iran commerce tenant for conversation / AI / reports demo. */
33094
- const MAGFA_TENANT_ID = AXPDataGenerator.uuid();
33558
+ const MAGFA_TENANT_ID = 'f0000002-0000-4000-a000-000000000004';
33095
33559
  /** @deprecated Use {@link MAGFA_TENANT_ID}. */
33096
33560
  const COLLABORATION_TENANT_ID = MAGFA_TENANT_ID;
33097
33561
  //#endregion
33098
33562
 
33563
+ //#region ---- Role ID Constants ----
33564
+ /**
33565
+ * Stable role primary keys for mock data (not generated per process) so IndexedDB seeds,
33566
+ * tenant-user links, and user roleIds stay aligned across reloads.
33567
+ */
33568
+ const MOCK_ROLE_IDS = {
33569
+ root: 'f0000004-0000-4000-a000-000000000001',
33570
+ platformApplicationAdministrator: 'f0000004-0000-4000-a000-000000000002',
33571
+ admin: 'f0000004-0000-4000-a000-000000000003',
33572
+ manager: 'f0000004-0000-4000-a000-000000000004',
33573
+ user: 'f0000004-0000-4000-a000-000000000005',
33574
+ support: 'f0000004-0000-4000-a000-000000000006',
33575
+ hr: 'f0000004-0000-4000-a000-000000000007',
33576
+ finance: 'f0000004-0000-4000-a000-000000000008',
33577
+ dev: 'f0000004-0000-4000-a000-000000000009',
33578
+ accountHolder: 'f0000004-0000-4000-a000-00000000000a',
33579
+ tenantAdministrator: 'f0000004-0000-4000-a000-00000000000b',
33580
+ conversationOnly: 'f0000004-0000-4000-a000-00000000000c',
33581
+ };
33582
+ //#endregion
33583
+
33099
33584
  //#region ---- Imports ----
33100
33585
  //#endregion
33101
33586
  //#region ---- Mock Data ----
33102
- const uuid$k = AXPDataGenerator.uuid;
33103
33587
  const mockRoleDefinitions = [
33104
33588
  {
33105
- id: uuid$k(),
33589
+ id: MOCK_ROLE_IDS.root,
33106
33590
  name: 'root',
33107
33591
  title: 'Super Administrator',
33108
33592
  description: 'Full system access with all administrative privileges',
@@ -33157,7 +33641,7 @@ const mockRoleDefinitions = [
33157
33641
  },
33158
33642
  },
33159
33643
  {
33160
- id: uuid$k(),
33644
+ id: MOCK_ROLE_IDS.platformApplicationAdministrator,
33161
33645
  name: 'platform-application-administrator',
33162
33646
  title: 'Platform Application Administrator',
33163
33647
  description: 'Full platform application access with all administrative privileges',
@@ -33177,7 +33661,7 @@ const mockRoleDefinitions = [
33177
33661
  },
33178
33662
  },
33179
33663
  {
33180
- id: uuid$k(),
33664
+ id: MOCK_ROLE_IDS.admin,
33181
33665
  name: 'admin',
33182
33666
  title: 'Administrator',
33183
33667
  description: 'Full system access with all administrative privileges',
@@ -33198,7 +33682,7 @@ const mockRoleDefinitions = [
33198
33682
  },
33199
33683
  },
33200
33684
  {
33201
- id: uuid$k(),
33685
+ id: MOCK_ROLE_IDS.manager,
33202
33686
  name: 'manager',
33203
33687
  title: 'Manager',
33204
33688
  description: 'Manages users and has access to most system features',
@@ -33216,7 +33700,7 @@ const mockRoleDefinitions = [
33216
33700
  },
33217
33701
  },
33218
33702
  {
33219
- id: uuid$k(),
33703
+ id: MOCK_ROLE_IDS.user,
33220
33704
  name: 'user',
33221
33705
  title: 'Regular User',
33222
33706
  description: 'Standard user with basic system access',
@@ -33236,7 +33720,7 @@ const mockRoleDefinitions = [
33236
33720
  },
33237
33721
  },
33238
33722
  {
33239
- id: uuid$k(),
33723
+ id: MOCK_ROLE_IDS.support,
33240
33724
  name: 'support',
33241
33725
  title: 'Support Staff',
33242
33726
  description: 'Customer support and ticket management access',
@@ -33254,7 +33738,7 @@ const mockRoleDefinitions = [
33254
33738
  },
33255
33739
  },
33256
33740
  {
33257
- id: uuid$k(),
33741
+ id: MOCK_ROLE_IDS.hr,
33258
33742
  name: 'hr',
33259
33743
  title: 'Human Resources',
33260
33744
  description: 'Access to HR-related features and user management',
@@ -33272,7 +33756,7 @@ const mockRoleDefinitions = [
33272
33756
  },
33273
33757
  },
33274
33758
  {
33275
- id: uuid$k(),
33759
+ id: MOCK_ROLE_IDS.finance,
33276
33760
  name: 'finance',
33277
33761
  title: 'Finance',
33278
33762
  description: 'Access to financial reports and invoicing features',
@@ -33290,7 +33774,7 @@ const mockRoleDefinitions = [
33290
33774
  },
33291
33775
  },
33292
33776
  {
33293
- id: uuid$k(),
33777
+ id: MOCK_ROLE_IDS.dev,
33294
33778
  name: 'dev',
33295
33779
  title: 'Developer',
33296
33780
  description: 'Technical access to development and debugging features',
@@ -33312,7 +33796,7 @@ const mockRoleDefinitions = [
33312
33796
  },
33313
33797
  },
33314
33798
  {
33315
- id: uuid$k(),
33799
+ id: MOCK_ROLE_IDS.accountHolder,
33316
33800
  name: 'account-holder',
33317
33801
  title: 'Account Holder',
33318
33802
  description: 'Primary account owner with full tenant management privileges',
@@ -33332,7 +33816,7 @@ const mockRoleDefinitions = [
33332
33816
  },
33333
33817
  },
33334
33818
  {
33335
- id: uuid$k(),
33819
+ id: MOCK_ROLE_IDS.tenantAdministrator,
33336
33820
  name: 'tenant-administrator',
33337
33821
  title: 'Tenant Administrator',
33338
33822
  description: 'Tenant-level administrator with full CRUD access to users and roles',
@@ -33380,7 +33864,7 @@ const mockRoleDefinitions = [
33380
33864
  },
33381
33865
  },
33382
33866
  {
33383
- id: 'a0000001-0000-4000-a000-000000000099',
33867
+ id: MOCK_ROLE_IDS.conversationOnly,
33384
33868
  name: 'conversation-only',
33385
33869
  title: 'Conversation Only',
33386
33870
  description: 'Conversation access only for MAGFA commerce',
@@ -35222,8 +35706,8 @@ const visibilityFilterMiddleware = {
35222
35706
  if (bypassVisibility && bypassOwnership) {
35223
35707
  return;
35224
35708
  }
35225
- // Filter function to check visibility (async to allow tenant loading)
35226
- const isVisible = async (record) => {
35709
+ // Filter function to check visibility
35710
+ const isVisible = (record) => {
35227
35711
  // Check stateInfo visibility flags (unless bypassed)
35228
35712
  if (!bypassVisibility && record?.stateInfo) {
35229
35713
  const { isHidden } = record.stateInfo;
@@ -35234,36 +35718,15 @@ const visibilityFilterMiddleware = {
35234
35718
  // Check ownershipInfo for tenant and application filtering (unless bypassed)
35235
35719
  if (!bypassOwnership && record?.ownershipInfo) {
35236
35720
  const { tenantId, applicationId } = record.ownershipInfo;
35237
- // Filter by tenant: check both session tenant and user's ownership tenant
35238
- // Show record if:
35239
- // - Record has no tenantId (global record)
35240
- // - Session tenant matches record tenant
35241
- // - User's ownership tenant matches record tenant (fallback if session tenant not set or different)
35242
- // - Neither session nor user tenant is set (show all)
35243
- // - Current user is a platform user (root/root2/super-root) and record is from platform tenant
35721
+ // Filter by tenant: session tenant is authoritative when set; otherwise fall back to the
35722
+ // signed-in user's ownership tenant (e.g. before tenant chooser completes).
35244
35723
  if (tenantId) {
35245
- const sessionTenantMatches = currentTenantId && tenantId === currentTenantId;
35246
- const userTenantMatches = currentUserTenantId && tenantId === currentUserTenantId;
35247
- const noTenantSet = !currentTenantId && !currentUserTenantId;
35248
- // Check if current user is a platform user (root/root2)
35249
- const isPlatformUser = session.user?.name === 'root' || session.user?.name === 'root2' || session.user?.name === 'super-root';
35250
- // If user is platform user, try to load tenant to check if it's platform tenant by name
35251
- let isPlatformTenant = false;
35252
- if (isPlatformUser && tenantId) {
35253
- try {
35254
- const tenantEntityName = 'TenantManagement.Tenant';
35255
- const tenant = await backend.getOne(tenantEntityName, tenantId);
35256
- if (tenant && (tenant.name === 'acorex-tenant' || tenant.name === 'platform-tenant')) {
35257
- isPlatformTenant = true;
35258
- }
35259
- }
35260
- catch (error) {
35261
- // If we can't load tenant, continue without platform tenant check
35724
+ if (currentTenantId) {
35725
+ if (tenantId !== currentTenantId) {
35726
+ return false;
35262
35727
  }
35263
35728
  }
35264
- // Filter out if tenant is set and doesn't match either session or user tenant
35265
- // Exception: platform users can see platform tenant records
35266
- if (!sessionTenantMatches && !userTenantMatches && !noTenantSet && !isPlatformTenant) {
35729
+ else if (currentUserTenantId && tenantId !== currentUserTenantId) {
35267
35730
  return false;
35268
35731
  }
35269
35732
  }
@@ -35297,8 +35760,7 @@ const visibilityFilterMiddleware = {
35297
35760
  take: Number.MAX_SAFE_INTEGER, // Get all records
35298
35761
  });
35299
35762
  // Filter all records with visibility filter
35300
- const visibilityResults = await Promise.all(allFilteredRecordsResult.items.map((record) => isVisible(record)));
35301
- const filteredAllRecords = allFilteredRecordsResult.items.filter((_, index) => visibilityResults[index]);
35763
+ const filteredAllRecords = allFilteredRecordsResult.items.filter((record) => isVisible(record));
35302
35764
  // Update total count based on filtered records
35303
35765
  const filteredTotal = filteredAllRecords.length;
35304
35766
  // Re-apply pagination to filtered records
@@ -35312,8 +35774,7 @@ const visibilityFilterMiddleware = {
35312
35774
  // For getAll operation, result is a plain array
35313
35775
  if (Array.isArray(ctx.result)) {
35314
35776
  // Filter all records
35315
- const visibilityResults = await Promise.all(ctx.result.map((record) => isVisible(record)));
35316
- ctx.result = ctx.result.filter((_, index) => visibilityResults[index]);
35777
+ ctx.result = ctx.result.filter((record) => isVisible(record));
35317
35778
  }
35318
35779
  }
35319
35780
  },
@@ -35644,7 +36105,7 @@ class MockTenantLoader {
35644
36105
  ],
35645
36106
  };
35646
36107
  // Get all active tenants
35647
- const tenantsResult = await tenantService.query({ skip: 0, take: 1000, filter: tenantFilter });
36108
+ const tenantsResult = await tenantService.query(bypassAllFilters({ skip: 0, take: 1000, filter: tenantFilter }));
35648
36109
  // Get active subscriptions for tenants
35649
36110
  const subscriptionFilter = {
35650
36111
  logic: 'and',
@@ -35661,7 +36122,7 @@ class MockTenantLoader {
35661
36122
  },
35662
36123
  ],
35663
36124
  };
35664
- const subscriptionsResult = await subscriptionService.query({ skip: 0, take: 1000, filter: subscriptionFilter });
36125
+ const subscriptionsResult = await subscriptionService.query(bypassAllFilters({ skip: 0, take: 1000, filter: subscriptionFilter }));
35665
36126
  // If user is in context, also filter by TenantUser membership
35666
36127
  if (context.user?.id) {
35667
36128
  const tenantUserFilter = {
@@ -35679,7 +36140,7 @@ class MockTenantLoader {
35679
36140
  },
35680
36141
  ],
35681
36142
  };
35682
- const tenantUsersResult = await tenantUserService.query({ skip: 0, take: 1000, filter: tenantUserFilter });
36143
+ const tenantUsersResult = await tenantUserService.query(bypassAllFilters({ skip: 0, take: 1000, filter: tenantUserFilter }));
35683
36144
  // Get unique tenant IDs that have active subscriptions
35684
36145
  const tenantIdsWithSubscriptions = new Set(subscriptionsResult.items.map((sub) => sub.subscriberId).filter((id) => !!id));
35685
36146
  // Get unique tenant IDs where user is a member
@@ -50243,6 +50704,161 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
50243
50704
  type: Injectable
50244
50705
  }] });
50245
50706
 
50707
+ function generateLeaveType() {
50708
+ const uuid = AXPDataGenerator.uuid;
50709
+ const M = createMultiLanguageString;
50710
+ return [
50711
+ {
50712
+ id: uuid(),
50713
+ title: M('Annual Leave', 'مرخصی سالانه'),
50714
+ description: M('Paid time off for vacation, rest, or personal activities', 'مرخصی استحقاقی برای استراحت یا امور شخصی'),
50715
+ color: '#3b82f6',
50716
+ },
50717
+ {
50718
+ id: uuid(),
50719
+ title: M("Sick & Carer's Leave", 'مرخصی استعلاجی و مراقبت'),
50720
+ description: M('Time off for personal illness or to care for sick family members', 'غیبت به دلیل بیماری یا مراقبت از بیمار خانواده'),
50721
+ color: '#ef4444',
50722
+ },
50723
+ {
50724
+ id: uuid(),
50725
+ title: M('Rostered Day off', 'روز تعطیل برنامه‌ریزی‌شده'),
50726
+ description: M('Scheduled day off as part of the regular work roster', 'روز تعطیل طبق برنامه نوبت کاری'),
50727
+ color: '#8b5cf6',
50728
+ },
50729
+ {
50730
+ id: uuid(),
50731
+ title: M('Training', 'آموزش'),
50732
+ description: M('Time allocated for professional development, courses, or skill enhancement', 'زمان توسعه حرفه‌ای و دوره‌ها'),
50733
+ color: '#06b6d4',
50734
+ },
50735
+ {
50736
+ id: uuid(),
50737
+ title: M('Compassionate & Bereavement Leave', 'مرخصی انسانی و سوگ'),
50738
+ description: M('Time off granted for family emergencies or the death of a loved one', 'مرخصی برای فوت نزدیکان یا شرایط اضطراری خانوادگی'),
50739
+ color: '#6366f1',
50740
+ },
50741
+ {
50742
+ id: uuid(),
50743
+ title: M('Time Off In Lieu', 'مرخصی جبرانی'),
50744
+ description: M('Compensatory time off earned for working additional hours beyond normal schedule', 'جبران ساعت اضافه‌کاری'),
50745
+ color: '#10b981',
50746
+ },
50747
+ {
50748
+ id: uuid(),
50749
+ title: M('Community Service Leave', 'مرخصی خدمت اجتماعی'),
50750
+ description: M('Paid leave for volunteer work or community service activities', 'مرخصی برای داوطلبی و خدمات اجتماعی'),
50751
+ color: '#059669',
50752
+ },
50753
+ {
50754
+ id: uuid(),
50755
+ title: M('Family & Domestic Violence Leave', 'مرخصی خشونت خانگی'),
50756
+ description: M('Paid leave for employees experiencing family or domestic violence situations', 'مرخصی حمایتی برای کارکنان در معرض خشونت خانگی'),
50757
+ color: '#ec4899',
50758
+ },
50759
+ {
50760
+ id: uuid(),
50761
+ title: M('Long Service Leave', 'مرخصی سنوات'),
50762
+ description: M('Extended paid leave granted after many years of continuous service', 'مرخصی طولانی پس از سال‌ها خدمت'),
50763
+ color: '#f59e0b',
50764
+ },
50765
+ {
50766
+ id: uuid(),
50767
+ title: M('Maternity & Paternal Leave', 'مرخصی زایمان و پدری'),
50768
+ description: M('Time off for new parents to care for and bond with their newborn child', 'مرخصی والدین برای مراقبت از نوزاد'),
50769
+ color: '#f472b6',
50770
+ },
50771
+ {
50772
+ id: uuid(),
50773
+ title: M("Public Holiday's", 'تعطیلات رسمی'),
50774
+ description: M('Recognized public holidays and national observances', 'تعطیلات رسمی و مناسبت‌های ملی'),
50775
+ color: '#eab308',
50776
+ },
50777
+ {
50778
+ id: uuid(),
50779
+ title: M('Unpaid Leave', 'مرخصی بدون حقوق'),
50780
+ description: M('Leave without pay for personal reasons or extended time off', 'بدون حقوق به دلایل شخصی'),
50781
+ color: '#6b7280',
50782
+ },
50783
+ {
50784
+ id: uuid(),
50785
+ title: M("Work's Compensation Leave", 'مرخصی بیمه کار'),
50786
+ description: M('Leave due to work-related injury or illness covered by workers compensation', 'مرخصی ناشی از آسیب یا بیماری شغلی'),
50787
+ color: '#dc2626',
50788
+ },
50789
+ ];
50790
+ }
50791
+ const LEAVE_TYPES_MOCK = generateLeaveType();
50792
+
50793
+ class AXMLeaveTypeDataSeeder {
50794
+ constructor() {
50795
+ this.storageService = inject(AXPEntityStorageService);
50796
+ }
50797
+ async seed() {
50798
+ await this.storageService.initial(RootConfig$j.entities.leaveType.source, LEAVE_TYPES_MOCK);
50799
+ }
50800
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMLeaveTypeDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
50801
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMLeaveTypeDataSeeder }); }
50802
+ }
50803
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMLeaveTypeDataSeeder, decorators: [{
50804
+ type: Injectable
50805
+ }] });
50806
+
50807
+ const uuid$9 = AXPDataGenerator.uuid;
50808
+ const LEAVE_REQUEST_STATUS_DEFINITIONS = [
50809
+ AXPSystemStatuses.Pending,
50810
+ AXPSystemStatuses.Approved,
50811
+ AXPSystemStatuses.Rejected,
50812
+ AXPSystemStatuses.Cancelled,
50813
+ ];
50814
+ function buildLeaveRequests() {
50815
+ const results = [];
50816
+ EMPLOYEES_MOCK.forEach((employee) => {
50817
+ // Generate 2 leave requests per employee
50818
+ const count = Math.floor(Math.random() * 2);
50819
+ for (let i = 0; i < count; i++) {
50820
+ const leaveType = LEAVE_TYPES_MOCK[Math.floor(Math.random() * LEAVE_TYPES_MOCK.length)];
50821
+ const duration = Math.floor(Math.random() * 5) + 1; // 1-5 days
50822
+ // Spread start/end across past, today, and future (inclusive) relative to "now"
50823
+ const startDayOffset = Math.floor(Math.random() * 211) - 120; // -120 .. +90 days
50824
+ const start = new Date();
50825
+ start.setDate(start.getDate() + startDayOffset);
50826
+ const end = new Date(start);
50827
+ end.setDate(start.getDate() + duration);
50828
+ const statusDefinition = LEAVE_REQUEST_STATUS_DEFINITIONS[Math.floor(Math.random() * LEAVE_REQUEST_STATUS_DEFINITIONS.length)];
50829
+ results.push({
50830
+ id: uuid$9(),
50831
+ employeeId: employee.id,
50832
+ employee,
50833
+ leaveTypeId: leaveType.id,
50834
+ leaveType,
50835
+ startDate: start,
50836
+ endDate: end,
50837
+ durationDays: duration,
50838
+ reason: `Request for ${leaveType.title}`,
50839
+ statusId: statusDefinition.name,
50840
+ status: { id: statusDefinition.name, title: statusDefinition.title },
50841
+ });
50842
+ }
50843
+ });
50844
+ return results;
50845
+ }
50846
+ const LEAVE_REQUESTS_MOCK = buildLeaveRequests();
50847
+
50848
+ class AXMLeaveRequestDataSeeder {
50849
+ constructor() {
50850
+ this.storageService = inject(AXPEntityStorageService);
50851
+ }
50852
+ async seed() {
50853
+ await this.storageService.initial(RootConfig$j.entities.leaveRequest.source, LEAVE_REQUESTS_MOCK);
50854
+ }
50855
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMLeaveRequestDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
50856
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMLeaveRequestDataSeeder }); }
50857
+ }
50858
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMLeaveRequestDataSeeder, decorators: [{
50859
+ type: Injectable
50860
+ }] });
50861
+
50246
50862
  //#region ---- Types ----
50247
50863
  const WORKFLOW_DEFINITION_ENTITY_SCHEMA = 'https://elsaworkflows.io/schemas/workflow-definition/v3.0.0/schema.json';
50248
50864
  const DEFAULT_TOOL_VERSION = '3.2.0.0';
@@ -50277,79 +50893,116 @@ function createWorkflowDefinitionEntityMock(def, options) {
50277
50893
  //#endregion
50278
50894
 
50279
50895
  const M$q = createMultiLanguageString;
50896
+ //#region ---- Workflow property interfaces ----
50897
+ const workflowLookup = (entity, textField, options) => ({
50898
+ type: 'lookup-editor',
50899
+ options: {
50900
+ entity,
50901
+ textField,
50902
+ valueField: options?.valueField ?? 'id',
50903
+ look: 'select',
50904
+ ...(options?.columns ? { columns: options.columns } : {}),
50905
+ },
50906
+ });
50907
+ const workflowDate = () => ({
50908
+ type: 'date-time-editor',
50909
+ options: { showTime: false },
50910
+ });
50911
+ //#endregion
50280
50912
  /**
50281
- * Generic employee lifecycle workflow: capture process row (dialog) → questionnaire → line-manager confirmation → employee status update.
50282
- * Caller passes employeeId, display names for tasks (employeeDisplayName, lifecycleProcessTypeTitle), questionnaireId,
50283
- * lifecycleProcessTypeId, targetEmployeeStatusId, and optional effectiveDate (ISO date) for the create dialog.
50913
+ * Generic employee lifecycle event workflow: capture event row (dialog) → questionnaire → line-manager confirmation → employee status update.
50914
+ * Caller passes employeeId, display names for tasks (employeeDisplayName, eventTypeTitle), questionnaireId,
50915
+ * eventTypeId, targetEmployeeStatusId, and optional effectiveDate for the create dialog.
50284
50916
  */
50285
- const employeeLifecycleGuidedFlowWorkflowDefinition = {
50917
+ const employeeLifecycleEventFlowWorkflowDefinition = {
50286
50918
  schemaVersion: 'acorex-platform-workflow/v1',
50287
- name: 'employeeLifecycleGuidedFlow',
50288
- title: M$q('Employee lifecycle guided flow', 'جریان هدایت‌شده چرخه عمر کارمند'),
50289
- description: M$q('Opens Employee Lifecycle Process create (type hidden; employee readonly; assignee and effective date prefilled), persists the row, then runs the questionnaire and manager approval path; on approve updates HumanCapitalManagement.Employee.statusId to targetEmployeeStatusId.', 'فرایند ایجاد رکورد چرخه عمر کارمند (نوع مخفی؛ کارمند فقط‌خواندنی؛ مسئول و تاریخ اثر از پیش پر شده)، سپس پرسشنامه و تأیید مدیر؛ در صورت تأیید، وضعیت کارمند به مقدار هدف به‌روز می‌شود.'),
50919
+ name: 'employee-lifecycle-event-flow',
50920
+ title: M$q('Employee lifecycle event flow', 'جریان رویداد چرخه عمر کارمند'),
50921
+ description: M$q('Opens Lifecycle Event create (event type hidden; employee readonly; assignee and effective date prefilled), persists the row, then runs the questionnaire and manager approval path; on approve updates HumanCapitalManagement.Employee.statusId to targetEmployeeStatusId.', 'فرم ایجاد رویداد چرخه عمر (نوع رویداد مخفی؛ کارمند فقط‌خواندنی؛ مسئول و تاریخ اثر از پیش پر شده)، سپس پرسشنامه و تأیید مدیر؛ در صورت تأیید، وضعیت کارمند به‌روز می‌شود.'),
50290
50922
  variables: [
50291
50923
  {
50292
50924
  name: 'employeeId',
50293
- title: 'Employee ID',
50294
- description: 'Subject HumanCapitalManagement.Employee row id',
50925
+ title: 'Employee',
50926
+ description: 'Subject HumanCapitalManagement.Employee',
50295
50927
  dataType: 'string',
50296
- interface: { type: 'text-editor', options: {} },
50928
+ interface: workflowLookup('HumanCapitalManagement.Employee', 'person.fullName', {
50929
+ columns: ['person.fullName', 'employeeCode'],
50930
+ }),
50297
50931
  },
50298
50932
  {
50299
50933
  name: 'questionnaireId',
50300
- title: 'Questionnaire ID',
50301
- description: 'AssessmentManagement questionnaire id (from lifecycle process type)',
50934
+ title: 'Questionnaire',
50935
+ description: 'AssessmentManagement questionnaire (from lifecycle event type)',
50302
50936
  dataType: 'string',
50303
- interface: { type: 'text-editor', options: {} },
50937
+ interface: workflowLookup('AssessmentManagement.Questionnaire', 'title', {
50938
+ columns: ['name', 'title'],
50939
+ }),
50304
50940
  },
50305
50941
  {
50306
- name: 'lifecycleProcessTypeId',
50307
- title: 'Lifecycle process type ID',
50308
- description: 'Optional template id for task context / tracing',
50942
+ name: 'eventTypeId',
50943
+ title: 'Lifecycle event type',
50944
+ description: 'Lifecycle event type template',
50309
50945
  dataType: 'string',
50310
- interface: { type: 'text-editor', options: {} },
50946
+ interface: workflowLookup('HumanCapitalManagement.LifecycleEventType', 'title', {
50947
+ columns: ['name', 'title'],
50948
+ }),
50311
50949
  },
50312
50950
  {
50313
50951
  name: 'targetEmployeeStatusId',
50314
- title: 'Target employee status id',
50315
- description: 'Employee.statusId after approval (e.g. active, terminated, pending)',
50952
+ title: 'Target employee status',
50953
+ description: 'Employee.statusId after approval (e.g. active, terminated)',
50316
50954
  dataType: 'string',
50317
50955
  interface: { type: 'text-editor', options: {} },
50318
50956
  },
50319
50957
  {
50320
50958
  name: 'assigneeUserId',
50321
- title: 'Assignee user ID',
50322
- description: 'Platform user id for subject employee',
50959
+ title: 'Assignee',
50960
+ description: 'Platform user for the subject employee',
50323
50961
  dataType: 'string',
50324
- interface: { type: 'text-editor', options: {} },
50962
+ interface: workflowLookup('SecurityManagement.User', 'displayName', {
50963
+ columns: ['displayName', 'username'],
50964
+ }),
50325
50965
  },
50326
50966
  {
50327
50967
  name: 'managerUserId',
50328
- title: 'Manager user ID',
50329
- description: 'Line manager login user id',
50968
+ title: 'Manager',
50969
+ description: 'Line manager user',
50330
50970
  dataType: 'string',
50331
- interface: { type: 'text-editor', options: {} },
50971
+ interface: workflowLookup('SecurityManagement.User', 'displayName', {
50972
+ columns: ['displayName', 'username'],
50973
+ }),
50332
50974
  },
50333
50975
  {
50334
50976
  name: 'initiatorUserId',
50335
- title: 'Initiator user ID',
50977
+ title: 'Initiator',
50336
50978
  description: 'Workflow starter; fallback when manager cannot be resolved',
50337
50979
  dataType: 'string',
50338
- interface: { type: 'text-editor', options: {} },
50980
+ interface: workflowLookup('SecurityManagement.User', 'displayName', {
50981
+ columns: ['displayName', 'username'],
50982
+ }),
50983
+ },
50984
+ {
50985
+ name: 'lifecycleEventId',
50986
+ title: 'Lifecycle event',
50987
+ description: 'HumanCapitalManagement.LifecycleEvent row after capture and persistence',
50988
+ dataType: 'string',
50989
+ interface: workflowLookup('HumanCapitalManagement.LifecycleEvent', 'eventType.title', {
50990
+ columns: ['eventTypeId', 'effectiveDate', 'statusId'],
50991
+ }),
50339
50992
  },
50340
50993
  {
50341
- name: 'employeeLifecycleProcessId',
50342
- title: 'Employee lifecycle process ID',
50343
- description: 'HumanCapitalManagement.EmployeeLifecycleProcess row id after the capture dialog and persistence step',
50994
+ name: 'lifecycleEventStatusId',
50995
+ title: 'Lifecycle event status',
50996
+ description: 'HumanCapitalManagement.LifecycleEvent.statusId mirrored for task board display',
50344
50997
  dataType: 'string',
50345
50998
  interface: { type: 'text-editor', options: {} },
50346
50999
  },
50347
51000
  {
50348
51001
  name: 'effectiveDate',
50349
51002
  title: 'Effective date',
50350
- description: 'Prefilled effective date for the lifecycle process create dialog (ISO yyyy-mm-dd)',
50351
- dataType: 'string',
50352
- interface: { type: 'text-editor', options: {} },
51003
+ description: 'Effective date for the lifecycle event',
51004
+ dataType: 'date',
51005
+ interface: workflowDate(),
50353
51006
  },
50354
51007
  {
50355
51008
  name: 'employeeDisplayName',
@@ -50359,52 +51012,65 @@ const employeeLifecycleGuidedFlowWorkflowDefinition = {
50359
51012
  interface: { type: 'text-editor', options: {} },
50360
51013
  },
50361
51014
  {
50362
- name: 'lifecycleProcessTypeTitle',
50363
- title: 'Lifecycle process type title',
50364
- description: 'Resolved lifecycle process type label in the active locale',
51015
+ name: 'eventTypeTitle',
51016
+ title: 'Lifecycle event type title',
51017
+ description: 'Resolved lifecycle event type label in the active locale',
50365
51018
  dataType: 'string',
50366
51019
  interface: { type: 'text-editor', options: {} },
50367
51020
  },
50368
51021
  {
50369
- name: 'assessmentCaseId',
50370
- title: 'Assessment case ID',
50371
- description: 'AssessmentManagement.AssessmentCase row for this lifecycle questionnaire',
51022
+ name: 'assessmentCaseTitle',
51023
+ title: 'Assessment case title',
51024
+ description: 'Friendly label for AssessmentManagement.AssessmentCase list and fill viewer',
50372
51025
  dataType: 'string',
50373
51026
  interface: { type: 'text-editor', options: {} },
50374
51027
  },
51028
+ {
51029
+ name: 'assessmentCaseId',
51030
+ title: 'Assessment case',
51031
+ description: 'AssessmentManagement.AssessmentCase for this lifecycle questionnaire',
51032
+ dataType: 'string',
51033
+ interface: workflowLookup('AssessmentManagement.AssessmentCase', 'title'),
51034
+ },
50375
51035
  {
50376
51036
  name: 'assessmentSessionId',
50377
- title: 'Assessment session ID',
50378
- description: 'AssessmentManagement.AssessmentSession row for the assignee responder',
51037
+ title: 'Assessment session',
51038
+ description: 'AssessmentManagement.AssessmentSession for the assignee responder',
50379
51039
  dataType: 'string',
50380
- interface: { type: 'text-editor', options: {} },
51040
+ interface: workflowLookup('AssessmentManagement.AssessmentSession', 'id'),
50381
51041
  },
50382
51042
  ],
50383
51043
  inputs: [
50384
51044
  {
50385
51045
  name: 'employeeId',
50386
- title: 'Employee ID',
50387
- description: 'Subject employee row id',
51046
+ title: 'Employee',
51047
+ description: 'Subject employee',
50388
51048
  dataType: 'string',
50389
- interface: { type: 'text-editor', options: {} },
51049
+ interface: workflowLookup('HumanCapitalManagement.Employee', 'person.fullName', {
51050
+ columns: ['person.fullName', 'employeeCode'],
51051
+ }),
50390
51052
  },
50391
51053
  {
50392
51054
  name: 'questionnaireId',
50393
- title: 'Questionnaire ID',
50394
- description: 'From lifecycle process type template',
51055
+ title: 'Questionnaire',
51056
+ description: 'From lifecycle event type template',
50395
51057
  dataType: 'string',
50396
- interface: { type: 'text-editor', options: {} },
51058
+ interface: workflowLookup('AssessmentManagement.Questionnaire', 'title', {
51059
+ columns: ['name', 'title'],
51060
+ }),
50397
51061
  },
50398
51062
  {
50399
- name: 'lifecycleProcessTypeId',
50400
- title: 'Lifecycle process type ID',
50401
- description: 'Optional; forwarded to task context',
51063
+ name: 'eventTypeId',
51064
+ title: 'Lifecycle event type',
51065
+ description: 'Lifecycle event type template',
50402
51066
  dataType: 'string',
50403
- interface: { type: 'text-editor', options: {} },
51067
+ interface: workflowLookup('HumanCapitalManagement.LifecycleEventType', 'title', {
51068
+ columns: ['name', 'title'],
51069
+ }),
50404
51070
  },
50405
51071
  {
50406
51072
  name: 'targetEmployeeStatusId',
50407
- title: 'Target employee status id',
51073
+ title: 'Target employee status',
50408
51074
  description: 'Applied to Employee.statusId when manager approves',
50409
51075
  dataType: 'string',
50410
51076
  interface: { type: 'text-editor', options: {} },
@@ -50412,9 +51078,9 @@ const employeeLifecycleGuidedFlowWorkflowDefinition = {
50412
51078
  {
50413
51079
  name: 'effectiveDate',
50414
51080
  title: 'Effective date',
50415
- description: 'Prefilled on the lifecycle process create form (ISO yyyy-mm-dd); optional',
50416
- dataType: 'string',
50417
- interface: { type: 'text-editor', options: {} },
51081
+ description: 'Prefilled on the lifecycle event create form; optional',
51082
+ dataType: 'date',
51083
+ interface: workflowDate(),
50418
51084
  },
50419
51085
  {
50420
51086
  name: 'employeeDisplayName',
@@ -50424,9 +51090,16 @@ const employeeLifecycleGuidedFlowWorkflowDefinition = {
50424
51090
  interface: { type: 'text-editor', options: {} },
50425
51091
  },
50426
51092
  {
50427
- name: 'lifecycleProcessTypeTitle',
50428
- title: 'Lifecycle process type title',
50429
- description: 'Lifecycle process type label in the active locale',
51093
+ name: 'eventTypeTitle',
51094
+ title: 'Lifecycle event type title',
51095
+ description: 'Lifecycle event type label in the active locale',
51096
+ dataType: 'string',
51097
+ interface: { type: 'text-editor', options: {} },
51098
+ },
51099
+ {
51100
+ name: 'assessmentCaseTitle',
51101
+ title: 'Assessment case title',
51102
+ description: 'Friendly label for AssessmentManagement.AssessmentCase and fill viewer',
50430
51103
  dataType: 'string',
50431
51104
  interface: { type: 'text-editor', options: {} },
50432
51105
  },
@@ -50443,11 +51116,12 @@ const employeeLifecycleGuidedFlowWorkflowDefinition = {
50443
51116
  variables: [
50444
51117
  { variableName: 'employeeId', value: '{{ inputs.employeeId }}' },
50445
51118
  { variableName: 'questionnaireId', value: '{{ inputs.questionnaireId }}' },
50446
- { variableName: 'lifecycleProcessTypeId', value: '{{ inputs.lifecycleProcessTypeId }}' },
51119
+ { variableName: 'eventTypeId', value: '{{ inputs.eventTypeId }}' },
50447
51120
  { variableName: 'targetEmployeeStatusId', value: '{{ inputs.targetEmployeeStatusId }}' },
50448
51121
  { variableName: 'effectiveDate', value: '{{ inputs.effectiveDate }}' },
50449
51122
  { variableName: 'employeeDisplayName', value: '{{ inputs.employeeDisplayName }}' },
50450
- { variableName: 'lifecycleProcessTypeTitle', value: '{{ inputs.lifecycleProcessTypeTitle }}' },
51123
+ { variableName: 'eventTypeTitle', value: '{{ inputs.eventTypeTitle }}' },
51124
+ { variableName: 'assessmentCaseTitle', value: '{{ inputs.assessmentCaseTitle || inputs.employeeDisplayName }}' },
50451
51125
  ],
50452
51126
  },
50453
51127
  },
@@ -50479,39 +51153,39 @@ const employeeLifecycleGuidedFlowWorkflowDefinition = {
50479
51153
  },
50480
51154
  },
50481
51155
  {
50482
- id: 'captureLifecycleProcessDetailsForm',
51156
+ id: 'captureLifecycleEventDetailsForm',
50483
51157
  name: 'workflow-activity:create-entity-form',
50484
51158
  inputs: {
50485
51159
  module: 'HumanCapitalManagement',
50486
- entity: 'EmployeeLifecycleProcess',
51160
+ entity: 'LifecycleEvent',
50487
51161
  persistInWorkflow: true,
50488
- excludes: ['lifecycleProcessTypeId'],
51162
+ excludes: ['eventTypeId'],
50489
51163
  readonlys: ['employeeId'],
50490
51164
  data: {
50491
51165
  employeeId: '{{ variables.employeeId }}',
50492
- lifecycleProcessTypeId: '{{ variables.lifecycleProcessTypeId }}',
50493
- processAssigneeUserId: '{{ variables.managerUserId || variables.initiatorUserId }}',
50494
- effectiveDate: '{{ variables.effectiveDate }}',
51166
+ eventTypeId: '{{ variables.eventTypeId }}',
51167
+ assignedToUserId: '{{ variables.managerUserId || variables.initiatorUserId }}',
50495
51168
  notes: '',
50496
51169
  },
50497
51170
  },
50498
51171
  },
50499
51172
  {
50500
- id: 'createEmployeeLifecycleProcessRecord',
51173
+ id: 'createLifecycleEventRecord',
50501
51174
  name: 'workflow-activity:entity-create',
50502
51175
  inputs: {
50503
- entity: 'HumanCapitalManagement.EmployeeLifecycleProcess',
51176
+ entity: 'HumanCapitalManagement.LifecycleEvent',
50504
51177
  data: {
50505
51178
  employeeId: '{{ variables.employeeId }}',
50506
- lifecycleProcessTypeId: '{{ variables.lifecycleProcessTypeId }}',
50507
- processAssigneeUserId: '{{ outputs.result.processAssigneeUserId }}',
50508
- effectiveDate: '{{ outputs.result.effectiveDate }}',
50509
- notes: '{{ outputs.result.notes }}',
51179
+ eventTypeId: '{{ variables.eventTypeId }}',
51180
+ assignedToUserId: '{{ variables.assignedToUserId }}',
51181
+ effectiveDate: '{{ variables.effectiveDate }}',
51182
+ notes: '{{ variables.notes }}',
50510
51183
  statusId: 'in-progress',
50511
51184
  },
50512
51185
  },
50513
51186
  outputToVariables: {
50514
- employeeLifecycleProcessId: 'id',
51187
+ lifecycleEventId: 'id',
51188
+ lifecycleEventStatusId: 'statusId',
50515
51189
  },
50516
51190
  },
50517
51191
  {
@@ -50521,11 +51195,11 @@ const employeeLifecycleGuidedFlowWorkflowDefinition = {
50521
51195
  entity: 'AssessmentManagement.AssessmentCase',
50522
51196
  data: {
50523
51197
  questionnaireId: '{{ variables.questionnaireId }}',
50524
- title: '{{ variables.lifecycleProcessTypeTitle }} — {{ variables.employeeDisplayName }}',
50525
- description: 'Employee lifecycle process {{ variables.employeeLifecycleProcessId }}',
51198
+ title: '{{ variables.assessmentCaseTitle || variables.employeeDisplayName }}',
50526
51199
  subjectRef: {
50527
51200
  type: 'HumanCapitalManagement.Employee',
50528
51201
  id: '{{ variables.employeeId }}',
51202
+ title: '{{ variables.employeeDisplayName }}',
50529
51203
  },
50530
51204
  statusId: 'active',
50531
51205
  },
@@ -50557,7 +51231,7 @@ const employeeLifecycleGuidedFlowWorkflowDefinition = {
50557
51231
  id: 'showLifecycleStartCancelledToast',
50558
51232
  name: 'workflow-activity:show-toast',
50559
51233
  inputs: {
50560
- message: '@human-capital-management:employee-lifecycle-processes.messages.lifecycle-start-cancelled',
51234
+ message: '@human-capital-management:lifecycle-events.messages.lifecycle-start-cancelled',
50561
51235
  type: 'info',
50562
51236
  },
50563
51237
  },
@@ -50565,20 +51239,24 @@ const employeeLifecycleGuidedFlowWorkflowDefinition = {
50565
51239
  id: 'subjectFillQuestionnaireTask',
50566
51240
  name: 'workflow-activity:human-task',
50567
51241
  inputs: {
50568
- title: '@human-capital-management:employee-lifecycle-processes.tasks.task-title',
50569
- description: '@human-capital-management:employee-lifecycle-processes.tasks.questionnaire.description',
51242
+ title: '@human-capital-management:lifecycle-events.tasks.task-title',
51243
+ description: '@human-capital-management:lifecycle-events.tasks.questionnaire.description',
50570
51244
  assignedUserIds: '{{ variables.managerUserId || variables.initiatorUserId }}',
50571
51245
  context: {
50572
51246
  employeeId: '{{ variables.employeeId }}',
50573
51247
  questionnaireId: '{{ variables.questionnaireId }}',
50574
- lifecycleProcessTypeId: '{{ variables.lifecycleProcessTypeId }}',
51248
+ eventTypeId: '{{ variables.eventTypeId }}',
51249
+ effectiveDate: '{{ variables.effectiveDate }}',
51250
+ lifecycleEventId: '{{ variables.lifecycleEventId }}',
51251
+ statusId: '{{ variables.lifecycleEventStatusId }}',
51252
+ entityType: 'HumanCapitalManagement.LifecycleEvent',
50575
51253
  _taskI18n: {
50576
51254
  employeeDisplayName: '{{ variables.employeeDisplayName }}',
50577
- lifecycleProcessTypeTitle: '{{ variables.lifecycleProcessTypeTitle }}',
51255
+ eventTypeTitle: '{{ variables.eventTypeTitle }}',
50578
51256
  effectiveDate: '{{ variables.effectiveDate }}',
50579
51257
  },
50580
51258
  _taskTitleParts: [
50581
- '{{ variables.lifecycleProcessTypeTitle }}',
51259
+ '{{ variables.eventTypeTitle }}',
50582
51260
  '{{ variables.employeeDisplayName }}',
50583
51261
  ],
50584
51262
  },
@@ -50601,38 +51279,47 @@ const employeeLifecycleGuidedFlowWorkflowDefinition = {
50601
51279
  inputs: {
50602
51280
  caseId: '{{ variables.assessmentCaseId }}',
50603
51281
  sessionId: '{{ variables.assessmentSessionId }}',
51282
+ title: '{{ variables.assessmentCaseTitle || variables.employeeDisplayName }}',
50604
51283
  showAs: 'popup',
50605
51284
  },
50606
51285
  },
50607
51286
  {
50608
- id: 'markLifecycleAwaitingManagerApproval',
51287
+ id: 'markLifecycleEventAwaitingManagerApproval',
50609
51288
  name: 'workflow-activity:entity-update',
50610
51289
  inputs: {
50611
- entity: 'HumanCapitalManagement.EmployeeLifecycleProcess',
50612
- id: '{{ variables.employeeLifecycleProcessId }}',
51290
+ entity: 'HumanCapitalManagement.LifecycleEvent',
51291
+ id: '{{ variables.lifecycleEventId }}',
50613
51292
  data: {
50614
51293
  notes: 'Questionnaire completed; awaiting manager approval.',
51294
+ statusId: AXPSystemStatusType.WaitingSignOff,
50615
51295
  },
50616
51296
  },
51297
+ outputToVariables: {
51298
+ lifecycleEventStatusId: 'data.statusId',
51299
+ },
50617
51300
  },
50618
51301
  {
50619
51302
  id: 'managerApproveEmployeeStatusTask',
50620
51303
  name: 'workflow-activity:human-task',
50621
51304
  inputs: {
50622
- title: '@human-capital-management:employee-lifecycle-processes.tasks.task-title',
50623
- description: '@human-capital-management:employee-lifecycle-processes.tasks.manager-approval.description',
51305
+ title: '@human-capital-management:lifecycle-events.tasks.task-title',
51306
+ description: '@human-capital-management:lifecycle-events.tasks.manager-approval.description',
50624
51307
  assignedUserIds: '{{ variables.managerUserId || variables.initiatorUserId }}',
50625
51308
  context: {
50626
51309
  employeeId: '{{ variables.employeeId }}',
50627
51310
  questionnaireId: '{{ variables.questionnaireId }}',
50628
51311
  targetEmployeeStatusId: '{{ variables.targetEmployeeStatusId }}',
51312
+ effectiveDate: '{{ variables.effectiveDate }}',
51313
+ lifecycleEventId: '{{ variables.lifecycleEventId }}',
51314
+ statusId: '{{ variables.lifecycleEventStatusId }}',
51315
+ entityType: 'HumanCapitalManagement.LifecycleEvent',
50629
51316
  _taskI18n: {
50630
51317
  employeeDisplayName: '{{ variables.employeeDisplayName }}',
50631
- lifecycleProcessTypeTitle: '{{ variables.lifecycleProcessTypeTitle }}',
51318
+ eventTypeTitle: '{{ variables.eventTypeTitle }}',
50632
51319
  effectiveDate: '{{ variables.effectiveDate }}',
50633
51320
  },
50634
51321
  _taskTitleParts: [
50635
- '{{ variables.lifecycleProcessTypeTitle }}',
51322
+ '{{ variables.eventTypeTitle }}',
50636
51323
  '{{ variables.employeeDisplayName }}',
50637
51324
  ],
50638
51325
  },
@@ -50668,11 +51355,11 @@ const employeeLifecycleGuidedFlowWorkflowDefinition = {
50668
51355
  },
50669
51356
  },
50670
51357
  {
50671
- id: 'updateEmployeeLifecycleProcessCompleted',
51358
+ id: 'updateLifecycleEventCompleted',
50672
51359
  name: 'workflow-activity:entity-update',
50673
51360
  inputs: {
50674
- entity: 'HumanCapitalManagement.EmployeeLifecycleProcess',
50675
- id: '{{ variables.employeeLifecycleProcessId }}',
51361
+ entity: 'HumanCapitalManagement.LifecycleEvent',
51362
+ id: '{{ variables.lifecycleEventId }}',
50676
51363
  data: {
50677
51364
  statusId: 'completed',
50678
51365
  },
@@ -50698,11 +51385,11 @@ const employeeLifecycleGuidedFlowWorkflowDefinition = {
50698
51385
  },
50699
51386
  },
50700
51387
  {
50701
- id: 'updateEmployeeLifecycleProcessCancelled',
51388
+ id: 'updateLifecycleEventCancelled',
50702
51389
  name: 'workflow-activity:entity-update',
50703
51390
  inputs: {
50704
- entity: 'HumanCapitalManagement.EmployeeLifecycleProcess',
50705
- id: '{{ variables.employeeLifecycleProcessId }}',
51391
+ entity: 'HumanCapitalManagement.LifecycleEvent',
51392
+ id: '{{ variables.lifecycleEventId }}',
50706
51393
  data: {
50707
51394
  statusId: 'cancelled',
50708
51395
  },
@@ -50723,7 +51410,7 @@ const employeeLifecycleGuidedFlowWorkflowDefinition = {
50723
51410
  id: 'showLifecycleRejectedToast',
50724
51411
  name: 'workflow-activity:show-toast',
50725
51412
  inputs: {
50726
- message: 'Employee lifecycle process was rejected by manager.',
51413
+ message: 'Lifecycle event was rejected by manager.',
50727
51414
  type: 'warning',
50728
51415
  },
50729
51416
  },
@@ -50743,18 +51430,18 @@ const employeeLifecycleGuidedFlowWorkflowDefinition = {
50743
51430
  },
50744
51431
  {
50745
51432
  source: { activtyName: 'resolveManagerFromSubjectEmployee', port: 'done' },
50746
- target: { activtyName: 'captureLifecycleProcessDetailsForm' },
51433
+ target: { activtyName: 'captureLifecycleEventDetailsForm' },
50747
51434
  },
50748
51435
  {
50749
- source: { activtyName: 'captureLifecycleProcessDetailsForm', port: 'Submitted' },
50750
- target: { activtyName: 'createEmployeeLifecycleProcessRecord' },
51436
+ source: { activtyName: 'captureLifecycleEventDetailsForm', port: 'Submitted' },
51437
+ target: { activtyName: 'createLifecycleEventRecord' },
50751
51438
  },
50752
51439
  {
50753
- source: { activtyName: 'captureLifecycleProcessDetailsForm', port: 'Cancelled' },
51440
+ source: { activtyName: 'captureLifecycleEventDetailsForm', port: 'Cancelled' },
50754
51441
  target: { activtyName: 'showLifecycleStartCancelledToast' },
50755
51442
  },
50756
51443
  {
50757
- source: { activtyName: 'createEmployeeLifecycleProcessRecord', port: 'Done' },
51444
+ source: { activtyName: 'createLifecycleEventRecord', port: 'Done' },
50758
51445
  target: { activtyName: 'createAssessmentCaseForLifecycle' },
50759
51446
  },
50760
51447
  {
@@ -50771,7 +51458,7 @@ const employeeLifecycleGuidedFlowWorkflowDefinition = {
50771
51458
  },
50772
51459
  {
50773
51460
  source: { activtyName: 'fillLifecycleQuestionnaire', port: 'Submitted' },
50774
- target: { activtyName: 'markLifecycleAwaitingManagerApproval' },
51461
+ target: { activtyName: 'markLifecycleEventAwaitingManagerApproval' },
50775
51462
  },
50776
51463
  {
50777
51464
  source: { activtyName: 'fillLifecycleQuestionnaire', port: 'Saved' },
@@ -50782,7 +51469,7 @@ const employeeLifecycleGuidedFlowWorkflowDefinition = {
50782
51469
  target: { activtyName: 'subjectFillQuestionnaireTask' },
50783
51470
  },
50784
51471
  {
50785
- source: { activtyName: 'markLifecycleAwaitingManagerApproval', port: 'Done' },
51472
+ source: { activtyName: 'markLifecycleEventAwaitingManagerApproval', port: 'Done' },
50786
51473
  target: { activtyName: 'managerApproveEmployeeStatusTask' },
50787
51474
  },
50788
51475
  {
@@ -50791,10 +51478,10 @@ const employeeLifecycleGuidedFlowWorkflowDefinition = {
50791
51478
  },
50792
51479
  {
50793
51480
  source: { activtyName: 'managerApproveEmployeeStatusTask', port: 'reject' },
50794
- target: { activtyName: 'updateEmployeeLifecycleProcessCancelled' },
51481
+ target: { activtyName: 'updateLifecycleEventCancelled' },
50795
51482
  },
50796
51483
  {
50797
- source: { activtyName: 'updateEmployeeLifecycleProcessCancelled', port: 'Done' },
51484
+ source: { activtyName: 'updateLifecycleEventCancelled', port: 'Done' },
50798
51485
  target: { activtyName: 'cancelAssessmentCaseOnReject' },
50799
51486
  },
50800
51487
  {
@@ -50803,10 +51490,10 @@ const employeeLifecycleGuidedFlowWorkflowDefinition = {
50803
51490
  },
50804
51491
  {
50805
51492
  source: { activtyName: 'updateEmployeeTargetStatus', port: 'Done' },
50806
- target: { activtyName: 'updateEmployeeLifecycleProcessCompleted' },
51493
+ target: { activtyName: 'updateLifecycleEventCompleted' },
50807
51494
  },
50808
51495
  {
50809
- source: { activtyName: 'updateEmployeeLifecycleProcessCompleted', port: 'Done' },
51496
+ source: { activtyName: 'updateLifecycleEventCompleted', port: 'Done' },
50810
51497
  target: { activtyName: 'closeAssessmentCaseOnApprove' },
50811
51498
  },
50812
51499
  {
@@ -50816,14 +51503,14 @@ const employeeLifecycleGuidedFlowWorkflowDefinition = {
50816
51503
  ],
50817
51504
  },
50818
51505
  };
50819
- const employeeLifecycleGuidedFlowWorkflowName = 'employeeLifecycleGuidedFlow';
50820
- /** Stable id so lifecycle process type mocks and seeds resolve the workflow row predictably. */
50821
- const EMPLOYEE_LIFECYCLE_GUIDED_FLOW_WORKFLOW_DEFINITION_ID = '7f000010-0010-4111-a111-0e0e0e0e0e0e';
51506
+ const employeeLifecycleEventFlowWorkflowName = 'employee-lifecycle-event-flow';
51507
+ /** Stable id so lifecycle event type mocks and seeds resolve the workflow row predictably. */
51508
+ const EMPLOYEE_LIFECYCLE_EVENT_FLOW_WORKFLOW_DEFINITION_ID = '7f000010-0010-4111-a111-0e0e0e0e0e0e';
50822
51509
  /**
50823
51510
  * Workflow definition entity row for WorkflowManagement.WorkflowDefinition seeding.
50824
51511
  */
50825
- const employeeLifecycleGuidedFlowWorkflowEntityMock = createWorkflowDefinitionEntityMock(employeeLifecycleGuidedFlowWorkflowDefinition, {
50826
- id: EMPLOYEE_LIFECYCLE_GUIDED_FLOW_WORKFLOW_DEFINITION_ID,
51512
+ const employeeLifecycleEventFlowWorkflowEntityMock = createWorkflowDefinitionEntityMock(employeeLifecycleEventFlowWorkflowDefinition, {
51513
+ id: EMPLOYEE_LIFECYCLE_EVENT_FLOW_WORKFLOW_DEFINITION_ID,
50827
51514
  statusId: AXPSystemStatusType.Published,
50828
51515
  });
50829
51516
 
@@ -50831,12 +51518,12 @@ const employeeLifecycleGuidedFlowWorkflowEntityMock = createWorkflowDefinitionEn
50831
51518
  //#endregion
50832
51519
  //#region ---- Stable demo IDs ----
50833
51520
  /** Stable ids so seeds and related mocks resolve types predictably. */
50834
- const MOCK_LIFECYCLE_PROCESS_TYPE_ONBOARDING_ID = '7f000001-0001-4111-a111-010101010101';
50835
- const MOCK_LIFECYCLE_PROCESS_TYPE_SEPARATION_ID = '7f000002-0002-4111-a111-020202020202';
50836
- const MOCK_LIFECYCLE_PROCESS_TYPE_PROMOTION_ID = '7f000003-0003-4111-a111-030303030303';
50837
- const MOCK_LIFECYCLE_PROCESS_TYPE_TRANSFER_ID = '7f000004-0004-4111-a111-040404040404';
50838
- const MOCK_LIFECYCLE_PROCESS_TYPE_RETURN_TO_WORK_ID = '7f000005-0005-4111-a111-050505050505';
50839
- const MOCK_LIFECYCLE_PROCESS_TYPE_LEAVE_OF_ABSENCE_ID = '7f000006-0006-4111-a111-060606060606';
51521
+ const MOCK_LIFECYCLE_EVENT_TYPE_ONBOARDING_ID = '7f000001-0001-4111-a111-010101010101';
51522
+ const MOCK_LIFECYCLE_EVENT_TYPE_SEPARATION_ID = '7f000002-0002-4111-a111-020202020202';
51523
+ const MOCK_LIFECYCLE_EVENT_TYPE_PROMOTION_ID = '7f000003-0003-4111-a111-030303030303';
51524
+ const MOCK_LIFECYCLE_EVENT_TYPE_TRANSFER_ID = '7f000004-0004-4111-a111-040404040404';
51525
+ const MOCK_LIFECYCLE_EVENT_TYPE_RETURN_TO_WORK_ID = '7f000005-0005-4111-a111-050505050505';
51526
+ const MOCK_LIFECYCLE_EVENT_TYPE_LEAVE_OF_ABSENCE_ID = '7f000006-0006-4111-a111-060606060606';
50840
51527
  //#endregion
50841
51528
  //#region ---- Meta-data builder payloads ----
50842
51529
  const M$p = createMultiLanguageString;
@@ -50872,22 +51559,22 @@ const separationQuestionnaireStub = {
50872
51559
  id: QUESTIONNAIRE_ID_EMPLOYEE_SEPARATION_CHECKLIST,
50873
51560
  title: M$p('Employee separation checklist', 'چک‌لیست جدایی کارمند'),
50874
51561
  };
50875
- function employeeLifecycleGuidedFlowStub() {
51562
+ function employeeLifecycleEventFlowStub() {
50876
51563
  return {
50877
- id: EMPLOYEE_LIFECYCLE_GUIDED_FLOW_WORKFLOW_DEFINITION_ID,
50878
- title: employeeLifecycleGuidedFlowWorkflowEntityMock.title ?? undefined,
51564
+ id: EMPLOYEE_LIFECYCLE_EVENT_FLOW_WORKFLOW_DEFINITION_ID,
51565
+ title: employeeLifecycleEventFlowWorkflowEntityMock.title ?? undefined,
50879
51566
  };
50880
51567
  }
50881
51568
  //#endregion
50882
51569
  //#region ---- Mock data ----
50883
- const LIFECYCLE_PROCESS_TYPES_MOCK = [
51570
+ const LIFECYCLE_EVENT_TYPES_MOCK = [
50884
51571
  {
50885
- id: MOCK_LIFECYCLE_PROCESS_TYPE_ONBOARDING_ID,
50886
- name: 'ONBOARDING_DEFAULT',
50887
- title: M$p('Default onboarding', 'استخدام و ورود پیش‌فرض'),
51572
+ id: MOCK_LIFECYCLE_EVENT_TYPE_ONBOARDING_ID,
51573
+ name: 'ONBOARDING',
51574
+ title: M$p('Onboarding', 'استخدام و ورود'),
50888
51575
  description: M$p('Standard new-hire path: profile capture, provisioning checklist, and employee induction questionnaire.', 'مسیر استاندارد کارکنان جدید: ثبت مشخصات، چک‌لیست دسترسی و پرسشنامه آشنایی کارمند.'),
50889
- workflowDefinitionId: EMPLOYEE_LIFECYCLE_GUIDED_FLOW_WORKFLOW_DEFINITION_ID,
50890
- workflowDefinition: employeeLifecycleGuidedFlowStub(),
51576
+ workflowDefinitionId: EMPLOYEE_LIFECYCLE_EVENT_FLOW_WORKFLOW_DEFINITION_ID,
51577
+ workflowDefinition: employeeLifecycleEventFlowStub(),
50891
51578
  questionnaireId: QUESTIONNAIRE_ID_HR_EMPLOYEE_INDUCTION,
50892
51579
  questionnaire: onboardingQuestionnaireStub,
50893
51580
  icon: 'fa-light fa-user-plus',
@@ -50939,12 +51626,12 @@ const LIFECYCLE_PROCESS_TYPES_MOCK = [
50939
51626
  ]),
50940
51627
  },
50941
51628
  {
50942
- id: MOCK_LIFECYCLE_PROCESS_TYPE_SEPARATION_ID,
51629
+ id: MOCK_LIFECYCLE_EVENT_TYPE_SEPARATION_ID,
50943
51630
  name: 'SEPARATION_DEFAULT',
50944
51631
  title: M$p('Offboarding / separation', 'خروج از سازمان / جدایی'),
50945
51632
  description: M$p('Exit checklist: access removal, asset return, employee separation questionnaire, and final approvals.', 'چک‌لیست خروج: حذف دسترسی، بازگشت دارایی، پرسشنامه جدایی کارمند و تأییدهای نهایی.'),
50946
- workflowDefinitionId: EMPLOYEE_LIFECYCLE_GUIDED_FLOW_WORKFLOW_DEFINITION_ID,
50947
- workflowDefinition: employeeLifecycleGuidedFlowStub(),
51633
+ workflowDefinitionId: EMPLOYEE_LIFECYCLE_EVENT_FLOW_WORKFLOW_DEFINITION_ID,
51634
+ workflowDefinition: employeeLifecycleEventFlowStub(),
50948
51635
  questionnaireId: QUESTIONNAIRE_ID_EMPLOYEE_SEPARATION_CHECKLIST,
50949
51636
  questionnaire: separationQuestionnaireStub,
50950
51637
  icon: 'fa-light fa-door-open',
@@ -50990,7 +51677,7 @@ const LIFECYCLE_PROCESS_TYPES_MOCK = [
50990
51677
  ]),
50991
51678
  },
50992
51679
  {
50993
- id: MOCK_LIFECYCLE_PROCESS_TYPE_PROMOTION_ID,
51680
+ id: MOCK_LIFECYCLE_EVENT_TYPE_PROMOTION_ID,
50994
51681
  name: 'PROMOTION_DEFAULT',
50995
51682
  title: M$p('Promotion', 'ارتقای شغلی'),
50996
51683
  description: M$p('Title or grade change with effective date and compensation band capture.', 'تغییر عنوان یا پایه با تاریخ اثر و ثبت بازهٔ حقوق و مزایا.'),
@@ -51033,7 +51720,7 @@ const LIFECYCLE_PROCESS_TYPES_MOCK = [
51033
51720
  ]),
51034
51721
  },
51035
51722
  {
51036
- id: MOCK_LIFECYCLE_PROCESS_TYPE_TRANSFER_ID,
51723
+ id: MOCK_LIFECYCLE_EVENT_TYPE_TRANSFER_ID,
51037
51724
  name: 'TRANSFER_DEFAULT',
51038
51725
  title: M$p('Transfer', 'انتقال سازمانی'),
51039
51726
  description: M$p('Move between business units or locations with manager and desk assignments.', 'جابه‌جایی بین واحد یا محل با مدیر و میز کار.'),
@@ -51076,7 +51763,7 @@ const LIFECYCLE_PROCESS_TYPES_MOCK = [
51076
51763
  ]),
51077
51764
  },
51078
51765
  {
51079
- id: MOCK_LIFECYCLE_PROCESS_TYPE_RETURN_TO_WORK_ID,
51766
+ id: MOCK_LIFECYCLE_EVENT_TYPE_RETURN_TO_WORK_ID,
51080
51767
  name: 'RETURN_TO_WORK_DEFAULT',
51081
51768
  title: M$p('Return to work', 'بازگشت به کار'),
51082
51769
  description: M$p('Medical or parental leave return: clearance, restrictions, and phased schedule.', 'بازگشت پس از مرخصی استعلاجی یا زایمان: مجوز، محدودیت‌ها و برنامه تدریجی.'),
@@ -51119,7 +51806,7 @@ const LIFECYCLE_PROCESS_TYPES_MOCK = [
51119
51806
  ]),
51120
51807
  },
51121
51808
  {
51122
- id: MOCK_LIFECYCLE_PROCESS_TYPE_LEAVE_OF_ABSENCE_ID,
51809
+ id: MOCK_LIFECYCLE_EVENT_TYPE_LEAVE_OF_ABSENCE_ID,
51123
51810
  name: 'LEAVE_OF_ABSENCE_DEFAULT',
51124
51811
  title: M$p('Leave of absence', 'مرخصی بلندمدت / غیبت موقت'),
51125
51812
  description: M$p('Structured absence workflow placeholder; leave entitlement stays on Leave Request records.', 'جریان مرخصی بلندمدت؛ محاسبه استحقاق مرخصی همچنان در رکورد درخواست مرخصی.'),
@@ -51167,229 +51854,17 @@ const LIFECYCLE_PROCESS_TYPES_MOCK = [
51167
51854
  ];
51168
51855
  //#endregion
51169
51856
 
51170
- //#region ---- Imports ----
51171
- //#endregion
51172
- //#region ---- Mock data ----
51173
- const onboardingType = LIFECYCLE_PROCESS_TYPES_MOCK.find((t) => t.id === MOCK_LIFECYCLE_PROCESS_TYPE_ONBOARDING_ID);
51174
- const separationType = LIFECYCLE_PROCESS_TYPES_MOCK.find((t) => t.id === MOCK_LIFECYCLE_PROCESS_TYPE_SEPARATION_ID);
51175
- /** Sample workflow-step assignee for list column demos (not Rod Jensen's login user). */
51176
- const demoProcessAssignee = mockUsers.find((u) => u.displayName === 'Sarah Johnson') ?? mockUsers[0];
51177
- const EMPLOYEE_LIFECYCLE_PROCESSES_MOCK = [
51178
- {
51179
- id: AXPDataGenerator.uuid(),
51180
- employeeId: EMPLOYEES_MOCK[0].id,
51181
- lifecycleProcessTypeId: onboardingType.id,
51182
- lifecycleProcessType: {
51183
- id: onboardingType.id,
51184
- name: onboardingType.name,
51185
- title: onboardingType.title,
51186
- },
51187
- processAssigneeUserId: demoProcessAssignee.id,
51188
- processAssigneeUser: { id: demoProcessAssignee.id, displayName: demoProcessAssignee.displayName },
51189
- effectiveDate: new Date(),
51190
- notes: 'Demo onboarding process instance.',
51191
- statusId: AXPSystemStatuses.Draft.name,
51192
- status: { id: AXPSystemStatuses.Draft.name, title: AXPSystemStatuses.Draft.title },
51193
- },
51194
- {
51195
- id: AXPDataGenerator.uuid(),
51196
- employeeId: EMPLOYEES_MOCK[1].id,
51197
- lifecycleProcessTypeId: separationType.id,
51198
- lifecycleProcessType: {
51199
- id: separationType.id,
51200
- name: separationType.name,
51201
- title: separationType.title,
51202
- },
51203
- processAssigneeUserId: demoProcessAssignee.id,
51204
- processAssigneeUser: { id: demoProcessAssignee.id, displayName: demoProcessAssignee.displayName },
51205
- effectiveDate: new Date(),
51206
- notes: 'Demo separation process instance.',
51207
- statusId: AXPSystemStatuses.InProgress.name,
51208
- status: { id: AXPSystemStatuses.InProgress.name, title: AXPSystemStatuses.InProgress.title },
51209
- },
51210
- ];
51211
- //#endregion
51212
-
51213
- class AXMEmployeeLifecycleProcessDataSeeder {
51857
+ class AXMLifecycleEventTypeDataSeeder {
51214
51858
  constructor() {
51215
51859
  this.storageService = inject(AXPEntityStorageService);
51216
51860
  }
51217
51861
  async seed() {
51218
- await this.storageService.initial(RootConfig$j.entities.employeeLifecycleProcess.source, EMPLOYEE_LIFECYCLE_PROCESSES_MOCK);
51862
+ await this.storageService.initial(RootConfig$j.entities.lifecycleEventType.source, LIFECYCLE_EVENT_TYPES_MOCK);
51219
51863
  }
51220
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMEmployeeLifecycleProcessDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
51221
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMEmployeeLifecycleProcessDataSeeder }); }
51864
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMLifecycleEventTypeDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
51865
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMLifecycleEventTypeDataSeeder }); }
51222
51866
  }
51223
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMEmployeeLifecycleProcessDataSeeder, decorators: [{
51224
- type: Injectable
51225
- }] });
51226
-
51227
- function generateLeaveType() {
51228
- const uuid = AXPDataGenerator.uuid;
51229
- const M = createMultiLanguageString;
51230
- return [
51231
- {
51232
- id: uuid(),
51233
- title: M('Annual Leave', 'مرخصی سالانه'),
51234
- description: M('Paid time off for vacation, rest, or personal activities', 'مرخصی استحقاقی برای استراحت یا امور شخصی'),
51235
- color: '#3b82f6',
51236
- },
51237
- {
51238
- id: uuid(),
51239
- title: M("Sick & Carer's Leave", 'مرخصی استعلاجی و مراقبت'),
51240
- description: M('Time off for personal illness or to care for sick family members', 'غیبت به دلیل بیماری یا مراقبت از بیمار خانواده'),
51241
- color: '#ef4444',
51242
- },
51243
- {
51244
- id: uuid(),
51245
- title: M('Rostered Day off', 'روز تعطیل برنامه‌ریزی‌شده'),
51246
- description: M('Scheduled day off as part of the regular work roster', 'روز تعطیل طبق برنامه نوبت کاری'),
51247
- color: '#8b5cf6',
51248
- },
51249
- {
51250
- id: uuid(),
51251
- title: M('Training', 'آموزش'),
51252
- description: M('Time allocated for professional development, courses, or skill enhancement', 'زمان توسعه حرفه‌ای و دوره‌ها'),
51253
- color: '#06b6d4',
51254
- },
51255
- {
51256
- id: uuid(),
51257
- title: M('Compassionate & Bereavement Leave', 'مرخصی انسانی و سوگ'),
51258
- description: M('Time off granted for family emergencies or the death of a loved one', 'مرخصی برای فوت نزدیکان یا شرایط اضطراری خانوادگی'),
51259
- color: '#6366f1',
51260
- },
51261
- {
51262
- id: uuid(),
51263
- title: M('Time Off In Lieu', 'مرخصی جبرانی'),
51264
- description: M('Compensatory time off earned for working additional hours beyond normal schedule', 'جبران ساعت اضافه‌کاری'),
51265
- color: '#10b981',
51266
- },
51267
- {
51268
- id: uuid(),
51269
- title: M('Community Service Leave', 'مرخصی خدمت اجتماعی'),
51270
- description: M('Paid leave for volunteer work or community service activities', 'مرخصی برای داوطلبی و خدمات اجتماعی'),
51271
- color: '#059669',
51272
- },
51273
- {
51274
- id: uuid(),
51275
- title: M('Family & Domestic Violence Leave', 'مرخصی خشونت خانگی'),
51276
- description: M('Paid leave for employees experiencing family or domestic violence situations', 'مرخصی حمایتی برای کارکنان در معرض خشونت خانگی'),
51277
- color: '#ec4899',
51278
- },
51279
- {
51280
- id: uuid(),
51281
- title: M('Long Service Leave', 'مرخصی سنوات'),
51282
- description: M('Extended paid leave granted after many years of continuous service', 'مرخصی طولانی پس از سال‌ها خدمت'),
51283
- color: '#f59e0b',
51284
- },
51285
- {
51286
- id: uuid(),
51287
- title: M('Maternity & Paternal Leave', 'مرخصی زایمان و پدری'),
51288
- description: M('Time off for new parents to care for and bond with their newborn child', 'مرخصی والدین برای مراقبت از نوزاد'),
51289
- color: '#f472b6',
51290
- },
51291
- {
51292
- id: uuid(),
51293
- title: M("Public Holiday's", 'تعطیلات رسمی'),
51294
- description: M('Recognized public holidays and national observances', 'تعطیلات رسمی و مناسبت‌های ملی'),
51295
- color: '#eab308',
51296
- },
51297
- {
51298
- id: uuid(),
51299
- title: M('Unpaid Leave', 'مرخصی بدون حقوق'),
51300
- description: M('Leave without pay for personal reasons or extended time off', 'بدون حقوق به دلایل شخصی'),
51301
- color: '#6b7280',
51302
- },
51303
- {
51304
- id: uuid(),
51305
- title: M("Work's Compensation Leave", 'مرخصی بیمه کار'),
51306
- description: M('Leave due to work-related injury or illness covered by workers compensation', 'مرخصی ناشی از آسیب یا بیماری شغلی'),
51307
- color: '#dc2626',
51308
- },
51309
- ];
51310
- }
51311
- const LEAVE_TYPES_MOCK = generateLeaveType();
51312
-
51313
- class AXMLeaveTypeDataSeeder {
51314
- constructor() {
51315
- this.storageService = inject(AXPEntityStorageService);
51316
- }
51317
- async seed() {
51318
- await this.storageService.initial(RootConfig$j.entities.leaveType.source, LEAVE_TYPES_MOCK);
51319
- }
51320
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMLeaveTypeDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
51321
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMLeaveTypeDataSeeder }); }
51322
- }
51323
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMLeaveTypeDataSeeder, decorators: [{
51324
- type: Injectable
51325
- }] });
51326
-
51327
- const uuid$9 = AXPDataGenerator.uuid;
51328
- const LEAVE_REQUEST_STATUS_DEFINITIONS = [
51329
- AXPSystemStatuses.Pending,
51330
- AXPSystemStatuses.Approved,
51331
- AXPSystemStatuses.Rejected,
51332
- AXPSystemStatuses.Cancelled,
51333
- ];
51334
- function buildLeaveRequests() {
51335
- const results = [];
51336
- EMPLOYEES_MOCK.forEach((employee) => {
51337
- // Generate 2 leave requests per employee
51338
- const count = Math.floor(Math.random() * 2);
51339
- for (let i = 0; i < count; i++) {
51340
- const leaveType = LEAVE_TYPES_MOCK[Math.floor(Math.random() * LEAVE_TYPES_MOCK.length)];
51341
- const duration = Math.floor(Math.random() * 5) + 1; // 1-5 days
51342
- // Spread start/end across past, today, and future (inclusive) relative to "now"
51343
- const startDayOffset = Math.floor(Math.random() * 211) - 120; // -120 .. +90 days
51344
- const start = new Date();
51345
- start.setDate(start.getDate() + startDayOffset);
51346
- const end = new Date(start);
51347
- end.setDate(start.getDate() + duration);
51348
- const statusDefinition = LEAVE_REQUEST_STATUS_DEFINITIONS[Math.floor(Math.random() * LEAVE_REQUEST_STATUS_DEFINITIONS.length)];
51349
- results.push({
51350
- id: uuid$9(),
51351
- employeeId: employee.id,
51352
- employee,
51353
- leaveTypeId: leaveType.id,
51354
- leaveType,
51355
- startDate: start,
51356
- endDate: end,
51357
- durationDays: duration,
51358
- reason: `Request for ${leaveType.title}`,
51359
- statusId: statusDefinition.name,
51360
- status: { id: statusDefinition.name, title: statusDefinition.title },
51361
- });
51362
- }
51363
- });
51364
- return results;
51365
- }
51366
- const LEAVE_REQUESTS_MOCK = buildLeaveRequests();
51367
-
51368
- class AXMLeaveRequestDataSeeder {
51369
- constructor() {
51370
- this.storageService = inject(AXPEntityStorageService);
51371
- }
51372
- async seed() {
51373
- await this.storageService.initial(RootConfig$j.entities.leaveRequest.source, LEAVE_REQUESTS_MOCK);
51374
- }
51375
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMLeaveRequestDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
51376
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMLeaveRequestDataSeeder }); }
51377
- }
51378
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMLeaveRequestDataSeeder, decorators: [{
51379
- type: Injectable
51380
- }] });
51381
-
51382
- class AXMLifecycleProcessTypeDataSeeder {
51383
- constructor() {
51384
- this.storageService = inject(AXPEntityStorageService);
51385
- }
51386
- async seed() {
51387
- await this.storageService.initial(RootConfig$j.entities.lifecycleProcessType.source, LIFECYCLE_PROCESS_TYPES_MOCK);
51388
- }
51389
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMLifecycleProcessTypeDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
51390
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMLifecycleProcessTypeDataSeeder }); }
51391
- }
51392
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMLifecycleProcessTypeDataSeeder, decorators: [{
51867
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMLifecycleEventTypeDataSeeder, decorators: [{
51393
51868
  type: Injectable
51394
51869
  }] });
51395
51870
 
@@ -51837,7 +52312,7 @@ const createLeaveRequestWorkflowEntityMock = createWorkflowDefinitionEntityMock(
51837
52312
 
51838
52313
  /** Human Capital Management workflow definition entity rows seeded into WorkflowManagement.WorkflowDefinition. */
51839
52314
  const humanCapitalManagementWorkflowDefinitionEntityMocks = [
51840
- employeeLifecycleGuidedFlowWorkflowEntityMock,
52315
+ employeeLifecycleEventFlowWorkflowEntityMock,
51841
52316
  createLeaveRequestWorkflowEntityMock,
51842
52317
  ];
51843
52318
  class AXCHumanCapitalManagementWorkflowDefinitionDataSeeder {
@@ -52120,9 +52595,8 @@ class AXCHumanCapitalManagementMockModule {
52120
52595
  { provide: AXP_DATA_SEEDER_TOKEN, useClass: AXMEmployeeDataSeeder, multi: true },
52121
52596
  { provide: AXP_DATA_SEEDER_TOKEN, useClass: AXMPositionAssignmentDataSeeder, multi: true },
52122
52597
  { provide: AXP_DATA_SEEDER_TOKEN, useClass: AXMLeaveTypeDataSeeder, multi: true },
52123
- { provide: AXP_DATA_SEEDER_TOKEN, useClass: AXMLifecycleProcessTypeDataSeeder, multi: true },
52598
+ { provide: AXP_DATA_SEEDER_TOKEN, useClass: AXMLifecycleEventTypeDataSeeder, multi: true },
52124
52599
  { provide: AXP_DATA_SEEDER_TOKEN, useClass: AXMLeaveRequestDataSeeder, multi: true },
52125
- { provide: AXP_DATA_SEEDER_TOKEN, useClass: AXMEmployeeLifecycleProcessDataSeeder, multi: true },
52126
52600
  {
52127
52601
  provide: AXP_DATA_SEEDER_TOKEN,
52128
52602
  useClass: AXCHumanCapitalManagementWorkflowDefinitionDataSeeder,
@@ -52141,9 +52615,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
52141
52615
  { provide: AXP_DATA_SEEDER_TOKEN, useClass: AXMEmployeeDataSeeder, multi: true },
52142
52616
  { provide: AXP_DATA_SEEDER_TOKEN, useClass: AXMPositionAssignmentDataSeeder, multi: true },
52143
52617
  { provide: AXP_DATA_SEEDER_TOKEN, useClass: AXMLeaveTypeDataSeeder, multi: true },
52144
- { provide: AXP_DATA_SEEDER_TOKEN, useClass: AXMLifecycleProcessTypeDataSeeder, multi: true },
52618
+ { provide: AXP_DATA_SEEDER_TOKEN, useClass: AXMLifecycleEventTypeDataSeeder, multi: true },
52145
52619
  { provide: AXP_DATA_SEEDER_TOKEN, useClass: AXMLeaveRequestDataSeeder, multi: true },
52146
- { provide: AXP_DATA_SEEDER_TOKEN, useClass: AXMEmployeeLifecycleProcessDataSeeder, multi: true },
52147
52620
  {
52148
52621
  provide: AXP_DATA_SEEDER_TOKEN,
52149
52622
  useClass: AXCHumanCapitalManagementWorkflowDefinitionDataSeeder,
@@ -53477,7 +53950,6 @@ const learningManagementEnrollmentMocks = [
53477
53950
  title: learningManagementTrainingMocks[0].course.title,
53478
53951
  },
53479
53952
  status: 'Approved',
53480
- workflowInstanceId: null,
53481
53953
  notes: null,
53482
53954
  },
53483
53955
  {
@@ -53492,7 +53964,6 @@ const learningManagementEnrollmentMocks = [
53492
53964
  title: learningManagementTrainingMocks[0].course.title,
53493
53965
  },
53494
53966
  status: 'Requested',
53495
- workflowInstanceId: null,
53496
53967
  notes: null,
53497
53968
  },
53498
53969
  ];
@@ -58219,7 +58690,7 @@ const primaryMiddleware = {
58219
58690
  };
58220
58691
 
58221
58692
  /** Keys to omit from version snapshots so we don't duplicate audit metadata in the version store. */
58222
- const VERSION_SNAPSHOT_OMIT_KEYS = ['auditInfo', 'stateInfo', 'ownershipInfo'];
58693
+ const VERSION_SNAPSHOT_OMIT_KEYS = ['auditInfo', 'stateInfo', 'ownershipInfo', 'workflowInfo'];
58223
58694
  function snapshotForVersion(record) {
58224
58695
  if (record == null) {
58225
58696
  return null;
@@ -58233,7 +58704,7 @@ function snapshotForVersion(record) {
58233
58704
  /**
58234
58705
  * Combined middleware: enriches entity records with audit info (who/when) and records
58235
58706
  * version history for the "Change history" timeline. Version snapshots exclude auditInfo
58236
- * (and stateInfo, ownershipInfo) so we don't log audit metadata again in the version store.
58707
+ * (and stateInfo, ownershipInfo, workflowInfo) so we don't log platform metadata again in the version store.
58237
58708
  */
58238
58709
  const historyMiddleware = {
58239
58710
  target: { ops: ['create', 'update', 'delete'], order: 15 },
@@ -59273,8 +59744,8 @@ class AXCMiddlewaresModule {
59273
59744
  { provide: AXP_ENTITY_STORAGE_MIDDLEWARE, multi: true, useValue: childCountMiddleware },
59274
59745
  { provide: AXP_ENTITY_STORAGE_MIDDLEWARE, multi: true, useValue: createFileCastMiddleware },
59275
59746
  { provide: AXP_ENTITY_STORAGE_MIDDLEWARE, multi: true, useValue: primaryMiddleware },
59747
+ { provide: AXP_ENTITY_STORAGE_MIDDLEWARE, multi: true, useValue: visibilityFilterMiddleware }, // order: 20
59276
59748
  // { provide: AXP_ENTITY_STORAGE_MIDDLEWARE, multi: true, useValue: firestoreRequestLoggerMiddleware }, // order: 200 - runs last before backend, logs request/response
59277
- //{ provide: AXP_ENTITY_STORAGE_MIDDLEWARE, multi: true, useValue: visibilityFilterMiddleware }, // order: 20
59278
59749
  //{ provide: AXP_ENTITY_STORAGE_MIDDLEWARE, multi: true, useValue: signatureLoaderMiddleware },
59279
59750
  // Sample entity event listener to show logs for all entity.* events
59280
59751
  //{ provide: AXP_DISTRIBUTED_EVENT_LISTENER_PROVIDER, multi: true, useValue: AXCMockEntityLogListener },
@@ -59300,8 +59771,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
59300
59771
  { provide: AXP_ENTITY_STORAGE_MIDDLEWARE, multi: true, useValue: childCountMiddleware },
59301
59772
  { provide: AXP_ENTITY_STORAGE_MIDDLEWARE, multi: true, useValue: createFileCastMiddleware },
59302
59773
  { provide: AXP_ENTITY_STORAGE_MIDDLEWARE, multi: true, useValue: primaryMiddleware },
59774
+ { provide: AXP_ENTITY_STORAGE_MIDDLEWARE, multi: true, useValue: visibilityFilterMiddleware }, // order: 20
59303
59775
  // { provide: AXP_ENTITY_STORAGE_MIDDLEWARE, multi: true, useValue: firestoreRequestLoggerMiddleware }, // order: 200 - runs last before backend, logs request/response
59304
- //{ provide: AXP_ENTITY_STORAGE_MIDDLEWARE, multi: true, useValue: visibilityFilterMiddleware }, // order: 20
59305
59776
  //{ provide: AXP_ENTITY_STORAGE_MIDDLEWARE, multi: true, useValue: signatureLoaderMiddleware },
59306
59777
  // Sample entity event listener to show logs for all entity.* events
59307
59778
  //{ provide: AXP_DISTRIBUTED_EVENT_LISTENER_PROVIDER, multi: true, useValue: AXCMockEntityLogListener },
@@ -67013,19 +67484,23 @@ class AXPSecurityManagementRoleDataSeeder {
67013
67484
  const roles = mockRoleDefinitions.map((role) => ({
67014
67485
  ...role,
67015
67486
  }));
67016
- await this.storageService.initial(entityName, roles);
67487
+ await this.storageService.initial(entityName, roles, {
67488
+ mergeType: 'merge',
67489
+ uniqueKeys: ['name'],
67490
+ });
67017
67491
  // Dexie `initial()` skips the whole batch when any role name already exists,
67018
67492
  // so permission changes in role.mock.ts would never reach IndexedDB without this sync.
67019
67493
  await this.syncRolePermissionsFromMock(entityName);
67020
67494
  }
67021
67495
  /**
67022
67496
  * Updates permissions (and metadata) on seeded roles when mock definitions change.
67497
+ * Skips system/immutable roles — policy middleware rejects those updates on app startup.
67023
67498
  */
67024
67499
  async syncRolePermissionsFromMock(entityName) {
67025
67500
  const storedRoles = await this.storageService.getAll(entityName);
67026
67501
  for (const mockRole of mockRoleDefinitions) {
67027
67502
  const existing = storedRoles.find((role) => role.name === mockRole.name);
67028
- if (!existing?.id) {
67503
+ if (!existing?.id || this.isPolicyProtectedRole(existing) || this.isPolicyProtectedRole(mockRole)) {
67029
67504
  continue;
67030
67505
  }
67031
67506
  await this.storageService.updateOne(entityName, existing.id, {
@@ -67035,6 +67510,9 @@ class AXPSecurityManagementRoleDataSeeder {
67035
67510
  });
67036
67511
  }
67037
67512
  }
67513
+ isPolicyProtectedRole(role) {
67514
+ return role.stateInfo?.isImmutable === true || role.stateInfo?.isSystem === true;
67515
+ }
67038
67516
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPSecurityManagementRoleDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
67039
67517
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPSecurityManagementRoleDataSeeder }); }
67040
67518
  }
@@ -67057,20 +67535,59 @@ class AXPSecurityManagementUserDataSeeder {
67057
67535
  }
67058
67536
  async seed() {
67059
67537
  const entityName = `${RootConfig$6.module.name}.${RootConfig$6.entities.users.name}`;
67060
- await this.storageService.initial(entityName, mockUsers);
67538
+ await this.storageService.initial(entityName, mockUsers, {
67539
+ mergeType: 'merge',
67540
+ uniqueKeys: ['username'],
67541
+ });
67542
+ await this.syncMissingUsersFromMock(entityName);
67543
+ await this.syncOwnershipInfoFromMock(entityName);
67061
67544
  await this.syncCollaborationDemoUserRoles(entityName);
67062
67545
  }
67546
+ /**
67547
+ * Inserts mock users added after the first IndexedDB seed (e.g. demo accounts for new features).
67548
+ */
67549
+ async syncMissingUsersFromMock(usersEntityName) {
67550
+ const storedUsers = await this.backend.getAll(usersEntityName);
67551
+ for (const mockUser of mockUsers) {
67552
+ const exists = storedUsers.some((user) => user.username === mockUser.username);
67553
+ if (exists) {
67554
+ continue;
67555
+ }
67556
+ await this.storageService.insertOne(usersEntityName, mockUser);
67557
+ }
67558
+ }
67559
+ /**
67560
+ * Aligns stored user ownership with mock data so tenant-scoped list filtering works after re-seeds.
67561
+ */
67562
+ async syncOwnershipInfoFromMock(usersEntityName) {
67563
+ const storedUsers = await this.backend.getAll(usersEntityName);
67564
+ for (const mockUser of mockUsers) {
67565
+ if (!mockUser.ownershipInfo) {
67566
+ continue;
67567
+ }
67568
+ const storedUser = storedUsers.find((user) => user.username === mockUser.username);
67569
+ if (!storedUser?.id) {
67570
+ continue;
67571
+ }
67572
+ if (storedUser.ownershipInfo?.tenantId === mockUser.ownershipInfo.tenantId) {
67573
+ continue;
67574
+ }
67575
+ await this.storageService.updateOne(usersEntityName, storedUser.id, {
67576
+ ownershipInfo: mockUser.ownershipInfo,
67577
+ });
67578
+ }
67579
+ }
67063
67580
  /**
67064
67581
  * Keeps MAGFA collaboration demo user aligned with the conversation-only role in storage.
67065
67582
  */
67066
67583
  async syncCollaborationDemoUserRoles(usersEntityName) {
67067
67584
  const rolesEntityName = `${RootConfig$6.module.name}.${RootConfig$6.entities.roles.name}`;
67068
- const storedRoles = await this.storageService.getAll(rolesEntityName);
67585
+ const storedRoles = await this.backend.getAll(rolesEntityName);
67069
67586
  const conversationOnlyRole = storedRoles.find((role) => role.name === 'conversation-only');
67070
67587
  if (!conversationOnlyRole?.id) {
67071
67588
  return;
67072
67589
  }
67073
- const storedUsers = await this.storageService.getAll(usersEntityName);
67590
+ const storedUsers = await this.backend.getAll(usersEntityName);
67074
67591
  const demoUser = storedUsers.find((u) => u.username === 'mohamad.pour.ghorban');
67075
67592
  if (!demoUser?.id) {
67076
67593
  return;
@@ -67334,7 +67851,7 @@ class AXCSecurityManagementMockModule {
67334
67851
  provideQuerySetups([
67335
67852
  {
67336
67853
  key: 'SecurityManagement:User:RolesForListColumn',
67337
- loader: () => import('./acorex-connectivity-mock-user-roles-for-list-column.query-DSr7jDGu.mjs').then((m) => m.UserRolesForListColumnQuery),
67854
+ loader: () => import('./acorex-connectivity-mock-user-roles-for-list-column.query-1lSQeAEv.mjs').then((m) => m.UserRolesForListColumnQuery),
67338
67855
  },
67339
67856
  ]),
67340
67857
  ] }); }
@@ -67378,7 +67895,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
67378
67895
  provideQuerySetups([
67379
67896
  {
67380
67897
  key: 'SecurityManagement:User:RolesForListColumn',
67381
- loader: () => import('./acorex-connectivity-mock-user-roles-for-list-column.query-DSr7jDGu.mjs').then((m) => m.UserRolesForListColumnQuery),
67898
+ loader: () => import('./acorex-connectivity-mock-user-roles-for-list-column.query-1lSQeAEv.mjs').then((m) => m.UserRolesForListColumnQuery),
67382
67899
  },
67383
67900
  ]),
67384
67901
  ],
@@ -67894,6 +68411,22 @@ function generateTenants() {
67894
68411
  }
67895
68412
  const tenantMocks = generateTenants();
67896
68413
 
68414
+ //#region ---- Subscription Plan ID Constants ----
68415
+ /**
68416
+ * Stable subscription plan primary keys keyed by plan `code`.
68417
+ */
68418
+ const MOCK_SUBSCRIPTION_PLAN_IDS = {
68419
+ 'PREM-001': 'f0000005-0000-4000-a000-000000000001',
68420
+ 'STD-SUB-001': 'f0000005-0000-4000-a000-000000000002',
68421
+ 'ENT-001': 'f0000005-0000-4000-a000-000000000003',
68422
+ 'ORD-STD-001': 'f0000005-0000-4000-a000-000000000004',
68423
+ 'PC-001': 'f0000005-0000-4000-a000-000000000005',
68424
+ 'SM-BASIC-001': 'f0000005-0000-4000-a000-000000000006',
68425
+ 'CM-ENT-001': 'f0000005-0000-4000-a000-000000000007',
68426
+ 'MAGFA-001': 'f0000005-0000-4000-a000-000000000008',
68427
+ };
68428
+ //#endregion
68429
+
67897
68430
  function generateSubscriptionPlans() {
67898
68431
  const plans = [];
67899
68432
  // Get edition IDs from mock data
@@ -67902,7 +68435,10 @@ function generateSubscriptionPlans() {
67902
68435
  const financeEdition = EDITIONS.find((e) => e.title === 'Finance Enterprise');
67903
68436
  // Helper function to create subscription plan
67904
68437
  const createPlan = (title, code, description, isDisabled = false) => {
67905
- const planId = AXPDataGenerator.uuid();
68438
+ const planId = MOCK_SUBSCRIPTION_PLAN_IDS[code];
68439
+ if (!planId) {
68440
+ throw new Error(`Missing stable subscription plan id for code: ${code}`);
68441
+ }
67906
68442
  const plan = {
67907
68443
  id: planId,
67908
68444
  title,
@@ -68002,12 +68538,90 @@ function generateSubscriptions() {
68002
68538
  }
68003
68539
  const SUBSCRIPTIONS_MOCK = generateSubscriptions();
68004
68540
 
68541
+ //#region ---- Imports ----
68542
+ //#endregion
68543
+ //#region ---- Subscription Seeder ----
68544
+ /**
68545
+ * Seeds tenant subscriptions for the mock tenant loader.
68546
+ *
68547
+ * Dexie `initial()` defaults to `uniqueKeys: ['name']`, but subscription rows have no `name` field.
68548
+ * Subscriber and plan ids in mock files can also drift from IndexedDB after reloads, so rows are
68549
+ * resolved against stored tenants (by tenant `name`) and stored plans (by `code`) before insert/sync.
68550
+ */
68005
68551
  class AXCSubscriptionSeeder {
68006
68552
  constructor() {
68007
68553
  this.storageService = inject(AXPEntityStorageService);
68008
68554
  }
68009
68555
  async seed() {
68010
- await this.storageService.initial(RootConfig$x.entities.subscription.source, SUBSCRIPTIONS_MOCK);
68556
+ const entityName = RootConfig$x.entities.subscription.source;
68557
+ const resolvedMocks = await this.resolveMockSubscriptions();
68558
+ await this.storageService.initial(entityName, resolvedMocks, {
68559
+ mergeType: 'merge',
68560
+ uniqueKeys: ['subscriberId', 'planId'],
68561
+ });
68562
+ await this.syncSubscriptionsFromMock(entityName, resolvedMocks);
68563
+ }
68564
+ async resolveMockSubscriptions() {
68565
+ const tenantEntityName = `${RootConfig$y.module.name}.${RootConfig$y.entities.tenant.name}`;
68566
+ const planEntityName = RootConfig$x.entities.subscriptionPlan.source;
68567
+ const [storedTenants, storedPlans] = await Promise.all([
68568
+ this.storageService.getAll(tenantEntityName),
68569
+ this.storageService.getAll(planEntityName),
68570
+ ]);
68571
+ const resolved = [];
68572
+ for (const mock of SUBSCRIPTIONS_MOCK) {
68573
+ const mockTenantDef = tenantMocks.find((tenant) => tenant.id === mock.subscriberId);
68574
+ const storedTenant = storedTenants.find((tenant) => tenant.id === mock.subscriberId ||
68575
+ (!!mockTenantDef?.name && tenant.name === mockTenantDef.name));
68576
+ if (!storedTenant?.id) {
68577
+ continue;
68578
+ }
68579
+ const mockPlanDef = SUBSCRIPTION_PLANS_MOCK.find((plan) => plan.id === mock.planId);
68580
+ const storedPlan = storedPlans.find((plan) => plan.id === mock.planId || (!!mockPlanDef?.code && plan.code === mockPlanDef.code));
68581
+ if (!storedPlan?.id) {
68582
+ continue;
68583
+ }
68584
+ resolved.push({
68585
+ ...mock,
68586
+ subscriberId: storedTenant.id,
68587
+ subscriber: {
68588
+ id: storedTenant.id,
68589
+ title: storedTenant.title,
68590
+ displayName: storedTenant.title,
68591
+ },
68592
+ planId: storedPlan.id,
68593
+ plan: {
68594
+ id: storedPlan.id,
68595
+ title: storedPlan.title,
68596
+ },
68597
+ });
68598
+ }
68599
+ return resolved;
68600
+ }
68601
+ async syncSubscriptionsFromMock(entityName, resolvedMocks) {
68602
+ const storedSubscriptions = await this.storageService.getAll(entityName);
68603
+ for (const mock of resolvedMocks) {
68604
+ const existing = storedSubscriptions.find((subscription) => subscription.subscriberId === mock.subscriberId && subscription.planId === mock.planId);
68605
+ if (!existing?.id) {
68606
+ await this.storageService.insertOne(entityName, {
68607
+ ...mock,
68608
+ id: mock.id ?? AXPDataGenerator.uuid(),
68609
+ });
68610
+ continue;
68611
+ }
68612
+ const subscriberChanged = existing.subscriberId !== mock.subscriberId;
68613
+ const planChanged = existing.planId !== mock.planId;
68614
+ const statusChanged = existing.statusId !== mock.statusId;
68615
+ if (subscriberChanged || planChanged || statusChanged) {
68616
+ await this.storageService.updateOne(entityName, existing.id, {
68617
+ subscriberId: mock.subscriberId,
68618
+ subscriber: mock.subscriber,
68619
+ planId: mock.planId,
68620
+ plan: mock.plan,
68621
+ statusId: mock.statusId,
68622
+ });
68623
+ }
68624
+ }
68011
68625
  }
68012
68626
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXCSubscriptionSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
68013
68627
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXCSubscriptionSeeder }); }
@@ -68021,7 +68635,10 @@ class AXCSubscriptionPlanSeeder {
68021
68635
  this.storageService = inject(AXPEntityStorageService);
68022
68636
  }
68023
68637
  async seed() {
68024
- await this.storageService.initial(RootConfig$x.entities.subscriptionPlan.source, SUBSCRIPTION_PLANS_MOCK);
68638
+ await this.storageService.initial(RootConfig$x.entities.subscriptionPlan.source, SUBSCRIPTION_PLANS_MOCK, {
68639
+ mergeType: 'merge',
68640
+ uniqueKeys: ['code'],
68641
+ });
68025
68642
  }
68026
68643
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXCSubscriptionPlanSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
68027
68644
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXCSubscriptionPlanSeeder }); }
@@ -68168,7 +68785,7 @@ class AXCSupplierCategorySeeder {
68168
68785
  this.storageService = inject(AXPEntityStorageService);
68169
68786
  }
68170
68787
  async seed() {
68171
- await this.storageService.initial(`${RootConfig$y.module.name}.${RootConfig$y.entities.supplier.name}Category`, supplierCategoryMocks);
68788
+ await this.storageService.initial(`${RootConfig$z.module.name}.${RootConfig$z.entities.supplier.name}Category`, supplierCategoryMocks);
68172
68789
  }
68173
68790
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXCSupplierCategorySeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
68174
68791
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXCSupplierCategorySeeder }); }
@@ -68182,7 +68799,7 @@ class AXCSupplierDataSeeder {
68182
68799
  this.storageService = inject(AXPEntityStorageService);
68183
68800
  }
68184
68801
  async seed() {
68185
- await this.storageService.initial(RootConfig$y.entities.supplier.source, SUPPLIERS_MOCK);
68802
+ await this.storageService.initial(RootConfig$z.entities.supplier.source, SUPPLIERS_MOCK);
68186
68803
  }
68187
68804
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXCSupplierDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
68188
68805
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXCSupplierDataSeeder }); }
@@ -68625,7 +69242,7 @@ class AXMTaskTypeDataSeeder {
68625
69242
  this.storageService = inject(AXPEntityStorageService);
68626
69243
  }
68627
69244
  async seed() {
68628
- await this.storageService.initial(`${RootConfig$z.module.name}.${RootConfig$z.entities.taskType.name}`, taskTypeMock);
69245
+ await this.storageService.initial(`${RootConfig$A.module.name}.${RootConfig$A.entities.taskType.name}`, taskTypeMock);
68629
69246
  }
68630
69247
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMTaskTypeDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
68631
69248
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMTaskTypeDataSeeder }); }
@@ -68772,7 +69389,7 @@ class AXMTaskStatusDataSeeder {
68772
69389
  this.storageService = inject(AXPEntityStorageService);
68773
69390
  }
68774
69391
  async seed() {
68775
- await this.storageService.initial(`${RootConfig$z.module.name}.${RootConfig$z.entities.taskStatus.name}`, taskStatusMock);
69392
+ await this.storageService.initial(`${RootConfig$A.module.name}.${RootConfig$A.entities.taskStatus.name}`, taskStatusMock);
68776
69393
  }
68777
69394
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMTaskStatusDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
68778
69395
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMTaskStatusDataSeeder }); }
@@ -68943,7 +69560,7 @@ class AXMTaskDataSeeder {
68943
69560
  this.storageService = inject(AXPEntityStorageService);
68944
69561
  }
68945
69562
  async seed() {
68946
- await this.storageService.initial(`${RootConfig$z.module.name}.${RootConfig$z.entities.task.name}`, taskMock);
69563
+ await this.storageService.initial(`${RootConfig$A.module.name}.${RootConfig$A.entities.task.name}`, taskMock);
68947
69564
  }
68948
69565
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMTaskDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
68949
69566
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMTaskDataSeeder }); }
@@ -69051,7 +69668,7 @@ class AXMTaskTemplateDataSeeder {
69051
69668
  this.storageService = inject(AXPEntityStorageService);
69052
69669
  }
69053
69670
  async seed() {
69054
- await this.storageService.initial(`${RootConfig$z.module.name}.${RootConfig$z.entities.taskTemplate.name}`, taskTemplateMock);
69671
+ await this.storageService.initial(`${RootConfig$A.module.name}.${RootConfig$A.entities.taskTemplate.name}`, taskTemplateMock);
69055
69672
  }
69056
69673
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMTaskTemplateDataSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
69057
69674
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMTaskTemplateDataSeeder }); }
@@ -69119,7 +69736,7 @@ class AXCTenantSeeder {
69119
69736
  this.storageService = inject(AXPEntityStorageService);
69120
69737
  }
69121
69738
  async seed() {
69122
- await this.storageService.initial(RootConfig$A.entities.tenant.source, tenantMocks);
69739
+ await this.storageService.initial(RootConfig$y.entities.tenant.source, tenantMocks);
69123
69740
  }
69124
69741
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXCTenantSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
69125
69742
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXCTenantSeeder }); }
@@ -69295,12 +69912,113 @@ const tenantUserMocks = generateTenantUsers();
69295
69912
  //#region ---- Imports ----
69296
69913
  //#endregion
69297
69914
  //#region ---- Tenant User Seeder ----
69915
+ /**
69916
+ * Seeds `TenantManagement.TenantUser` mock memberships.
69917
+ *
69918
+ * Dexie `initial()` defaults to `uniqueKeys: ['name']`, but TenantUser rows have no `name` field.
69919
+ * User and tenant ids in mock files can drift from IndexedDB after reloads, so rows are resolved
69920
+ * against stored users (by `username`) and stored tenants (by tenant `name`) before insert/sync.
69921
+ */
69298
69922
  class AXCTenantUserSeeder {
69299
69923
  constructor() {
69300
69924
  this.storageService = inject(AXPEntityStorageService);
69925
+ this.backend = inject(AXP_ENTITY_STORAGE_BACKEND);
69301
69926
  }
69302
69927
  async seed() {
69303
- await this.storageService.initial(`${RootConfig$A.module.name}.${RootConfig$A.entities.tenantUser.name}`, tenantUserMocks);
69928
+ const entityName = `${RootConfig$y.module.name}.${RootConfig$y.entities.tenantUser.name}`;
69929
+ const resolvedMocks = await this.resolveMockTenantUsers();
69930
+ await this.storageService.initial(entityName, resolvedMocks, {
69931
+ mergeType: 'merge',
69932
+ uniqueKeys: ['userId', 'tenantId'],
69933
+ });
69934
+ await this.syncTenantUsersFromMock(entityName, resolvedMocks);
69935
+ }
69936
+ /**
69937
+ * Maps mock tenant-user rows to user/tenant/role ids currently stored in IndexedDB.
69938
+ */
69939
+ async resolveMockTenantUsers() {
69940
+ const tenantEntityName = `${RootConfig$y.module.name}.${RootConfig$y.entities.tenant.name}`;
69941
+ const userEntityName = `${RootConfig$6.module.name}.${RootConfig$6.entities.users.name}`;
69942
+ const roleEntityName = `${RootConfig$6.module.name}.${RootConfig$6.entities.roles.name}`;
69943
+ const [storedTenants, storedUsers, storedRoles] = await Promise.all([
69944
+ this.backend.getAll(tenantEntityName),
69945
+ this.backend.getAll(userEntityName),
69946
+ this.backend.getAll(roleEntityName),
69947
+ ]);
69948
+ const resolved = [];
69949
+ for (const mock of tenantUserMocks) {
69950
+ const username = mock.user?.username;
69951
+ if (!username) {
69952
+ continue;
69953
+ }
69954
+ const storedUser = storedUsers.find((user) => user.username === username);
69955
+ if (!storedUser?.id) {
69956
+ continue;
69957
+ }
69958
+ const mockTenantDef = tenantMocks.find((tenant) => tenant.id === mock.tenantId || tenant.id === mock.tenant?.id);
69959
+ const storedTenant = storedTenants.find((tenant) => tenant.id === mock.tenantId ||
69960
+ (!!mockTenantDef?.name && tenant.name === mockTenantDef.name));
69961
+ if (!storedTenant?.id) {
69962
+ continue;
69963
+ }
69964
+ const roleName = mock.role?.name;
69965
+ const storedRole = roleName ? storedRoles.find((role) => role.name === roleName) : undefined;
69966
+ resolved.push({
69967
+ ...mock,
69968
+ userId: storedUser.id,
69969
+ user: {
69970
+ id: storedUser.id,
69971
+ username: storedUser.username,
69972
+ displayName: storedUser.displayName,
69973
+ },
69974
+ tenantId: storedTenant.id,
69975
+ tenant: { id: storedTenant.id, title: storedTenant.title },
69976
+ roleId: storedRole?.id ?? mock.roleId,
69977
+ role: storedRole
69978
+ ? { id: storedRole.id, name: storedRole.name, title: storedRole.title }
69979
+ : mock.role,
69980
+ });
69981
+ }
69982
+ return resolved;
69983
+ }
69984
+ /**
69985
+ * Inserts or updates tenant-user rows when mock membership definitions change.
69986
+ */
69987
+ async syncTenantUsersFromMock(entityName, resolvedMocks) {
69988
+ const storedLinks = await this.backend.getAll(entityName);
69989
+ for (const mock of resolvedMocks) {
69990
+ const existing = this.findExistingTenantUserLink(storedLinks, mock);
69991
+ if (!existing?.id) {
69992
+ await this.storageService.insertOne(entityName, {
69993
+ ...mock,
69994
+ id: mock.id ?? AXPDataGenerator.uuid(),
69995
+ });
69996
+ continue;
69997
+ }
69998
+ const userChanged = existing.userId !== mock.userId;
69999
+ const roleChanged = existing.roleId !== mock.roleId;
70000
+ const statusChanged = existing.statusId !== mock.statusId;
70001
+ if (userChanged || roleChanged || statusChanged) {
70002
+ await this.storageService.updateOne(entityName, existing.id, {
70003
+ userId: mock.userId,
70004
+ user: mock.user,
70005
+ roleId: mock.roleId,
70006
+ role: mock.role,
70007
+ statusId: mock.statusId,
70008
+ });
70009
+ }
70010
+ }
70011
+ }
70012
+ findExistingTenantUserLink(storedLinks, mock) {
70013
+ const byIds = storedLinks.find((link) => link.userId === mock.userId && link.tenantId === mock.tenantId);
70014
+ if (byIds) {
70015
+ return byIds;
70016
+ }
70017
+ const username = mock.user?.username;
70018
+ if (!username) {
70019
+ return undefined;
70020
+ }
70021
+ return storedLinks.find((link) => link.user?.username === username && link.tenantId === mock.tenantId);
69304
70022
  }
69305
70023
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXCTenantUserSeeder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
69306
70024
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXCTenantUserSeeder }); }
@@ -69331,7 +70049,7 @@ class AXMCreateTenantUserCommand {
69331
70049
  };
69332
70050
  }
69333
70051
  // Check if account holder already exists for this tenant
69334
- const tenantUserEntityName = `${RootConfig$A.module.name}.${RootConfig$A.entities.tenantUser.name}`;
70052
+ const tenantUserEntityName = `${RootConfig$y.module.name}.${RootConfig$y.entities.tenantUser.name}`;
69335
70053
  const accountHolderResult = await this.storageService.query(tenantUserEntityName, {
69336
70054
  skip: 0,
69337
70055
  take: 1,
@@ -70717,8 +71435,8 @@ class AXCUserPassStrategyMock extends AXPAuthStrategy {
70717
71435
  try {
70718
71436
  let user = null;
70719
71437
  const func = entityRef?.queries?.list?.execute;
70720
- // Bypass visibility filter for authentication (system users need to be accessible)
70721
- const users = await func(bypassVisibilityFilter({
71438
+ // Bypass tenant/visibility filters for authentication (system users must be discoverable)
71439
+ const users = await func(bypassAllFilters({
70722
71440
  skip: 0,
70723
71441
  take: 1000,
70724
71442
  }));
@@ -71689,6 +72407,13 @@ function generateActivityDefinitions() {
71689
72407
  dataType: 'string',
71690
72408
  interface: { type: AXPWidgetsList.Editors.TextBox, options: {} },
71691
72409
  },
72410
+ {
72411
+ name: 'title',
72412
+ title: 'Viewer title',
72413
+ description: 'Optional popup title; defaults to assessment case title when omitted',
72414
+ dataType: 'string',
72415
+ interface: { type: AXPWidgetsList.Editors.TextBox, options: {} },
72416
+ },
71692
72417
  {
71693
72418
  name: 'showAs',
71694
72419
  title: 'Show as',
@@ -73075,6 +73800,63 @@ const documentWorkflowTriggerMiddleware = {
73075
73800
  },
73076
73801
  };
73077
73802
 
73803
+ const AXC_WORKFLOW_EXECUTION_STORE = new InjectionToken('AXC_WORKFLOW_EXECUTION_STORE');
73804
+
73805
+ //#region ---- Imports ----
73806
+ //#endregion
73807
+ //#region ---- Sync ----
73808
+ /**
73809
+ * Writes {@link AXPRecordWorkflowInfo} on a domain row and links the workflow instance entity ref.
73810
+ * Uses the workflow-trigger guard so entity update middleware does not re-start workflows.
73811
+ */
73812
+ async function syncEntityRecordWorkflowInfo(storage, store, params) {
73813
+ const entityType = params.entityType?.trim();
73814
+ const entityId = params.entityId?.trim();
73815
+ const instanceId = params.instanceId?.trim();
73816
+ if (!entityType || !entityId || !instanceId) {
73817
+ return;
73818
+ }
73819
+ const manageGuard = params.manageWorkflowTriggerGuard !== false;
73820
+ if (manageGuard) {
73821
+ setWorkflowStartInProgress(true);
73822
+ }
73823
+ try {
73824
+ const workflowInfo = buildAXPRecordWorkflowInfo({
73825
+ instanceId,
73826
+ definitionId: params.definitionId,
73827
+ correlationId: params.correlationId,
73828
+ pinnedVersion: params.pinnedVersion,
73829
+ });
73830
+ const instance = await store.getInstance(instanceId);
73831
+ if (instance) {
73832
+ instance.entityRefId = entityId;
73833
+ instance.entityRefType = entityType;
73834
+ await store.putInstance(instance);
73835
+ }
73836
+ let existingWorkflowInfo;
73837
+ try {
73838
+ const existing = await storage.getOne(entityType, entityId);
73839
+ existingWorkflowInfo = existing?.workflowInfo;
73840
+ }
73841
+ catch {
73842
+ /* record may not exist yet */
73843
+ }
73844
+ await storage.updateOne(entityType, entityId, {
73845
+ workflowInfo: {
73846
+ ...existingWorkflowInfo,
73847
+ ...workflowInfo,
73848
+ pinnedVersion: workflowInfo.pinnedVersion ?? existingWorkflowInfo?.pinnedVersion ?? null,
73849
+ },
73850
+ });
73851
+ }
73852
+ finally {
73853
+ if (manageGuard) {
73854
+ setWorkflowStartInProgress(false);
73855
+ }
73856
+ }
73857
+ }
73858
+ //#endregion
73859
+
73078
73860
  /**
73079
73861
  * Workflow Trigger Middleware
73080
73862
  *
@@ -73113,6 +73895,7 @@ const workflowTriggerMiddleware = {
73113
73895
  const workflowManager = inject(AXPWorkflowManager);
73114
73896
  const storageService = inject(AXPEntityStorageService);
73115
73897
  const workflowDefinitionService = inject(AXPWorkflowDefinitionService);
73898
+ const workflowExecutionStore = inject(AXC_WORKFLOW_EXECUTION_STORE);
73116
73899
  await next();
73117
73900
  if (!ctx.result) {
73118
73901
  return;
@@ -73299,6 +74082,14 @@ const workflowTriggerMiddleware = {
73299
74082
  if (!startResult.success || !startResult.instanceId) {
73300
74083
  continue;
73301
74084
  }
74085
+ await syncEntityRecordWorkflowInfo(storageService, workflowExecutionStore, {
74086
+ entityType: ctx.entityName,
74087
+ entityId: recordId,
74088
+ instanceId: startResult.instanceId,
74089
+ definitionId: workflow.name,
74090
+ correlationId,
74091
+ manageWorkflowTriggerGuard: false,
74092
+ });
73302
74093
  }
73303
74094
  catch {
73304
74095
  // Continue with other workflows
@@ -74307,8 +75098,6 @@ class AXCWorkflowExecutionDB extends Dexie {
74307
75098
  const axWorkflowExecutionDB = new AXCWorkflowExecutionDB();
74308
75099
  //#endregion
74309
75100
 
74310
- const AXC_WORKFLOW_EXECUTION_STORE = new InjectionToken('AXC_WORKFLOW_EXECUTION_STORE');
74311
-
74312
75101
  class AXCWorkflowExecutionStoreDexie {
74313
75102
  constructor() {
74314
75103
  this.db = axWorkflowExecutionDB;
@@ -74719,7 +75508,7 @@ class AXCWorkflowEngine {
74719
75508
  },
74720
75509
  ]
74721
75510
  : [],
74722
- input: workflowInput,
75511
+ input: { ...workflowInput, _workflowInstanceId: instanceId },
74723
75512
  output: {},
74724
75513
  properties: {},
74725
75514
  createdAt: now,
@@ -74961,6 +75750,33 @@ class AXCWorkflowEngine {
74961
75750
  lastActivityOutput,
74962
75751
  };
74963
75752
  }
75753
+ /**
75754
+ * Terminates a non-finished workflow instance (e.g. superseded lifecycle run).
75755
+ */
75756
+ async cancelInstance(instanceId, reason) {
75757
+ const instance = await this.getInstance(instanceId);
75758
+ if (!instance || instance.status === 'Finished') {
75759
+ return;
75760
+ }
75761
+ const now = new Date().toISOString();
75762
+ instance.status = 'Finished';
75763
+ instance.subStatus = 'Cancelled';
75764
+ instance.updatedAt = now;
75765
+ instance.finishedAt = now;
75766
+ instance.workflowState.status = 'Finished';
75767
+ instance.workflowState.subStatus = 'Cancelled';
75768
+ instance.workflowState.updatedAt = now;
75769
+ instance.workflowState.finishedAt = now;
75770
+ if (reason) {
75771
+ instance.workflowState.properties = {
75772
+ ...(instance.workflowState.properties ?? {}),
75773
+ cancelReason: reason,
75774
+ };
75775
+ }
75776
+ await this.store.updateInstance(instance);
75777
+ await this.updateInstanceInEntityService(instance);
75778
+ console.log(`[AXCWorkflowEngine] 🛑 Cancelled workflow instance: ${instanceId}`, { reason });
75779
+ }
74964
75780
  /**
74965
75781
  * Find activity in Graph by ID.
74966
75782
  */
@@ -75038,6 +75854,71 @@ class AXCWorkflowEngine {
75038
75854
  return { ...value };
75039
75855
  return { value };
75040
75856
  }
75857
+ /**
75858
+ * Extracts persisted create-entity-form payload (`data.result`) from a frontend step output.
75859
+ */
75860
+ extractPersistedEntityFormResult(output) {
75861
+ const result = output['result'];
75862
+ if (result && typeof result === 'object' && !Array.isArray(result)) {
75863
+ return result;
75864
+ }
75865
+ return null;
75866
+ }
75867
+ /**
75868
+ * Coerces date-like workflow values to a {@link Date} (local calendar date when input is `yyyy-mm-dd`).
75869
+ */
75870
+ coerceWorkflowDateValue(value) {
75871
+ if (value == null) {
75872
+ return null;
75873
+ }
75874
+ if (value instanceof Date) {
75875
+ return Number.isNaN(value.getTime()) ? null : value;
75876
+ }
75877
+ if (typeof value === 'string') {
75878
+ const trimmed = value.trim();
75879
+ const dateOnlyMatch = /^(\d{4})-(\d{2})-(\d{2})/.exec(trimmed);
75880
+ if (dateOnlyMatch) {
75881
+ const year = Number(dateOnlyMatch[1]);
75882
+ const month = Number(dateOnlyMatch[2]);
75883
+ const day = Number(dateOnlyMatch[3]);
75884
+ const local = new Date(year, month - 1, day);
75885
+ return Number.isNaN(local.getTime()) ? null : local;
75886
+ }
75887
+ const parsed = new Date(trimmed);
75888
+ return Number.isNaN(parsed.getTime()) ? null : parsed;
75889
+ }
75890
+ return null;
75891
+ }
75892
+ /**
75893
+ * Promotes `create-entity-form` submit payload (`output.result`) onto workflow variables
75894
+ * so downstream steps and human tasks see form values (e.g. effectiveDate), not start inputs.
75895
+ */
75896
+ buildPersistedEntityFormVariablePromotions(output, activityName, outcome) {
75897
+ if (activityName !== 'workflow-activity:create-entity-form' || outcome !== 'Submitted') {
75898
+ return {};
75899
+ }
75900
+ const form = this.extractPersistedEntityFormResult(output);
75901
+ if (!form) {
75902
+ return {};
75903
+ }
75904
+ const promoted = {};
75905
+ for (const [key, value] of Object.entries(form)) {
75906
+ if (value == null || key === 'id') {
75907
+ continue;
75908
+ }
75909
+ if (key === 'effectiveDate') {
75910
+ const coerced = this.coerceWorkflowDateValue(value);
75911
+ if (coerced) {
75912
+ promoted[key] = coerced;
75913
+ }
75914
+ continue;
75915
+ }
75916
+ if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
75917
+ promoted[key] = value;
75918
+ }
75919
+ }
75920
+ return promoted;
75921
+ }
75041
75922
  /**
75042
75923
  * Resume a suspended workflow instance.
75043
75924
  *
@@ -76349,6 +77230,34 @@ class AXCWorkflowEngine {
76349
77230
  }
76350
77231
  //#endregion
76351
77232
  //#region ---- Backend Activity Executors ----
77233
+ /**
77234
+ * Evaluates activity inputs against current workflow scope (same as backend execution).
77235
+ */
77236
+ async evaluateActivityInputs(activity, state, lastOutput) {
77237
+ const scope = this.expressionScopeService.buildScopeFromState(state, this.ensureOutputsForScope(lastOutput));
77238
+ return this.expressionEvaluator.evaluate(activity.inputs || {}, scope);
77239
+ }
77240
+ /**
77241
+ * After entity-create: link instance entity ref and persist {@link AXPRecordWorkflowInfo} on the row.
77242
+ */
77243
+ async linkEntityRecordAfterCreate(instanceId, activity, state, lastOutput, entityId) {
77244
+ const properties = await this.evaluateActivityInputs(activity, state, lastOutput);
77245
+ const entityType = typeof properties['entity'] === 'string' ? properties['entity'].trim() : '';
77246
+ const recordId = entityId?.trim();
77247
+ if (!entityType || !recordId) {
77248
+ return;
77249
+ }
77250
+ const instance = await this.store.getInstance(instanceId);
77251
+ const definitionId = instance?.definitionId ?? instance?.workflowState?.definitionId ?? state.workflowId ?? null;
77252
+ const correlationId = instance?.correlationId ?? instance?.workflowState?.correlationId ?? null;
77253
+ await syncEntityRecordWorkflowInfo(this.entityStorageService, this.store, {
77254
+ entityType,
77255
+ entityId: recordId,
77256
+ instanceId,
77257
+ definitionId: definitionId != null ? String(definitionId) : null,
77258
+ correlationId: correlationId != null ? String(correlationId) : null,
77259
+ });
77260
+ }
76352
77261
  /**
76353
77262
  * Execute backend activities locally using CommandBus.
76354
77263
  *
@@ -76393,6 +77302,13 @@ class AXCWorkflowEngine {
76393
77302
  output,
76394
77303
  outcomes,
76395
77304
  };
77305
+ if (activityType === 'workflow-activity:entity-create' &&
77306
+ outcomes['Done'] &&
77307
+ output &&
77308
+ typeof output === 'object' &&
77309
+ typeof output['id'] === 'string') {
77310
+ await this.linkEntityRecordAfterCreate(state.instanceId, activity, state, lastOutput, output['id']);
77311
+ }
76396
77312
  return finalResult;
76397
77313
  }
76398
77314
  catch (error) {
@@ -76960,40 +77876,24 @@ class AXCWorkflowEngine {
76960
77876
  const allowedOutcomes = await this.getActivityAllowedOutcomes(workflow, request.activityNode);
76961
77877
  const outcome = this.normalizeOutcome(request.outcome ?? 'Done', allowedOutcomes, request.activityNode);
76962
77878
  // Apply frontend output: only last activity output is kept (overwritten each step)
76963
- const output = request.output || {};
77879
+ const output = (request.output || {});
76964
77880
  let lastActivityOutput = output;
76965
77881
  // Apply outputToVariables for the completed frontend activity (e.g. leaveRequestForm → leaveRequestId: 'id')
76966
77882
  const variableUpdatesFromOutput = this.getVariableUpdatesFromOutput(workflow, request.activityNode, output);
77883
+ const completedActivity = this.findActivityInGraph(workflow.graph, request.activityNode);
77884
+ const formResultPromotions = this.buildPersistedEntityFormVariablePromotions(output, completedActivity?.name, outcome);
76967
77885
  state = {
76968
77886
  ...state,
76969
77887
  variables: {
76970
77888
  ...state.variables,
76971
77889
  ...output, // Merge frontend output into variables
77890
+ ...formResultPromotions, // Promote capture-form fields (e.g. effectiveDate) onto variables
76972
77891
  ...variableUpdatesFromOutput, // Map output paths to variable names (e.g. id → leaveRequestId)
76973
77892
  [`${request.activityNode}_outcome`]: outcome, // Keep outcome for reference (normalized)
76974
77893
  },
76975
77894
  lastActivityOutput,
76976
77895
  lastUpdated: new Date(),
76977
77896
  };
76978
- // 🎯 Update entityRefId and entityRefType if entity was created
76979
- // Check if this activity created an entity (workflow-activity:create-entity)
76980
- const completedActivity = this.findActivityInGraph(workflow.graph, request.activityNode);
76981
- if (completedActivity?.name === 'workflow-activity:create-entity' && output['id']) {
76982
- // Extract entity type from activity inputs
76983
- const entityModule = completedActivity.inputs?.module || '';
76984
- const entityName = completedActivity.inputs?.entity || '';
76985
- const entityType = entityModule && entityName ? `${entityModule}.${entityName}` : null;
76986
- const entityId = output['id'];
76987
- if (entityId && entityType) {
76988
- // Update workflow instance with entity reference
76989
- const instance = await this.store.getInstance(request.instanceId);
76990
- if (instance) {
76991
- instance.entityRefId = entityId;
76992
- instance.entityRefType = entityType;
76993
- await this.store.putInstance(instance);
76994
- }
76995
- }
76996
- }
76997
77897
  // Find next activity based on outcome from frontend (use normalized outcome)
76998
77898
  const nextConnection = connections.find((conn) => conn.source.activtyName === request.activityNode &&
76999
77899
  (conn.source.port === outcome || (!conn.source.port && outcome === 'Done')));
@@ -77325,7 +78225,7 @@ class AXCWorkflowManagementMockModule {
77325
78225
  provideCommandSetups([
77326
78226
  {
77327
78227
  key: 'workflow-activity:assign-to-manager',
77328
- command: () => import('./acorex-connectivity-mock-assign-to-manager.activity-DtDwfWx9.mjs').then((c) => c.AssignToManagerActivity),
78228
+ command: () => import('./acorex-connectivity-mock-assign-to-manager.activity-BRdgF2Nt.mjs').then((c) => c.AssignToManagerActivity),
77329
78229
  },
77330
78230
  {
77331
78231
  key: 'workflow-activity:get-current-user-manager',
@@ -77361,7 +78261,7 @@ class AXCWorkflowManagementMockModule {
77361
78261
  },
77362
78262
  {
77363
78263
  key: 'workflow-activity:entity-create',
77364
- command: () => import('./acorex-connectivity-mock-entity-create.activity-Ca19tIj4.mjs').then((c) => c.EntityCreateActivity),
78264
+ command: () => import('./acorex-connectivity-mock-entity-create.activity-CdoUzUvF.mjs').then((c) => c.EntityCreateActivity),
77365
78265
  },
77366
78266
  {
77367
78267
  key: 'workflow-activity:entity-read',
@@ -77436,7 +78336,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
77436
78336
  provideCommandSetups([
77437
78337
  {
77438
78338
  key: 'workflow-activity:assign-to-manager',
77439
- command: () => import('./acorex-connectivity-mock-assign-to-manager.activity-DtDwfWx9.mjs').then((c) => c.AssignToManagerActivity),
78339
+ command: () => import('./acorex-connectivity-mock-assign-to-manager.activity-BRdgF2Nt.mjs').then((c) => c.AssignToManagerActivity),
77440
78340
  },
77441
78341
  {
77442
78342
  key: 'workflow-activity:get-current-user-manager',
@@ -77472,7 +78372,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
77472
78372
  },
77473
78373
  {
77474
78374
  key: 'workflow-activity:entity-create',
77475
- command: () => import('./acorex-connectivity-mock-entity-create.activity-Ca19tIj4.mjs').then((c) => c.EntityCreateActivity),
78375
+ command: () => import('./acorex-connectivity-mock-entity-create.activity-CdoUzUvF.mjs').then((c) => c.EntityCreateActivity),
77476
78376
  },
77477
78377
  {
77478
78378
  key: 'workflow-activity:entity-read',
@@ -81496,6 +82396,7 @@ class AXCMockModule {
81496
82396
  AXCSupplierManagementMockModule,
81497
82397
  AXCProcurementManagementMockModule,
81498
82398
  AXCOrderManagementMockModule,
82399
+ AXCTenantManagementMockModule,
81499
82400
  AXCSubscriptionManagementMockModule,
81500
82401
  AXCLocationManagementMockModule,
81501
82402
  AXCContactCoreMockModule,
@@ -81511,7 +82412,6 @@ class AXCMockModule {
81511
82412
  AXCAiManagementMockModule,
81512
82413
  AXCPlatformManagementMockModule,
81513
82414
  AXCApplicationManagementMockModule,
81514
- AXCTenantManagementMockModule,
81515
82415
  AXCLearningManagementMockModule,
81516
82416
  AXCAssetManagementMockModule,
81517
82417
  AXCProjectManagementMockModule,
@@ -81556,6 +82456,7 @@ class AXCMockModule {
81556
82456
  AXCSupplierManagementMockModule,
81557
82457
  AXCProcurementManagementMockModule,
81558
82458
  AXCOrderManagementMockModule,
82459
+ AXCTenantManagementMockModule,
81559
82460
  AXCSubscriptionManagementMockModule,
81560
82461
  AXCLocationManagementMockModule,
81561
82462
  AXCContactCoreMockModule,
@@ -81571,7 +82472,6 @@ class AXCMockModule {
81571
82472
  AXCAiManagementMockModule,
81572
82473
  AXCPlatformManagementMockModule,
81573
82474
  AXCApplicationManagementMockModule,
81574
- AXCTenantManagementMockModule,
81575
82475
  AXCLearningManagementMockModule,
81576
82476
  AXCAssetManagementMockModule,
81577
82477
  AXCProjectManagementMockModule,
@@ -81613,6 +82513,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
81613
82513
  AXCSupplierManagementMockModule,
81614
82514
  AXCProcurementManagementMockModule,
81615
82515
  AXCOrderManagementMockModule,
82516
+ AXCTenantManagementMockModule,
81616
82517
  AXCSubscriptionManagementMockModule,
81617
82518
  AXCLocationManagementMockModule,
81618
82519
  AXCContactCoreMockModule,
@@ -81628,7 +82529,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
81628
82529
  AXCAiManagementMockModule,
81629
82530
  AXCPlatformManagementMockModule,
81630
82531
  AXCApplicationManagementMockModule,
81631
- AXCTenantManagementMockModule,
81632
82532
  AXCLearningManagementMockModule,
81633
82533
  AXCAssetManagementMockModule,
81634
82534
  AXCProjectManagementMockModule,
@@ -81773,5 +82673,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
81773
82673
  * Generated bundle index. Do not edit.
81774
82674
  */
81775
82675
 
81776
- export { AXCFileStorageServiceFirestore as $, AXCAiChatRouterService as A, AXCAuthMockModule as B, AXCCalendarDataSeeder as C, AXCCalendarEventDataSeeder as D, AXCCalendarManagementMockModule as E, AXCCommandRegistryDataSeeder as F, AXCCommonMockModule as G, AXCContactCoreMockModule as H, AXCContentManagementMockModule as I, AXCConversationDataSeeder as J, AXCConversationMockConversationApi as K, AXCConversationMockMessageApi as L, AXCConversationMockModule as M, AXCConversationMockRealtimeApi as N, AXCConversationMockUserApi as O, AXCCustomerManagementMockModule as P, AXCDashboardManagementMockModule as Q, AXCDataManagementMockModule as R, AXCDexieEntityStorageService as S, AXCDocumentManagementMockModule as T, AXCEditionDataSeeder as U, AXCEntityDefinitionSeederService as V, AXCEntityDefinitionsModule as W, AXCEntityStorageInsertCommand as X, AXCEntityStorageModule as Y, AXCEntityStorageQueryQuery as Z, AXCFileStorageServiceDexie as _, AXMAiModelStableIds as a, AXMCalendarEventTypeSeeder as a$, AXCFinancialCoreMockModule as a0, AXCFirestoreEntityStorageService as a1, AXCFormTemplateManagementMockModule as a2, AXCGoogleStrategyMock as a3, AXCHealthCoreMockModule as a4, AXCHelpDeskMockModule as a5, AXCHumanCapitalManagementMockModule as a6, AXCIdentifierManagementMockModule as a7, AXCImageCaptchaChallengeProviderMock as a8, AXCLearningManagementMockModule as a9, AXCTaskManagementMockModule as aA, AXCTenantManagementMockModule as aB, AXCTenantSeeder as aC, AXCTextTemplateRenderBackend as aD, AXCTokensDataSeeder as aE, AXCUserPassStrategyMock as aF, AXCVersionDB as aG, AXCVersioningService as aH, AXCWidgetCatalogDataSeeder as aI, AXCWorkflowCategorySeeder as aJ, AXCWorkflowDefinitionDataSeeder as aK, AXCWorkflowEngine as aL, AXCWorkflowExecutionDB as aM, AXCWorkflowExecutionStoreDexie as aN, AXCWorkflowExecutionStoreFirestore as aO, AXCWorkflowInstanceCartableDemoSeeder as aP, AXCWorkflowManagementMockModule as aQ, AXC_ENTITY_STORAGE_BACKEND_TYPE as aR, AXC_FIRESTORE_CONFIG as aS, AXC_FIRESTORE_DB as aT, AXC_WORKFLOW_EXECUTION_STORE as aU, AXMAiDemisAssistAgentUuid as aV, AXMAiDemisAssistId as aW, AXMAiDemisGeneralAssistId as aX, AXMAiPlatformAssistantAssistId as aY, AXMAutomationDataSeeder as aZ, AXMBusinessUnitDataSeeder as a_, AXCLocaleManagementMockModule as aa, AXCLocationManagementMockModule as ab, AXCLockService as ac, AXCMeasurementCoreMockModule as ad, AXCMeetingManagementMockModule as ae, AXCMetaDataDefinitionDataSeeder as af, AXCMetadataCategorySeeder as ag, AXCMiddlewaresModule as ah, AXCMockCaptchaChallengeComponent as ai, AXCMockEntityLogListener as aj, AXCMockModule as ak, AXCMockShowMetaDataFormPopupCommand as al, AXCNotificationManagementMockModule as am, AXCOrderManagementMockModule as an, AXCOrganizationManagementMockModule as ao, AXCPersonCoreMockModule as ap, AXCPlatformManagementMockModule as aq, AXCProcurementManagementMockModule as ar, AXCProductCatalogMockModule as as, AXCProjectManagementMockModule as at, AXCQueryRegistryDataSeeder as au, AXCReportManagementMockModule as av, AXCSecurityManagementMockModule as aw, AXCStoredEntityDefinitionLoader as ax, AXCSubscriptionManagementMockModule as ay, AXCSupplierManagementMockModule as az, resolveAssistSpeechModelId as b, FINANCE_ENTERPRISE as b$, AXMDashboardChartDataSourceDefinition as b0, AXMEmployeeDataSeeder as b1, AXMEmploymentTypeDataSeeder as b2, AXMFormDataSourcesProvider as b3, AXMJobDefinitionDataSeeder as b4, AXMJobLevelDataSeeder as b5, AXMLeaveRequestDataSeeder as b6, AXMMeetingDataSeeder as b7, AXMMeetingFilesDataSeeder as b8, AXMMeetingParticipantDataSeeder as b9, AXPMockIdentifierService as bA, AXPMockLookupProvider as bB, AXPMockPolicyProvider as bC, AXPMockSequenceProvider as bD, AXPRoomDataSeeder as bE, AXPSecurityManagementRoleDataSeeder as bF, AXPSecurityManagementUserDataSeeder as bG, AXPTaskBoardPlatformManagementTaskProvider as bH, AXPTaskBoardProjectManagementTaskProvider as bI, AXVChangeType as bJ, BCC as bK, BOC as bL, BUSINESS_UNITS_MOCK as bM, CHAT_LAST_MESSAGE_IDS as bN, COLLABORATION_STANDARD as bO, COSTMANAGER_ENTERPRISE as bP, COSTMANAGER_PROFESSIONAL as bQ, COSTMANAGER_STANDARD as bR, CP as bS, CRM_ENTERPRISE as bT, DASHBOARDS as bU, EDITIONS as bV, EMPLOYEES_MOCK as bW, EMPLOYMENT_TYPES_MOCK as bX, ENTITY_DEFINITION_MAP as bY, ENTITY_REGISTRY as bZ, FINANCE_BASIC as b_, AXMMeetingRoleTypeDataSeeder as ba, AXMMeetingSessionDataSeeder as bb, AXMMeetingTypeDataSeeder as bc, AXMMeetingTypeFileTemplateDataSeeder as bd, AXMPositionAssignmentDataSeeder as be, AXMPositionDataSeeder as bf, AXMQuestionBankItemCategoryDataSeeder as bg, AXMQuestionBankItemDataSeeder as bh, AXMQuestionnaireCalculationDataSeeder as bi, AXMQuestionnaireCategoryDataSeeder as bj, AXMQuestionnaireDataSeeder as bk, AXMResponsibilityDataSeeder as bl, AXMTagDataSeeder as bm, AXMTeamBusinessUnitDataSeeder as bn, AXMTeamDataSeeder as bo, AXMTeamMemberDataSeeder as bp, AXMTeamMemberRoleDataSeeder as bq, AXMWorkflowDashboardChartDataSourceDefinition as br, AXM_AI_REGISTRY_COMMAND_NAME as bs, AXM_AI_REGISTRY_QUERY_NAME as bt, AXM_CORPORATE_BUSINESS_UNIT_ID as bu, AXPDashboardDataSeeder as bv, AXPIdentifierDB as bw, AXPMessageDataSeeder as bx, AXPMockChecksumProvider as by, AXPMockClockProvider as bz, resolveDelegatedAssistOptionString as c, WS as c$, FINANCE_PRO as c0, G as c1, HR_ENTERPRISE as c2, HW as c3, JOB_DEFINITIONS_CATEGORY_MOCK as c4, JOB_DEFINITIONS_MOCK as c5, JOB_DEFINITION_CATEGORY_KEY_TO_ID as c6, JOB_LEVELS_MOCK as c7, LASER_PLUMBING_TENANT_ID as c8, LEAVE_REQUESTS_MOCK as c9, QWS as cA, RESPONSIBILITIES_CATEGORY_MOCK as cB, RESPONSIBILITIES_MOCK as cC, RESPONSIBILITY_CATEGORY_KEY_TO_ID as cD, SAFETYMINDER_BASIC as cE, SAFETYMINDER_ENTERPRISE as cF, SAFETYMINDER_PROFESSIONAL as cG, SHOP_BASIC as cH, SHOP_ENTERPRISE as cI, SHOP_PRO as cJ, TAGS_MOCK as cK, TASKS as cL, TASK_STATUSES as cM, TASK_TEMPLATES as cN, TASK_TYPES as cO, TEAMS_CATEGORY_MOCK as cP, TEAMS_MOCK as cQ, TEAM_BUSINESS_UNITS_MOCK as cR, TEAM_CATEGORY_KEY_TO_ID as cS, TEAM_MEMBERS_MOCK as cT, TEAM_MEMBER_ROLES_MOCK as cU, TIMEPLICITY_TENANT_ID as cV, TLA as cW, TOKENS as cX, TPC as cY, VISIBILITY_FILTER_BYPASS as cZ, WORKFLOW_CATEGORIES as c_, MAGFA_COMMERCE_STANDARD as ca, MAGFA_CONVERSATION_DASHBOARD as cb, MAGFA_TENANT_ID as cc, METADATA_CATEGORY_IDS as cd, METADATA_GENERAL_CATEGORY_REFS as ce, METADATA_SYSTEM_CATEGORY_REFS as cf, MLC as cg, OHR as ch, ORDERING_BASIC as ci, ORDERING_ENTERPRISE as cj, ORDERING_STANDARD as ck, OWNERSHIP_FILTER_BYPASS as cl, PLATFORM_CONSOLE as cm, PLATFORM_TENANT_ID as cn, PM as co, POSITIONS_CATEGORY_MOCK as cp, POSITIONS_MOCK as cq, POSITION_ASSIGNMENTS_MOCK as cr, QCP as cs, QGEN as ct, QHW as cu, QOHR as cv, QPM as cw, QTLE as cx, QUESTIONNAIRE_CATEGORY_MOCK as cy, QUESTION_BANK_ITEM_CATEGORY_MOCK as cz, axcSyncSingleEmployeeDenormalizedOrgFields as d, meetingRoleTypeMock as d$, activityCategoryMocks as d0, activityDefinitionEntityMock as d1, applyEntityDefinitionFirestoreSnapshot as d2, automationCommandMiddleware as d3, automationMock as d4, avatarInterface as d5, awaitConversationMockSharedStorage as d6, axVersionDB as d7, axWorkflowExecutionDB as d8, axcPatchEmployeeActivePrimaryBusinessUnitRefsFromRows as d9, createWorkflowDefinitionEntityMock as dA, dateInterface as dB, dateTimeInterface as dC, descriptionInterface as dD, documentFolderSyncMiddleware as dE, emailInterface as dF, entityDefDb as dG, entityValidationMiddleware as dH, fileUploaderInterface as dI, finalizeActivityCategoryItemCounts as dJ, findEmployeeById as dK, folderStorageMiddleware as dL, groupOrderItemCalculatorMiddleware as dM, historyMiddleware as dN, identifierCommitMiddleware as dO, imageInterface as dP, inspectionOkXNaInterface as dQ, loadMockPropertyDefinitions as dR, lockGuardMiddleware as dS, longTextAnswerInterface as dT, lookupInterface as dU, lookupResolverMiddleware as dV, mapInterface as dW, meetingFilesMock as dX, meetingIds as dY, meetingMock as dZ, meetingParticipantMock as d_, axcPatchEmployeeActivePrimaryPositionRefsFromRows as da, axcPatchEmployeeManagerRefsFromRows as db, axcResolveCommandRegistrySeedId as dc, axcResolveQueryRegistrySeedId as dd, axcResolveWidgetCatalogSeedId as de, bankCategory as df, buildEntityStorageQuickSearchFilter as dg, buildWorkflowInstanceCartableDemoRows as dh, bypassAllFilters as di, bypassOwnershipFilter as dj, bypassVisibilityFilter as dk, calendarEventMock as dl, calendarEventTypeMockData as dm, calendarMock as dn, chatMessageMock as dp, chatMock as dq, checkboxInterface as dr, childCountMiddleware as ds, clearEntityDefinitionFirestoreCollections as dt, colorInterface as du, computeDiff as dv, contactInterface as dw, conversationDemoSeedUserIds as dx, createFileCastMiddleware as dy, createWidgetLayoutConfig as dz, ACTIVITY_CATEGORIES as e, meetingSessionMock as e0, meetingTimeSlotMock as e1, meetingTypeFileTemplateMock as e2, meetingTypeMock as e3, mergeDetailRelationMiddleware as e4, mergeQuickSearchIntoRequest as e5, metadataCategoryMocks as e6, mockParticipantIndexForSecurityUserId as e7, mockQuestionBankItemByName as e8, mockRoleDefinitions as e9, selectionListInterface as eA, sexAtBirthInterface as eB, signatureInterface as eC, signatureLoaderMiddleware as eD, statusDefaultMiddleware as eE, tagInterface as eF, tenantMocks as eG, textAreaInterface as eH, textInterface as eI, timeDurationInterface as eJ, titleInterface as eK, toUiRows as eL, toggleInterface as eM, tokenCategoryIds as eN, tokenCategoryMocks as eO, urlInterface as eP, versionInterface as eQ, visibilityFilterMiddleware as eR, workflowDefinitionEntityMock as eS, workflowDefinitionIds as eT, workflowDefinitionMock as eU, yesNoInterface as eV, multipleChoiceInterface as ea, multipleSelectInterface as eb, normalizeAnyFileArrayForView as ec, normalizeSnapshotFileFieldsForView as ed, numberInterface as ee, parseEntityStorageInsertData as ef, parseEntityStorageQueryRequest as eg, participantIds as eh, participantMock as ei, passwordInterface as ej, personIdentifierTypeMock as ek, personIds as el, personLegalIds as em, personMock as en, personNaturalIds as eo, phoneInterface as ep, primaryMiddleware as eq, provideMockPropertySetups as er, qrcodeInterface as es, questionBankItemMock as et, questionnaireCalculationMock as eu, questionnaireMock as ev, ratingInterface as ew, richTextInterface as ex, scaleInterface as ey, selectInterface as ez, ACTIVITY_CATEGORY_ID_BY_KEY as f, ACTIVITY_DEFINITIONS as g, AI_ASSIST_MOCK as h, AI_MODEL_MOCK as i, APPLICATIONS as j, APPLICATION_CATEGORY_IDS as k, APPLICATION_CATEGORY_MOCKS as l, mockUsers as m, AXCActivityCategorySeeder as n, AXCActivityDefinitionSeeder as o, AXCAiAssistSeeder as p, AXCAiManagementMockModule as q, resolveDelegatedAssistOptionModel as r, AXCAiModelSeeder as s, AXCAppTermDataSeeder as t, AXCAppVersionDataSeeder as u, AXCApplicationCategoryDataSeeder as v, AXCApplicationDataSeeder as w, AXCApplicationManagementMockModule as x, AXCAssessmentManagementMockModule as y, AXCAssetManagementMockModule as z };
81777
- //# sourceMappingURL=acorex-connectivity-mock-acorex-connectivity-mock-DBwcu-v0.mjs.map
82676
+ export { AXCFileStorageServiceFirestore as $, AXCAiChatRouterService as A, AXCAuthMockModule as B, AXCCalendarDataSeeder as C, AXCCalendarEventDataSeeder as D, AXCCalendarManagementMockModule as E, AXCCommandRegistryDataSeeder as F, AXCCommonMockModule as G, AXCContactCoreMockModule as H, AXCContentManagementMockModule as I, AXCConversationDataSeeder as J, AXCConversationMockConversationApi as K, AXCConversationMockMessageApi as L, AXCConversationMockModule as M, AXCConversationMockRealtimeApi as N, AXCConversationMockUserApi as O, AXCCustomerManagementMockModule as P, AXCDashboardManagementMockModule as Q, AXCDataManagementMockModule as R, AXCDexieEntityStorageService as S, AXCDocumentManagementMockModule as T, AXCEditionDataSeeder as U, AXCEntityDefinitionSeederService as V, AXCEntityDefinitionsModule as W, AXCEntityStorageInsertCommand as X, AXCEntityStorageModule as Y, AXCEntityStorageQueryQuery as Z, AXCFileStorageServiceDexie as _, AXMAiModelStableIds as a, AXMCalendarEventTypeSeeder as a$, AXCFinancialCoreMockModule as a0, AXCFirestoreEntityStorageService as a1, AXCFormTemplateManagementMockModule as a2, AXCGoogleStrategyMock as a3, AXCHealthCoreMockModule as a4, AXCHelpDeskMockModule as a5, AXCHumanCapitalManagementMockModule as a6, AXCIdentifierManagementMockModule as a7, AXCImageCaptchaChallengeProviderMock as a8, AXCLearningManagementMockModule as a9, AXCTaskManagementMockModule as aA, AXCTenantManagementMockModule as aB, AXCTenantSeeder as aC, AXCTextTemplateRenderBackend as aD, AXCTokensDataSeeder as aE, AXCUserPassStrategyMock as aF, AXCVersionDB as aG, AXCVersioningService as aH, AXCWidgetCatalogDataSeeder as aI, AXCWorkflowCategorySeeder as aJ, AXCWorkflowDefinitionDataSeeder as aK, AXCWorkflowEngine as aL, AXCWorkflowExecutionDB as aM, AXCWorkflowExecutionStoreDexie as aN, AXCWorkflowExecutionStoreFirestore as aO, AXCWorkflowInstanceCartableDemoSeeder as aP, AXCWorkflowManagementMockModule as aQ, AXC_ENTITY_STORAGE_BACKEND_TYPE as aR, AXC_FIRESTORE_CONFIG as aS, AXC_FIRESTORE_DB as aT, AXC_WORKFLOW_EXECUTION_STORE as aU, AXMAiDemisAssistAgentUuid as aV, AXMAiDemisAssistId as aW, AXMAiDemisGeneralAssistId as aX, AXMAiPlatformAssistantAssistId as aY, AXMAutomationDataSeeder as aZ, AXMBusinessUnitDataSeeder as a_, AXCLocaleManagementMockModule as aa, AXCLocationManagementMockModule as ab, AXCLockService as ac, AXCMeasurementCoreMockModule as ad, AXCMeetingManagementMockModule as ae, AXCMetaDataDefinitionDataSeeder as af, AXCMetadataCategorySeeder as ag, AXCMiddlewaresModule as ah, AXCMockCaptchaChallengeComponent as ai, AXCMockEntityLogListener as aj, AXCMockModule as ak, AXCMockShowMetaDataFormPopupCommand as al, AXCNotificationManagementMockModule as am, AXCOrderManagementMockModule as an, AXCOrganizationManagementMockModule as ao, AXCPersonCoreMockModule as ap, AXCPlatformManagementMockModule as aq, AXCProcurementManagementMockModule as ar, AXCProductCatalogMockModule as as, AXCProjectManagementMockModule as at, AXCQueryRegistryDataSeeder as au, AXCReportManagementMockModule as av, AXCSecurityManagementMockModule as aw, AXCStoredEntityDefinitionLoader as ax, AXCSubscriptionManagementMockModule as ay, AXCSupplierManagementMockModule as az, resolveAssistSpeechModelId as b, FINANCE_PRO as b$, AXMDashboardChartDataSourceDefinition as b0, AXMEmployeeDataSeeder as b1, AXMEmploymentTypeDataSeeder as b2, AXMFormDataSourcesProvider as b3, AXMJobDefinitionDataSeeder as b4, AXMJobLevelDataSeeder as b5, AXMLeaveRequestDataSeeder as b6, AXMMeetingDataSeeder as b7, AXMMeetingFilesDataSeeder as b8, AXMMeetingParticipantDataSeeder as b9, AXPMockLookupProvider as bA, AXPMockPolicyProvider as bB, AXPMockSequenceProvider as bC, AXPRoomDataSeeder as bD, AXPSecurityManagementRoleDataSeeder as bE, AXPSecurityManagementUserDataSeeder as bF, AXPTaskBoardPlatformManagementTaskProvider as bG, AXPTaskBoardProjectManagementTaskProvider as bH, AXVChangeType as bI, BCC as bJ, BOC as bK, BUSINESS_UNITS_MOCK as bL, CHAT_LAST_MESSAGE_IDS as bM, COLLABORATION_STANDARD as bN, COSTMANAGER_ENTERPRISE as bO, COSTMANAGER_PROFESSIONAL as bP, COSTMANAGER_STANDARD as bQ, CP as bR, CRM_ENTERPRISE as bS, DASHBOARDS as bT, EDITIONS as bU, EMPLOYEES_MOCK as bV, EMPLOYMENT_TYPES_MOCK as bW, ENTITY_DEFINITION_MAP as bX, ENTITY_REGISTRY as bY, FINANCE_BASIC as bZ, FINANCE_ENTERPRISE as b_, AXMMeetingRoleTypeDataSeeder as ba, AXMMeetingSessionDataSeeder as bb, AXMMeetingTypeDataSeeder as bc, AXMMeetingTypeFileTemplateDataSeeder as bd, AXMPositionAssignmentDataSeeder as be, AXMPositionDataSeeder as bf, AXMQuestionBankItemCategoryDataSeeder as bg, AXMQuestionBankItemDataSeeder as bh, AXMQuestionnaireCategoryDataSeeder as bi, AXMQuestionnaireDataSeeder as bj, AXMResponsibilityDataSeeder as bk, AXMTagDataSeeder as bl, AXMTeamBusinessUnitDataSeeder as bm, AXMTeamDataSeeder as bn, AXMTeamMemberDataSeeder as bo, AXMTeamMemberRoleDataSeeder as bp, AXMWorkflowDashboardChartDataSourceDefinition as bq, AXM_AI_REGISTRY_COMMAND_NAME as br, AXM_AI_REGISTRY_QUERY_NAME as bs, AXM_CORPORATE_BUSINESS_UNIT_ID as bt, AXPDashboardDataSeeder as bu, AXPIdentifierDB as bv, AXPMessageDataSeeder as bw, AXPMockChecksumProvider as bx, AXPMockClockProvider as by, AXPMockIdentifierService as bz, resolveDelegatedAssistOptionString as c, activityCategoryMocks as c$, G as c0, HR_ENTERPRISE as c1, HW as c2, JOB_DEFINITIONS_CATEGORY_MOCK as c3, JOB_DEFINITIONS_MOCK as c4, JOB_DEFINITION_CATEGORY_KEY_TO_ID as c5, JOB_LEVELS_MOCK as c6, LASER_PLUMBING_TENANT_ID as c7, LEAVE_REQUESTS_MOCK as c8, MAGFA_COMMERCE_STANDARD as c9, RESPONSIBILITIES_CATEGORY_MOCK as cA, RESPONSIBILITIES_MOCK as cB, RESPONSIBILITY_CATEGORY_KEY_TO_ID as cC, SAFETYMINDER_BASIC as cD, SAFETYMINDER_ENTERPRISE as cE, SAFETYMINDER_PROFESSIONAL as cF, SHOP_BASIC as cG, SHOP_ENTERPRISE as cH, SHOP_PRO as cI, TAGS_MOCK as cJ, TASKS as cK, TASK_STATUSES as cL, TASK_TEMPLATES as cM, TASK_TYPES as cN, TEAMS_CATEGORY_MOCK as cO, TEAMS_MOCK as cP, TEAM_BUSINESS_UNITS_MOCK as cQ, TEAM_CATEGORY_KEY_TO_ID as cR, TEAM_MEMBERS_MOCK as cS, TEAM_MEMBER_ROLES_MOCK as cT, TIMEPLICITY_TENANT_ID as cU, TLA as cV, TOKENS as cW, TPC as cX, VISIBILITY_FILTER_BYPASS as cY, WORKFLOW_CATEGORIES as cZ, WS as c_, MAGFA_CONVERSATION_DASHBOARD as ca, MAGFA_TENANT_ID as cb, METADATA_CATEGORY_IDS as cc, METADATA_GENERAL_CATEGORY_REFS as cd, METADATA_SYSTEM_CATEGORY_REFS as ce, MLC as cf, OHR as cg, ORDERING_BASIC as ch, ORDERING_ENTERPRISE as ci, ORDERING_STANDARD as cj, OWNERSHIP_FILTER_BYPASS as ck, PLATFORM_CONSOLE as cl, PLATFORM_TENANT_ID as cm, PM as cn, POSITIONS_CATEGORY_MOCK as co, POSITIONS_MOCK as cp, POSITION_ASSIGNMENTS_MOCK as cq, QCP as cr, QGEN as cs, QHW as ct, QOHR as cu, QPM as cv, QTLE as cw, QUESTIONNAIRE_CATEGORY_MOCK as cx, QUESTION_BANK_ITEM_CATEGORY_MOCK as cy, QWS as cz, axcSyncSingleEmployeeDenormalizedOrgFields as d, meetingSessionMock as d$, activityDefinitionEntityMock as d0, applyEntityDefinitionFirestoreSnapshot as d1, automationCommandMiddleware as d2, automationMock as d3, avatarInterface as d4, awaitConversationMockSharedStorage as d5, axVersionDB as d6, axWorkflowExecutionDB as d7, axcPatchEmployeeActivePrimaryBusinessUnitRefsFromRows as d8, axcPatchEmployeeActivePrimaryPositionRefsFromRows as d9, dateInterface as dA, dateTimeInterface as dB, descriptionInterface as dC, documentFolderSyncMiddleware as dD, emailInterface as dE, entityDefDb as dF, entityValidationMiddleware as dG, fileUploaderInterface as dH, finalizeActivityCategoryItemCounts as dI, findEmployeeById as dJ, folderStorageMiddleware as dK, groupOrderItemCalculatorMiddleware as dL, historyMiddleware as dM, identifierCommitMiddleware as dN, imageInterface as dO, inspectionOkXNaInterface as dP, loadMockPropertyDefinitions as dQ, lockGuardMiddleware as dR, longTextAnswerInterface as dS, lookupInterface as dT, lookupResolverMiddleware as dU, mapInterface as dV, meetingFilesMock as dW, meetingIds as dX, meetingMock as dY, meetingParticipantMock as dZ, meetingRoleTypeMock as d_, axcPatchEmployeeManagerRefsFromRows as da, axcResolveCommandRegistrySeedId as db, axcResolveQueryRegistrySeedId as dc, axcResolveWidgetCatalogSeedId as dd, bankCategory as de, buildEntityStorageQuickSearchFilter as df, buildWorkflowInstanceCartableDemoRows as dg, bypassAllFilters as dh, bypassOwnershipFilter as di, bypassVisibilityFilter as dj, calendarEventMock as dk, calendarEventTypeMockData as dl, calendarMock as dm, chatMessageMock as dn, chatMock as dp, checkboxInterface as dq, childCountMiddleware as dr, clearEntityDefinitionFirestoreCollections as ds, colorInterface as dt, computeDiff as du, contactInterface as dv, conversationDemoSeedUserIds as dw, createFileCastMiddleware as dx, createWidgetLayoutConfig as dy, createWorkflowDefinitionEntityMock as dz, ACTIVITY_CATEGORIES as e, meetingTimeSlotMock as e0, meetingTypeFileTemplateMock as e1, meetingTypeMock as e2, mergeDetailRelationMiddleware as e3, mergeQuickSearchIntoRequest as e4, metadataCategoryMocks as e5, mockParticipantIndexForSecurityUserId as e6, mockQuestionBankItemByName as e7, mockRoleDefinitions as e8, multipleChoiceInterface as e9, signatureInterface as eA, signatureLoaderMiddleware as eB, statusDefaultMiddleware as eC, tagInterface as eD, tenantMocks as eE, textAreaInterface as eF, textInterface as eG, timeDurationInterface as eH, titleInterface as eI, toUiRows as eJ, toggleInterface as eK, tokenCategoryIds as eL, tokenCategoryMocks as eM, urlInterface as eN, versionInterface as eO, visibilityFilterMiddleware as eP, workflowDefinitionEntityMock as eQ, workflowDefinitionIds as eR, workflowDefinitionMock as eS, yesNoInterface as eT, multipleSelectInterface as ea, normalizeAnyFileArrayForView as eb, normalizeSnapshotFileFieldsForView as ec, numberInterface as ed, parseEntityStorageInsertData as ee, parseEntityStorageQueryRequest as ef, participantIds as eg, participantMock as eh, passwordInterface as ei, personIdentifierTypeMock as ej, personIds as ek, personLegalIds as el, personMock as em, personNaturalIds as en, phoneInterface as eo, primaryMiddleware as ep, provideMockPropertySetups as eq, qrcodeInterface as er, questionBankItemMock as es, questionnaireMock as et, ratingInterface as eu, richTextInterface as ev, scaleInterface as ew, selectInterface as ex, selectionListInterface as ey, sexAtBirthInterface as ez, ACTIVITY_CATEGORY_ID_BY_KEY as f, ACTIVITY_DEFINITIONS as g, AI_ASSIST_MOCK as h, AI_MODEL_MOCK as i, APPLICATIONS as j, APPLICATION_CATEGORY_IDS as k, APPLICATION_CATEGORY_MOCKS as l, mockUsers as m, AXCActivityCategorySeeder as n, AXCActivityDefinitionSeeder as o, AXCAiAssistSeeder as p, AXCAiManagementMockModule as q, resolveDelegatedAssistOptionModel as r, AXCAiModelSeeder as s, AXCAppTermDataSeeder as t, AXCAppVersionDataSeeder as u, AXCApplicationCategoryDataSeeder as v, AXCApplicationDataSeeder as w, AXCApplicationManagementMockModule as x, AXCAssessmentManagementMockModule as y, AXCAssetManagementMockModule as z };
82677
+ //# sourceMappingURL=acorex-connectivity-mock-acorex-connectivity-mock-U3_OWcLL.mjs.map