@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.
- package/_window/api.types.ts +12 -13
- package/_window/index.ts.bak +16 -0
- package/_window/sdk.types.ts +5 -2
- package/_window/service.types.ts +3 -12
- package/_window/state.types.ts +0 -24
- package/_window/utils.types.ts +3 -0
- package/_window/window.ts +0 -1
- package/alert/index.ts +4 -4
- package/alert/index.ts.bak +6 -0
- package/ats/index.ts +4 -4
- package/ats/index.ts.bak +6 -0
- package/ats/types.ts +7 -1
- package/basket/index.ts +5 -5
- package/basket/index.ts.bak +7 -0
- package/basket/service.types.ts +1 -1
- package/basket/utils.types.ts +6 -2
- package/campaign/api.types.ts +5 -1
- package/campaign/enums.ts +0 -3
- package/campaign/index.ts +8 -8
- package/campaign/index.ts.bak +10 -0
- package/campaign/service.types.ts +14 -0
- package/campaign/types.ts +31 -21
- package/campaign/utils.types.ts +1 -0
- package/campaign/validations.types.ts +15 -1
- package/common/enums.ts +0 -4
- package/common/events/EventCommand/index.ts.bak +4 -0
- package/common/events/index.ts.bak +4 -0
- package/common/index.ts +7 -5
- package/common/index.ts.bak +7 -0
- package/common/logger/index.ts +4 -0
- package/common/types.ts +8 -1
- package/common/validations.types.ts +2 -0
- package/common/validator/index.ts +3 -0
- package/contract/api.types.ts +1 -0
- package/contract/index.ts +7 -7
- package/contract/index.ts.bak +9 -0
- package/contract/service.types.ts +7 -1
- package/contract/types.ts +2 -0
- package/contract/validations.types.ts +1 -0
- package/debugging/index.ts +3 -2
- package/debugging/index.ts.bak +4 -0
- package/index.ts +16 -16
- package/index.ts.bak +18 -0
- package/language/enums.ts +5 -0
- package/language/index.ts +6 -3
- package/language/index.ts.bak +5 -0
- package/language/service.types.ts +7 -0
- package/language/state.types.ts +3 -1
- package/language/utils.types.ts +11 -0
- package/modal/enums.ts +3 -3
- package/modal/index.ts +5 -4
- package/modal/index.ts.bak +6 -0
- package/modal/types.ts +11 -8
- package/orderJourney/index.ts +7 -6
- package/orderJourney/index.ts.bak +8 -0
- package/orderJourney/qa.types.ts +3 -1
- package/orderJourney/service.types.ts +2 -8
- package/orderJourney/state.types.ts +31 -8
- package/orderJourney/types.ts +79 -16
- package/orderJourney/validations.types.ts +13 -2
- package/package.json +2 -3
- package/product/index.ts +8 -8
- package/product/index.ts.bak +10 -0
- package/product/types.ts +4 -1
- package/routing/index.ts +2 -1
- package/routing/index.ts.bak +3 -0
- package/theming/index.ts +4 -4
- package/theming/index.ts.bak +6 -0
- package/theming/types.ts +44 -0
- package/theming/validations.types.ts +16 -0
- package/ui/index.ts.bak +3 -0
- package/wallet/index.ts +5 -5
- package/wallet/index.ts.bak +7 -0
- package/wallet/state.types.ts +1 -1
- package/wallet/types.ts +6 -1
- package/talentMindCompany/api.types.ts +0 -18
- package/talentMindCompany/service.types.ts +0 -15
- package/talentMindCompany/state.types.ts +0 -5
- package/talentMindCompany/types.ts +0 -6
- package/talentMindCompany/validations.types.ts +0 -5
- package/talentMindEvaluation/api.types.ts +0 -25
- package/talentMindEvaluation/service.types.ts +0 -25
- package/talentMindEvaluation/state.types.ts +0 -6
- package/talentMindEvaluation/types.ts +0 -15
- package/talentMindEvaluation/validations.types.ts +0 -5
- package/talentMindJob/api.types.ts +0 -26
- package/talentMindJob/service.types.ts +0 -28
- package/talentMindJob/state.types.ts +0 -6
- package/talentMindJob/types.ts +0 -12
- package/talentMindJob/validations.types.ts +0 -5
- package/talentMindResume/api.types.ts +0 -30
- package/talentMindResume/service.types.ts +0 -34
- package/talentMindResume/state.types.ts +0 -6
- package/talentMindResume/types.ts +0 -119
- package/talentMindResume/validations.types.ts +0 -5
- 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:
|
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]>
|
package/contract/api.types.ts
CHANGED
@@ -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
|
4
|
-
export * from
|
5
|
-
export * from
|
6
|
-
export * from
|
7
|
-
export * from
|
8
|
-
export * from
|
9
|
-
export * from
|
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,
|
package/debugging/index.ts
CHANGED
package/index.ts
CHANGED
@@ -1,18 +1,18 @@
|
|
1
1
|
// created from 'create-ts-index'
|
2
2
|
|
3
|
-
export * from
|
4
|
-
export * from
|
5
|
-
export * from
|
6
|
-
export * from
|
7
|
-
export * from
|
8
|
-
export * from
|
9
|
-
export * from
|
10
|
-
export * from
|
11
|
-
export * from
|
12
|
-
export * from
|
13
|
-
export * from
|
14
|
-
export * from
|
15
|
-
export * from
|
16
|
-
export * from
|
17
|
-
export * from
|
18
|
-
export * from
|
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"
|
package/language/index.ts
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
// created from 'create-ts-index'
|
2
2
|
|
3
|
-
export * from
|
4
|
-
export * from
|
5
|
-
export * from
|
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';
|
package/language/state.types.ts
CHANGED
@@ -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
|
4
|
-
export * from
|
5
|
-
export * from
|
6
|
-
export * from
|
3
|
+
export * from './enums';
|
4
|
+
export * from './service.types';
|
5
|
+
export * from './state.types';
|
6
|
+
export * from './types';
|
7
|
+
export * from './utils.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
|
}
|
package/orderJourney/index.ts
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
// created from 'create-ts-index'
|
2
2
|
|
3
|
-
export * from
|
4
|
-
export * from
|
5
|
-
export * from
|
6
|
-
export * from
|
7
|
-
export * from
|
8
|
-
export * from
|
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';
|
package/orderJourney/qa.types.ts
CHANGED
@@ -4,7 +4,9 @@ import { WindowHapiModuleWithConstructorArgs } from "../_window"
|
|
4
4
|
|
5
5
|
export type WindowHapiQAOrderJourney = WindowHapiModuleWithConstructorArgs<
|
6
6
|
{
|
7
|
-
setEnabledSteps: (
|
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
|
-
|
6
|
-
|
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
|
-
|
10
|
-
|
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:
|
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>
|
package/orderJourney/types.ts
CHANGED
@@ -61,8 +61,7 @@ export type OrderJourneyUTMStepValidations = {
|
|
61
61
|
}
|
62
62
|
}
|
63
63
|
>
|
64
|
-
|
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
|
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
|
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
|
+
}
|