@vonq/hapi-elements-types 1.42.0 → 1.44.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/state.types.ts +24 -6
- package/_window/validation.types.ts +10 -0
- package/_window/window.ts +2 -0
- package/alert/enums.ts +1 -1
- package/alert/types.ts +1 -1
- package/ats/types.ts +3 -0
- package/campaign/service.types.ts +5 -0
- package/campaign/types.ts +9 -2
- package/campaign/utils.types.ts +7 -0
- package/campaign/validations.types.ts +56 -13
- package/common/qa.types.ts +0 -1
- package/common/types.ts +5 -69
- package/common/validations.types.ts +2 -0
- package/contract/enums.ts +39 -0
- package/contract/index.ts +8 -7
- package/contract/service.types.ts +79 -2
- package/contract/state.cache.types.ts +5 -0
- package/contract/types.ts +192 -0
- package/contract/utils.types.ts +16 -1
- package/debugging/state.types.ts +0 -1
- package/orderJourney/state.types.ts +10 -2
- package/orderJourney/types.ts +26 -5
- package/package.json +1 -1
- package/product/enums.ts +6 -0
- package/product/service.types.ts +6 -0
- package/product/state.cache.types.ts +5 -0
- package/product/state.types.ts +7 -1
- package/product/types.ts +19 -15
- package/product/utils.types.ts +6 -1
- package/product/validations.types.ts +3 -0
package/_window/state.types.ts
CHANGED
@@ -27,16 +27,24 @@ import { WindowHapiValidationsOrderJourney } from "../orderJourney/validations.t
|
|
27
27
|
import { WindowHapiValidationsWallet } from "../wallet/validations.types"
|
28
28
|
import { WindowHapiValidations } from "./validation.types"
|
29
29
|
import { ExperimentalState } from "../experimental/state.types"
|
30
|
+
import { ProductCacheState } from "../product/state.cache.types"
|
31
|
+
import { ContractCacheState } from "../contract/state.cache.types"
|
30
32
|
|
31
33
|
export type WindowHapiState = WindowHapiModuleWithConstructorArgs<
|
32
34
|
{
|
33
35
|
[WindowHapiModuleName.alert]: WindowHapiStateModule<AlertState>
|
34
36
|
[WindowHapiModuleName.basket]: WindowHapiStateModule<BasketState>
|
35
37
|
[WindowHapiModuleName.campaign]: WindowHapiStateModule<CampaignState>
|
36
|
-
[WindowHapiModuleName.contract]: WindowHapiStateModule<
|
38
|
+
[WindowHapiModuleName.contract]: WindowHapiStateModule<
|
39
|
+
ContractState,
|
40
|
+
ContractCacheState
|
41
|
+
>
|
37
42
|
[WindowHapiModuleName.debugging]: WindowHapiStateModule<DebuggingState>
|
38
43
|
[WindowHapiModuleName.language]: WindowHapiStateModule<LanguageState>
|
39
|
-
[WindowHapiModuleName.product]: WindowHapiStateModule<
|
44
|
+
[WindowHapiModuleName.product]: WindowHapiStateModule<
|
45
|
+
ProductState,
|
46
|
+
ProductCacheState
|
47
|
+
>
|
40
48
|
[WindowHapiModuleName.theming]: WindowHapiStateModule<ThemingState>
|
41
49
|
[WindowHapiModuleName.orderJourney]: WindowHapiStateModule<OrderJourneyState>
|
42
50
|
[WindowHapiModuleName.wallet]: WindowHapiStateModule<WalletState>
|
@@ -56,10 +64,16 @@ export type WindowHapiState = WindowHapiModuleWithConstructorArgs<
|
|
56
64
|
[WindowHapiModuleName.alert]: WindowHapiStateModule<AlertState>
|
57
65
|
[WindowHapiModuleName.basket]: WindowHapiStateModule<BasketState>
|
58
66
|
[WindowHapiModuleName.campaign]: WindowHapiStateModule<CampaignState>
|
59
|
-
[WindowHapiModuleName.contract]: WindowHapiStateModule<
|
67
|
+
[WindowHapiModuleName.contract]: WindowHapiStateModule<
|
68
|
+
ContractState,
|
69
|
+
ContractCacheState
|
70
|
+
>
|
60
71
|
[WindowHapiModuleName.debugging]: WindowHapiStateModule<DebuggingState>
|
61
72
|
[WindowHapiModuleName.language]: WindowHapiStateModule<LanguageState>
|
62
|
-
[WindowHapiModuleName.product]: WindowHapiStateModule<
|
73
|
+
[WindowHapiModuleName.product]: WindowHapiStateModule<
|
74
|
+
ProductState,
|
75
|
+
ProductCacheState
|
76
|
+
>
|
63
77
|
[WindowHapiModuleName.theming]: WindowHapiStateModule<ThemingState>
|
64
78
|
[WindowHapiModuleName.orderJourney]: WindowHapiStateModule<OrderJourneyState>
|
65
79
|
[WindowHapiModuleName.wallet]: WindowHapiStateModule<WalletState>
|
@@ -91,12 +105,13 @@ export type WindowHapiStatesJSON = {
|
|
91
105
|
[WindowHapiModuleName.experimental]: ExperimentalState
|
92
106
|
}
|
93
107
|
|
94
|
-
export type WindowHapiStateBase<T> = {
|
108
|
+
export type WindowHapiStateBase<T, CacheType = undefined> = {
|
95
109
|
propertiesThatShouldNotBeDocumented: string[]
|
96
110
|
__elementsStateModuleName: string
|
97
111
|
toJSON: any
|
98
112
|
addClassPropertiesObserver: () => void
|
99
113
|
validations: StateValidations<T>
|
114
|
+
cache: WindowHapiStateModule<CacheType> | undefined
|
100
115
|
}
|
101
116
|
|
102
117
|
export type HapiStateValueWithListener<T> = {
|
@@ -104,7 +119,10 @@ export type HapiStateValueWithListener<T> = {
|
|
104
119
|
value: T
|
105
120
|
}
|
106
121
|
|
107
|
-
export type WindowHapiStateModule<
|
122
|
+
export type WindowHapiStateModule<
|
123
|
+
T,
|
124
|
+
CacheType = undefined,
|
125
|
+
> = WindowHapiStateBase<T, CacheType> & {
|
108
126
|
[P in keyof T]:
|
109
127
|
| T[P]
|
110
128
|
| HapiStateValueWithListener<T[P]>
|
@@ -36,6 +36,16 @@ export type WindowHapiValidations = WindowHapiModuleWithConstructorArgs<
|
|
36
36
|
invalidator?: Function,
|
37
37
|
) => void
|
38
38
|
runSDKEventsValidations: (callback: Function) => void
|
39
|
+
zodRefineRegex: (
|
40
|
+
regex: RegExp,
|
41
|
+
) => readonly [(data: any) => boolean, string]
|
42
|
+
zodRefineArrayOfObjectsUniqueByProperty: <
|
43
|
+
ArrSchema extends z.ZodArray<z.ZodTypeAny, "many">,
|
44
|
+
UniqueVal,
|
45
|
+
>(
|
46
|
+
objAccessor: string,
|
47
|
+
schema: ArrSchema,
|
48
|
+
) => z.ZodEffects<ArrSchema, any[], any[]>
|
39
49
|
},
|
40
50
|
{ readonly core: WindowHapiClassInterface }
|
41
51
|
>
|
package/_window/window.ts
CHANGED
@@ -22,6 +22,7 @@ import {
|
|
22
22
|
} from "../common"
|
23
23
|
import { DebugPanelPosition } from "./config.types"
|
24
24
|
import { ProductPriceCurrency } from "../product/enums"
|
25
|
+
import { CampaignCreateForm } from "../campaign"
|
25
26
|
|
26
27
|
export type WindowHapiModuleWithConstructorArgs<Module, ConstructorArgs> =
|
27
28
|
Module & ConstructorArgs
|
@@ -163,6 +164,7 @@ export type WindowHapiClassInterface = {
|
|
163
164
|
bootstrap: () => Promise<void>
|
164
165
|
logWelcomeMessage: () => void
|
165
166
|
logDirectChargeDraftCampaignNotes: () => void
|
167
|
+
logCampaignWeeklyWorkingMinutesNotes: (form: CampaignCreateForm) => void
|
166
168
|
logDeprecationNotice: () => void
|
167
169
|
logLatestTypesPackageVersion: () => Promise<void>
|
168
170
|
logFeatureBranches: () => Promise<void>
|
package/alert/enums.ts
CHANGED
@@ -16,7 +16,7 @@ export enum AlertKey {
|
|
16
16
|
productAddToBasket = "add-product-to-basket-success",
|
17
17
|
productRemoveFromBasket = "remove-product-from-basket-warning",
|
18
18
|
utmCodeConfirmation = "utm-code-confirmation",
|
19
|
-
|
19
|
+
campaignAISmartfillFailedError = "campaign-ai-smartfill-failed-error",
|
20
20
|
}
|
21
21
|
|
22
22
|
export enum AlertType {
|
package/alert/types.ts
CHANGED
@@ -36,7 +36,7 @@ export type UTMCodesSuccessAlertProps = {
|
|
36
36
|
type: "save" | "reset"
|
37
37
|
}
|
38
38
|
|
39
|
-
export type
|
39
|
+
export type CampaignAISmartfillFailedAlertProps = {}
|
40
40
|
|
41
41
|
export type ButtonCopySuccessAlertProps = {}
|
42
42
|
|
package/ats/types.ts
CHANGED
@@ -21,6 +21,7 @@ import {
|
|
21
21
|
import { PaginatedAPIResponseV2 } from "../common/types"
|
22
22
|
import { WindowHapiModuleWithConstructorArgs } from "../_window"
|
23
23
|
import { AlertKey } from "../alert"
|
24
|
+
import { Modals } from "../modal"
|
24
25
|
|
25
26
|
export type CampaignServiceGetCampaignsHandler = (
|
26
27
|
offset?: number,
|
@@ -99,6 +100,10 @@ export type CampaignServiceGetSuggestionOfVacancyFieldsHandler = (
|
|
99
100
|
|
100
101
|
export type WindowHapiServiceCampaign = WindowHapiModuleWithConstructorArgs<
|
101
102
|
{
|
103
|
+
onAfterCampaignEditModalOpenClose: (
|
104
|
+
currentModals: Modals,
|
105
|
+
previousModals: Modals,
|
106
|
+
) => void
|
102
107
|
getCampaigns: HapiServiceFunctionWithLifecycleHooks<CampaignServiceGetCampaignsHandler>
|
103
108
|
getCampaignsLabeled: HapiServiceFunctionWithLifecycleHooks<CampaignServiceGetCampaignsLabeledHandler>
|
104
109
|
getCampaignDetail: HapiServiceFunctionWithLifecycleHooks<CampaignServiceGetCampaignDetailHandler>
|
package/campaign/types.ts
CHANGED
@@ -63,6 +63,11 @@ export type CampaignPostingDetailsWeeklyWorkingHours = {
|
|
63
63
|
from?: number | null
|
64
64
|
}
|
65
65
|
|
66
|
+
export type CampaignPostingDetailsWeeklyWorkingMinutes = {
|
67
|
+
to: number
|
68
|
+
from?: number | null
|
69
|
+
}
|
70
|
+
|
66
71
|
export type CampaignPostingDetailsWorkingLocation = {
|
67
72
|
addressLine1: string
|
68
73
|
addressLine2: string
|
@@ -82,7 +87,8 @@ export type CampaignPostingDetails = {
|
|
82
87
|
organization: CampaignPostingDetailsOrganization
|
83
88
|
salaryIndication: CampaignPostingDetailsSalaryIndication | null
|
84
89
|
title: string
|
85
|
-
weeklyWorkingHours
|
90
|
+
weeklyWorkingHours?: CampaignPostingDetailsWeeklyWorkingHours
|
91
|
+
weeklyWorkingMinutes?: CampaignPostingDetailsWeeklyWorkingMinutes
|
86
92
|
workingLocation: CampaignPostingDetailsWorkingLocation
|
87
93
|
yearsOfExperience: number
|
88
94
|
}
|
@@ -219,7 +225,8 @@ export type CampaignCreateFormPostingDetails = {
|
|
219
225
|
workingLocation: CampaignPostingDetailsWorkingLocation
|
220
226
|
yearsOfExperience: number
|
221
227
|
employmentType: EmploymentType
|
222
|
-
weeklyWorkingHours
|
228
|
+
weeklyWorkingHours?: CampaignPostingDetailsWeeklyWorkingHours
|
229
|
+
weeklyWorkingMinutes?: CampaignPostingDetailsWeeklyWorkingMinutes
|
223
230
|
salaryIndication: CampaignPostingDetailsSalaryIndication | null
|
224
231
|
contactInfo: CampaignPostingDetailsContactInfo | null
|
225
232
|
jobPageUrl: string
|
package/campaign/utils.types.ts
CHANGED
@@ -28,11 +28,13 @@ import {
|
|
28
28
|
FormFacetsFieldType,
|
29
29
|
PostingRequirement,
|
30
30
|
PostingRequirementLabelsMap,
|
31
|
+
RecursivePartial,
|
31
32
|
TransformedPostingRequirement,
|
32
33
|
} from "../common"
|
33
34
|
|
34
35
|
export type WindowHapiUtilsCampaign = WindowHapiModuleWithConstructorArgs<
|
35
36
|
{
|
37
|
+
excludedDotNotatedObjectPathsOfCampaignFormForSmartFill: string[]
|
36
38
|
getInitialCampaignForm: () => CampaignCreateForm
|
37
39
|
mapCampaignsAndUpdateById: (
|
38
40
|
campaignId: string,
|
@@ -86,6 +88,11 @@ export type WindowHapiUtilsCampaign = WindowHapiModuleWithConstructorArgs<
|
|
86
88
|
getPostingRequirementFormFieldType: (
|
87
89
|
requirement: TransformedPostingRequirement | PostingRequirement,
|
88
90
|
) => FormFacetsFieldType
|
91
|
+
getUpdatedCampaignFormWithSmartFillData: (
|
92
|
+
currentCampaignForm: CampaignCreateForm,
|
93
|
+
prefillData: RecursivePartial<CampaignCreateForm>,
|
94
|
+
excludedDotNotatedObjectPathsOfCampaignForm?: string[],
|
95
|
+
) => CampaignCreateForm
|
89
96
|
},
|
90
97
|
{ readonly utils: WindowHapiUtils }
|
91
98
|
>
|
@@ -63,6 +63,10 @@ export type ZodCampaignPostingDetailsWeeklyWorkingHours = ZodObject<{
|
|
63
63
|
from: ZodOptional<ZodNullable<ZodNumber>>
|
64
64
|
to: ZodNumber
|
65
65
|
}>
|
66
|
+
export type ZodCampaignPostingDetailsWeeklyWorkingMinutes = ZodObject<{
|
67
|
+
from: ZodOptional<ZodNullable<ZodNumber>>
|
68
|
+
to: ZodNumber
|
69
|
+
}>
|
66
70
|
export type ZodCampaignPostingDetailsWorkingLocationPostCodeDefinition = {
|
67
71
|
postCode: ZodOptional<ZodNullable<ZodString>>
|
68
72
|
}
|
@@ -96,7 +100,7 @@ export type ZodCampaignTaxonomySeniority = ZodObject<{
|
|
96
100
|
}>
|
97
101
|
export type ZodCampaignTaxonomySeniorities =
|
98
102
|
ZodArray<ZodCampaignTaxonomySeniority>
|
99
|
-
export type
|
103
|
+
export type ZodCampaignPostingDetailsWithWeeklyWorkingHours = ZodObject<{
|
100
104
|
applicationUrl: ZodString
|
101
105
|
description: ZodString
|
102
106
|
contactInfo: ZodCampaignPostingDetailsContactInfo
|
@@ -109,6 +113,25 @@ export type ZodCampaignPostingDetails = ZodObject<{
|
|
109
113
|
workingLocation: ZodCampaignPostingDetailsWorkingLocation
|
110
114
|
yearsOfExperience: ZodNumber
|
111
115
|
}>
|
116
|
+
export type ZodCampaignPostingDetailsWithWeeklyWorkingMinutes = ZodObject<{
|
117
|
+
applicationUrl: ZodString
|
118
|
+
description: ZodString
|
119
|
+
contactInfo: ZodCampaignPostingDetailsContactInfo
|
120
|
+
employmentType: ZodString
|
121
|
+
jobPageUrl: ZodString
|
122
|
+
organization: ZodCampaignPostingDetailsOrganization
|
123
|
+
salaryIndication: ZodCampaignPostingDetailsSalaryIndication
|
124
|
+
title: ZodString
|
125
|
+
weeklyWorkingMinutes: ZodCampaignPostingDetailsWeeklyWorkingMinutes
|
126
|
+
workingLocation: ZodCampaignPostingDetailsWorkingLocation
|
127
|
+
yearsOfExperience: ZodNumber
|
128
|
+
}>
|
129
|
+
export type ZodCampaignPostingDetails = ZodUnion<
|
130
|
+
[
|
131
|
+
ZodCampaignPostingDetailsWithWeeklyWorkingHours,
|
132
|
+
ZodCampaignPostingDetailsWithWeeklyWorkingMinutes,
|
133
|
+
]
|
134
|
+
>
|
112
135
|
export type ZodCampaignOrderedProductSpec = ZodObject<{
|
113
136
|
contractId: ZodNullable<ZodString>
|
114
137
|
postingRequirements: ZodNullable<ZodObject<any>>
|
@@ -165,18 +188,38 @@ export type ZodCampaignDraftV2 = ZodObject<{
|
|
165
188
|
export type ZodCampaigns = ZodArray<
|
166
189
|
ZodUnion<[ZodCampaign, ZodCampaignDraft, ZodCampaignDraftV2]>
|
167
190
|
>
|
168
|
-
export type
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
191
|
+
export type ZodCampaignCreateFormPostingDetailsWithWeeklyWorkingHours =
|
192
|
+
ZodObject<{
|
193
|
+
title: ZodString
|
194
|
+
description: ZodString
|
195
|
+
organization: ZodCampaignPostingDetailsOrganization
|
196
|
+
workingLocation: ZodObject<ZodCampaignPostingDetailsWorkingLocationAddressDetailsDefinition>
|
197
|
+
yearsOfExperience: ZodNumber
|
198
|
+
employmentType: ZodString
|
199
|
+
weeklyWorkingHours: ZodCampaignPostingDetailsWeeklyWorkingHours
|
200
|
+
salaryIndication: ZodCampaignPostingDetailsSalaryIndication
|
201
|
+
jobPageUrl: ZodString
|
202
|
+
applicationUrl: ZodString
|
203
|
+
}>
|
204
|
+
export type ZodCampaignCreateFormPostingDetailsWithWeeklyWorkingMinutes =
|
205
|
+
ZodObject<{
|
206
|
+
title: ZodString
|
207
|
+
description: ZodString
|
208
|
+
organization: ZodCampaignPostingDetailsOrganization
|
209
|
+
workingLocation: ZodObject<ZodCampaignPostingDetailsWorkingLocationAddressDetailsDefinition>
|
210
|
+
yearsOfExperience: ZodNumber
|
211
|
+
employmentType: ZodString
|
212
|
+
weeklyWorkingMinutes: ZodCampaignPostingDetailsWeeklyWorkingMinutes
|
213
|
+
salaryIndication: ZodCampaignPostingDetailsSalaryIndication
|
214
|
+
jobPageUrl: ZodString
|
215
|
+
applicationUrl: ZodString
|
216
|
+
}>
|
217
|
+
export type ZodCampaignCreateFormPostingDetails = ZodUnion<
|
218
|
+
[
|
219
|
+
ZodCampaignCreateFormPostingDetailsWithWeeklyWorkingHours,
|
220
|
+
ZodCampaignCreateFormPostingDetailsWithWeeklyWorkingMinutes,
|
221
|
+
]
|
222
|
+
>
|
180
223
|
export type ZodCampaignCreateFormTargetGroup = ZodObject<{
|
181
224
|
educationLevel: ZodCampaignTaxonomyEducationLevels
|
182
225
|
seniority: ZodCampaignTaxonomySeniorities
|
package/common/qa.types.ts
CHANGED
@@ -4,7 +4,6 @@ import { WindowHapiModuleWithConstructorArgs } from "../_window"
|
|
4
4
|
export type WindowHapiQACommon = WindowHapiModuleWithConstructorArgs<
|
5
5
|
{
|
6
6
|
setComponentDebuggingIsEnabled: (isEnabled: boolean) => boolean
|
7
|
-
setIsAIFeaturesEnabled: (isEnabled: boolean) => boolean
|
8
7
|
refreshPage: () => void
|
9
8
|
},
|
10
9
|
{ readonly qa: WindowHapiQA }
|
package/common/types.ts
CHANGED
@@ -2,6 +2,7 @@ import validator from "validator"
|
|
2
2
|
import { MessageDescriptor } from "react-intl"
|
3
3
|
import { WindowHapiLogger } from "./logger/types"
|
4
4
|
import { Validators } from "./validator/types"
|
5
|
+
import { ContractDirectApplyPostingRequirementQuestionnaire } from "../contract"
|
5
6
|
|
6
7
|
export type ValueOf<T> = T[keyof T]
|
7
8
|
export type AnyNonFunction<T> = Omit<T, "function">
|
@@ -196,74 +197,6 @@ export type PostingRequirementAutocomplete = {
|
|
196
197
|
parameters_source: PostingRequirementParametersSource | null
|
197
198
|
}
|
198
199
|
|
199
|
-
export type UNSTABLE_PostingRequirementQuestionnaireQuestion = {
|
200
|
-
maxLength?: number
|
201
|
-
minLength?: number
|
202
|
-
maxQuestions?: number
|
203
|
-
htmlAllowed?: string
|
204
|
-
}
|
205
|
-
|
206
|
-
export type UNSTABLE_PostingRequirementQuestionnaireClosedQuestionItem = {
|
207
|
-
maxLength: number
|
208
|
-
minLength: number
|
209
|
-
}
|
210
|
-
|
211
|
-
export type UNSTABLE_PostingRequirementQuestionnaireClosedQuestionItems = {
|
212
|
-
item: UNSTABLE_PostingRequirementQuestionnaireClosedQuestionItem[]
|
213
|
-
maxOccurs: number
|
214
|
-
minOccurs: number
|
215
|
-
}
|
216
|
-
|
217
|
-
export type UNSTABLE_PostingRequirementQuestionnaireText = {
|
218
|
-
limit?: number
|
219
|
-
formats?: string
|
220
|
-
min?: string
|
221
|
-
max?: string
|
222
|
-
question: UNSTABLE_PostingRequirementQuestionnaireQuestion
|
223
|
-
}
|
224
|
-
|
225
|
-
export type UNSTABLE_PostingRequirementQuestionnaireClosedQuestion = {
|
226
|
-
items: UNSTABLE_PostingRequirementQuestionnaireClosedQuestionItems
|
227
|
-
question: UNSTABLE_PostingRequirementQuestionnaireQuestion
|
228
|
-
}
|
229
|
-
|
230
|
-
export type UNSTABLE_PostingRequirementQuestionnaireSettings = {
|
231
|
-
ordered: boolean
|
232
|
-
editable: boolean
|
233
|
-
maxQuestions: number
|
234
|
-
maxOpenQuestions: number
|
235
|
-
supportsRequired: boolean
|
236
|
-
maxClosedQuestions: number
|
237
|
-
supportsConditions: boolean
|
238
|
-
}
|
239
|
-
|
240
|
-
export type UNSTABLE_PostingRequirementQuestionnaire = {
|
241
|
-
types: UNSTABLE_PostingRequirementQuestionnaireType[]
|
242
|
-
text?: UNSTABLE_PostingRequirementQuestionnaireText
|
243
|
-
choice?: UNSTABLE_PostingRequirementQuestionnaireClosedQuestion
|
244
|
-
"multi-choice"?: UNSTABLE_PostingRequirementQuestionnaireClosedQuestion
|
245
|
-
hier?: UNSTABLE_PostingRequirementQuestionnaireClosedQuestion
|
246
|
-
questionnaire: UNSTABLE_PostingRequirementQuestionnaireSettings
|
247
|
-
}
|
248
|
-
export type UNSTABLE_PostingRequirementQuestionnaireType =
|
249
|
-
| "text"
|
250
|
-
| "choice"
|
251
|
-
| "multi-choice"
|
252
|
-
| "textarea"
|
253
|
-
| "page-break"
|
254
|
-
| "date"
|
255
|
-
| "file"
|
256
|
-
| "hier"
|
257
|
-
| "information"
|
258
|
-
|
259
|
-
export type UNSTABLE_PostingRequirementQuestionnaireQuestionBodyToStringify = {
|
260
|
-
id: string
|
261
|
-
question: string
|
262
|
-
type: UNSTABLE_PostingRequirementQuestionnaireType
|
263
|
-
is_required: boolean
|
264
|
-
answers: { answer: string }[]
|
265
|
-
}
|
266
|
-
|
267
200
|
export type PostingRequirement = {
|
268
201
|
name: string
|
269
202
|
label: string
|
@@ -271,7 +204,7 @@ export type PostingRequirement = {
|
|
271
204
|
display_rules: PostingRequirementDisplayRule | null
|
272
205
|
autocomplete: PostingRequirementAutocomplete | null
|
273
206
|
options: PostingRequirementOption[] | null
|
274
|
-
questionnaire
|
207
|
+
questionnaire?: ContractDirectApplyPostingRequirementQuestionnaire | null
|
275
208
|
primary_taxonomy?: string | null
|
276
209
|
message?: string | null
|
277
210
|
required: boolean
|
@@ -307,6 +240,7 @@ export type PostingRequirementOptionDataImage = {
|
|
307
240
|
}
|
308
241
|
export type PostingRequirementOptionData = {
|
309
242
|
description?: string
|
243
|
+
selected?: boolean
|
310
244
|
images?: PostingRequirementOptionDataImage[]
|
311
245
|
}
|
312
246
|
export type TransformedPostingRequirementOption = {
|
@@ -358,3 +292,5 @@ export type HapiFeatureBranch = {
|
|
358
292
|
releaseDate: string
|
359
293
|
}
|
360
294
|
export type FlattenedItem = { label: string; value: any }
|
295
|
+
|
296
|
+
export type StringifiedJSON<T> = string
|
@@ -3,6 +3,7 @@ import {
|
|
3
3
|
ZodArray,
|
4
4
|
ZodBoolean,
|
5
5
|
ZodFunction,
|
6
|
+
ZodMap,
|
6
7
|
ZodNullable,
|
7
8
|
ZodNumber,
|
8
9
|
ZodObject,
|
@@ -63,6 +64,7 @@ export type WindowHapiValidationsCommon = {
|
|
63
64
|
genericString: ZodString
|
64
65
|
genericStringArray: ZodArray<ZodString>
|
65
66
|
genericObject: ZodObject<any>
|
67
|
+
genericMap: ZodMap<any, any>
|
66
68
|
genericRecordFunction: ZodRecord<
|
67
69
|
ZodString,
|
68
70
|
ZodFunction<ZodTuple<[], ZodUnknown>, ZodUnknown>
|
@@ -0,0 +1,39 @@
|
|
1
|
+
export enum ContractDirectApplyChannelName {
|
2
|
+
SEEK_AUSTRALIA = "seekAustralia",
|
3
|
+
INFOJOBS_SPAIN = "infoJobsSpain",
|
4
|
+
}
|
5
|
+
|
6
|
+
export enum ContractDirectApplyPostingRequirementQuestionnaireType {
|
7
|
+
TEXT = "text",
|
8
|
+
CHOICE = "choice",
|
9
|
+
MULTI_CHOICE = "multi-choice",
|
10
|
+
}
|
11
|
+
|
12
|
+
export enum ContractDirectApplyPostingRequirementQuestionnaireLengthRule {
|
13
|
+
MAX_LENGTH = "maxLength",
|
14
|
+
MIN_LENGTH = "minLength",
|
15
|
+
}
|
16
|
+
|
17
|
+
export enum ContractDirectApplyPostingRequirementQuestionnaireOccursRule {
|
18
|
+
MAX_OCCURS = "maxOccurs",
|
19
|
+
MIN_OCCURS = "minOccurs",
|
20
|
+
}
|
21
|
+
|
22
|
+
export enum ContractDirectApplyPostingRequirementQuestionnaireQuestionCommonRule {
|
23
|
+
MAX_QUESTIONS = "maxQuestions",
|
24
|
+
HTML_ALLOWED = "htmlAllowed",
|
25
|
+
}
|
26
|
+
|
27
|
+
export enum ContractDirectApplyPostingRequirementQuestionnaireValidationWarningCode {
|
28
|
+
CLOSED_QUESTION_ANSWER_MIN_LENGTH_WARNING = "closedQuestionAnswerMinLengthWarning",
|
29
|
+
CLOSED_QUESTION_ANSWER_MAX_LENGTH_WARNING = "closedQuestionAnswerMaxLengthWarning",
|
30
|
+
CLOSED_QUESTIONS_MAX_WARNING = "closedQuestionsMaxWarning",
|
31
|
+
CLOSED_QUESTION_ANSWER_MAX_OCCURS_WARNING = "closedQuestionAnswerMaxOccursWarning",
|
32
|
+
CLOSED_QUESTION_ANSWER_MIN_OCCURS_WARNING = "closedQuestionAnswerMinOccursWarning",
|
33
|
+
CLOSED_QUESTION_NO_VALID_ANSWERS_WARNING = "closedQuestionNoValidAnswersWarning",
|
34
|
+
CLOSED_QUESTION_SOME_ANSWERS_ARE_INVALID_WARNING = "closedQuestionSomeAnswersAreInvalidWarning",
|
35
|
+
OPEN_QUESTIONS_MAX_WARNING = "openQuestionsMaxWarning",
|
36
|
+
QUESTION_MIN_LENGTH_WARNING = "questionMinLengthWarning",
|
37
|
+
QUESTION_MAX_LENGTH_WARNING = "questionMaxLengthWarning",
|
38
|
+
QUESTIONS_MAX_TOTAL_WARNING = "questionsTotalMaxWarning",
|
39
|
+
}
|
package/contract/index.ts
CHANGED
@@ -1,9 +1,10 @@
|
|
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"
|
10
|
+
export * from "./enums"
|
@@ -3,42 +3,114 @@ import {
|
|
3
3
|
WindowHapiService,
|
4
4
|
} from "../_window/service.types"
|
5
5
|
import { OrderJourneyStepKey } from "../orderJourney/enums"
|
6
|
-
import {
|
6
|
+
import {
|
7
|
+
Contract,
|
8
|
+
ContractCredential,
|
9
|
+
ContractDirectApplyChannelPrefillVariablesMap,
|
10
|
+
ContractGroup,
|
11
|
+
ContractDirectApplyPostingRequirementQuestionnaireQuestionBody,
|
12
|
+
ContractDirectApplyPostingRequirementQuestionnaireRules,
|
13
|
+
ContractDirectApplyPostingRequirementQuestionnaireQuestionIgnoreReason,
|
14
|
+
} from "./types"
|
7
15
|
import {
|
8
16
|
PaginatedAPIResponseV1,
|
17
|
+
PostingRequirementOption,
|
9
18
|
PostingRequirementsAutocompleteRequestOption,
|
19
|
+
TransformedPostingRequirement,
|
10
20
|
} from "../common/types"
|
11
21
|
import { WindowHapiModuleWithConstructorArgs } from "../_window"
|
22
|
+
import { Modals } from "../modal"
|
23
|
+
import { ContractDirectApplyChannelName } from "./enums"
|
24
|
+
import { ProductSupportingContractsComplete } from "../product"
|
25
|
+
import { OrderJourneyChannelPostingRequirementsStepOptions } from "../orderJourney"
|
12
26
|
|
13
27
|
export type ContractServiceGetContractPostingRequirementOptionsHandler = (
|
14
28
|
contractId: string,
|
15
29
|
fieldName: string,
|
16
30
|
autocompleteRequestOptions: PostingRequirementsAutocompleteRequestOption[],
|
17
|
-
) => Promise<
|
31
|
+
) => Promise<PostingRequirementOption[]>
|
32
|
+
|
18
33
|
export type ContractServiceGetContractsHandler = (
|
19
34
|
offset: number,
|
20
35
|
) => Promise<PaginatedAPIResponseV1<Contract>>
|
36
|
+
|
21
37
|
export type ContractServiceGetContractGroupsHandler = () => Promise<
|
22
38
|
ContractGroup[]
|
23
39
|
>
|
40
|
+
|
24
41
|
export type ContractServiceGetContractsLabeledHandler = (
|
25
42
|
offset?: number,
|
26
43
|
limit?: number,
|
27
44
|
labels?: Record<string, string> | null,
|
28
45
|
) => Promise<PaginatedAPIResponseV1<Contract>>
|
46
|
+
|
29
47
|
export type ContractServiceCreateContractHandler = () => Promise<Contract>
|
48
|
+
|
30
49
|
export type ContractServiceSaveContractHandler = () => Promise<Contract>
|
50
|
+
|
31
51
|
export type ContractServiceRemoveContractHandler = (
|
32
52
|
contractId: string,
|
33
53
|
) => Promise<void>
|
54
|
+
|
34
55
|
export type ContractServiceCreateContractGroupHandler =
|
35
56
|
() => Promise<ContractGroup>
|
57
|
+
|
36
58
|
export type ContractServiceGetContractHandler = (
|
37
59
|
id: string,
|
38
60
|
) => Promise<Contract>
|
39
61
|
|
62
|
+
export type ContractServiceGetContractChannelPostingRequirementQuestionnaireRulesForDirectApplyResponse =
|
63
|
+
{
|
64
|
+
rules: ContractDirectApplyPostingRequirementQuestionnaireRules
|
65
|
+
directApplyVariables: ContractDirectApplyChannelPrefillVariablesMap
|
66
|
+
questionnairePostingRequirement: TransformedPostingRequirement
|
67
|
+
contractInBasket: Contract
|
68
|
+
}
|
69
|
+
|
70
|
+
export type ContractServiceGetContractChannelPostingRequirementQuestionnaireBodyForDirectApplyResponse =
|
71
|
+
{
|
72
|
+
hasIgnoredQuestions: boolean
|
73
|
+
ignoredQuestionDetails: ContractDirectApplyPostingRequirementQuestionnaireQuestionIgnoreReason[]
|
74
|
+
validQuestions: ContractDirectApplyPostingRequirementQuestionnaireQuestionBody[]
|
75
|
+
} & ContractServiceGetContractChannelPostingRequirementQuestionnaireRulesForDirectApplyResponse
|
76
|
+
|
77
|
+
export type ContractServicePrefillContractChannelPostingRequirementQuestionnaireForDirectApplyHandler =
|
78
|
+
(
|
79
|
+
channelName: ContractDirectApplyChannelName,
|
80
|
+
questionsBody: ContractDirectApplyPostingRequirementQuestionnaireQuestionBody[],
|
81
|
+
) => Promise<true>
|
82
|
+
|
83
|
+
export type ContractServiceSetContractChannelPostingRequirementQuestionnaireOptionsDirectApplyHandler =
|
84
|
+
(
|
85
|
+
channelName: ContractDirectApplyChannelName,
|
86
|
+
partialOptions: OrderJourneyChannelPostingRequirementsStepOptions,
|
87
|
+
) => Promise<void>
|
88
|
+
|
89
|
+
export type ContractServiceGetContractChannelPostingRequirementQuestionnaireBodyForDirectApplyHandler =
|
90
|
+
(
|
91
|
+
channelName: ContractDirectApplyChannelName,
|
92
|
+
questionsBody: ContractDirectApplyPostingRequirementQuestionnaireQuestionBody[],
|
93
|
+
) => Promise<ContractServiceGetContractChannelPostingRequirementQuestionnaireBodyForDirectApplyResponse>
|
94
|
+
|
95
|
+
export type ContractServiceGetContractChannelPostingRequirementQuestionnaireRulesForDirectApplyHandler =
|
96
|
+
(
|
97
|
+
channelName: ContractDirectApplyChannelName,
|
98
|
+
) => Promise<ContractServiceGetContractChannelPostingRequirementQuestionnaireRulesForDirectApplyResponse>
|
99
|
+
|
100
|
+
export type ContractServiceGetContractPostingRequirementOptionsFromCacheOrAPIHandler =
|
101
|
+
(
|
102
|
+
contractId: string,
|
103
|
+
fieldName: string,
|
104
|
+
autocompleteRequestOptions: PostingRequirementsAutocompleteRequestOption[],
|
105
|
+
forceRefresh?: boolean,
|
106
|
+
) => Promise<PostingRequirementOption[]>
|
107
|
+
|
40
108
|
export type WindowHapiServiceContract = WindowHapiModuleWithConstructorArgs<
|
41
109
|
{
|
110
|
+
onAfterContractEditModalOpenClose: (
|
111
|
+
currentModals: Modals,
|
112
|
+
previousModals: Modals,
|
113
|
+
) => void
|
42
114
|
getContractPostingRequirementOptions: HapiServiceFunctionWithLifecycleHooks<ContractServiceGetContractPostingRequirementOptionsHandler>
|
43
115
|
getContractsLabeled: HapiServiceFunctionWithLifecycleHooks<ContractServiceGetContractsLabeledHandler>
|
44
116
|
getContracts: HapiServiceFunctionWithLifecycleHooks<ContractServiceGetContractsHandler>
|
@@ -48,6 +120,11 @@ export type WindowHapiServiceContract = WindowHapiModuleWithConstructorArgs<
|
|
48
120
|
saveContract: HapiServiceFunctionWithLifecycleHooks<ContractServiceSaveContractHandler>
|
49
121
|
createContractGroup: HapiServiceFunctionWithLifecycleHooks<ContractServiceCreateContractGroupHandler>
|
50
122
|
getContract: HapiServiceFunctionWithLifecycleHooks<ContractServiceGetContractHandler>
|
123
|
+
prefillContractChannelPostingRequirementQuestionnaireForDirectApply: HapiServiceFunctionWithLifecycleHooks<ContractServicePrefillContractChannelPostingRequirementQuestionnaireForDirectApplyHandler>
|
124
|
+
getContractChannelPostingRequirementQuestionnaireBodyForDirectApply: HapiServiceFunctionWithLifecycleHooks<ContractServiceGetContractChannelPostingRequirementQuestionnaireBodyForDirectApplyHandler>
|
125
|
+
getContractChannelPostingRequirementQuestionnaireRulesForDirectApply: HapiServiceFunctionWithLifecycleHooks<ContractServiceGetContractChannelPostingRequirementQuestionnaireRulesForDirectApplyHandler>
|
126
|
+
setContractChannelPostingRequirementQuestionnaireOptionsDirectApply: HapiServiceFunctionWithLifecycleHooks<ContractServiceSetContractChannelPostingRequirementQuestionnaireOptionsDirectApplyHandler>
|
127
|
+
getContractPostingRequirementOptionsFromCacheOrAPI: HapiServiceFunctionWithLifecycleHooks<ContractServiceGetContractPostingRequirementOptionsFromCacheOrAPIHandler>
|
51
128
|
initiateOauthLogin: (
|
52
129
|
contractId: string | number,
|
53
130
|
orderJourneyStepActive: OrderJourneyStepKey,
|
package/contract/types.ts
CHANGED
@@ -1,4 +1,18 @@
|
|
1
1
|
import { ProductLogos, ProductType } from "../product/types"
|
2
|
+
import {
|
3
|
+
Facet,
|
4
|
+
PostingRequirement,
|
5
|
+
PostingRequirementLabelsMap,
|
6
|
+
PostingRequirementsAutocompleteRequestOption,
|
7
|
+
StringifiedJSON,
|
8
|
+
} from "../common"
|
9
|
+
import {
|
10
|
+
ContractDirectApplyPostingRequirementQuestionnaireLengthRule,
|
11
|
+
ContractDirectApplyPostingRequirementQuestionnaireOccursRule,
|
12
|
+
ContractDirectApplyPostingRequirementQuestionnaireQuestionCommonRule,
|
13
|
+
ContractDirectApplyPostingRequirementQuestionnaireType,
|
14
|
+
ContractDirectApplyPostingRequirementQuestionnaireValidationWarningCode,
|
15
|
+
} from "./enums"
|
2
16
|
|
3
17
|
export type ContractProduct = {
|
4
18
|
product_id: string
|
@@ -68,6 +82,16 @@ export type Contract = {
|
|
68
82
|
group: ContractGroup | null
|
69
83
|
posting_requirements_defaults: Record<string, string | string[]> | null
|
70
84
|
errors?: string[]
|
85
|
+
} & ContractDetails
|
86
|
+
|
87
|
+
export type ContractDetails = {
|
88
|
+
contract_credentials: ContractCredential[]
|
89
|
+
contract_facets?: Facet[]
|
90
|
+
feed_url: string | null
|
91
|
+
manual_setup_required: boolean
|
92
|
+
posting_requirements: PostingRequirement[]
|
93
|
+
posting_requirements_labels: PostingRequirementLabelsMap
|
94
|
+
setup_instructions: string //html;
|
71
95
|
}
|
72
96
|
|
73
97
|
export type ContractGroup = {
|
@@ -78,3 +102,171 @@ export type ContractGroup = {
|
|
78
102
|
}
|
79
103
|
|
80
104
|
export type ContractGroupSelected = ContractGroup | "add-new" | null
|
105
|
+
|
106
|
+
export type ContractDirectApplyChannelPrefillVariablesMap = {
|
107
|
+
id: number
|
108
|
+
applyMethodPostingRequirementName: string
|
109
|
+
applyMethodDirectApplyOptionKey: string
|
110
|
+
questionnairePostingRequirementName: string
|
111
|
+
}
|
112
|
+
export type ContractDirectApplyPostingRequirementQuestionnaireOpenQuestionType =
|
113
|
+
ContractDirectApplyPostingRequirementQuestionnaireType.TEXT
|
114
|
+
|
115
|
+
export type ContractDirectApplyPostingRequirementQuestionnaireClosedQuestionType =
|
116
|
+
|
117
|
+
| ContractDirectApplyPostingRequirementQuestionnaireType.CHOICE
|
118
|
+
| ContractDirectApplyPostingRequirementQuestionnaireType.MULTI_CHOICE
|
119
|
+
|
120
|
+
export type ContractDirectApplyPostingRequirementQuestionnaireQuestion = {
|
121
|
+
[ContractDirectApplyPostingRequirementQuestionnaireLengthRule.MAX_LENGTH]?: number
|
122
|
+
[ContractDirectApplyPostingRequirementQuestionnaireLengthRule.MIN_LENGTH]?: number
|
123
|
+
[ContractDirectApplyPostingRequirementQuestionnaireQuestionCommonRule.MAX_QUESTIONS]?: number
|
124
|
+
[ContractDirectApplyPostingRequirementQuestionnaireQuestionCommonRule.HTML_ALLOWED]?: string
|
125
|
+
}
|
126
|
+
|
127
|
+
export type ContractDirectApplyPostingRequirementQuestionnaireClosedQuestionItem =
|
128
|
+
{
|
129
|
+
[ContractDirectApplyPostingRequirementQuestionnaireLengthRule.MAX_LENGTH]: number
|
130
|
+
[ContractDirectApplyPostingRequirementQuestionnaireLengthRule.MIN_LENGTH]: number
|
131
|
+
}
|
132
|
+
|
133
|
+
export type ContractDirectApplyPostingRequirementQuestionnaireClosedQuestionItems =
|
134
|
+
{
|
135
|
+
item: ContractDirectApplyPostingRequirementQuestionnaireClosedQuestionItem[]
|
136
|
+
[ContractDirectApplyPostingRequirementQuestionnaireOccursRule.MAX_OCCURS]: number
|
137
|
+
[ContractDirectApplyPostingRequirementQuestionnaireOccursRule.MIN_OCCURS]: number
|
138
|
+
}
|
139
|
+
|
140
|
+
export type ContractDirectApplyPostingRequirementQuestionnaireText = {
|
141
|
+
limit?: number
|
142
|
+
formats?: string
|
143
|
+
min?: string
|
144
|
+
max?: string
|
145
|
+
question: ContractDirectApplyPostingRequirementQuestionnaireQuestion
|
146
|
+
}
|
147
|
+
|
148
|
+
export type ContractDirectApplyPostingRequirementQuestionnaireClosedQuestion = {
|
149
|
+
items: ContractDirectApplyPostingRequirementQuestionnaireClosedQuestionItems
|
150
|
+
question: ContractDirectApplyPostingRequirementQuestionnaireQuestion
|
151
|
+
}
|
152
|
+
|
153
|
+
export type ContractDirectApplyPostingRequirementQuestionnaireSettings = {
|
154
|
+
ordered: boolean
|
155
|
+
editable: boolean
|
156
|
+
maxQuestions: number
|
157
|
+
maxOpenQuestions?: number
|
158
|
+
maxClosedQuestions?: number
|
159
|
+
supportsRequired: boolean
|
160
|
+
supportsConditions: boolean
|
161
|
+
}
|
162
|
+
|
163
|
+
export type ContractDirectApplyPostingRequirementQuestionnaire = {
|
164
|
+
types: ContractDirectApplyPostingRequirementQuestionnaireType[]
|
165
|
+
text?: ContractDirectApplyPostingRequirementQuestionnaireText
|
166
|
+
choice?: ContractDirectApplyPostingRequirementQuestionnaireClosedQuestion
|
167
|
+
"multi-choice"?: ContractDirectApplyPostingRequirementQuestionnaireClosedQuestion
|
168
|
+
questionnaire: ContractDirectApplyPostingRequirementQuestionnaireSettings
|
169
|
+
}
|
170
|
+
|
171
|
+
export type ContractDirectApplyPostingRequirementQuestionnaireClosedQuestionAnswer =
|
172
|
+
{
|
173
|
+
id: string
|
174
|
+
answer: string
|
175
|
+
}
|
176
|
+
|
177
|
+
export type ContractDirectApplyPostingRequirementQuestionnaireCommonQuestionBody =
|
178
|
+
{
|
179
|
+
id: string
|
180
|
+
question: string
|
181
|
+
is_required?: boolean
|
182
|
+
}
|
183
|
+
|
184
|
+
export type ContractDirectApplyPostingRequirementQuestionnaireOpenQuestionBody =
|
185
|
+
{
|
186
|
+
type: ContractDirectApplyPostingRequirementQuestionnaireOpenQuestionType
|
187
|
+
} & ContractDirectApplyPostingRequirementQuestionnaireCommonQuestionBody
|
188
|
+
|
189
|
+
export type ContractDirectApplyPostingRequirementQuestionnaireClosedQuestionBody =
|
190
|
+
{
|
191
|
+
type: ContractDirectApplyPostingRequirementQuestionnaireClosedQuestionType
|
192
|
+
answers: ContractDirectApplyPostingRequirementQuestionnaireClosedQuestionAnswer[]
|
193
|
+
} & ContractDirectApplyPostingRequirementQuestionnaireCommonQuestionBody
|
194
|
+
|
195
|
+
export type ContractDirectApplyPostingRequirementQuestionnaireQuestionBody =
|
196
|
+
| ContractDirectApplyPostingRequirementQuestionnaireOpenQuestionBody
|
197
|
+
| ContractDirectApplyPostingRequirementQuestionnaireClosedQuestionBody
|
198
|
+
|
199
|
+
export type ContractDirectApplyPostingRequirementQuestionnaireRules = {
|
200
|
+
types: ContractDirectApplyPostingRequirementQuestionnaireType[]
|
201
|
+
generalRules:
|
202
|
+
| ContractDirectApplyPostingRequirementQuestionnaireSettings
|
203
|
+
| undefined
|
204
|
+
textRules:
|
205
|
+
| ContractDirectApplyPostingRequirementQuestionnaireText
|
206
|
+
| undefined
|
207
|
+
choiceRules:
|
208
|
+
| ContractDirectApplyPostingRequirementQuestionnaireClosedQuestion
|
209
|
+
| undefined
|
210
|
+
multiChoiceRules:
|
211
|
+
| ContractDirectApplyPostingRequirementQuestionnaireClosedQuestion
|
212
|
+
| undefined
|
213
|
+
maxQuestionsRule: number | undefined
|
214
|
+
maxOpenQuestionsRule: number | undefined
|
215
|
+
maxClosedQuestionsRule: number | undefined
|
216
|
+
supportsRequiredRule: boolean | undefined
|
217
|
+
textQuestionMaxLengthRule: number | undefined
|
218
|
+
textQuestionMinLengthRule: number | undefined
|
219
|
+
choiceQuestionMaxLengthRule: number | undefined
|
220
|
+
choiceQuestionMinLengthRule: number | undefined
|
221
|
+
multiChoiceQuestionMaxLengthRule: number | undefined
|
222
|
+
multiChoiceQuestionMinLengthRule: number | undefined
|
223
|
+
getChoiceItemOccursRule: (
|
224
|
+
type: ContractDirectApplyPostingRequirementQuestionnaireClosedQuestionType,
|
225
|
+
rule: ContractDirectApplyPostingRequirementQuestionnaireOccursRule,
|
226
|
+
) => number | undefined
|
227
|
+
getQuestionLengthRule: (
|
228
|
+
type: ContractDirectApplyPostingRequirementQuestionnaireType,
|
229
|
+
rule: ContractDirectApplyPostingRequirementQuestionnaireLengthRule,
|
230
|
+
) => number | undefined
|
231
|
+
choiceItemMaxLengthRule: number | undefined
|
232
|
+
choiceItemMinLengthRule: number | undefined
|
233
|
+
multiChoiceItemMaxLengthRule: number | undefined
|
234
|
+
multiChoiceItemMinLengthRule: number | undefined
|
235
|
+
getChoiceOrMultiChoiceItemLengthRule: (
|
236
|
+
type: ContractDirectApplyPostingRequirementQuestionnaireClosedQuestionType,
|
237
|
+
rule: ContractDirectApplyPostingRequirementQuestionnaireLengthRule,
|
238
|
+
) => number | undefined
|
239
|
+
}
|
240
|
+
|
241
|
+
export type ContractDirectApplyPostingRequirementQuestionnaireQuestionValidationError =
|
242
|
+
{
|
243
|
+
code: ContractDirectApplyPostingRequirementQuestionnaireValidationWarningCode
|
244
|
+
message: string
|
245
|
+
data: Record<string, any>
|
246
|
+
}
|
247
|
+
|
248
|
+
export type ContractDirectApplyPostingRequirementQuestionnaireQuestionIgnoreReason =
|
249
|
+
{
|
250
|
+
question: ContractDirectApplyPostingRequirementQuestionnaireQuestionBody
|
251
|
+
ignoreReasons: ContractDirectApplyPostingRequirementQuestionnaireQuestionValidationError[]
|
252
|
+
}
|
253
|
+
|
254
|
+
export type ContractDirectApplyPostingRequirementQuestionnaireQuestionAnswerIgnoreReason =
|
255
|
+
{
|
256
|
+
answer: ContractDirectApplyPostingRequirementQuestionnaireClosedQuestionAnswer
|
257
|
+
ignoreReasons: ContractDirectApplyPostingRequirementQuestionnaireQuestionValidationError[]
|
258
|
+
}
|
259
|
+
|
260
|
+
export type ContractPostingRequirementsOptionsPayload = [
|
261
|
+
string | number, // argument 1 of fn ContractServiceGetContractPostingRequirementOptionsFromCacheOrAPIHandler
|
262
|
+
string, // argument 2 of fn ContractServiceGetContractPostingRequirementOptionsFromCacheOrAPIHandler
|
263
|
+
PostingRequirementsAutocompleteRequestOption[], // argument 3 of fn ContractServiceGetContractPostingRequirementOptionsFromCacheOrAPIHandler
|
264
|
+
]
|
265
|
+
export type ContractPostingRequirementsOptionsMapState = {
|
266
|
+
isLoading: boolean
|
267
|
+
data: any | null
|
268
|
+
}
|
269
|
+
export type ContractProductsSupportingContractsMap = Map<
|
270
|
+
StringifiedJSON<ContractPostingRequirementsOptionsPayload>,
|
271
|
+
ContractPostingRequirementsOptionsMapState
|
272
|
+
>
|
package/contract/utils.types.ts
CHANGED
@@ -1,9 +1,24 @@
|
|
1
|
-
import {
|
1
|
+
import {
|
2
|
+
Contract,
|
3
|
+
ContractDirectApplyChannelPrefillVariablesMap,
|
4
|
+
ContractCreateForm,
|
5
|
+
ContractGroupCreateForm,
|
6
|
+
} from "./types"
|
2
7
|
import { WindowHapiUtils } from "../_window/utils.types"
|
3
8
|
import { WindowHapiModuleWithConstructorArgs } from "../_window"
|
9
|
+
import {
|
10
|
+
ContractDirectApplyChannelName,
|
11
|
+
ContractDirectApplyPostingRequirementQuestionnaireValidationWarningCode,
|
12
|
+
} from "./enums"
|
4
13
|
|
5
14
|
export type WindowHapiUtilsContract = WindowHapiModuleWithConstructorArgs<
|
6
15
|
{
|
16
|
+
directApplyChannelName: typeof ContractDirectApplyChannelName
|
17
|
+
directApplyPrefillVariablesMap: Record<
|
18
|
+
ContractDirectApplyChannelName,
|
19
|
+
ContractDirectApplyChannelPrefillVariablesMap
|
20
|
+
>
|
21
|
+
directApplyIgnoreReasonWarning: typeof ContractDirectApplyPostingRequirementQuestionnaireValidationWarningCode
|
7
22
|
getInitialContractForm: () => ContractCreateForm
|
8
23
|
getInitialGroupForm: () => ContractGroupCreateForm
|
9
24
|
getContractNameWithGroupSuffix: (contract: Contract) => string
|
package/debugging/state.types.ts
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
import { OrderJourneyPaymentMethod, OrderJourneyStepKey } from "./enums"
|
2
2
|
import {
|
3
|
+
OrderJourneyChannelPostingRequirementsStepData,
|
4
|
+
OrderJourneyChannelPostingRequirementsStepOptions,
|
3
5
|
OrderJourneyContractStep,
|
4
6
|
OrderJourneyOrderConfirmationStepData,
|
5
7
|
OrderJourneyOrderErrors,
|
@@ -112,9 +114,15 @@ export type OrderJourneyState = {
|
|
112
114
|
Record<string, MessageDescriptor | MessageDescriptor[]>
|
113
115
|
>
|
114
116
|
contractStepsValidators: Record<string, Record<string, NestedValidatorKeys>>
|
115
|
-
contractStepsData: Record<
|
117
|
+
contractStepsData: Record<
|
118
|
+
string,
|
119
|
+
Record<string, OrderJourneyChannelPostingRequirementsStepData>
|
120
|
+
>
|
121
|
+
contractStepsOptions: Record<
|
122
|
+
string,
|
123
|
+
Record<string, OrderJourneyChannelPostingRequirementsStepOptions>
|
124
|
+
>
|
116
125
|
contractStepsValidations: Record<string, UseValidatorResult> | null
|
117
|
-
|
118
126
|
/* UTM Codes */
|
119
127
|
utmCodesStep: OrderJourneyStep
|
120
128
|
utmCodesStepData: OrderJourneyUTMStepData
|
package/orderJourney/types.ts
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
import { MessageDescriptor } from "react-intl"
|
2
2
|
import { OrderJourneyStepKey } from "./enums"
|
3
|
-
import {
|
3
|
+
import {
|
4
|
+
PostingRequirementOption,
|
5
|
+
TransformedPostingRequirementOption,
|
6
|
+
UseValidatorResult,
|
7
|
+
} from "../common"
|
4
8
|
import { OrderJourneyProductStep } from "../experimental"
|
5
9
|
|
6
10
|
export type OrderJourneyStepBlurredFields = {
|
@@ -140,6 +144,16 @@ export type OrderJourneyOrderErrorsPostingDetailsBaseSalaryIndicationV2 = {
|
|
140
144
|
}
|
141
145
|
}
|
142
146
|
|
147
|
+
export type OrderJourneyOrderErrorsPostingDetailsWeeklyWorkingHours = {
|
148
|
+
from?: string[]
|
149
|
+
to?: string[]
|
150
|
+
}
|
151
|
+
|
152
|
+
export type OrderJourneyOrderErrorsPostingDetailsWeeklyWorkingMinutes = {
|
153
|
+
from?: string[]
|
154
|
+
to?: string[]
|
155
|
+
}
|
156
|
+
|
143
157
|
export type OrderJourneyOrderErrorsPostingDetailsBase = {
|
144
158
|
title?: string[]
|
145
159
|
description?: string[]
|
@@ -147,10 +161,8 @@ export type OrderJourneyOrderErrorsPostingDetailsBase = {
|
|
147
161
|
salaryIndication?:
|
148
162
|
| OrderJourneyOrderErrorsPostingDetailsBaseSalaryIndicationV1
|
149
163
|
| OrderJourneyOrderErrorsPostingDetailsBaseSalaryIndicationV2
|
150
|
-
weeklyWorkingHours?:
|
151
|
-
|
152
|
-
to?: string[]
|
153
|
-
}
|
164
|
+
weeklyWorkingHours?: OrderJourneyOrderErrorsPostingDetailsWeeklyWorkingHours
|
165
|
+
weeklyWorkingMinutes?: OrderJourneyOrderErrorsPostingDetailsWeeklyWorkingMinutes
|
154
166
|
}
|
155
167
|
|
156
168
|
export type OrderJourneyOrderErrorsPostingDetails =
|
@@ -236,3 +248,12 @@ export type OrderReviewAccordionKeys = Exclude<
|
|
236
248
|
| OrderJourneyStepKey.orderConfirmation
|
237
249
|
| OrderJourneyStepKey.paymentMethod
|
238
250
|
>
|
251
|
+
|
252
|
+
export type OrderJourneyChannelPostingRequirementsStepData =
|
253
|
+
| TransformedPostingRequirementOption
|
254
|
+
| string
|
255
|
+
| number
|
256
|
+
|
257
|
+
export type OrderJourneyChannelPostingRequirementsStepOptions = {
|
258
|
+
shouldShowQuestionEditingTool?: boolean
|
259
|
+
}
|
package/package.json
CHANGED
package/product/enums.ts
CHANGED
package/product/service.types.ts
CHANGED
@@ -67,6 +67,11 @@ export type ProductServiceSetArbitraryJobTitle = (
|
|
67
67
|
shouldResetJobFunctionsIds?: boolean,
|
68
68
|
) => void
|
69
69
|
|
70
|
+
export type ProductServiceGetProductSupportingContractsFromCacheOrAPIHandler = (
|
71
|
+
id: string | number,
|
72
|
+
forceRefresh?: boolean,
|
73
|
+
) => Promise<ProductSupportingContractsComplete | undefined>
|
74
|
+
|
70
75
|
export type WindowHapiServiceProduct = WindowHapiModuleWithConstructorArgs<
|
71
76
|
{
|
72
77
|
loadMoreProducts: HapiServiceFunctionWithLifecycleHooks<ProductServiceLoadMoreProductsHandler>
|
@@ -83,6 +88,7 @@ export type WindowHapiServiceProduct = WindowHapiModuleWithConstructorArgs<
|
|
83
88
|
getJobTitles: HapiServiceFunctionWithLifecycleHooks<ProductServiceGetJobTitlesHandler>
|
84
89
|
getJobFunctions: HapiServiceFunctionWithLifecycleHooks<ProductServiceGetJobFunctionsHandler>
|
85
90
|
getIndustries: HapiServiceFunctionWithLifecycleHooks<ProductServiceGetIndustriesHandler>
|
91
|
+
getProductSupportingContractsFromCacheOrAPI: HapiServiceFunctionWithLifecycleHooks<ProductServiceGetProductSupportingContractsFromCacheOrAPIHandler>
|
86
92
|
},
|
87
93
|
{ readonly service: WindowHapiService }
|
88
94
|
>
|
package/product/state.types.ts
CHANGED
@@ -7,7 +7,11 @@ import {
|
|
7
7
|
ProductSupportingContractsPartial,
|
8
8
|
} from "./types"
|
9
9
|
import { PaginationResponseV1 } from "../common/types"
|
10
|
-
import {
|
10
|
+
import {
|
11
|
+
ProductTypeFilterBy,
|
12
|
+
ProductPriceCurrency,
|
13
|
+
ProductSortBy,
|
14
|
+
} from "./enums"
|
11
15
|
|
12
16
|
export type ProductState = {
|
13
17
|
/* Products */
|
@@ -44,4 +48,6 @@ export type ProductState = {
|
|
44
48
|
jobIndustriesAreLoading: boolean
|
45
49
|
/* Search Text */
|
46
50
|
searchTextInput: string
|
51
|
+
/* Product Type */
|
52
|
+
searchTypeFilterBy: ProductTypeFilterBy
|
47
53
|
}
|
package/product/types.ts
CHANGED
@@ -2,13 +2,10 @@ import {
|
|
2
2
|
ProductFilterRecommendations,
|
3
3
|
ProductPriceCurrency,
|
4
4
|
ProductSortBy,
|
5
|
+
ProductTypeFilterBy,
|
5
6
|
} from "./enums"
|
6
|
-
import {
|
7
|
-
import {
|
8
|
-
Facet,
|
9
|
-
PostingRequirement,
|
10
|
-
PostingRequirementLabelsMap,
|
11
|
-
} from "../common"
|
7
|
+
import { ContractDetails } from "../contract/types"
|
8
|
+
import { StringifiedJSON } from "../common"
|
12
9
|
|
13
10
|
export type ProductRange = "hours" | "days" | "weeks" | "months"
|
14
11
|
|
@@ -140,6 +137,7 @@ export type ProductFilterQueryParams = {
|
|
140
137
|
filterMyContractSupportedOnly: boolean
|
141
138
|
searchTextInput: string
|
142
139
|
searchSortBy: ProductSortBy
|
140
|
+
searchTypeFilterBy: ProductTypeFilterBy
|
143
141
|
}
|
144
142
|
|
145
143
|
export type ProductSearchFilters = {
|
@@ -162,17 +160,23 @@ export type ProductWithSupportForContractsFilters = {
|
|
162
160
|
search?: string
|
163
161
|
}
|
164
162
|
export type ProductSupportingContractsComplete = ProductLogos &
|
165
|
-
ProductSupportingContractsPartial &
|
166
|
-
|
167
|
-
contract_facets?: Facet[]
|
168
|
-
feed_url: string | null
|
169
|
-
manual_setup_required: boolean
|
170
|
-
posting_requirements: PostingRequirement[]
|
171
|
-
posting_requirements_labels: PostingRequirementLabelsMap
|
172
|
-
setup_instructions: string //html;
|
173
|
-
}
|
163
|
+
ProductSupportingContractsPartial &
|
164
|
+
ContractDetails
|
174
165
|
|
175
166
|
export type ProductUserProvidedFilters = Omit<
|
176
167
|
ProductFilterQueryParams,
|
177
168
|
"filterProductRecommendations" | "filterMyContractSupportedOnly"
|
178
169
|
>
|
170
|
+
|
171
|
+
export type ProductProductsSupportingContractsPayload = [
|
172
|
+
string | number, // argument 1 of fn ProductServiceGetProductSupportingContractsFromCacheOrAPIHandler
|
173
|
+
]
|
174
|
+
|
175
|
+
export type ProductProductsSupportingContractsMapState = {
|
176
|
+
isLoading: boolean
|
177
|
+
data: ProductSupportingContractsComplete | null
|
178
|
+
}
|
179
|
+
export type ProductProductsSupportingContractsMap = Map<
|
180
|
+
StringifiedJSON<ProductProductsSupportingContractsPayload>,
|
181
|
+
ProductProductsSupportingContractsMapState
|
182
|
+
>
|
package/product/utils.types.ts
CHANGED
@@ -2,12 +2,17 @@ import { ProductFilterQueryParams, ProductUserProvidedFilters } from "./types"
|
|
2
2
|
import { PaginationResponseV1 } from "../common/types"
|
3
3
|
import { WindowHapiUtils } from "../_window/utils.types"
|
4
4
|
import { WindowHapiModuleWithConstructorArgs } from "../_window"
|
5
|
-
import {
|
5
|
+
import {
|
6
|
+
ProductPriceCurrency,
|
7
|
+
ProductSortBy,
|
8
|
+
ProductTypeFilterBy,
|
9
|
+
} from "./enums"
|
6
10
|
|
7
11
|
export type WindowHapiUtilsProduct = WindowHapiModuleWithConstructorArgs<
|
8
12
|
{
|
9
13
|
currencyKeys: typeof ProductPriceCurrency
|
10
14
|
sortByKeys: typeof ProductSortBy
|
15
|
+
typeFilterByKeys: typeof ProductTypeFilterBy
|
11
16
|
getUserProvidedFilters: () => ProductUserProvidedFilters
|
12
17
|
getProductsQueryParams: (
|
13
18
|
params: Partial<ProductFilterQueryParams>,
|
@@ -93,6 +93,7 @@ export type ZodProductFilters = ZodObject<{
|
|
93
93
|
name: ZodOptional<ZodString>
|
94
94
|
recommended: ZodOptional<ZodBoolean>
|
95
95
|
sortBy: ZodOptional<ZodString>
|
96
|
+
typeFilterBy: ZodOptional<ZodString>
|
96
97
|
}>
|
97
98
|
export type ZodProductWithSupportForContractsFilters = ZodObject<{
|
98
99
|
search: ZodString
|
@@ -163,6 +164,8 @@ export type WindowHapiValidationsProduct = {
|
|
163
164
|
currency: ZodString
|
164
165
|
searchSortBy: string[]
|
165
166
|
searchSortByRegex: RegExp
|
167
|
+
searchTypeFilterBy: string[]
|
168
|
+
searchTypeFilterByRegex: RegExp
|
166
169
|
placeTypes: string[]
|
167
170
|
placeTypesRegex: RegExp
|
168
171
|
logoWithSize: ZodProductLogoWithSize
|