@vonq/hapi-elements-types 1.41.0 → 1.43.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 +9 -3
- package/_window/config.types.ts +4 -0
- package/_window/service.types.ts +1 -0
- 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/api.types.ts +1 -3
- package/ats/service.types.ts +4 -10
- package/ats/types.ts +3 -14
- 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 +3 -69
- package/contract/enums.ts +39 -0
- package/contract/index.ts +8 -7
- package/contract/service.types.ts +68 -1
- package/contract/types.ts +176 -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/state.types.ts +7 -1
- package/product/types.ts +5 -10
- package/product/utils.types.ts +6 -1
- package/product/validations.types.ts +3 -0
package/_window/api.types.ts
CHANGED
@@ -4,7 +4,7 @@ import {
|
|
4
4
|
RawAxiosRequestConfig,
|
5
5
|
RawAxiosRequestHeaders,
|
6
6
|
} from "axios"
|
7
|
-
import { WindowHapiModuleName } from "../common/enums"
|
7
|
+
import { WindowHapiModuleName, WindowHapiSubmoduleName } from "../common/enums"
|
8
8
|
import { WindowHapiAPIATS } from "../ats/api.types"
|
9
9
|
import { WindowHapiAPICampaign } from "../campaign/api.types"
|
10
10
|
import { WindowHapiAPIContract } from "../contract/api.types"
|
@@ -111,11 +111,17 @@ export type WindowHapiAPI = WindowHapiModuleWithConstructorArgs<
|
|
111
111
|
headers: RawAxiosRequestHeaders
|
112
112
|
setHeaders: (headers: RawAxiosRequestHeaders) => void
|
113
113
|
baseRequestConfig: RawAxiosRequestConfig<any>
|
114
|
-
|
115
|
-
method:
|
114
|
+
makeElementsAPIRequest: (
|
115
|
+
method: string,
|
116
116
|
endpoint: string,
|
117
117
|
data?: any,
|
118
|
+
params?: Record<string, any>,
|
118
119
|
) => Promise<any>
|
120
|
+
makeSDKUsageElementsAPIRequest: (
|
121
|
+
moduleName: WindowHapiSubmoduleName,
|
122
|
+
functionName: string,
|
123
|
+
functionType?: string,
|
124
|
+
) => void
|
119
125
|
modules: WindowHapiAPIModules
|
120
126
|
} & WindowHapiAPIModules,
|
121
127
|
{ readonly core: WindowHapiClassInterface }
|
package/_window/config.types.ts
CHANGED
package/_window/service.types.ts
CHANGED
@@ -29,6 +29,7 @@ export type HapiServiceFunctionLifecycleHookHandler = (
|
|
29
29
|
|
30
30
|
export type HapiServiceFunctionWithLifecycleHooks<HandlerType> = {
|
31
31
|
run: HandlerType
|
32
|
+
runWithoutSDKUsageLog: HandlerType
|
32
33
|
onStart: HapiServiceFunctionLifecycleHookHandler
|
33
34
|
onSuccess: HapiServiceFunctionLifecycleHookHandler
|
34
35
|
onFailure: HapiServiceFunctionLifecycleHookHandler
|
@@ -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/api.types.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { AxiosRequestConfig } from "axios/index"
|
2
|
-
import {
|
2
|
+
import { ATSSettings, ATSUserTokenResponse } from "./types"
|
3
3
|
import { WindowHapiAPI, WindowHapiAPIModule } from "../_window/api.types"
|
4
4
|
import { WindowHapiModuleWithConstructorArgs } from "../_window"
|
5
5
|
|
@@ -15,8 +15,6 @@ export type WindowHapiAPIATSRequests = {
|
|
15
15
|
refreshJWTToken: () => Promise<ATSUserTokenResponse>
|
16
16
|
validateJWTToken: () => Promise<boolean>
|
17
17
|
getUserData: () => Promise<any>
|
18
|
-
getMessages: () => Promise<ATSMessage[]>
|
19
|
-
sendMessage: (ticket: ATSMessage) => Promise<ATSMessage[]>
|
20
18
|
}
|
21
19
|
export type WindowHapiAPIATS = WindowHapiModuleWithConstructorArgs<
|
22
20
|
WindowHapiAPIModule<WindowHapiAPIATSRequests, WindowHapiAPIATSConfigs>,
|
package/ats/service.types.ts
CHANGED
@@ -2,26 +2,20 @@ import {
|
|
2
2
|
HapiServiceFunctionWithLifecycleHooks,
|
3
3
|
WindowHapiService,
|
4
4
|
} from "../_window/service.types"
|
5
|
-
import {
|
5
|
+
import { ATSSettings, ATSUserData } from "./types"
|
6
6
|
import { WindowHapiModuleWithConstructorArgs } from "../_window"
|
7
7
|
|
8
8
|
export type ATSServiceGetUserSettingsHandler = () => Promise<
|
9
9
|
ATSSettings | undefined
|
10
10
|
>
|
11
11
|
|
12
|
-
export type ATSServiceGetUserDataHandler = () => Promise<
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
export type ATSServiceSendMessageHandler = (
|
17
|
-
message: ATSMessage,
|
18
|
-
) => Promise<ATSMessage[]>
|
12
|
+
export type ATSServiceGetUserDataHandler = () => Promise<
|
13
|
+
ATSUserData | undefined
|
14
|
+
>
|
19
15
|
|
20
16
|
export type WindowHapiServiceATS = WindowHapiModuleWithConstructorArgs<
|
21
17
|
{
|
22
18
|
getUserSettings: HapiServiceFunctionWithLifecycleHooks<ATSServiceGetUserSettingsHandler>
|
23
|
-
getMessages: HapiServiceFunctionWithLifecycleHooks<ATSServiceGetMessagesHandler>
|
24
|
-
sendMessage: HapiServiceFunctionWithLifecycleHooks<ATSServiceSendMessageHandler>
|
25
19
|
},
|
26
20
|
{ readonly service: WindowHapiService }
|
27
21
|
>
|
package/ats/types.ts
CHANGED
@@ -31,6 +31,9 @@ export type ATSUserSettings = {
|
|
31
31
|
direct_apply?: {
|
32
32
|
enabled: boolean
|
33
33
|
}
|
34
|
+
campaigns?: {
|
35
|
+
enable_weekly_working_minutes: boolean
|
36
|
+
}
|
34
37
|
}
|
35
38
|
export type ATSSettings = {
|
36
39
|
payment_settings: ATSUserPaymentSetting[]
|
@@ -54,17 +57,3 @@ export type ATSUserData = {
|
|
54
57
|
export type ATSUserTokenResponse = {
|
55
58
|
token: string
|
56
59
|
}
|
57
|
-
|
58
|
-
export type ATSMessage = {
|
59
|
-
id?: string
|
60
|
-
sender: "ats" | "vonq"
|
61
|
-
createdAt?: string
|
62
|
-
message: string
|
63
|
-
}
|
64
|
-
|
65
|
-
export type ATSDataResponse = {
|
66
|
-
data: {
|
67
|
-
messages: ATSMessage[]
|
68
|
-
}
|
69
|
-
type: "elements"
|
70
|
-
}
|
@@ -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 = {
|
@@ -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,105 @@ import {
|
|
3
3
|
WindowHapiService,
|
4
4
|
} from "../_window/service.types"
|
5
5
|
import { OrderJourneyStepKey } from "../orderJourney/enums"
|
6
|
-
import {
|
6
|
+
import {
|
7
|
+
Contract,
|
8
|
+
ContractDirectApplyChannelPrefillVariablesMap,
|
9
|
+
ContractCredential,
|
10
|
+
ContractGroup,
|
11
|
+
ContractDirectApplyPostingRequirementQuestionnaireQuestionBody,
|
12
|
+
ContractDirectApplyPostingRequirementQuestionnaireRules,
|
13
|
+
ContractDirectApplyPostingRequirementQuestionnaireQuestionIgnoreReason,
|
14
|
+
} from "./types"
|
7
15
|
import {
|
8
16
|
PaginatedAPIResponseV1,
|
9
17
|
PostingRequirementsAutocompleteRequestOption,
|
18
|
+
TransformedPostingRequirement,
|
10
19
|
} from "../common/types"
|
11
20
|
import { WindowHapiModuleWithConstructorArgs } from "../_window"
|
21
|
+
import { Modals } from "../modal"
|
22
|
+
import { ContractDirectApplyChannelName } from "./enums"
|
23
|
+
import { ProductSupportingContractsComplete } from "../product"
|
24
|
+
import { OrderJourneyChannelPostingRequirementsStepOptions } from "../orderJourney"
|
12
25
|
|
13
26
|
export type ContractServiceGetContractPostingRequirementOptionsHandler = (
|
14
27
|
contractId: string,
|
15
28
|
fieldName: string,
|
16
29
|
autocompleteRequestOptions: PostingRequirementsAutocompleteRequestOption[],
|
17
30
|
) => Promise<any>
|
31
|
+
|
18
32
|
export type ContractServiceGetContractsHandler = (
|
19
33
|
offset: number,
|
20
34
|
) => Promise<PaginatedAPIResponseV1<Contract>>
|
35
|
+
|
21
36
|
export type ContractServiceGetContractGroupsHandler = () => Promise<
|
22
37
|
ContractGroup[]
|
23
38
|
>
|
39
|
+
|
24
40
|
export type ContractServiceGetContractsLabeledHandler = (
|
25
41
|
offset?: number,
|
26
42
|
limit?: number,
|
27
43
|
labels?: Record<string, string> | null,
|
28
44
|
) => Promise<PaginatedAPIResponseV1<Contract>>
|
45
|
+
|
29
46
|
export type ContractServiceCreateContractHandler = () => Promise<Contract>
|
47
|
+
|
30
48
|
export type ContractServiceSaveContractHandler = () => Promise<Contract>
|
49
|
+
|
31
50
|
export type ContractServiceRemoveContractHandler = (
|
32
51
|
contractId: string,
|
33
52
|
) => Promise<void>
|
53
|
+
|
34
54
|
export type ContractServiceCreateContractGroupHandler =
|
35
55
|
() => Promise<ContractGroup>
|
56
|
+
|
36
57
|
export type ContractServiceGetContractHandler = (
|
37
58
|
id: string,
|
38
59
|
) => Promise<Contract>
|
39
60
|
|
61
|
+
export type ContractServiceGetContractChannelPostingRequirementQuestionnaireRulesForDirectApplyResponse =
|
62
|
+
{
|
63
|
+
rules: ContractDirectApplyPostingRequirementQuestionnaireRules
|
64
|
+
directApplyVariables: ContractDirectApplyChannelPrefillVariablesMap
|
65
|
+
questionnairePostingRequirement: TransformedPostingRequirement
|
66
|
+
contractInBasket: Contract
|
67
|
+
}
|
68
|
+
|
69
|
+
export type ContractServiceGetContractChannelPostingRequirementQuestionnaireBodyForDirectApplyResponse =
|
70
|
+
{
|
71
|
+
hasIgnoredQuestions: boolean
|
72
|
+
ignoredQuestionDetails: ContractDirectApplyPostingRequirementQuestionnaireQuestionIgnoreReason[]
|
73
|
+
validQuestions: ContractDirectApplyPostingRequirementQuestionnaireQuestionBody[]
|
74
|
+
} & ContractServiceGetContractChannelPostingRequirementQuestionnaireRulesForDirectApplyResponse
|
75
|
+
|
76
|
+
export type ContractServicePrefillContractChannelPostingRequirementQuestionnaireForDirectApplyHandler =
|
77
|
+
(
|
78
|
+
channelName: ContractDirectApplyChannelName,
|
79
|
+
questionsBody: ContractDirectApplyPostingRequirementQuestionnaireQuestionBody[],
|
80
|
+
) => Promise<true>
|
81
|
+
|
82
|
+
export type ContractServiceSetContractChannelPostingRequirementQuestionnaireOptionsDirectApplyHandler =
|
83
|
+
(
|
84
|
+
channelName: ContractDirectApplyChannelName,
|
85
|
+
partialOptions: OrderJourneyChannelPostingRequirementsStepOptions,
|
86
|
+
) => Promise<void>
|
87
|
+
|
88
|
+
export type ContractServiceGetContractChannelPostingRequirementQuestionnaireBodyForDirectApplyHandler =
|
89
|
+
(
|
90
|
+
channelName: ContractDirectApplyChannelName,
|
91
|
+
questionsBody: ContractDirectApplyPostingRequirementQuestionnaireQuestionBody[],
|
92
|
+
) => Promise<ContractServiceGetContractChannelPostingRequirementQuestionnaireBodyForDirectApplyResponse>
|
93
|
+
|
94
|
+
export type ContractServiceGetContractChannelPostingRequirementQuestionnaireRulesForDirectApplyHandler =
|
95
|
+
(
|
96
|
+
channelName: ContractDirectApplyChannelName,
|
97
|
+
) => Promise<ContractServiceGetContractChannelPostingRequirementQuestionnaireRulesForDirectApplyResponse>
|
98
|
+
|
40
99
|
export type WindowHapiServiceContract = WindowHapiModuleWithConstructorArgs<
|
41
100
|
{
|
101
|
+
onAfterContractEditModalOpenClose: (
|
102
|
+
currentModals: Modals,
|
103
|
+
previousModals: Modals,
|
104
|
+
) => void
|
42
105
|
getContractPostingRequirementOptions: HapiServiceFunctionWithLifecycleHooks<ContractServiceGetContractPostingRequirementOptionsHandler>
|
43
106
|
getContractsLabeled: HapiServiceFunctionWithLifecycleHooks<ContractServiceGetContractsLabeledHandler>
|
44
107
|
getContracts: HapiServiceFunctionWithLifecycleHooks<ContractServiceGetContractsHandler>
|
@@ -48,6 +111,10 @@ export type WindowHapiServiceContract = WindowHapiModuleWithConstructorArgs<
|
|
48
111
|
saveContract: HapiServiceFunctionWithLifecycleHooks<ContractServiceSaveContractHandler>
|
49
112
|
createContractGroup: HapiServiceFunctionWithLifecycleHooks<ContractServiceCreateContractGroupHandler>
|
50
113
|
getContract: HapiServiceFunctionWithLifecycleHooks<ContractServiceGetContractHandler>
|
114
|
+
prefillContractChannelPostingRequirementQuestionnaireForDirectApply: HapiServiceFunctionWithLifecycleHooks<ContractServicePrefillContractChannelPostingRequirementQuestionnaireForDirectApplyHandler>
|
115
|
+
getContractChannelPostingRequirementQuestionnaireBodyForDirectApply: HapiServiceFunctionWithLifecycleHooks<ContractServiceGetContractChannelPostingRequirementQuestionnaireBodyForDirectApplyHandler>
|
116
|
+
getContractChannelPostingRequirementQuestionnaireRulesForDirectApply: HapiServiceFunctionWithLifecycleHooks<ContractServiceGetContractChannelPostingRequirementQuestionnaireRulesForDirectApplyHandler>
|
117
|
+
setContractChannelPostingRequirementQuestionnaireOptionsDirectApply: HapiServiceFunctionWithLifecycleHooks<ContractServiceSetContractChannelPostingRequirementQuestionnaireOptionsDirectApplyHandler>
|
51
118
|
initiateOauthLogin: (
|
52
119
|
contractId: string | number,
|
53
120
|
orderJourneyStepActive: OrderJourneyStepKey,
|
package/contract/types.ts
CHANGED
@@ -1,4 +1,16 @@
|
|
1
1
|
import { ProductLogos, ProductType } from "../product/types"
|
2
|
+
import {
|
3
|
+
Facet,
|
4
|
+
PostingRequirement,
|
5
|
+
PostingRequirementLabelsMap,
|
6
|
+
} from "../common"
|
7
|
+
import {
|
8
|
+
ContractDirectApplyPostingRequirementQuestionnaireLengthRule,
|
9
|
+
ContractDirectApplyPostingRequirementQuestionnaireOccursRule,
|
10
|
+
ContractDirectApplyPostingRequirementQuestionnaireQuestionCommonRule,
|
11
|
+
ContractDirectApplyPostingRequirementQuestionnaireType,
|
12
|
+
ContractDirectApplyPostingRequirementQuestionnaireValidationWarningCode,
|
13
|
+
} from "./enums"
|
2
14
|
|
3
15
|
export type ContractProduct = {
|
4
16
|
product_id: string
|
@@ -68,6 +80,16 @@ export type Contract = {
|
|
68
80
|
group: ContractGroup | null
|
69
81
|
posting_requirements_defaults: Record<string, string | string[]> | null
|
70
82
|
errors?: string[]
|
83
|
+
} & ContractDetails
|
84
|
+
|
85
|
+
export type ContractDetails = {
|
86
|
+
contract_credentials: ContractCredential[]
|
87
|
+
contract_facets?: Facet[]
|
88
|
+
feed_url: string | null
|
89
|
+
manual_setup_required: boolean
|
90
|
+
posting_requirements: PostingRequirement[]
|
91
|
+
posting_requirements_labels: PostingRequirementLabelsMap
|
92
|
+
setup_instructions: string //html;
|
71
93
|
}
|
72
94
|
|
73
95
|
export type ContractGroup = {
|
@@ -78,3 +100,157 @@ export type ContractGroup = {
|
|
78
100
|
}
|
79
101
|
|
80
102
|
export type ContractGroupSelected = ContractGroup | "add-new" | null
|
103
|
+
|
104
|
+
export type ContractDirectApplyChannelPrefillVariablesMap = {
|
105
|
+
id: number
|
106
|
+
applyMethodPostingRequirementName: string
|
107
|
+
applyMethodDirectApplyOptionKey: string
|
108
|
+
questionnairePostingRequirementName: string
|
109
|
+
}
|
110
|
+
export type ContractDirectApplyPostingRequirementQuestionnaireOpenQuestionType =
|
111
|
+
ContractDirectApplyPostingRequirementQuestionnaireType.TEXT
|
112
|
+
|
113
|
+
export type ContractDirectApplyPostingRequirementQuestionnaireClosedQuestionType =
|
114
|
+
|
115
|
+
| ContractDirectApplyPostingRequirementQuestionnaireType.CHOICE
|
116
|
+
| ContractDirectApplyPostingRequirementQuestionnaireType.MULTI_CHOICE
|
117
|
+
|
118
|
+
export type ContractDirectApplyPostingRequirementQuestionnaireQuestion = {
|
119
|
+
[ContractDirectApplyPostingRequirementQuestionnaireLengthRule.MAX_LENGTH]?: number
|
120
|
+
[ContractDirectApplyPostingRequirementQuestionnaireLengthRule.MIN_LENGTH]?: number
|
121
|
+
[ContractDirectApplyPostingRequirementQuestionnaireQuestionCommonRule.MAX_QUESTIONS]?: number
|
122
|
+
[ContractDirectApplyPostingRequirementQuestionnaireQuestionCommonRule.HTML_ALLOWED]?: string
|
123
|
+
}
|
124
|
+
|
125
|
+
export type ContractDirectApplyPostingRequirementQuestionnaireClosedQuestionItem =
|
126
|
+
{
|
127
|
+
[ContractDirectApplyPostingRequirementQuestionnaireLengthRule.MAX_LENGTH]: number
|
128
|
+
[ContractDirectApplyPostingRequirementQuestionnaireLengthRule.MIN_LENGTH]: number
|
129
|
+
}
|
130
|
+
|
131
|
+
export type ContractDirectApplyPostingRequirementQuestionnaireClosedQuestionItems =
|
132
|
+
{
|
133
|
+
item: ContractDirectApplyPostingRequirementQuestionnaireClosedQuestionItem[]
|
134
|
+
[ContractDirectApplyPostingRequirementQuestionnaireOccursRule.MAX_OCCURS]: number
|
135
|
+
[ContractDirectApplyPostingRequirementQuestionnaireOccursRule.MIN_OCCURS]: number
|
136
|
+
}
|
137
|
+
|
138
|
+
export type ContractDirectApplyPostingRequirementQuestionnaireText = {
|
139
|
+
limit?: number
|
140
|
+
formats?: string
|
141
|
+
min?: string
|
142
|
+
max?: string
|
143
|
+
question: ContractDirectApplyPostingRequirementQuestionnaireQuestion
|
144
|
+
}
|
145
|
+
|
146
|
+
export type ContractDirectApplyPostingRequirementQuestionnaireClosedQuestion = {
|
147
|
+
items: ContractDirectApplyPostingRequirementQuestionnaireClosedQuestionItems
|
148
|
+
question: ContractDirectApplyPostingRequirementQuestionnaireQuestion
|
149
|
+
}
|
150
|
+
|
151
|
+
export type ContractDirectApplyPostingRequirementQuestionnaireSettings = {
|
152
|
+
ordered: boolean
|
153
|
+
editable: boolean
|
154
|
+
maxQuestions: number
|
155
|
+
maxOpenQuestions?: number
|
156
|
+
maxClosedQuestions?: number
|
157
|
+
supportsRequired: boolean
|
158
|
+
supportsConditions: boolean
|
159
|
+
}
|
160
|
+
|
161
|
+
export type ContractDirectApplyPostingRequirementQuestionnaire = {
|
162
|
+
types: ContractDirectApplyPostingRequirementQuestionnaireType[]
|
163
|
+
text?: ContractDirectApplyPostingRequirementQuestionnaireText
|
164
|
+
choice?: ContractDirectApplyPostingRequirementQuestionnaireClosedQuestion
|
165
|
+
"multi-choice"?: ContractDirectApplyPostingRequirementQuestionnaireClosedQuestion
|
166
|
+
questionnaire: ContractDirectApplyPostingRequirementQuestionnaireSettings
|
167
|
+
}
|
168
|
+
|
169
|
+
export type ContractDirectApplyPostingRequirementQuestionnaireClosedQuestionAnswer =
|
170
|
+
{
|
171
|
+
id: string
|
172
|
+
answer: string
|
173
|
+
}
|
174
|
+
|
175
|
+
export type ContractDirectApplyPostingRequirementQuestionnaireCommonQuestionBody =
|
176
|
+
{
|
177
|
+
id: string
|
178
|
+
question: string
|
179
|
+
is_required?: boolean
|
180
|
+
}
|
181
|
+
|
182
|
+
export type ContractDirectApplyPostingRequirementQuestionnaireOpenQuestionBody =
|
183
|
+
{
|
184
|
+
type: ContractDirectApplyPostingRequirementQuestionnaireOpenQuestionType
|
185
|
+
} & ContractDirectApplyPostingRequirementQuestionnaireCommonQuestionBody
|
186
|
+
|
187
|
+
export type ContractDirectApplyPostingRequirementQuestionnaireClosedQuestionBody =
|
188
|
+
{
|
189
|
+
type: ContractDirectApplyPostingRequirementQuestionnaireClosedQuestionType
|
190
|
+
answers: ContractDirectApplyPostingRequirementQuestionnaireClosedQuestionAnswer[]
|
191
|
+
} & ContractDirectApplyPostingRequirementQuestionnaireCommonQuestionBody
|
192
|
+
|
193
|
+
export type ContractDirectApplyPostingRequirementQuestionnaireQuestionBody =
|
194
|
+
| ContractDirectApplyPostingRequirementQuestionnaireOpenQuestionBody
|
195
|
+
| ContractDirectApplyPostingRequirementQuestionnaireClosedQuestionBody
|
196
|
+
|
197
|
+
export type ContractDirectApplyPostingRequirementQuestionnaireRules = {
|
198
|
+
types: ContractDirectApplyPostingRequirementQuestionnaireType[]
|
199
|
+
generalRules:
|
200
|
+
| ContractDirectApplyPostingRequirementQuestionnaireSettings
|
201
|
+
| undefined
|
202
|
+
textRules:
|
203
|
+
| ContractDirectApplyPostingRequirementQuestionnaireText
|
204
|
+
| undefined
|
205
|
+
choiceRules:
|
206
|
+
| ContractDirectApplyPostingRequirementQuestionnaireClosedQuestion
|
207
|
+
| undefined
|
208
|
+
multiChoiceRules:
|
209
|
+
| ContractDirectApplyPostingRequirementQuestionnaireClosedQuestion
|
210
|
+
| undefined
|
211
|
+
maxQuestionsRule: number | undefined
|
212
|
+
maxOpenQuestionsRule: number | undefined
|
213
|
+
maxClosedQuestionsRule: number | undefined
|
214
|
+
supportsRequiredRule: boolean | undefined
|
215
|
+
textQuestionMaxLengthRule: number | undefined
|
216
|
+
textQuestionMinLengthRule: number | undefined
|
217
|
+
choiceQuestionMaxLengthRule: number | undefined
|
218
|
+
choiceQuestionMinLengthRule: number | undefined
|
219
|
+
multiChoiceQuestionMaxLengthRule: number | undefined
|
220
|
+
multiChoiceQuestionMinLengthRule: number | undefined
|
221
|
+
getChoiceItemOccursRule: (
|
222
|
+
type: ContractDirectApplyPostingRequirementQuestionnaireClosedQuestionType,
|
223
|
+
rule: ContractDirectApplyPostingRequirementQuestionnaireOccursRule,
|
224
|
+
) => number | undefined
|
225
|
+
getQuestionLengthRule: (
|
226
|
+
type: ContractDirectApplyPostingRequirementQuestionnaireType,
|
227
|
+
rule: ContractDirectApplyPostingRequirementQuestionnaireLengthRule,
|
228
|
+
) => number | undefined
|
229
|
+
choiceItemMaxLengthRule: number | undefined
|
230
|
+
choiceItemMinLengthRule: number | undefined
|
231
|
+
multiChoiceItemMaxLengthRule: number | undefined
|
232
|
+
multiChoiceItemMinLengthRule: number | undefined
|
233
|
+
getChoiceOrMultiChoiceItemLengthRule: (
|
234
|
+
type: ContractDirectApplyPostingRequirementQuestionnaireClosedQuestionType,
|
235
|
+
rule: ContractDirectApplyPostingRequirementQuestionnaireLengthRule,
|
236
|
+
) => number | undefined
|
237
|
+
}
|
238
|
+
|
239
|
+
export type ContractDirectApplyPostingRequirementQuestionnaireQuestionValidationError =
|
240
|
+
{
|
241
|
+
code: ContractDirectApplyPostingRequirementQuestionnaireValidationWarningCode
|
242
|
+
message: string
|
243
|
+
data: Record<string, any>
|
244
|
+
}
|
245
|
+
|
246
|
+
export type ContractDirectApplyPostingRequirementQuestionnaireQuestionIgnoreReason =
|
247
|
+
{
|
248
|
+
question: ContractDirectApplyPostingRequirementQuestionnaireQuestionBody
|
249
|
+
ignoreReasons: ContractDirectApplyPostingRequirementQuestionnaireQuestionValidationError[]
|
250
|
+
}
|
251
|
+
|
252
|
+
export type ContractDirectApplyPostingRequirementQuestionnaireQuestionAnswerIgnoreReason =
|
253
|
+
{
|
254
|
+
answer: ContractDirectApplyPostingRequirementQuestionnaireClosedQuestionAnswer
|
255
|
+
ignoreReasons: ContractDirectApplyPostingRequirementQuestionnaireQuestionValidationError[]
|
256
|
+
}
|
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/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,8 +2,9 @@ import {
|
|
2
2
|
ProductFilterRecommendations,
|
3
3
|
ProductPriceCurrency,
|
4
4
|
ProductSortBy,
|
5
|
+
ProductTypeFilterBy,
|
5
6
|
} from "./enums"
|
6
|
-
import { ContractCredential } from "../contract/types"
|
7
|
+
import { ContractCredential, ContractDetails } from "../contract/types"
|
7
8
|
import {
|
8
9
|
Facet,
|
9
10
|
PostingRequirement,
|
@@ -140,6 +141,7 @@ export type ProductFilterQueryParams = {
|
|
140
141
|
filterMyContractSupportedOnly: boolean
|
141
142
|
searchTextInput: string
|
142
143
|
searchSortBy: ProductSortBy
|
144
|
+
searchTypeFilterBy: ProductTypeFilterBy
|
143
145
|
}
|
144
146
|
|
145
147
|
export type ProductSearchFilters = {
|
@@ -162,15 +164,8 @@ export type ProductWithSupportForContractsFilters = {
|
|
162
164
|
search?: string
|
163
165
|
}
|
164
166
|
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
|
-
}
|
167
|
+
ProductSupportingContractsPartial &
|
168
|
+
ContractDetails
|
174
169
|
|
175
170
|
export type ProductUserProvidedFilters = Omit<
|
176
171
|
ProductFilterQueryParams,
|
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
|