@vonq/hapi-elements-types 1.22.0 → 1.23.0

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 (96) hide show
  1. package/_window/api.types.ts +12 -13
  2. package/_window/index.ts.bak +16 -0
  3. package/_window/sdk.types.ts +5 -2
  4. package/_window/service.types.ts +3 -12
  5. package/_window/state.types.ts +0 -24
  6. package/_window/utils.types.ts +3 -0
  7. package/_window/window.ts +0 -1
  8. package/alert/index.ts +4 -4
  9. package/alert/index.ts.bak +6 -0
  10. package/ats/index.ts +4 -4
  11. package/ats/index.ts.bak +6 -0
  12. package/ats/types.ts +7 -1
  13. package/basket/index.ts +5 -5
  14. package/basket/index.ts.bak +7 -0
  15. package/basket/service.types.ts +1 -1
  16. package/basket/utils.types.ts +6 -2
  17. package/campaign/api.types.ts +5 -1
  18. package/campaign/enums.ts +0 -3
  19. package/campaign/index.ts +8 -8
  20. package/campaign/index.ts.bak +10 -0
  21. package/campaign/service.types.ts +14 -0
  22. package/campaign/types.ts +31 -21
  23. package/campaign/utils.types.ts +1 -0
  24. package/campaign/validations.types.ts +15 -1
  25. package/common/enums.ts +0 -4
  26. package/common/events/EventCommand/index.ts.bak +4 -0
  27. package/common/events/index.ts.bak +4 -0
  28. package/common/index.ts +7 -5
  29. package/common/index.ts.bak +7 -0
  30. package/common/logger/index.ts +4 -0
  31. package/common/types.ts +8 -1
  32. package/common/validations.types.ts +2 -0
  33. package/common/validator/index.ts +3 -0
  34. package/contract/api.types.ts +1 -0
  35. package/contract/index.ts +7 -7
  36. package/contract/index.ts.bak +9 -0
  37. package/contract/service.types.ts +7 -1
  38. package/contract/types.ts +2 -0
  39. package/contract/validations.types.ts +1 -0
  40. package/debugging/index.ts +3 -2
  41. package/debugging/index.ts.bak +4 -0
  42. package/index.ts +16 -16
  43. package/index.ts.bak +18 -0
  44. package/language/enums.ts +5 -0
  45. package/language/index.ts +6 -3
  46. package/language/index.ts.bak +5 -0
  47. package/language/service.types.ts +7 -0
  48. package/language/state.types.ts +3 -1
  49. package/language/utils.types.ts +11 -0
  50. package/modal/enums.ts +3 -3
  51. package/modal/index.ts +5 -4
  52. package/modal/index.ts.bak +6 -0
  53. package/modal/types.ts +11 -8
  54. package/orderJourney/index.ts +7 -6
  55. package/orderJourney/index.ts.bak +8 -0
  56. package/orderJourney/qa.types.ts +3 -1
  57. package/orderJourney/service.types.ts +2 -8
  58. package/orderJourney/state.types.ts +31 -8
  59. package/orderJourney/types.ts +79 -16
  60. package/orderJourney/validations.types.ts +13 -2
  61. package/package.json +2 -3
  62. package/product/index.ts +8 -8
  63. package/product/index.ts.bak +10 -0
  64. package/product/types.ts +4 -1
  65. package/routing/index.ts +2 -1
  66. package/routing/index.ts.bak +3 -0
  67. package/theming/index.ts +4 -4
  68. package/theming/index.ts.bak +6 -0
  69. package/theming/types.ts +44 -0
  70. package/theming/validations.types.ts +16 -0
  71. package/ui/index.ts.bak +3 -0
  72. package/wallet/index.ts +5 -5
  73. package/wallet/index.ts.bak +7 -0
  74. package/wallet/state.types.ts +1 -1
  75. package/wallet/types.ts +6 -1
  76. package/talentMindCompany/api.types.ts +0 -18
  77. package/talentMindCompany/service.types.ts +0 -15
  78. package/talentMindCompany/state.types.ts +0 -5
  79. package/talentMindCompany/types.ts +0 -6
  80. package/talentMindCompany/validations.types.ts +0 -5
  81. package/talentMindEvaluation/api.types.ts +0 -25
  82. package/talentMindEvaluation/service.types.ts +0 -25
  83. package/talentMindEvaluation/state.types.ts +0 -6
  84. package/talentMindEvaluation/types.ts +0 -15
  85. package/talentMindEvaluation/validations.types.ts +0 -5
  86. package/talentMindJob/api.types.ts +0 -26
  87. package/talentMindJob/service.types.ts +0 -28
  88. package/talentMindJob/state.types.ts +0 -6
  89. package/talentMindJob/types.ts +0 -12
  90. package/talentMindJob/validations.types.ts +0 -5
  91. package/talentMindResume/api.types.ts +0 -30
  92. package/talentMindResume/service.types.ts +0 -34
  93. package/talentMindResume/state.types.ts +0 -6
  94. package/talentMindResume/types.ts +0 -119
  95. package/talentMindResume/validations.types.ts +0 -5
  96. package/tsconfig.json +0 -36
package/common/types.ts CHANGED
@@ -54,9 +54,14 @@ export type HapiInputErrorMessageOrValidity =
54
54
  | boolean
55
55
  | undefined
56
56
  | null
57
+ export type UseValidatorResultValidityOrErrorMessages = Record<
58
+ string,
59
+ HapiInputErrorMessageOrValidity
60
+ >
57
61
  export type UseValidatorResult = {
58
- validityOrErrorMessages: Record<string, HapiInputErrorMessageOrValidity>
62
+ validityOrErrorMessages: UseValidatorResultValidityOrErrorMessages
59
63
  areAllValid: boolean
64
+ hasBackendTakenOver?: boolean
60
65
  }
61
66
  export type ValidatorKey =
62
67
  | Exclude<
@@ -127,6 +132,7 @@ export type PostingRequirementType =
127
132
  | "AUTOCOMPLETE"
128
133
  | "STATISCH"
129
134
  | "FILE-URL"
135
+ | "HTMLAREA"
130
136
 
131
137
  export type PostingRequirementRuleName =
132
138
  | "int"
@@ -245,6 +251,7 @@ export type PostingRequirementsAutocompleteRequestOption = {
245
251
  }
246
252
  export type FormFacetsFieldType =
247
253
  | "input"
254
+ | "input-html"
248
255
  | "textarea"
249
256
  | "select"
250
257
  | "select-multi"
@@ -59,6 +59,7 @@ export type WindowHapiValidationsCommon = {
59
59
  genericBoolean: ZodBoolean
60
60
  genericNumber: ZodNumber
61
61
  genericNumberArray: ZodArray<ZodNumber>
62
+ genericNumberOrNull: ZodNullable<ZodNumber>
62
63
  genericString: ZodString
63
64
  genericStringArray: ZodArray<ZodString>
64
65
  genericObject: ZodObject<any>
@@ -67,6 +68,7 @@ export type WindowHapiValidationsCommon = {
67
68
  ZodFunction<ZodTuple<[], ZodUnknown>, ZodUnknown>
68
69
  >
69
70
  genericRecordBoolean: ZodRecord<ZodString, ZodBoolean>
71
+ genericBooleanOrNull: ZodNullable<ZodBoolean>
70
72
  genericRecordAny: ZodRecord<ZodString, ZodAny>
71
73
  genericRecordString: ZodRecord<ZodString, ZodString>
72
74
  genericStringOrNumber: ZodUnion<[ZodNumber, ZodString]>
@@ -0,0 +1,3 @@
1
+ // created from 'create-ts-index'
2
+
3
+ export * from './types';
@@ -22,6 +22,7 @@ export type WindowHapiAPIContractConfigs = {
22
22
  export type WindowHapiAPIContractRequests = {
23
23
  getContracts: (
24
24
  limitOffset?: PaginationLimitOffset,
25
+ labels?: Record<string, string> | null,
25
26
  ) => Promise<PaginatedAPIResponseV1<Contract>>
26
27
  getContractsByIds: (
27
28
  contractIds: (string | number)[],
package/contract/index.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  // created from 'create-ts-index'
2
2
 
3
- export * from "./api.types"
4
- export * from "./qa.types"
5
- export * from "./service.types"
6
- export * from "./state.types"
7
- export * from "./types"
8
- export * from "./utils.types"
9
- export * from "./validations.types"
3
+ export * from './api.types';
4
+ export * from './qa.types';
5
+ export * from './service.types';
6
+ export * from './state.types';
7
+ export * from './types';
8
+ export * from './utils.types';
9
+ export * from './validations.types';
@@ -0,0 +1,9 @@
1
+ // created from 'create-ts-index'
2
+
3
+ export * from "./api.types"
4
+ export * from "./qa.types"
5
+ export * from "./service.types"
6
+ export * from "./state.types"
7
+ export * from "./types"
8
+ export * from "./utils.types"
9
+ export * from "./validations.types"
@@ -5,8 +5,8 @@ import {
5
5
  import { OrderJourneyStepKey } from "../orderJourney/enums"
6
6
  import { Contract, ContractCredential, ContractGroup } from "./types"
7
7
  import {
8
- PostingRequirementsAutocompleteRequestOption,
9
8
  PaginatedAPIResponseV1,
9
+ PostingRequirementsAutocompleteRequestOption,
10
10
  } from "../common/types"
11
11
  import { WindowHapiModuleWithConstructorArgs } from "../_window"
12
12
 
@@ -21,6 +21,11 @@ export type ContractServiceGetContractsHandler = (
21
21
  export type ContractServiceGetContractGroupsHandler = () => Promise<
22
22
  ContractGroup[]
23
23
  >
24
+ export type ContractServiceGetContractsLabeledHandler = (
25
+ offset?: number,
26
+ limit?: number,
27
+ labels?: Record<string, string> | null,
28
+ ) => Promise<PaginatedAPIResponseV1<Contract>>
24
29
  export type ContractServiceCreateContractHandler = () => Promise<Contract>
25
30
  export type ContractServiceRemoveContractHandler = (
26
31
  contractId: string,
@@ -34,6 +39,7 @@ export type ContractServiceGetContractHandler = (
34
39
  export type WindowHapiServiceContract = WindowHapiModuleWithConstructorArgs<
35
40
  {
36
41
  getContractPostingRequirementOptions: HapiServiceFunctionWithLifecycleHooks<ContractServiceGetContractPostingRequirementOptionsHandler>
42
+ getContractsLabeled: HapiServiceFunctionWithLifecycleHooks<ContractServiceGetContractsLabeledHandler>
37
43
  getContracts: HapiServiceFunctionWithLifecycleHooks<ContractServiceGetContractsHandler>
38
44
  getContractGroups: HapiServiceFunctionWithLifecycleHooks<ContractServiceGetContractGroupsHandler>
39
45
  createContract: HapiServiceFunctionWithLifecycleHooks<ContractServiceCreateContractHandler>
package/contract/types.ts CHANGED
@@ -34,6 +34,7 @@ export type ContractCreateForm = {
34
34
  followed_instructions: boolean
35
35
  posting_duration_days: number | null
36
36
  allow_renegotiation: boolean
37
+ labels: Record<string, string> | null
37
38
  }
38
39
 
39
40
  export type ContractGroupCreateForm = {
@@ -48,6 +49,7 @@ export type ContractChannel = ProductLogos &
48
49
  }
49
50
 
50
51
  export type Contract = {
52
+ labels: Record<string, string> | null
51
53
  channel?: ContractChannel
52
54
  alias: string
53
55
  channel_id: number
@@ -67,6 +67,7 @@ export type ZodContractCreateForm = ZodObject<{
67
67
  ]
68
68
  >
69
69
  allow_renegotiation: ZodOptional<ZodBoolean>
70
+ labels: ZodOptional<ZodNullable<ZodRecord<ZodString, ZodString>>>
70
71
  }>
71
72
  export type ZodContractPostingRequirementAutocompleteRequestOptions = ZodRecord<
72
73
  ZodString,
@@ -1,4 +1,5 @@
1
1
  // created from 'create-ts-index'
2
2
 
3
- export * from "./state.types"
4
- export * from "./types"
3
+ export * from './service.types';
4
+ export * from './state.types';
5
+ export * from './types';
@@ -0,0 +1,4 @@
1
+ // created from 'create-ts-index'
2
+
3
+ export * from "./state.types"
4
+ export * from "./types"
package/index.ts CHANGED
@@ -1,18 +1,18 @@
1
1
  // created from 'create-ts-index'
2
2
 
3
- export * from "./_window"
4
- export * from "./alert"
5
- export * from "./ats"
6
- export * from "./basket"
7
- export * from "./campaign"
8
- export * from "./common"
9
- export * from "./contract"
10
- export * from "./debugging"
11
- export * from "./language"
12
- export * from "./modal"
13
- export * from "./orderJourney"
14
- export * from "./product"
15
- export * from "./routing"
16
- export * from "./theming"
17
- export * from "./ui"
18
- export * from "./wallet"
3
+ export * from './_window';
4
+ export * from './alert';
5
+ export * from './ats';
6
+ export * from './basket';
7
+ export * from './campaign';
8
+ export * from './common';
9
+ export * from './contract';
10
+ export * from './debugging';
11
+ export * from './language';
12
+ export * from './modal';
13
+ export * from './orderJourney';
14
+ export * from './product';
15
+ export * from './routing';
16
+ export * from './theming';
17
+ export * from './ui';
18
+ export * from './wallet';
package/index.ts.bak ADDED
@@ -0,0 +1,18 @@
1
+ // created from 'create-ts-index'
2
+
3
+ export * from "./_window"
4
+ export * from "./alert"
5
+ export * from "./ats"
6
+ export * from "./basket"
7
+ export * from "./campaign"
8
+ export * from "./common"
9
+ export * from "./contract"
10
+ export * from "./debugging"
11
+ export * from "./language"
12
+ export * from "./modal"
13
+ export * from "./orderJourney"
14
+ export * from "./product"
15
+ export * from "./routing"
16
+ export * from "./theming"
17
+ export * from "./ui"
18
+ export * from "./wallet"
@@ -0,0 +1,5 @@
1
+ export enum LanguageSupportedLocale {
2
+ "en" = "en",
3
+ "nl" = "nl",
4
+ "de" = "de",
5
+ }
package/language/index.ts CHANGED
@@ -1,5 +1,8 @@
1
1
  // created from 'create-ts-index'
2
2
 
3
- export * from "./qa.types"
4
- export * from "./state.types"
5
- export * from "./validations.types"
3
+ export * from './enums';
4
+ export * from './qa.types';
5
+ export * from './service.types';
6
+ export * from './state.types';
7
+ export * from './utils.types';
8
+ export * from './validations.types';
@@ -0,0 +1,5 @@
1
+ // created from 'create-ts-index'
2
+
3
+ export * from "./qa.types"
4
+ export * from "./state.types"
5
+ export * from "./validations.types"
@@ -0,0 +1,7 @@
1
+ import { WindowHapiService } from "../_window/service.types"
2
+ import { WindowHapiModuleWithConstructorArgs } from "../_window"
3
+
4
+ export type WindowHapiServiceLanguage = WindowHapiModuleWithConstructorArgs<
5
+ {},
6
+ { readonly service: WindowHapiService }
7
+ >
@@ -1,9 +1,11 @@
1
+ import { LanguageSupportedLocale } from "./enums"
2
+
1
3
  export type LanguageStoreLocaleTranslations = Record<string, string>
2
4
  export type LanguageStoreTranslations = Record<
3
5
  string,
4
6
  LanguageStoreLocaleTranslations
5
7
  >
6
8
  export type LanguageState = {
7
- locale: string
9
+ locale: LanguageSupportedLocale | string
8
10
  translations: LanguageStoreTranslations
9
11
  }
@@ -0,0 +1,11 @@
1
+ import { WindowHapiUtils } from "../_window/utils.types"
2
+ import { WindowHapiModuleWithConstructorArgs } from "../_window"
3
+ import { LanguageSupportedLocale } from "./enums"
4
+
5
+ export type WindowHapiUtilsLanguage = WindowHapiModuleWithConstructorArgs<
6
+ {
7
+ localeKeys: typeof LanguageSupportedLocale
8
+ localesSupportedByBackend: LanguageSupportedLocale[]
9
+ },
10
+ { readonly utils: WindowHapiUtils }
11
+ >
package/modal/enums.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  export enum ModalZone {
2
2
  "primary" = "primary",
3
3
  "secondary" = "secondary",
4
+ "tercary" = "tercary",
4
5
  }
5
6
 
6
7
  export enum ModalKeys {
@@ -14,12 +15,12 @@ export enum ModalKeys {
14
15
  campaignCopySelection = "contract-copy-selection",
15
16
  campaignEdit = "campaign-edit",
16
17
  basketRemoveProductConfirmation = "remove-product-from-basket",
18
+ basketProductBundleParentClashConfirmation = "basket-product-bundle-parent-clash-confirmation",
19
+ basketProductBundleChildClashConfirmation = "basket-product-bundle-child-clash-confirmation",
17
20
  contractRemoveConfirmation = "contract-remove-confirmation",
18
21
  contractGroupConflictInfo = "contract-group-conflict-info",
19
22
  filePicker = "file-picker",
20
23
  contractPostingRequirementsSmartFillSuccess = "contract-posting-requirements-smart-fill-success",
21
- talentMindEvaluateJobWithResume = "talentmind-evaluate-job-with-resume",
22
- talentMindEvaluateResumeWithJob = "talentmind-evaluate-resume-with-job",
23
24
  "mediaEditor" = "media-editor",
24
25
  "uploadWidget" = "upload-widget",
25
26
  "mediaLibrary" = "media-library",
@@ -27,6 +28,5 @@ export enum ModalKeys {
27
28
 
28
29
  export enum FilePickerModalPropsActionFor {
29
30
  postingOrganization = "posting-organization",
30
- talentmindResume = "talentmind-resume",
31
31
  postingRequirements = "posting-requirements",
32
32
  }
package/modal/index.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  // created from 'create-ts-index'
2
2
 
3
- export * from "./enums"
4
- export * from "./service.types"
5
- export * from "./state.types"
6
- export * from "./types"
3
+ export * from './enums';
4
+ export * from './service.types';
5
+ export * from './state.types';
6
+ export * from './types';
7
+ export * from './utils.types';
@@ -0,0 +1,6 @@
1
+ // created from 'create-ts-index'
2
+
3
+ export * from "./enums"
4
+ export * from "./service.types"
5
+ export * from "./state.types"
6
+ export * from "./types"
package/modal/types.ts CHANGED
@@ -3,10 +3,9 @@ import { Contract } from "../contract/types"
3
3
  import { FilePickerModalPropsActionFor, ModalKeys, ModalZone } from "./enums"
4
4
  import { AnyNonFunction, TransformedPostingRequirement } from "../common/types"
5
5
  import { Campaign } from "../campaign"
6
- import { TalentMindResume } from "../talentMindResume/types"
7
- import { TalentMindJob } from "../talentMindJob/types"
8
6
  import { OrderJourneyPaymentMethod } from "../orderJourney"
9
7
  import { PickerDisplayMode } from "filestack-js"
8
+ import { HapiSiteTheme } from "../theming"
10
9
 
11
10
  export type ProductDetailModalProps = {
12
11
  id: string
@@ -29,6 +28,14 @@ export type CampaignCopySelectionModalProps = {
29
28
  products: (Product | Contract)[]
30
29
  campaign: Campaign
31
30
  }
31
+ export type BasketProductBundleParentClashConfirmationModalProps = {
32
+ bundleProduct: Product
33
+ childProduct: Product
34
+ }
35
+ export type BasketProductBundleParentClashConfirmationProps = {
36
+ bundleProduct: Product
37
+ childProducts: Product[]
38
+ }
32
39
  export type CampaignEditModalProps = {
33
40
  campaign?: Campaign
34
41
  }
@@ -59,12 +66,6 @@ export type WalletModalProps = {
59
66
  paymentMethod: OrderJourneyPaymentMethod | null
60
67
  }
61
68
  export type WalletPurchaseOrderModalProps = {}
62
- export type TalentMindEvaluateJobWithResumeModalProps = {
63
- resume: TalentMindResume
64
- }
65
- export type TalentMindEvaluateResumeWithJobModalProps = {
66
- job: TalentMindJob
67
- }
68
69
 
69
70
  export type FilePickerModalPropsActionDataPostingRequirements = {
70
71
  requirement: TransformedPostingRequirement
@@ -99,6 +100,7 @@ export type ModalOptions = {
99
100
  showBackdrop?: boolean
100
101
  unstyled?: boolean
101
102
  disableVerticalScroll?: boolean
103
+ siteTheme?: HapiSiteTheme
102
104
  }
103
105
 
104
106
  export type Modal = {
@@ -111,4 +113,5 @@ export type Modal = {
111
113
  export type Modals = {
112
114
  [ModalZone.primary]: Modal | null
113
115
  [ModalZone.secondary]: Modal | null
116
+ [ModalZone.tercary]: Modal | null
114
117
  }
@@ -1,8 +1,9 @@
1
1
  // created from 'create-ts-index'
2
2
 
3
- export * from "./enums"
4
- export * from "./qa.types"
5
- export * from "./state.types"
6
- export * from "./types"
7
- export * from "./utils.types"
8
- export * from "./validations.types"
3
+ export * from './enums';
4
+ export * from './qa.types';
5
+ export * from './service.types';
6
+ export * from './state.types';
7
+ export * from './types';
8
+ export * from './utils.types';
9
+ export * from './validations.types';
@@ -0,0 +1,8 @@
1
+ // created from 'create-ts-index'
2
+
3
+ export * from "./enums"
4
+ export * from "./qa.types"
5
+ export * from "./state.types"
6
+ export * from "./types"
7
+ export * from "./utils.types"
8
+ export * from "./validations.types"
@@ -4,7 +4,9 @@ import { WindowHapiModuleWithConstructorArgs } from "../_window"
4
4
 
5
5
  export type WindowHapiQAOrderJourney = WindowHapiModuleWithConstructorArgs<
6
6
  {
7
- setEnabledSteps: (steps: OrderJourneyStepKey[]) => OrderJourneyStepKey[]
7
+ setEnabledSteps: (
8
+ steps: OrderJourneyStepKey[] | OrderJourneyStepKey[][],
9
+ ) => OrderJourneyStepKey[] | OrderJourneyStepKey[][]
8
10
  setEnabledPaymentMethods: (
9
11
  methods: OrderJourneyPaymentMethod[],
10
12
  ) => OrderJourneyPaymentMethod[]
@@ -47,10 +47,7 @@ export type WindowHapiServiceOrderJourney = WindowHapiModuleWithConstructorArgs<
47
47
  setContractStepsErrorMessages: (
48
48
  messages: Record<
49
49
  string,
50
- Record<
51
- string,
52
- MessageDescriptor | MessageDescriptor[] | boolean
53
- >
50
+ Record<string, MessageDescriptor | boolean>
54
51
  >,
55
52
  ) => void
56
53
  setContractStepsSubmittedSteps: (steps: Record<string, boolean>) => void
@@ -64,10 +61,7 @@ export type WindowHapiServiceOrderJourney = WindowHapiModuleWithConstructorArgs<
64
61
  setProductStepsErrorMessages: (
65
62
  messages: Record<
66
63
  string,
67
- Record<
68
- string,
69
- MessageDescriptor | MessageDescriptor[] | boolean
70
- >
64
+ Record<string, MessageDescriptor | boolean>
71
65
  >,
72
66
  ) => void
73
67
  setProductStepsSubmittedSteps: (steps: Record<string, boolean>) => void
@@ -1,20 +1,32 @@
1
1
  import { OrderJourneyPaymentMethod, OrderJourneyStepKey } from "./enums"
2
2
  import {
3
- OrderJourneyStep,
4
3
  OrderJourneyContractStep,
5
- OrderJourneyUTMStepData,
6
- OrderJourneyUTMStepValidations,
4
+ OrderJourneyOrderConfirmationStepData,
5
+ OrderJourneyOrderErrors,
6
+ OrderJourneyOrderErrorsCampaignIsInvalidWithOrderedProducts,
7
+ OrderJourneyOrderErrorsCampaignIsInvalidWithOrderedProductsSpecs,
8
+ OrderJourneyOrderErrorsCampaignIsInvalidWithPaymentMethod,
9
+ OrderJourneyOrderErrorsCampaignIsInvalidWithRecruiterInfo,
10
+ OrderJourneyOrderErrorsCampaignIsInvalidWithTargetGroup,
11
+ OrderJourneyOrderErrorsCampaignIsInvalidWithWalletId,
12
+ OrderJourneyOrderErrorsPostingDetailsBase,
13
+ OrderJourneyOrderErrorsPostingDetailsOrganization,
14
+ OrderJourneyOrderErrorsPostingDetailsURLs,
15
+ OrderJourneyOrderErrorsPostingDetailsWorkingLocation,
7
16
  OrderJourneyOrderReviewStepData,
8
17
  OrderJourneyProductStep,
9
- OrderJourneyOrderErrors,
10
- OrderJourneyOrderConfirmationStepData,
18
+ OrderJourneyStep,
19
+ OrderJourneyUTMStepData,
20
+ OrderJourneyUTMStepValidations,
11
21
  } from "./types"
12
22
  import { MessageDescriptor } from "react-intl"
13
23
  import { NestedValidatorKeys, UseValidatorResult } from "../common/types"
14
24
 
15
25
  export type OrderJourneyState = {
16
- stepsEnabled: OrderJourneyStepKey[]
17
- steps: OrderJourneyStep[]
26
+ stepsEnabled: (OrderJourneyStepKey | OrderJourneyStepKey[])[]
27
+ steps: (OrderJourneyStep | OrderJourneyStep[])[]
28
+ stepsAreGroups: boolean
29
+ flattenedSteps: OrderJourneyStep[]
18
30
  stepPreviousIndex: number
19
31
  stepActiveIndex: number
20
32
  stepNextIndex: number
@@ -29,7 +41,18 @@ export type OrderJourneyState = {
29
41
  paymentMethodsEnabled: OrderJourneyPaymentMethod[]
30
42
  hidePrefilledFields: boolean
31
43
  orderErrors: OrderJourneyOrderErrors | null
32
- stepActiveOrderErrors: OrderJourneyOrderErrors | null
44
+ stepActiveOrderErrors:
45
+ | OrderJourneyOrderErrorsPostingDetailsOrganization
46
+ | OrderJourneyOrderErrorsPostingDetailsWorkingLocation
47
+ | OrderJourneyOrderErrorsPostingDetailsURLs
48
+ | OrderJourneyOrderErrorsPostingDetailsBase
49
+ | OrderJourneyOrderErrorsCampaignIsInvalidWithRecruiterInfo
50
+ | OrderJourneyOrderErrorsCampaignIsInvalidWithTargetGroup
51
+ | OrderJourneyOrderErrorsCampaignIsInvalidWithOrderedProducts
52
+ | OrderJourneyOrderErrorsCampaignIsInvalidWithOrderedProductsSpecs
53
+ | OrderJourneyOrderErrorsCampaignIsInvalidWithWalletId
54
+ | OrderJourneyOrderErrorsCampaignIsInvalidWithPaymentMethod
55
+ | null
33
56
  /* Onboarding */
34
57
  onboardingStep: OrderJourneyStep
35
58
  onboardingStepData: Record<string, any>
@@ -61,8 +61,7 @@ export type OrderJourneyUTMStepValidations = {
61
61
  }
62
62
  }
63
63
  >
64
- areAllValid: boolean
65
- }
64
+ } & UseValidatorResult
66
65
 
67
66
  export type OrderJourneyOrderReviewStepData = {
68
67
  accordionsOpen: OrderJourneyStepKey[]
@@ -94,14 +93,32 @@ export type OrderJourneyOrderErrorsRecruiterInfo = {
94
93
 
95
94
  export type OrderJourneyOrderErrorsTargetGroup = string[]
96
95
 
97
- export type OrderJourneyOrderErrorsPostingDetails = {
98
- title?: string[]
99
- description?: string[]
100
- employmentType?: string[]
96
+ export type OrderJourneyOrderErrorsPostingDetailsOrganization = {
101
97
  organization?: {
102
98
  name?: string[]
103
99
  companyLogo?: string[]
104
100
  }
101
+ }
102
+
103
+ export type OrderJourneyOrderErrorsPostingDetailsWorkingLocation = {
104
+ workingLocation?: {
105
+ addressLine1?: string[]
106
+ addressLine2?: string[]
107
+ city?: string[]
108
+ country?: string[]
109
+ postcode?: string[]
110
+ }
111
+ }
112
+
113
+ export type OrderJourneyOrderErrorsPostingDetailsURLs = {
114
+ jobPageUrl?: string[]
115
+ applicationUrl?: string[]
116
+ }
117
+
118
+ export type OrderJourneyOrderErrorsPostingDetailsBase = {
119
+ title?: string[]
120
+ description?: string[]
121
+ employmentType?: string[]
105
122
  salaryIndication?: {
106
123
  period?: string[]
107
124
  to?: string[]
@@ -112,26 +129,51 @@ export type OrderJourneyOrderErrorsPostingDetails = {
112
129
  from?: string[]
113
130
  to?: string[]
114
131
  }
115
- workingLocation?: {
116
- addressLine1?: string[]
117
- addressLine2?: string[]
118
- city?: string[]
119
- country?: string[]
120
- postcode?: string[]
121
- }
122
- jobPageUrl?: string[]
123
- applicationUrl?: string[]
124
132
  }
125
133
 
126
- export type OrderJourneyOrderErrorsCampaignIsInvalid = {
134
+ export type OrderJourneyOrderErrorsPostingDetails =
135
+ OrderJourneyOrderErrorsPostingDetailsOrganization &
136
+ OrderJourneyOrderErrorsPostingDetailsWorkingLocation &
137
+ OrderJourneyOrderErrorsPostingDetailsURLs &
138
+ OrderJourneyOrderErrorsPostingDetailsBase
139
+
140
+ export type OrderJourneyOrderErrorsCampaignIsInvalidWithPostingDetails = {
127
141
  postingDetails?: OrderJourneyOrderErrorsPostingDetails
142
+ }
143
+
144
+ export type OrderJourneyOrderErrorsCampaignIsInvalidWithRecruiterInfo = {
128
145
  recruiterInfo?: OrderJourneyOrderErrorsRecruiterInfo
146
+ }
147
+
148
+ export type OrderJourneyOrderErrorsCampaignIsInvalidWithTargetGroup = {
129
149
  targetGroup?: OrderJourneyOrderErrorsTargetGroup
150
+ }
151
+
152
+ export type OrderJourneyOrderErrorsCampaignIsInvalidWithOrderedProducts = {
130
153
  orderedProducts?: string[]
154
+ }
155
+
156
+ export type OrderJourneyOrderErrorsCampaignIsInvalidWithPaymentMethod = {
157
+ paymentMethod?: string[]
158
+ }
159
+
160
+ export type OrderJourneyOrderErrorsCampaignIsInvalidWithOrderedProductsSpecs = {
131
161
  orderedProductsSpecs?: any[]
162
+ }
163
+
164
+ export type OrderJourneyOrderErrorsCampaignIsInvalidWithWalletId = {
132
165
  walletId?: string
133
166
  }
134
167
 
168
+ export type OrderJourneyOrderErrorsCampaignIsInvalid =
169
+ OrderJourneyOrderErrorsCampaignIsInvalidWithPostingDetails &
170
+ OrderJourneyOrderErrorsCampaignIsInvalidWithRecruiterInfo &
171
+ OrderJourneyOrderErrorsCampaignIsInvalidWithTargetGroup &
172
+ OrderJourneyOrderErrorsCampaignIsInvalidWithOrderedProducts &
173
+ OrderJourneyOrderErrorsCampaignIsInvalidWithOrderedProductsSpecs &
174
+ OrderJourneyOrderErrorsCampaignIsInvalidWithWalletId &
175
+ OrderJourneyOrderErrorsCampaignIsInvalidWithPaymentMethod
176
+
135
177
  // HAPI Backend validation works in this order:
136
178
  // - it validates the campaign first, if campaign itself is not valid, it does not validate the posting requirements at all
137
179
  // - if campaign is valid, then it validates posting requirements
@@ -140,3 +182,24 @@ export type OrderJourneyOrderErrorsCampaignIsInvalid = {
140
182
  export type OrderJourneyOrderErrors =
141
183
  | OrderJourneyOrderErrorsCampaignIsValidButPostingRequirementsInvalid
142
184
  | OrderJourneyOrderErrorsCampaignIsInvalid
185
+
186
+ export type OrderJourneyStepMap = {
187
+ [OrderJourneyStepKey.searchRecommendProducts]: OrderJourneyStep
188
+ [OrderJourneyStepKey.selectProducts]: OrderJourneyStep
189
+ [OrderJourneyStepKey.addContracts]: OrderJourneyStep
190
+ [OrderJourneyStepKey.selectContracts]: OrderJourneyStep
191
+ [OrderJourneyStepKey.basketSummary]: OrderJourneyStep
192
+ [OrderJourneyStepKey.targetGroup]: OrderJourneyStep
193
+ [OrderJourneyStepKey.recruiterInfo]: OrderJourneyStep
194
+ [OrderJourneyStepKey.postingDetails]: OrderJourneyStep
195
+ [OrderJourneyStepKey.postingOrganization]: OrderJourneyStep
196
+ [OrderJourneyStepKey.postingContactInfo]: OrderJourneyStep
197
+ [OrderJourneyStepKey.postingWorkingLocation]: OrderJourneyStep
198
+ [OrderJourneyStepKey.postingURLs]: OrderJourneyStep
199
+ [OrderJourneyStepKey.contractChannelPostingRequirements]: OrderJourneyContractStep[]
200
+ [OrderJourneyStepKey.productChannelPostingRequirements]: OrderJourneyProductStep[]
201
+ [OrderJourneyStepKey.postingUTMCodes]: OrderJourneyStep
202
+ [OrderJourneyStepKey.orderReview]: OrderJourneyStep
203
+ [OrderJourneyStepKey.paymentMethod]: OrderJourneyStep
204
+ [OrderJourneyStepKey.orderConfirmation]: OrderJourneyStep
205
+ }