@vonq/hapi-elements-types 1.3.0 → 1.5.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 (187) hide show
  1. package/enums.ts +41 -0
  2. package/package.json +6 -7
  3. package/src/_window/api.types.ts +59 -0
  4. package/src/_window/auth.types.ts +11 -0
  5. package/src/_window/config.types.ts +30 -0
  6. package/src/_window/events.types.ts +157 -0
  7. package/src/_window/index.ts +16 -0
  8. package/src/_window/instances.types.ts +18 -0
  9. package/src/_window/qa.types.ts +28 -0
  10. package/src/_window/routing.types.ts +21 -0
  11. package/src/_window/sdk.types.ts +147 -0
  12. package/src/_window/service.types.ts +67 -0
  13. package/src/_window/state.types.ts +112 -0
  14. package/src/_window/ui.types.ts +13 -0
  15. package/src/_window/utils.types.ts +34 -0
  16. package/src/_window/validation.types.ts +43 -0
  17. package/src/_window/window.ts +56 -0
  18. package/src/alert/enums.ts +22 -0
  19. package/src/alert/functions.types.ts +13 -0
  20. package/src/alert/index.ts +9 -0
  21. package/src/alert/service.types.ts +15 -0
  22. package/src/alert/state.initial.ts +16 -0
  23. package/src/alert/state.types.ts +27 -0
  24. package/src/alert/state.validations.ts +11 -0
  25. package/src/alert/types.ts +63 -0
  26. package/src/ats/api.types.ts +16 -0
  27. package/src/ats/functions.types.ts +7 -0
  28. package/src/ats/index.ts +9 -0
  29. package/src/ats/service.types.ts +17 -0
  30. package/src/ats/state.initial.ts +5 -0
  31. package/src/ats/state.types.ts +5 -0
  32. package/src/ats/state.validations.ts +6 -0
  33. package/src/ats/types.ts +19 -0
  34. package/src/basket/consts.ts +1 -0
  35. package/src/basket/functions.types.ts +40 -0
  36. package/src/basket/index.ts +12 -0
  37. package/src/basket/service.types.ts +32 -0
  38. package/src/basket/state.initial.ts +11 -0
  39. package/src/basket/state.types.ts +34 -0
  40. package/src/basket/state.validations.ts +12 -0
  41. package/src/basket/types.ts +4 -0
  42. package/src/basket/utils.ts +79 -0
  43. package/src/basket/utils.types.ts +10 -0
  44. package/src/basket/validations.types.ts +25 -0
  45. package/src/campaign/api.types.ts +45 -0
  46. package/src/campaign/consts.ts +1 -0
  47. package/src/campaign/enums.ts +17 -0
  48. package/src/campaign/functions.types.ts +90 -0
  49. package/src/campaign/index.ts +15 -0
  50. package/src/campaign/qa.types.ts +12 -0
  51. package/src/campaign/service.types.ts +48 -0
  52. package/src/campaign/state.initial.ts +84 -0
  53. package/src/campaign/state.types.ts +55 -0
  54. package/src/campaign/state.validations.ts +16 -0
  55. package/src/campaign/types.ts +237 -0
  56. package/src/campaign/utils.ts +53 -0
  57. package/src/campaign/utils.types.ts +59 -0
  58. package/src/campaign/validations.types.ts +215 -0
  59. package/src/common/LocalStorage.ts +123 -0
  60. package/src/common/browser.ts +2 -0
  61. package/src/common/color.ts +9 -0
  62. package/src/common/events/EventCommand/enums.ts +49 -0
  63. package/src/common/events/EventCommand/index.ts +4 -0
  64. package/src/common/events/EventCommand/types.ts +18 -0
  65. package/src/common/events/index.ts +4 -0
  66. package/src/common/events/types.ts +52 -0
  67. package/src/common/immutable.ts +28 -0
  68. package/src/common/index.ts +22 -0
  69. package/src/common/instances/Instance.ts +13 -0
  70. package/src/common/instances/consts.ts +1 -0
  71. package/src/common/instances/index.ts +4 -0
  72. package/src/common/json.ts +25 -0
  73. package/src/common/logger/Logger.ts +70 -0
  74. package/src/common/logger/enums.ts +12 -0
  75. package/src/common/logger/index.ts +5 -0
  76. package/src/common/logger/types.ts +7 -0
  77. package/src/common/logger-datadog/LoggerDatadog.ts +42 -0
  78. package/src/common/logger-datadog/index.ts +3 -0
  79. package/src/common/misc.ts +114 -0
  80. package/src/common/promise.ts +161 -0
  81. package/src/common/proxy.ts +77 -0
  82. package/src/common/qa.types.ts +9 -0
  83. package/src/common/regExTest.ts +12 -0
  84. package/src/common/tree.ts +148 -0
  85. package/src/common/types.ts +110 -0
  86. package/src/common/utm.ts +19 -0
  87. package/src/common/validations.types.ts +89 -0
  88. package/src/common/validators.ts +21 -0
  89. package/src/common/webComponents.ts +26 -0
  90. package/src/config/functions.types.ts +23 -0
  91. package/src/config/index.ts +5 -0
  92. package/src/config/state.initial.ts +11 -0
  93. package/src/config/state.types.ts +15 -0
  94. package/src/consts.ts +980 -0
  95. package/src/contract/api.types.ts +47 -0
  96. package/src/contract/consts.ts +1 -0
  97. package/src/contract/functions.types.ts +112 -0
  98. package/src/contract/index.ts +14 -0
  99. package/src/contract/qa.types.ts +12 -0
  100. package/src/contract/service.types.ts +54 -0
  101. package/src/contract/state.initial.ts +39 -0
  102. package/src/contract/state.types.ts +74 -0
  103. package/src/contract/state.validations.ts +21 -0
  104. package/src/contract/types.ts +145 -0
  105. package/src/contract/utils.ts +36 -0
  106. package/src/contract/utils.types.ts +11 -0
  107. package/src/contract/validations.types.ts +104 -0
  108. package/src/debugging/functions.types.ts +34 -0
  109. package/src/debugging/index.ts +6 -0
  110. package/src/debugging/state.initial.ts +10 -0
  111. package/src/debugging/state.types.ts +18 -0
  112. package/src/debugging/state.validations.ts +10 -0
  113. package/src/index.ts +22 -0
  114. package/src/language/consts.ts +6 -0
  115. package/src/language/en.ts +530 -0
  116. package/src/language/functions.types.ts +29 -0
  117. package/src/language/index.ts +11 -0
  118. package/src/language/qa.types.ts +19 -0
  119. package/src/language/state.initial.ts +13 -0
  120. package/src/language/state.types.ts +25 -0
  121. package/src/language/state.validations.ts +10 -0
  122. package/src/language/utils.ts +17 -0
  123. package/src/language/validations.types.ts +13 -0
  124. package/src/modal/consts.ts +6 -0
  125. package/src/modal/enums.ts +14 -0
  126. package/src/modal/functions.types.ts +22 -0
  127. package/src/modal/index.ts +11 -0
  128. package/src/modal/service.types.ts +32 -0
  129. package/src/modal/state.initial.ts +9 -0
  130. package/src/modal/state.types.ts +8 -0
  131. package/src/modal/state.validations.ts +6 -0
  132. package/src/modal/store.types.ts +5 -0
  133. package/src/modal/types.ts +44 -0
  134. package/src/orderJourney/consts.ts +289 -0
  135. package/src/orderJourney/enums.ts +25 -0
  136. package/src/orderJourney/functions.types.ts +140 -0
  137. package/src/orderJourney/index.ts +13 -0
  138. package/src/orderJourney/qa.types.ts +16 -0
  139. package/src/orderJourney/state.initial.ts +401 -0
  140. package/src/orderJourney/state.types.ts +99 -0
  141. package/src/orderJourney/state.validations.ts +78 -0
  142. package/src/orderJourney/types.ts +31 -0
  143. package/src/orderJourney/utils.ts +7 -0
  144. package/src/orderJourney/utils.types.ts +11 -0
  145. package/src/orderJourney/validations.types.ts +34 -0
  146. package/src/product/api.types.ts +62 -0
  147. package/src/product/consts.ts +1 -0
  148. package/src/product/enums.ts +11 -0
  149. package/src/product/functions.types.ts +156 -0
  150. package/src/product/index.ts +14 -0
  151. package/src/product/qa.types.ts +11 -0
  152. package/src/product/service.types.ts +68 -0
  153. package/src/product/state.initial.ts +28 -0
  154. package/src/product/state.types.ts +93 -0
  155. package/src/product/state.validations.ts +25 -0
  156. package/src/product/types.ts +161 -0
  157. package/src/product/utils.types.ts +22 -0
  158. package/src/product/validations.types.ts +189 -0
  159. package/src/routing/functions.types.ts +48 -0
  160. package/src/routing/index.ts +5 -0
  161. package/src/routing/state.initial.ts +10 -0
  162. package/src/routing/state.types.ts +30 -0
  163. package/src/theming/consts.ts +7727 -0
  164. package/src/theming/functions.types.ts +13 -0
  165. package/src/theming/index.ts +11 -0
  166. package/src/theming/qa.types.ts +11 -0
  167. package/src/theming/state.initial.ts +16 -0
  168. package/src/theming/state.types.ts +6 -0
  169. package/src/theming/state.validations.ts +8 -0
  170. package/src/theming/types.ts +123 -0
  171. package/src/theming/utils.ts +581 -0
  172. package/src/theming/validations.types.ts +62 -0
  173. package/src/types.ts +229 -0
  174. package/src/ui/index.ts +3 -0
  175. package/src/ui/service.types.ts +26 -0
  176. package/src/utils.ts +3 -0
  177. package/src/wallet/api.types.ts +33 -0
  178. package/src/wallet/consts.ts +3 -0
  179. package/src/wallet/functions.types.ts +58 -0
  180. package/src/wallet/index.ts +11 -0
  181. package/src/wallet/service.types.ts +26 -0
  182. package/src/wallet/state.initial.ts +18 -0
  183. package/src/wallet/state.types.ts +58 -0
  184. package/src/wallet/state.validations.ts +18 -0
  185. package/src/wallet/types.ts +65 -0
  186. package/src/wallet/validations.types.ts +18 -0
  187. package/tsconfig.json +41 -0
@@ -0,0 +1,29 @@
1
+ import { MessageDescriptor } from "react-intl"
2
+ import { LanguageStoreTranslations } from "./state.types"
3
+ import { ProductPriceCurrency } from "../product/enums"
4
+
5
+ export type LanguageStoreFormatMessageHandler = (
6
+ isDebuggingEnabled: boolean,
7
+ message: MessageDescriptor,
8
+ values?: Record<string, any>,
9
+ ) => any
10
+ export type LanguageStoreSetIntlInstanceHandler = (
11
+ locale: string,
12
+ messages: Record<string, string>,
13
+ ) => void
14
+ export type LanguageStoreGetTranslationsHandler = (
15
+ locale: string,
16
+ ) => LanguageStoreTranslations
17
+ export type LanguageStoreSetLocaleHandler = (locale: string) => void
18
+ export type LanguageStoreSetTranslationsHandler = (
19
+ translations: LanguageStoreTranslations,
20
+ ) => void
21
+ export type LanguageStoreSetDisplayCurrencyHandler = (
22
+ currency: ProductPriceCurrency,
23
+ ) => void
24
+ export type LanguageStoreFunctions = {
25
+ formatMessage: LanguageStoreFormatMessageHandler
26
+ setTranslations: LanguageStoreSetTranslationsHandler
27
+ setLocale: LanguageStoreSetLocaleHandler
28
+ setDisplayCurrency: LanguageStoreSetDisplayCurrencyHandler
29
+ }
@@ -0,0 +1,11 @@
1
+ // created from 'create-ts-index'
2
+
3
+ export * from './consts';
4
+ export * from './en';
5
+ export * from './functions.types';
6
+ export * from './qa.types';
7
+ export * from './state.initial';
8
+ export * from './state.types';
9
+ export * from './state.validations';
10
+ export * from './utils';
11
+ export * from './validations.types';
@@ -0,0 +1,19 @@
1
+ import { ProductPriceCurrency } from "../product/enums"
2
+ import { LanguageStoreTranslations } from "./state.types"
3
+ import { ModuleWithConstructorArgs } from "../types"
4
+ import { WindowHapiQA } from "../_window/qa.types"
5
+
6
+ export type WindowHapiQALanguage = ModuleWithConstructorArgs<
7
+ {
8
+ setLocale: (locale: string) => string
9
+ setDisplayCurrency: (
10
+ currency: ProductPriceCurrency,
11
+ ) => ProductPriceCurrency
12
+ setTranslationByLocaleAndKey: (
13
+ locale: string,
14
+ key: string,
15
+ message: string,
16
+ ) => LanguageStoreTranslations
17
+ },
18
+ { readonly qa: WindowHapiQA }
19
+ >
@@ -0,0 +1,13 @@
1
+ import { LanguageStoreState } from "./state.types"
2
+ import { LOCALES_DATA } from "./consts"
3
+ import { ProductPriceCurrency } from "../product/enums"
4
+
5
+ const locale = "en"
6
+ const translations = LOCALES_DATA
7
+
8
+ export const initialLanguageStoreState: LanguageStoreState = {
9
+ locale,
10
+ translations: translations,
11
+ displayCurrency: ProductPriceCurrency.USD,
12
+ supportedCurrencies: Object.values(ProductPriceCurrency),
13
+ }
@@ -0,0 +1,25 @@
1
+ import { ProductPriceCurrency } from "../product/enums"
2
+
3
+ export type LanguageStoreLocaleTranslations = Record<string, string>
4
+ export type LanguageStoreTranslations = Record<
5
+ string,
6
+ LanguageStoreLocaleTranslations
7
+ >
8
+ export type LanguageStoreState = {
9
+ /**
10
+ * Locale of the user (navigator language) in RFC 5646 that can be changed via setLocale function
11
+ */
12
+ locale: string
13
+ /**
14
+ * An object containing key-value parts where the key is the i18n key such as `test.example-string` and the value is the actual translation. Translations will be loaded by current locale and fallbacks will be used from American English defaults we have.
15
+ */
16
+ translations: LanguageStoreTranslations
17
+ /**
18
+ * Current Display Currency of all the widgets
19
+ */
20
+ displayCurrency: ProductPriceCurrency
21
+ /**
22
+ * Array of supported currencies. **This value changes automatically when user scrolls and should not be set from outside**
23
+ */
24
+ supportedCurrencies: ProductPriceCurrency[]
25
+ }
@@ -0,0 +1,10 @@
1
+ import { LanguageStoreState } from "./state.types"
2
+ import { StateValidations } from "../_window/state.types"
3
+
4
+ export const languageStoreStateValidations: StateValidations<LanguageStoreState> =
5
+ {
6
+ locale: "common.genericString",
7
+ translations: "language.translations",
8
+ displayCurrency: "language.displayCurrency",
9
+ supportedCurrencies: "throwHasNoSetterError",
10
+ }
@@ -0,0 +1,17 @@
1
+ import { createIntl, createIntlCache } from "react-intl"
2
+
3
+ export const getIntlInstance = (
4
+ locale: string,
5
+ messages: Record<string, string>,
6
+ ) => {
7
+ const cache = createIntlCache()
8
+ const intl = createIntl(
9
+ {
10
+ locale,
11
+ messages,
12
+ },
13
+ cache,
14
+ )
15
+
16
+ return intl
17
+ }
@@ -0,0 +1,13 @@
1
+ import { ZodRecord, ZodString } from "zod"
2
+ import { ProductPriceCurrency } from "../product/enums"
3
+
4
+ export type ZodTranslations = ZodRecord<
5
+ ZodString,
6
+ ZodRecord<ZodString, ZodString>
7
+ >
8
+ export type WindowHapiValidationsLanguage = {
9
+ translations: ZodTranslations
10
+ supportedCurrencies: ProductPriceCurrency[]
11
+ supportedCurrenciesRegex: RegExp
12
+ displayCurrency: ZodString
13
+ }
@@ -0,0 +1,6 @@
1
+ import { ModalOptions } from "./types"
2
+
3
+ export const ModalDefaultOptions: ModalOptions = {
4
+ showCloseButton: true,
5
+ showBackdrop: true,
6
+ }
@@ -0,0 +1,14 @@
1
+ export enum ModalZone {
2
+ "primary" = "primary",
3
+ "secondary" = "secondary",
4
+ }
5
+
6
+ export enum ModalKeys {
7
+ wallet = "layout-wallet-modal",
8
+ basket = "layout-basket-modal",
9
+ productInfo = "product-info",
10
+ campaignTakeOfflineConfirmation = "campaign-confirm-take-offline",
11
+ campaignCopyConfirmation = "campaign-confirm-copy",
12
+ basketRemoveProductConfirmation = "remove-product-from-basket",
13
+ contractRemoveConfirmation = "contract-remove-confirmation",
14
+ }
@@ -0,0 +1,22 @@
1
+ import { ModalKeys, ModalZone } from "./enums"
2
+ import { ModalOptions, ModalProps } from "./types"
3
+
4
+ export type ModalStoreOpenModalHandler = (
5
+ key: ModalKeys,
6
+ props: ModalProps | undefined,
7
+ options?: ModalOptions,
8
+ zone?: ModalZone,
9
+ ) => void
10
+
11
+ export type ModalStoreCloseModalHandler = (key: ModalKeys) => void
12
+
13
+ export type ModalStoreFunctions = {
14
+ /**
15
+ * Shows a modal component by key on target layer
16
+ */
17
+ openModal: ModalStoreOpenModalHandler
18
+ /**
19
+ * Hides a modal component by key
20
+ */
21
+ closeModal: ModalStoreCloseModalHandler
22
+ }
@@ -0,0 +1,11 @@
1
+ // created from 'create-ts-index'
2
+
3
+ export * from './consts';
4
+ export * from './enums';
5
+ export * from './functions.types';
6
+ export * from './service.types';
7
+ export * from './state.initial';
8
+ export * from './state.types';
9
+ export * from './state.validations';
10
+ export * from './store.types';
11
+ export * from './types';
@@ -0,0 +1,32 @@
1
+ import { ModalOptions } from "./types"
2
+ import { ModalKeys, ModalZone } from "./enums"
3
+ import { Product } from "../product/types"
4
+ import { Contract } from "../contract/types"
5
+ import { IObservableValue } from "mobx"
6
+ import { AnyNonFunction } from "../common/types"
7
+ import { ModuleWithConstructorArgs } from "../types"
8
+ import { WindowHapiService } from "../_window/service.types"
9
+
10
+ export type WindowHapiServiceModal = ModuleWithConstructorArgs<
11
+ {
12
+ openModal: (
13
+ key: ModalKeys,
14
+ props: AnyNonFunction<
15
+ | { product: Product }
16
+ | {
17
+ onClickAccept: (
18
+ productOrContract: Product | Contract,
19
+ ) => void
20
+ onClickDecline: () => void
21
+ basketProduct: Product | Contract
22
+ }
23
+ | { campaignId: string }
24
+ | { partnerId?: IObservableValue<string> }
25
+ >,
26
+ options?: ModalOptions,
27
+ zone?: ModalZone,
28
+ ) => void
29
+ closeModal: (key: ModalKeys) => void
30
+ },
31
+ { readonly service: WindowHapiService }
32
+ >
@@ -0,0 +1,9 @@
1
+ import { ModalStoreState } from "./state.types"
2
+ import { ModalZone } from "./enums"
3
+
4
+ export const initialModalStoreState: ModalStoreState = {
5
+ modals: {
6
+ [ModalZone.primary]: null,
7
+ [ModalZone.secondary]: null,
8
+ },
9
+ }
@@ -0,0 +1,8 @@
1
+ import { Modals } from "./types"
2
+
3
+ export type ModalStoreState = {
4
+ /**
5
+ * An object of modals that are seperated into different layers
6
+ */
7
+ modals: Modals
8
+ }
@@ -0,0 +1,6 @@
1
+ import { ModalStoreState } from "./state.types"
2
+ import { StateValidations } from "../_window/state.types"
3
+
4
+ export const modalStoreStateValidations: StateValidations<ModalStoreState> = {
5
+ modals: undefined,
6
+ }
@@ -0,0 +1,5 @@
1
+ import { ModalStoreFunctions } from "./functions.types"
2
+ import { ModalStoreState } from "./state.types"
3
+ import { BaseStore } from "../types"
4
+
5
+ export type ModalStore = BaseStore<ModalStoreState, ModalStoreFunctions>
@@ -0,0 +1,44 @@
1
+ import { Product } from "../product/types"
2
+ import { Contract } from "../contract/types"
3
+ import { ModalKeys, ModalZone } from "./enums"
4
+ import { AnyNonFunction } from "../common/types"
5
+
6
+ export type ProductDetailModalProps = {
7
+ id: string
8
+ }
9
+ export type UTMCodesModalProps = {}
10
+ export type BasketRemoveProductConfirmationModalProps = {
11
+ basketProduct: Product | Contract
12
+ }
13
+ export type CampaignTakeOfflineConfirmationModalProps = { campaignId: string }
14
+ export type ContractRemoveConfirmationModalProps = { contractId: string }
15
+ export type BasketModalProps = {}
16
+ export type WalletModalProps = {}
17
+
18
+ export type ModalProps = AnyNonFunction<
19
+ | ProductDetailModalProps
20
+ | UTMCodesModalProps
21
+ | BasketRemoveProductConfirmationModalProps
22
+ | CampaignTakeOfflineConfirmationModalProps
23
+ | ContractRemoveConfirmationModalProps
24
+ | BasketModalProps
25
+ | WalletModalProps
26
+ >
27
+
28
+ export type ModalOptions = {
29
+ showCloseButton?: boolean
30
+ showBackdrop?: boolean
31
+ disableVerticalScroll?: boolean
32
+ }
33
+
34
+ export type Modal = {
35
+ zone: ModalZone
36
+ key: ModalKeys
37
+ props: ModalProps | undefined
38
+ options: ModalOptions
39
+ }
40
+
41
+ export type Modals = {
42
+ [ModalZone.primary]: Modal | null
43
+ [ModalZone.secondary]: Modal | null
44
+ }
@@ -0,0 +1,289 @@
1
+ import {
2
+ ERROR_MESSAGE_CANNOT_BE_EMPTY,
3
+ ERROR_MESSAGE_SHOULD_BE_EMAIL,
4
+ ERROR_MESSAGE_SHOULD_BE_MORE_THAN_ZERO,
5
+ ERROR_MESSAGE_SHOULD_BE_URL,
6
+ } from "../consts"
7
+ import { OrderJourneyStepKey } from "./enums"
8
+ import { NestedValidatorKeys } from "../common/types"
9
+
10
+ /* Get Recommendations Step (User Journey) */
11
+ export const orderJourneySearchRecommendProductsBlurredFields = {
12
+ "productStore.jobTitlesIdsSelected": false,
13
+ "productStore.jobFunctionsIdsSelected": false,
14
+ "productStore.jobRegionsIdsSelected": false,
15
+ }
16
+ export const orderJourneysearchRecommendProductsErrorMessages = {
17
+ "productStore.jobTitlesIdsSelected": ERROR_MESSAGE_CANNOT_BE_EMPTY,
18
+ "productStore.jobFunctionsIdsSelected": ERROR_MESSAGE_CANNOT_BE_EMPTY,
19
+ "productStore.jobRegionsIdsSelected": ERROR_MESSAGE_CANNOT_BE_EMPTY,
20
+ }
21
+ export const orderJourneySearchRecommendProductsValidators: NestedValidatorKeys =
22
+ {
23
+ "productStore.jobTitlesIdsSelected": "isNotEmpty",
24
+ "productStore.jobFunctionsIdsSelected": "isNotEmpty",
25
+ "productStore.jobRegionsIdsSelected": "isNotEmpty",
26
+ }
27
+ export const orderJourneySearchRecommendProductsHideFields = {
28
+ "productStore.jobTitlesIdsSelected": false,
29
+ "productStore.jobFunctionsIdsSelected": false,
30
+ "productStore.jobRegionsIdsSelected": false,
31
+ }
32
+ /* Select Products Step (User Journey) */
33
+ export const orderJourneySelectProductsStepErrorMessages = {
34
+ "basketStore.products": {
35
+ id: "campaign.select-channels.no-items-in-basket",
36
+ defaultMessage:
37
+ "You need at least one product or a contract added to campaign in order to proceed",
38
+ },
39
+ }
40
+ export const orderJourneySelectProductsBlurredFields = {}
41
+ export const orderJourneySelectProductsStepValidators: NestedValidatorKeys = {}
42
+ /* Add Contracts Step */
43
+ export const orderJourneyAddContractsErrorMessages = {}
44
+ export const orderJourneyAddContractsValidators = {}
45
+ export const orderJourneyAddContractsBlurredFields = {}
46
+ /* Select Contracts Step */
47
+ export const orderJourneySelectContractsErrorMessages = {}
48
+ export const orderJourneySelectContractsValidators = {}
49
+ export const orderJourneySelectContractsBlurredFields = {}
50
+
51
+ /* Basket Summary Step */
52
+ export const orderJourneyBasketSummaryValidators: NestedValidatorKeys = {
53
+ "basketStore.products": "isNotEmpty",
54
+ }
55
+ export const orderJourneyJBasketSummaryErrorMessages = {
56
+ "basketStore.products": {
57
+ id: "campaign.select-channels.no-items-in-basket",
58
+ defaultMessage:
59
+ "You need at least one product or a contract added to campaign in order to proceed",
60
+ },
61
+ }
62
+ export const orderJourneyBasketSummaryBlurredFields = {}
63
+
64
+ /* Target Group Step (Create Campaign Form) */
65
+ export const orderJourneyTargetGroupStepErrorMessages = {
66
+ educationLevel: ERROR_MESSAGE_CANNOT_BE_EMPTY,
67
+ seniority: ERROR_MESSAGE_CANNOT_BE_EMPTY,
68
+ industry: ERROR_MESSAGE_CANNOT_BE_EMPTY,
69
+ jobCategory: ERROR_MESSAGE_CANNOT_BE_EMPTY,
70
+ }
71
+ export const orderJourneyTargetGroupStepValidators: NestedValidatorKeys = {
72
+ educationLevel: "isNotEmpty",
73
+ seniority: "isNotEmpty",
74
+ industry: "isNotEmpty",
75
+ jobCategory: "isNotEmpty",
76
+ }
77
+ export const orderJourneyTargetGroupStepBlurredFields = {
78
+ educationLevel: false,
79
+ seniority: false,
80
+ industry: false,
81
+ jobCategory: false,
82
+ }
83
+ export const orderJourneyTargetGroupStepHideFields = {
84
+ educationLevel: false,
85
+ seniority: false,
86
+ industry: false,
87
+ jobCategory: false,
88
+ }
89
+ /* Recruiter Info Step (Create Campaign Form) */
90
+ export const orderJourneyRecruiterInfoStepErrorMessages = {
91
+ name: ERROR_MESSAGE_CANNOT_BE_EMPTY,
92
+ emailAddress: ERROR_MESSAGE_SHOULD_BE_EMAIL,
93
+ }
94
+ export const orderJourneyRecruiterInfoStepValidators: NestedValidatorKeys = {
95
+ name: "isNotEmpty",
96
+ //emailAddress: "isEmail", //Not required by IGB
97
+ }
98
+ export const orderJourneyRecruiterInfoStepBlurredFields = {
99
+ name: false,
100
+ emailAddress: false,
101
+ }
102
+ export const orderJourneyRecruiterInfoStepHideFields = {
103
+ name: false,
104
+ emailAddress: false,
105
+ }
106
+ /* Posting Details Step (Create Campaign Form) */
107
+ export const orderJourneyPostingDetailsStepErrorMessages = {
108
+ title: ERROR_MESSAGE_CANNOT_BE_EMPTY,
109
+ description: ERROR_MESSAGE_CANNOT_BE_EMPTY,
110
+ // yearsOfExperience: ERROR_MESSAGE_SHOULD_BE_MORE_THAN_ZERO, //Not required by IGB
111
+ employmentType: ERROR_MESSAGE_CANNOT_BE_EMPTY,
112
+ weeklyWorkingHours: {
113
+ // from: ERROR_MESSAGE_SHOULD_BE_MORE_THAN_ZERO, //Not required by IGB
114
+ to: ERROR_MESSAGE_SHOULD_BE_MORE_THAN_ZERO,
115
+ },
116
+ salaryIndication: {
117
+ period: ERROR_MESSAGE_CANNOT_BE_EMPTY,
118
+ range: {
119
+ // from: ERROR_MESSAGE_SHOULD_BE_MORE_THAN_ZERO, //Not required by IGB
120
+ to: ERROR_MESSAGE_SHOULD_BE_MORE_THAN_ZERO,
121
+ currency: ERROR_MESSAGE_CANNOT_BE_EMPTY,
122
+ },
123
+ },
124
+ }
125
+ export const orderJourneyPostingDetailsStepValidators: NestedValidatorKeys = {
126
+ title: "isNotEmpty",
127
+ description: "isNotEmpty",
128
+ // yearsOfExperience: "isNotZero", //Not required by IGB
129
+ employmentType: "isNotEmpty",
130
+ weeklyWorkingHours: {
131
+ // from: "isNotZero", //Not required by IGB
132
+ to: "isNotZero",
133
+ },
134
+ salaryIndication: {
135
+ period: "isNotEmpty",
136
+ range: {
137
+ // from: "isNotZero", //Not required by IGB
138
+ to: "isNotZero",
139
+ currency: "isNotEmpty",
140
+ },
141
+ },
142
+ }
143
+ export const orderJourneyPostingDetailsStepBlurredFields = {
144
+ title: false,
145
+ description: false,
146
+ yearsOfExperience: false,
147
+ employmentType: false,
148
+ weeklyWorkingHours: {
149
+ from: false,
150
+ to: false,
151
+ },
152
+ salaryIndication: {
153
+ period: false,
154
+ range: {
155
+ from: false,
156
+ to: false,
157
+ currency: false,
158
+ },
159
+ },
160
+ campaignName: false,
161
+ }
162
+ export const orderJourneyPostingDetailsStepHideFields = {
163
+ title: false,
164
+ description: false,
165
+ yearsOfExperience: false,
166
+ employmentType: false,
167
+ "weeklyWorkingHours.from": false,
168
+ "weeklyWorkingHours.to": false,
169
+ "salaryIndication.period": false,
170
+ "salaryIndication.range.from": false,
171
+ "salaryIndication.range.to": false,
172
+ "salaryIndication.range.currency": false,
173
+ campaignName: false,
174
+ }
175
+ /* Organization Step (Create Campaign Form) */
176
+ export const orderJourneyOrganizationStepErrorMessages = {
177
+ name: ERROR_MESSAGE_CANNOT_BE_EMPTY,
178
+ companyLogo: ERROR_MESSAGE_SHOULD_BE_URL,
179
+ }
180
+ export const orderJourneyOrganizationStepValidators: NestedValidatorKeys = {
181
+ name: "isNotEmpty",
182
+ companyLogo: "isURL",
183
+ }
184
+ export const orderJourneyOrganizationStepBlurredFields = {
185
+ name: false,
186
+ companyLogo: false,
187
+ }
188
+ export const orderJourneyOrganizationStepHideFields = {
189
+ name: false,
190
+ companyLogo: false,
191
+ }
192
+ /* Contact Info Step (Create Campaign Form) */
193
+ export const orderJourneyContactInfoStepErrorMessages = {}
194
+ export const orderJourneyContactInfoStepValidators: NestedValidatorKeys = {}
195
+ export const orderJourneyContactInfoStepBlurredFields = {
196
+ name: false,
197
+ emailAddress: false,
198
+ phoneNumber: false,
199
+ }
200
+ export const orderJourneyContactInfoStepHideFields = {
201
+ name: false,
202
+ emailAddress: false,
203
+ phoneNumber: false,
204
+ }
205
+ /* Working Location Step (Create Campaign Form) */
206
+ export const orderJourneyWorkingLocationStepErrorMessages = {
207
+ addressLine1: ERROR_MESSAGE_CANNOT_BE_EMPTY,
208
+ // addressLine2: ERROR_MESSAGE_CANNOT_BE_EMPTY, //Not required by IGB
209
+ postcode: ERROR_MESSAGE_CANNOT_BE_EMPTY,
210
+ city: ERROR_MESSAGE_CANNOT_BE_EMPTY,
211
+ country: ERROR_MESSAGE_CANNOT_BE_EMPTY,
212
+ }
213
+ export const orderJourneyWorkingLocationStepValidators: NestedValidatorKeys = {
214
+ addressLine1: "isNotEmpty",
215
+ // addressLine2: "isNotEmpty", //Not required by IGB
216
+ postcode: "isNotEmpty",
217
+ city: "isNotEmpty",
218
+ country: "isNotEmpty",
219
+ }
220
+ export const orderJourneyWorkingLocationStepBlurredFields = {
221
+ addressLine1: false,
222
+ addressLine2: false,
223
+ postcode: false,
224
+ city: false,
225
+ country: false,
226
+ allowsRemoteWork: false,
227
+ }
228
+ export const orderJourneyWorkingLocationStepHideFields = {
229
+ addressLine1: false,
230
+ addressLine2: false,
231
+ postcode: false,
232
+ city: false,
233
+ country: false,
234
+ allowsRemoteWork: false,
235
+ }
236
+ /* URLs Step (Create Campaign Form) */
237
+ export const orderJourneyURLsStepErrorMessages = {
238
+ jobPageUrl: ERROR_MESSAGE_SHOULD_BE_URL,
239
+ applicationUrl: ERROR_MESSAGE_SHOULD_BE_URL,
240
+ }
241
+ export const orderJourneyURLsStepValidators: NestedValidatorKeys = {
242
+ jobPageUrl: "isURL",
243
+ applicationUrl: "isURL",
244
+ }
245
+ export const orderJourneyURLsStepBlurredFields = {
246
+ jobPageUrl: false,
247
+ applicationUrl: false,
248
+ }
249
+ export const orderJourneyURLsStepHideFields = {
250
+ jobPageUrl: false,
251
+ applicationUrl: false,
252
+ }
253
+ /* UTM Codes */
254
+ export const orderJourneyUTMCodesStepErrorMessages = {}
255
+ export const orderJourneyUTMCodesStepValidators: NestedValidatorKeys = {}
256
+ export const orderJourneyUTMCodesStepBlurredFields = {}
257
+ /* Order Review */
258
+ export const orderJourneyOrderReviewStepErrorMessages = {}
259
+ export const orderJourneyOrderReviewStepValidators: NestedValidatorKeys = {}
260
+ export const orderJourneyOrderReviewStepBlurredFields = {}
261
+ /* Payment Method */
262
+ export const orderJourneyPaymentMethodStepErrorMessages = {}
263
+ export const orderJourneyPaymentMethodStepValidators: NestedValidatorKeys = {}
264
+ export const orderJourneyPaymentMethodStepBlurredFields = {}
265
+ /* Order Confirmation */
266
+ export const orderJourneyOrderConfirmationStepErrorMessages = {}
267
+ export const orderJourneyOrderConfirmationStepValidators: NestedValidatorKeys =
268
+ {}
269
+ export const orderJourneyOrderConfirmationStepBlurredFields = {}
270
+
271
+ export const orderJourneyDefaultEnabledSteps = [
272
+ OrderJourneyStepKey.searchRecommendProducts,
273
+ OrderJourneyStepKey.selectProducts,
274
+ OrderJourneyStepKey.addContracts,
275
+ OrderJourneyStepKey.selectContracts,
276
+ OrderJourneyStepKey.basketSummary,
277
+ OrderJourneyStepKey.targetGroup,
278
+ OrderJourneyStepKey.recruiterInfo,
279
+ OrderJourneyStepKey.postingDetails,
280
+ OrderJourneyStepKey.postingOrganization,
281
+ OrderJourneyStepKey.postingContactInfo,
282
+ OrderJourneyStepKey.postingWorkingLocation,
283
+ OrderJourneyStepKey.postingURLs,
284
+ OrderJourneyStepKey.contractChannelPostingRequirements,
285
+ OrderJourneyStepKey.postingUTMCodes,
286
+ OrderJourneyStepKey.orderReview,
287
+ OrderJourneyStepKey.paymentMethod,
288
+ OrderJourneyStepKey.orderConfirmation,
289
+ ]
@@ -0,0 +1,25 @@
1
+ export enum OrderJourneyStepKey {
2
+ searchRecommendProducts = "search-recommend-products",
3
+ selectProducts = "select-products",
4
+ addContracts = "add-contracts",
5
+ selectContracts = "select-contracts",
6
+ basketSummary = "basket-summary",
7
+ targetGroup = "target-group",
8
+ recruiterInfo = "recruiter-info",
9
+ postingDetails = "posting-details",
10
+ postingOrganization = "posting-organization",
11
+ postingContactInfo = "posting-contact-info",
12
+ postingWorkingLocation = "posting-working-location",
13
+ postingURLs = "posting-urls",
14
+ contractChannelPostingRequirements = "contract-channel-posting-requirements",
15
+ postingUTMCodes = "posting-utm-codes",
16
+ orderReview = "order-review",
17
+ paymentMethod = "payment-method",
18
+ orderConfirmation = "order-confirmation",
19
+ }
20
+
21
+ export enum OrderJourneyPaymentMethod {
22
+ atsManaged = "ats-managed",
23
+ wallet = "wallet",
24
+ purchaseOrder = "purchase-order",
25
+ }