@vonq/hapi-elements-types 1.4.0 → 1.6.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/package.json +17 -8
- package/src/_window/api.types.ts +61 -0
- package/src/_window/auth.types.ts +13 -0
- package/src/_window/config.types.ts +5 -0
- package/src/_window/events.types.ts +158 -0
- package/src/_window/index.ts +16 -0
- package/src/_window/instances.types.ts +27 -0
- package/src/_window/qa.types.ts +30 -0
- package/src/_window/routing.types.ts +23 -0
- package/src/_window/sdk.types.ts +149 -0
- package/src/_window/service.types.ts +69 -0
- package/src/_window/state.types.ts +114 -0
- package/src/_window/ui.types.ts +15 -0
- package/src/_window/utils.types.ts +36 -0
- package/src/_window/validation.types.ts +45 -0
- package/src/_window/window.ts +140 -0
- package/src/alert/enums.ts +22 -0
- package/src/alert/index.ts +6 -0
- package/src/alert/service.types.ts +15 -0
- package/src/alert/state.types.ts +9 -0
- package/src/alert/types.ts +63 -0
- package/src/ats/api.types.ts +16 -0
- package/src/ats/index.ts +6 -0
- package/src/ats/service.types.ts +17 -0
- package/src/ats/state.types.ts +5 -0
- package/src/ats/types.ts +19 -0
- package/src/basket/index.ts +7 -0
- package/src/basket/service.types.ts +32 -0
- package/src/basket/state.types.ts +34 -0
- package/src/basket/types.ts +4 -0
- package/src/basket/utils.types.ts +10 -0
- package/src/basket/validations.types.ts +25 -0
- package/src/campaign/api.types.ts +45 -0
- package/src/campaign/enums.ts +17 -0
- package/src/campaign/index.ts +10 -0
- package/src/campaign/qa.types.ts +12 -0
- package/src/campaign/service.types.ts +48 -0
- package/src/campaign/state.types.ts +55 -0
- package/src/campaign/types.ts +237 -0
- package/src/campaign/utils.types.ts +59 -0
- package/src/campaign/validations.types.ts +215 -0
- package/src/common/enums.ts +42 -0
- package/src/common/events/EventCommand/enums.ts +49 -0
- package/src/common/events/EventCommand/index.ts +4 -0
- package/src/common/events/EventCommand/types.ts +18 -0
- package/src/common/events/index.ts +4 -0
- package/src/common/events/types.ts +52 -0
- package/src/common/index.ts +7 -0
- package/src/common/logger/enums.ts +12 -0
- package/src/common/logger/types.ts +18 -0
- package/src/common/qa.types.ts +9 -0
- package/src/common/types.ts +109 -0
- package/src/common/validations.types.ts +89 -0
- package/src/common/validator/types.ts +4 -0
- package/src/contract/api.types.ts +47 -0
- package/src/contract/index.ts +9 -0
- package/src/contract/qa.types.ts +12 -0
- package/src/contract/service.types.ts +54 -0
- package/src/contract/state.types.ts +74 -0
- package/src/contract/types.ts +145 -0
- package/src/contract/utils.types.ts +11 -0
- package/src/contract/validations.types.ts +104 -0
- package/src/debugging/index.ts +3 -0
- package/src/debugging/state.types.ts +18 -0
- package/src/index.ts +18 -0
- package/src/language/index.ts +5 -0
- package/src/language/qa.types.ts +19 -0
- package/src/language/state.types.ts +25 -0
- package/src/language/validations.types.ts +13 -0
- package/src/modal/enums.ts +14 -0
- package/src/modal/index.ts +6 -0
- package/src/modal/service.types.ts +32 -0
- package/src/modal/state.types.ts +8 -0
- package/src/modal/types.ts +44 -0
- package/src/orderJourney/enums.ts +25 -0
- package/src/orderJourney/index.ts +8 -0
- package/src/orderJourney/qa.types.ts +16 -0
- package/src/orderJourney/state.types.ts +99 -0
- package/src/orderJourney/types.ts +31 -0
- package/src/orderJourney/utils.types.ts +11 -0
- package/src/orderJourney/validations.types.ts +34 -0
- package/src/product/api.types.ts +62 -0
- package/src/product/enums.ts +11 -0
- package/src/product/index.ts +10 -0
- package/src/product/qa.types.ts +11 -0
- package/src/product/service.types.ts +68 -0
- package/src/product/state.types.ts +93 -0
- package/src/product/types.ts +161 -0
- package/src/product/utils.types.ts +22 -0
- package/src/product/validations.types.ts +189 -0
- package/src/routing/index.ts +3 -0
- package/src/routing/state.types.ts +30 -0
- package/src/theming/index.ts +6 -0
- package/src/theming/qa.types.ts +11 -0
- package/src/theming/state.types.ts +6 -0
- package/src/theming/types.ts +123 -0
- package/src/theming/validations.types.ts +62 -0
- package/src/ui/index.ts +3 -0
- package/src/ui/service.types.ts +26 -0
- package/src/wallet/api.types.ts +33 -0
- package/src/wallet/index.ts +7 -0
- package/src/wallet/service.types.ts +26 -0
- package/src/wallet/state.types.ts +58 -0
- package/src/wallet/types.ts +65 -0
- package/src/wallet/validations.types.ts +18 -0
- package/tsconfig.json +36 -0
- package/index.d.ts +0 -5207
@@ -0,0 +1,45 @@
|
|
1
|
+
import { AxiosRequestConfig } from "axios"
|
2
|
+
import {
|
3
|
+
Campaign,
|
4
|
+
CampaignOrderRequestBody,
|
5
|
+
TaxonomyEducationAndSeniorityLevel,
|
6
|
+
} from "./types"
|
7
|
+
import { ProductSupportingContractsComplete } from "../product/types"
|
8
|
+
import { WindowHapiAPI, WindowHapiAPIModule } from "../_window/api.types"
|
9
|
+
import { PaginatedAPIResponseV2 } from "../common/types"
|
10
|
+
import { WindowHapiModuleWithConstructorArgs } from "../_window"
|
11
|
+
|
12
|
+
export type WindowHapiAPICampaignConfigs = {
|
13
|
+
getCampaigns: AxiosRequestConfig
|
14
|
+
getCampaign: AxiosRequestConfig
|
15
|
+
getCampaignDetail: AxiosRequestConfig
|
16
|
+
setCampaignCancellation: AxiosRequestConfig
|
17
|
+
getEducationLevels: AxiosRequestConfig
|
18
|
+
getSeniorities: AxiosRequestConfig
|
19
|
+
orderCampaign: AxiosRequestConfig
|
20
|
+
}
|
21
|
+
export type WindowHapiAPICampaignRequests = {
|
22
|
+
getCampaigns: (
|
23
|
+
offset?: number,
|
24
|
+
limit?: number,
|
25
|
+
) => Promise<PaginatedAPIResponseV2<Campaign>>
|
26
|
+
getCampaign: (campaignId: string) => Promise<Campaign>
|
27
|
+
getCampaignDetail: (
|
28
|
+
campaignId: string,
|
29
|
+
detail: "status",
|
30
|
+
) => Promise<ProductSupportingContractsComplete>
|
31
|
+
setCampaignCancellation: (
|
32
|
+
campaignId: string,
|
33
|
+
body: Partial<Campaign>,
|
34
|
+
) => Promise<ProductSupportingContractsComplete>
|
35
|
+
getEducationLevels: () => Promise<TaxonomyEducationAndSeniorityLevel[]>
|
36
|
+
getSeniorities: () => Promise<TaxonomyEducationAndSeniorityLevel[]>
|
37
|
+
orderCampaign: (postBody: CampaignOrderRequestBody) => Promise<Campaign>
|
38
|
+
}
|
39
|
+
export type WindowHapiAPICampaign = WindowHapiModuleWithConstructorArgs<
|
40
|
+
WindowHapiAPIModule<
|
41
|
+
WindowHapiAPICampaignRequests,
|
42
|
+
WindowHapiAPICampaignConfigs
|
43
|
+
>,
|
44
|
+
{ readonly api: WindowHapiAPI }
|
45
|
+
>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
export enum EmploymentType {
|
2
|
+
permanent = "permanent",
|
3
|
+
temporary = "temporary",
|
4
|
+
fixed_term = "fixed_term",
|
5
|
+
fixed_term_with_option_for_permanent = "fixed_term_with_option_for_permanent",
|
6
|
+
freelance = "freelance",
|
7
|
+
traineeship = "traineeship",
|
8
|
+
internship = "internship",
|
9
|
+
}
|
10
|
+
|
11
|
+
export enum SalaryPeriod {
|
12
|
+
DAILY = "daily",
|
13
|
+
MONTHLY = "monthly",
|
14
|
+
HOURLY = "hourly",
|
15
|
+
WEEKLY = "weekly",
|
16
|
+
YEARLY = "yearly",
|
17
|
+
}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
// created from 'create-ts-index'
|
2
|
+
|
3
|
+
export * from "./api.types"
|
4
|
+
export * from "./enums"
|
5
|
+
export * from "./qa.types"
|
6
|
+
export * from "./service.types"
|
7
|
+
export * from "./state.types"
|
8
|
+
export * from "./types"
|
9
|
+
export * from "./utils.types"
|
10
|
+
export * from "./validations.types"
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { WindowHapiQA } from "../_window/qa.types"
|
2
|
+
import { WindowHapiModuleWithConstructorArgs } from "../_window"
|
3
|
+
import { CampaignCreateForm } from "./types"
|
4
|
+
|
5
|
+
export type WindowHapiQACampaign = WindowHapiModuleWithConstructorArgs<
|
6
|
+
{
|
7
|
+
useMockCampaignForm: () => CampaignCreateForm
|
8
|
+
getRandomCampaignId: () => Promise<string>
|
9
|
+
setCampaignFormDebuggerIsShown: (isEnabled: boolean) => boolean
|
10
|
+
},
|
11
|
+
{ readonly qa: WindowHapiQA }
|
12
|
+
>
|
@@ -0,0 +1,48 @@
|
|
1
|
+
import {
|
2
|
+
HapiServiceFunctionWithLifecycleHooks,
|
3
|
+
WindowHapiService,
|
4
|
+
} from "../_window/service.types"
|
5
|
+
import { ProductSupportingContractsComplete } from "../product/types"
|
6
|
+
import { Campaign, TaxonomyEducationAndSeniorityLevel } from "./types"
|
7
|
+
import { PaginatedAPIResponseV2 } from "../common/types"
|
8
|
+
import { WindowHapiModuleWithConstructorArgs } from "../_window"
|
9
|
+
|
10
|
+
export type CampaignServiceGetCampaignsHandler = (
|
11
|
+
offset?: number,
|
12
|
+
limit?: number,
|
13
|
+
) => Promise<PaginatedAPIResponseV2<Campaign>>
|
14
|
+
export type CampaignServiceGetCampaignDetailHandler = (
|
15
|
+
campaignId: string,
|
16
|
+
detail: "status",
|
17
|
+
) => Promise<ProductSupportingContractsComplete>
|
18
|
+
export type CampaignServiceGetCampaignHandler = (
|
19
|
+
campaignId: string,
|
20
|
+
) => Promise<ProductSupportingContractsComplete>
|
21
|
+
export type CampaignServiceSetCampaignCancellationHandler = (
|
22
|
+
campaignId: string,
|
23
|
+
body: Partial<Campaign>,
|
24
|
+
) => Promise<ProductSupportingContractsComplete>
|
25
|
+
export type CampaignServiceGetEducationLevelsHandler = () => Promise<
|
26
|
+
TaxonomyEducationAndSeniorityLevel[]
|
27
|
+
>
|
28
|
+
export type CampaignServiceGetSenioritiesHandler = () => Promise<
|
29
|
+
TaxonomyEducationAndSeniorityLevel[]
|
30
|
+
>
|
31
|
+
export type CampaignServiceOrderCampaignHandler = () => Promise<Campaign>
|
32
|
+
export type CampaignServiceCopyCampaignHandler = (
|
33
|
+
campaign: Campaign,
|
34
|
+
) => Promise<Campaign>
|
35
|
+
|
36
|
+
export type WindowHapiServiceCampaign = WindowHapiModuleWithConstructorArgs<
|
37
|
+
{
|
38
|
+
getCampaigns: HapiServiceFunctionWithLifecycleHooks<CampaignServiceGetCampaignsHandler>
|
39
|
+
getCampaignDetail: HapiServiceFunctionWithLifecycleHooks<CampaignServiceGetCampaignDetailHandler>
|
40
|
+
getCampaign: HapiServiceFunctionWithLifecycleHooks<CampaignServiceGetCampaignHandler>
|
41
|
+
setCampaignCancellation: HapiServiceFunctionWithLifecycleHooks<CampaignServiceSetCampaignCancellationHandler>
|
42
|
+
getEducationLevels: HapiServiceFunctionWithLifecycleHooks<CampaignServiceGetEducationLevelsHandler>
|
43
|
+
getSeniorities: HapiServiceFunctionWithLifecycleHooks<CampaignServiceGetSenioritiesHandler>
|
44
|
+
orderCampaign: HapiServiceFunctionWithLifecycleHooks<CampaignServiceOrderCampaignHandler>
|
45
|
+
copyCampaign: HapiServiceFunctionWithLifecycleHooks<CampaignServiceCopyCampaignHandler>
|
46
|
+
},
|
47
|
+
{ readonly service: WindowHapiService }
|
48
|
+
>
|
@@ -0,0 +1,55 @@
|
|
1
|
+
import {
|
2
|
+
Campaign,
|
3
|
+
CampaignCreateForm,
|
4
|
+
TaxonomyEducationAndSeniorityLevel,
|
5
|
+
TaxonomyEmploymentTypes,
|
6
|
+
TaxonomySeniority,
|
7
|
+
} from "./types"
|
8
|
+
import { PaginationResponseV2 } from "../common/types"
|
9
|
+
|
10
|
+
export type CampaignState = {
|
11
|
+
/* Campaign */
|
12
|
+
/**
|
13
|
+
* Array of Campaign Objects for listing in Campaigns Landing and Campaigns List (both Card and Accordion Table Layout) widgets
|
14
|
+
*/
|
15
|
+
campaigns: Campaign[]
|
16
|
+
/**
|
17
|
+
* An object that holds information like next URL, previous URL and count for pagination purposes
|
18
|
+
*/
|
19
|
+
campaignsPaginationMeta: PaginationResponseV2
|
20
|
+
/**
|
21
|
+
* Used to show a loading spinner in Campaign widgets that show list of campaigns
|
22
|
+
*/
|
23
|
+
campaignsAreLoading: boolean
|
24
|
+
/**
|
25
|
+
* Object used to create (order) a campaign
|
26
|
+
*/
|
27
|
+
campaignForm: CampaignCreateForm
|
28
|
+
/**
|
29
|
+
* Shows a loading spinner and disables the buttons in Campaign Create Form while creating a Campaign
|
30
|
+
*/
|
31
|
+
campaignIsCreating: boolean
|
32
|
+
/* Education Levels */
|
33
|
+
/**
|
34
|
+
* Array of Education Levels that end user will select via a Select HTML element
|
35
|
+
*/
|
36
|
+
educationLevels: TaxonomyEducationAndSeniorityLevel[]
|
37
|
+
/**
|
38
|
+
* Used to show a loading spinner and also disable the Select HTML element while values for Education Levels is loading
|
39
|
+
*/
|
40
|
+
educationLevelsAreLoading: boolean
|
41
|
+
/* Seniorities */
|
42
|
+
/**
|
43
|
+
* Array of Seniorities that end user will select via a Select HTML element
|
44
|
+
*/
|
45
|
+
seniorities: TaxonomySeniority[]
|
46
|
+
/**
|
47
|
+
* Used to show a loading spinner and also disable the Select HTML element while values for Seniorities is loading
|
48
|
+
*/
|
49
|
+
senioritiesAreLoading: boolean
|
50
|
+
/* Employment Types */
|
51
|
+
/**
|
52
|
+
* Array of Employment Types that end user will select via a Select HTML element
|
53
|
+
*/
|
54
|
+
employmentTypes: TaxonomyEmploymentTypes[]
|
55
|
+
}
|
@@ -0,0 +1,237 @@
|
|
1
|
+
import { ProductDuration, ProductIndustry } from "../product/types"
|
2
|
+
import { ContractPostingRequirement } from "../contract/types"
|
3
|
+
import { ProductPriceCurrency } from "../product/enums"
|
4
|
+
import { EmploymentType, SalaryPeriod } from "./enums"
|
5
|
+
|
6
|
+
export type CampaignProductSpecs = {
|
7
|
+
contractId: string | null
|
8
|
+
deliveredOn: string | null
|
9
|
+
duration: string
|
10
|
+
durationPeriod: ProductDuration
|
11
|
+
jobBoardLink: string | null
|
12
|
+
postingRequirements: Record<string, any> | null
|
13
|
+
productId: string
|
14
|
+
status: CampaignStatus
|
15
|
+
utm: string | null
|
16
|
+
statusDescription: string | null
|
17
|
+
}
|
18
|
+
|
19
|
+
export type CampaignPostingDetailsContactInfo = {
|
20
|
+
emailAddress?: string | null
|
21
|
+
name?: string | null
|
22
|
+
phoneNumber?: string | null
|
23
|
+
}
|
24
|
+
|
25
|
+
export type CampaignPostingDetailsOrganization = {
|
26
|
+
companyLogo: string
|
27
|
+
name: string
|
28
|
+
}
|
29
|
+
|
30
|
+
export type CampaignProductPostingDetailsSalaryIndicationRange = {
|
31
|
+
currency?: string | null
|
32
|
+
from?: number | null
|
33
|
+
to: number
|
34
|
+
}
|
35
|
+
|
36
|
+
export type CampaignPostingDetailsSalaryIndication = {
|
37
|
+
period: SalaryPeriod
|
38
|
+
range: CampaignProductPostingDetailsSalaryIndicationRange
|
39
|
+
}
|
40
|
+
|
41
|
+
export type CampaignPostingDetailsWeeklyWorkingHours = {
|
42
|
+
to: number
|
43
|
+
from?: number | null
|
44
|
+
}
|
45
|
+
|
46
|
+
export type CampaignPostingDetailsWorkingLocation = {
|
47
|
+
addressLine1: string
|
48
|
+
addressLine2: string
|
49
|
+
allowsRemoteWork?: boolean | number | null
|
50
|
+
city: string
|
51
|
+
country: string
|
52
|
+
postCode?: string | null
|
53
|
+
postcode: string
|
54
|
+
}
|
55
|
+
|
56
|
+
export type CampaignPostingDetails = {
|
57
|
+
applicationUrl: string
|
58
|
+
contactInfo: CampaignPostingDetailsContactInfo
|
59
|
+
description: string
|
60
|
+
employmentType: EmploymentType
|
61
|
+
jobPageUrl: string
|
62
|
+
organization: CampaignPostingDetailsOrganization
|
63
|
+
salaryIndication: CampaignPostingDetailsSalaryIndication
|
64
|
+
title: string
|
65
|
+
weeklyWorkingHours: CampaignPostingDetailsWeeklyWorkingHours
|
66
|
+
workingLocation: CampaignPostingDetailsWorkingLocation
|
67
|
+
yearsOfExperience: number
|
68
|
+
}
|
69
|
+
|
70
|
+
export type CampaignPosting = {
|
71
|
+
clicks: number
|
72
|
+
name: string
|
73
|
+
productId: string
|
74
|
+
}
|
75
|
+
|
76
|
+
export type CampaignRecruiterInfo = {
|
77
|
+
id?: number | null
|
78
|
+
name: string
|
79
|
+
emailAddress?: string | null
|
80
|
+
}
|
81
|
+
|
82
|
+
export type CampaignTargetGroupData = {
|
83
|
+
description: string
|
84
|
+
vonqId: string | number
|
85
|
+
}
|
86
|
+
|
87
|
+
export type CampaignTargetGroup = {
|
88
|
+
educationLevel: CampaignTargetGroupData[]
|
89
|
+
industry: CampaignTargetGroupData[]
|
90
|
+
jobCategory: CampaignTargetGroupData[]
|
91
|
+
seniority: CampaignTargetGroupData[]
|
92
|
+
}
|
93
|
+
|
94
|
+
export type CampaignTotalPrice = {
|
95
|
+
amount: number
|
96
|
+
currency: ProductPriceCurrency
|
97
|
+
}
|
98
|
+
|
99
|
+
export type CampaignStatus = "in progress" | "offline"
|
100
|
+
|
101
|
+
export type CampaignDetailsStatusOrderedProductStatus = {
|
102
|
+
productId: string
|
103
|
+
status: CampaignStatus
|
104
|
+
statusDescription: string | null
|
105
|
+
}
|
106
|
+
|
107
|
+
export type CampaignDetailedStatus = {
|
108
|
+
campaignId: string
|
109
|
+
status: CampaignStatus
|
110
|
+
orderedProductsStatuses: CampaignDetailsStatusOrderedProductStatus[]
|
111
|
+
}
|
112
|
+
|
113
|
+
export type Campaign = {
|
114
|
+
currency: ProductPriceCurrency
|
115
|
+
campaignId: string
|
116
|
+
campaignName: string | null
|
117
|
+
companyId: string
|
118
|
+
createdOn: string
|
119
|
+
customerId: string
|
120
|
+
orderReference: string | null
|
121
|
+
orderedProducts: string[]
|
122
|
+
orderedProductsSpecs: CampaignProductSpecs[]
|
123
|
+
postingDetails: CampaignPostingDetails
|
124
|
+
postings: CampaignPosting[]
|
125
|
+
recruiterInfo: CampaignRecruiterInfo
|
126
|
+
status: CampaignStatus
|
127
|
+
targetGroup: CampaignTargetGroup
|
128
|
+
totalPrice: CampaignTotalPrice
|
129
|
+
walletId: string
|
130
|
+
detailedStatus?: CampaignDetailedStatus //this is only added virtually on FE on demand
|
131
|
+
}
|
132
|
+
|
133
|
+
export type CampaignCreateFormTargetGroupEducationLevel =
|
134
|
+
TaxonomyEducationAndSeniorityLevel
|
135
|
+
|
136
|
+
export type CampaignCreateFormTargetGroupSeniority = TaxonomySeniority
|
137
|
+
|
138
|
+
export type CampaignCreateFormTargetGroupIndustry = ProductIndustry
|
139
|
+
|
140
|
+
export type CampaignCreateFormTargetGroupJobCategory = {
|
141
|
+
label: string
|
142
|
+
value: number
|
143
|
+
}
|
144
|
+
|
145
|
+
export type CampaignCreateFormTargetGroup = {
|
146
|
+
educationLevel: CampaignCreateFormTargetGroupEducationLevel[]
|
147
|
+
seniority: CampaignCreateFormTargetGroupSeniority[]
|
148
|
+
industry: CampaignCreateFormTargetGroupIndustry[]
|
149
|
+
jobCategory: CampaignCreateFormTargetGroupJobCategory[]
|
150
|
+
}
|
151
|
+
|
152
|
+
export type CampaignCreateFormOrderedProductSpecBase = {
|
153
|
+
productId: string
|
154
|
+
utm: string
|
155
|
+
contractId: string
|
156
|
+
postingRequirements: ContractPostingRequirement[]
|
157
|
+
}
|
158
|
+
export type CampaignCreateFormOrderedProductSpec =
|
159
|
+
CampaignCreateFormOrderedProductSpecBase & { [k: string]: any }
|
160
|
+
|
161
|
+
export type CampaignCreateForm = {
|
162
|
+
companyId: string
|
163
|
+
campaignName?: string | null
|
164
|
+
poNumber?: string
|
165
|
+
targetGroup: CampaignCreateFormTargetGroup
|
166
|
+
recruiterInfo: CampaignRecruiterInfo
|
167
|
+
postingDetails: {
|
168
|
+
title: string
|
169
|
+
description: string
|
170
|
+
organization: CampaignPostingDetailsOrganization
|
171
|
+
workingLocation: CampaignPostingDetailsWorkingLocation
|
172
|
+
yearsOfExperience: number
|
173
|
+
employmentType: EmploymentType
|
174
|
+
weeklyWorkingHours: CampaignPostingDetailsWeeklyWorkingHours
|
175
|
+
salaryIndication: CampaignPostingDetailsSalaryIndication
|
176
|
+
contactInfo: CampaignPostingDetailsContactInfo
|
177
|
+
jobPageUrl: string
|
178
|
+
applicationUrl: string
|
179
|
+
}
|
180
|
+
orderedProducts: string[] //Array of UUIDs
|
181
|
+
orderedProductsSpecs: Record<string, CampaignCreateFormOrderedProductSpec>
|
182
|
+
}
|
183
|
+
|
184
|
+
export type CampaignOrderRequestBodyOrderedProductsSpec = {
|
185
|
+
contractId: string
|
186
|
+
utm: string
|
187
|
+
productId: string
|
188
|
+
postingRequirements?: any
|
189
|
+
}
|
190
|
+
|
191
|
+
export type CampaignOrderRequestBody = {
|
192
|
+
companyId: string
|
193
|
+
campaignName: string | null | undefined
|
194
|
+
walletId?: string
|
195
|
+
poNumber?: string
|
196
|
+
recruiterInfo: Omit<CampaignRecruiterInfo, "id">
|
197
|
+
postingDetails: CampaignPostingDetails
|
198
|
+
targetGroup: CampaignTargetGroup
|
199
|
+
orderedProducts: string[]
|
200
|
+
orderedProductsSpecs: CampaignOrderRequestBodyOrderedProductsSpec[]
|
201
|
+
currency: string
|
202
|
+
}
|
203
|
+
|
204
|
+
export type CampaignTaxonomyNameWithLanguage = {
|
205
|
+
languageCode: string
|
206
|
+
value: string
|
207
|
+
}
|
208
|
+
|
209
|
+
export type TaxonomyEducationLevelName = CampaignTaxonomyNameWithLanguage
|
210
|
+
|
211
|
+
export type TaxonomySeniorityName = CampaignTaxonomyNameWithLanguage
|
212
|
+
|
213
|
+
export type TaxonomySeniority = {
|
214
|
+
id: number
|
215
|
+
name: TaxonomySeniorityName[]
|
216
|
+
}
|
217
|
+
|
218
|
+
export type TaxonomyEducationAndSeniorityLevel = {
|
219
|
+
id: number
|
220
|
+
name: TaxonomyEducationLevelName[]
|
221
|
+
}
|
222
|
+
|
223
|
+
export type TaxonomyEmploymentTypes = {
|
224
|
+
value: EmploymentType
|
225
|
+
label: string
|
226
|
+
}
|
227
|
+
export type TransformedPostingRequirementOption = {
|
228
|
+
value?: string
|
229
|
+
options?: { label: string; value: string; data?: any[] }[]
|
230
|
+
label: string
|
231
|
+
}
|
232
|
+
export type TransformedPostingRequirement = Omit<
|
233
|
+
ContractPostingRequirement,
|
234
|
+
"options"
|
235
|
+
> & {
|
236
|
+
options: TransformedPostingRequirementOption[] | null
|
237
|
+
}
|
@@ -0,0 +1,59 @@
|
|
1
|
+
import {
|
2
|
+
Campaign,
|
3
|
+
CampaignCreateForm,
|
4
|
+
CampaignCreateFormOrderedProductSpec,
|
5
|
+
CampaignCreateFormTargetGroup,
|
6
|
+
CampaignCreateFormTargetGroupEducationLevel,
|
7
|
+
CampaignCreateFormTargetGroupIndustry,
|
8
|
+
CampaignCreateFormTargetGroupJobCategory,
|
9
|
+
CampaignCreateFormTargetGroupSeniority,
|
10
|
+
CampaignOrderRequestBody,
|
11
|
+
CampaignOrderRequestBodyOrderedProductsSpec,
|
12
|
+
CampaignTargetGroup,
|
13
|
+
CampaignTargetGroupData,
|
14
|
+
} from "./types"
|
15
|
+
import { Product } from "../product/types"
|
16
|
+
import { Contract } from "../contract/types"
|
17
|
+
import { BasketProduct } from "../basket/types"
|
18
|
+
import { WindowHapiUtils } from "../_window/utils.types"
|
19
|
+
import { WindowHapiModuleWithConstructorArgs } from "../_window"
|
20
|
+
|
21
|
+
export type WindowHapiUtilsCampaign = WindowHapiModuleWithConstructorArgs<
|
22
|
+
{
|
23
|
+
getInitialCampaignForm: () => CampaignCreateForm
|
24
|
+
mapCampaignsAndUpdateById: (
|
25
|
+
campaignId: string,
|
26
|
+
campaign: Partial<Campaign>,
|
27
|
+
) => void
|
28
|
+
getOrderCampaignRequestBody: () => CampaignOrderRequestBody
|
29
|
+
getCopyCampaignRequestBody: (
|
30
|
+
campaign: Campaign,
|
31
|
+
) => CampaignOrderRequestBody
|
32
|
+
getPostBodyValuesForTargetGroupProperty: (
|
33
|
+
selectValue:
|
34
|
+
| CampaignCreateFormTargetGroupEducationLevel[]
|
35
|
+
| CampaignCreateFormTargetGroupSeniority[]
|
36
|
+
| CampaignCreateFormTargetGroupIndustry[]
|
37
|
+
| CampaignCreateFormTargetGroupJobCategory[]
|
38
|
+
| undefined,
|
39
|
+
type: "educationLevel" | "seniority" | "industry" | "jobCategory",
|
40
|
+
) => CampaignTargetGroupData[]
|
41
|
+
getPostBodyForTargetGroup: (
|
42
|
+
targetGroup: CampaignCreateFormTargetGroup,
|
43
|
+
) => CampaignTargetGroup
|
44
|
+
getPostBodyForOrderedProductsFromBasketProducts: (
|
45
|
+
productsOrContracts: (Contract | Product)[],
|
46
|
+
) => string[]
|
47
|
+
getPostBodyForOrderedProductsSpecs: (
|
48
|
+
products: (Product | Contract)[],
|
49
|
+
orderedProductsSpecs: Record<
|
50
|
+
string,
|
51
|
+
CampaignCreateFormOrderedProductSpec
|
52
|
+
>,
|
53
|
+
) => CampaignOrderRequestBodyOrderedProductsSpec[]
|
54
|
+
getPostBodyForOrderedProductsSpecsPostingRequirement: (
|
55
|
+
postingRequirement: any,
|
56
|
+
) => any
|
57
|
+
},
|
58
|
+
{ readonly utils: WindowHapiUtils }
|
59
|
+
>
|