@vonq/hapi-elements-types 1.24.0 → 1.25.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.
@@ -16,7 +16,6 @@ import {
16
16
  import { PaginatedAPIResponseV2 } from "../common/types"
17
17
  import { WindowHapiModuleWithConstructorArgs } from "../_window"
18
18
  import { AlertKey } from "../alert"
19
- import { EmploymentType } from "./enums"
20
19
 
21
20
  export type CampaignServiceGetCampaignsHandler = (
22
21
  offset?: number,
@@ -4,6 +4,7 @@ import {
4
4
  ContractCreateForm,
5
5
  ContractGroup,
6
6
  ContractGroupCreateForm,
7
+ ContractUpdateForm,
7
8
  } from "./types"
8
9
  import { WindowHapiAPI, WindowHapiAPIModule } from "../_window/api.types"
9
10
  import { PaginatedAPIResponseV1, PaginationLimitOffset } from "../common/types"
@@ -14,6 +15,7 @@ export type WindowHapiAPIContractConfigs = {
14
15
  getContractsByIds: AxiosRequestConfig
15
16
  getContract: AxiosRequestConfig
16
17
  createContract: AxiosRequestConfig
18
+ updateContract: AxiosRequestConfig
17
19
  removeContract: AxiosRequestConfig
18
20
  getPostingRequirementOptions: AxiosRequestConfig
19
21
  getGroups: AxiosRequestConfig
@@ -30,6 +32,10 @@ export type WindowHapiAPIContractRequests = {
30
32
  ) => Promise<PaginatedAPIResponseV1<Contract>>
31
33
  getContract: (contractId: string) => Promise<Contract>
32
34
  createContract: (contract: ContractCreateForm) => Promise<Contract>
35
+ updateContract: (
36
+ contractId: string,
37
+ contract: ContractUpdateForm,
38
+ ) => Promise<Contract>
33
39
  getPostingRequirementOptions: (
34
40
  contractId: string,
35
41
  fieldName: string,
@@ -5,6 +5,7 @@ import {
5
5
  ContractGroup,
6
6
  ContractGroupCreateForm,
7
7
  ContractGroupSelected,
8
+ ContractUpdateForm,
8
9
  } from "./types"
9
10
  import { PaginationResponseV1 } from "../common/types"
10
11
 
@@ -16,7 +17,7 @@ export type ContractState = {
16
17
  contractSelectedId: string | number | null
17
18
  contractSelected: ProductSupportingContractsComplete | null
18
19
  contractSelectedIsLoading: boolean
19
- contractForm: ContractCreateForm
20
+ contractForm: ContractCreateForm | ContractUpdateForm
20
21
  contractCreateError: any
21
22
  contractFormIsValid: boolean | null
22
23
  /* Contracts Groups */
package/contract/types.ts CHANGED
@@ -26,17 +26,20 @@ export type ContractCreateFormCredentials = Record<string, string>
26
26
  export type ContractCreateForm = {
27
27
  id?: number
28
28
  credentials?: ContractCreateFormCredentials
29
- facets?: any
29
+ facets?: any | null
30
30
  expiry_date: string | null
31
31
  alias: string | null
32
- purchase_price: ContractPurchasePrice
32
+ purchase_price: ContractPurchasePrice | null
33
33
  credits: string | null
34
34
  followed_instructions: boolean
35
35
  posting_duration_days: number | null
36
36
  allow_renegotiation: boolean
37
37
  labels: Record<string, string> | null
38
+ posting_requirements_defaults: Record<string, string> | null
38
39
  }
39
40
 
41
+ export type ContractUpdateForm = Omit<ContractCreateForm, "id">
42
+
40
43
  export type ContractGroupCreateForm = {
41
44
  name: string
42
45
  }
@@ -58,7 +61,6 @@ export type Contract = {
58
61
  credits: number | null
59
62
  customer_id: string
60
63
  expiry_date: string | null
61
- facets?: any[]
62
64
  product: ContractProduct
63
65
  purchase_price: ContractPurchasePrice | null
64
66
  posting_duration_days: number | null
package/modal/enums.ts CHANGED
@@ -18,6 +18,7 @@ export enum ModalKeys {
18
18
  basketProductBundleParentClashConfirmation = "basket-product-bundle-parent-clash-confirmation",
19
19
  basketProductBundleChildClashConfirmation = "basket-product-bundle-child-clash-confirmation",
20
20
  contractRemoveConfirmation = "contract-remove-confirmation",
21
+ contractEdit = "contract-edit",
21
22
  contractGroupConflictInfo = "contract-group-conflict-info",
22
23
  filePicker = "file-picker",
23
24
  contractPostingRequirementsSmartFillSuccess = "contract-posting-requirements-smart-fill-success",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@vonq/hapi-elements-types",
4
- "version": "1.24.0",
4
+ "version": "1.25.0",
5
5
  "description": "This package contains Typescript definitions for HAPI Elements",
6
6
  "author": "VONQ HAPI Team",
7
7
  "license": "BSD-3-Clause",
@@ -25,6 +25,9 @@ export type ProductServiceGetFilteredProductsHandler = (
25
25
  filters?: Partial<ProductFilterQueryParams>,
26
26
  ) => Promise<Product[]>
27
27
  export type ProductServiceLoadMoreProductsHandler = () => Promise<Product[]>
28
+ export type ProductServiceLoadMoreFreeAddOnProductsHandler = () => Promise<
29
+ Product[]
30
+ >
28
31
  export type ProductServiceGetProductWithContractsSupportByIdHandler = (
29
32
  id: string | number,
30
33
  ) => Promise<ProductSupportingContractsComplete>
@@ -34,6 +37,7 @@ export type ProductServiceGetProductsWithContractsSupportHandler = (
34
37
  export type ProductServiceGetRecommendedProductsHandler = () => Promise<
35
38
  Product[]
36
39
  >
40
+ export type ProductServiceGetFreeAddOnProductsHandler = () => Promise<Product[]>
37
41
  export type ProductServiceGetProductHandler = (
38
42
  productId: number | string,
39
43
  ) => Promise<Product>
@@ -76,11 +80,13 @@ export type ProductServiceGetProductPostingRequirementsHandler = (
76
80
  export type WindowHapiServiceProduct = WindowHapiModuleWithConstructorArgs<
77
81
  {
78
82
  loadMoreProducts: HapiServiceFunctionWithLifecycleHooks<ProductServiceLoadMoreProductsHandler>
83
+ loadMoreFreeAddOnProducts: HapiServiceFunctionWithLifecycleHooks<ProductServiceLoadMoreFreeAddOnProductsHandler>
79
84
  setArbitraryJobTitle: ProductServiceSetArbitraryJobTitle
80
85
  getProductWithContractsSupportById: HapiServiceFunctionWithLifecycleHooks<ProductServiceGetProductWithContractsSupportByIdHandler>
81
86
  getProductsWithContractsSupport: HapiServiceFunctionWithLifecycleHooks<ProductServiceGetProductsWithContractsSupportHandler>
82
87
  getFilteredProducts: HapiServiceFunctionWithLifecycleHooks<ProductServiceGetFilteredProductsHandler>
83
88
  getRecommendedProducts: HapiServiceFunctionWithLifecycleHooks<ProductServiceGetRecommendedProductsHandler>
89
+ getFreeAddOnProducts: HapiServiceFunctionWithLifecycleHooks<ProductServiceGetFreeAddOnProductsHandler>
84
90
  getProducts: HapiServiceFunctionWithLifecycleHooks<ProductServiceGetProductsHandler>
85
91
  getProduct: HapiServiceFunctionWithLifecycleHooks<ProductServiceGetProductHandler>
86
92
  getLocations: HapiServiceFunctionWithLifecycleHooks<ProductServiceGetLocationsHandler>
@@ -13,6 +13,9 @@ export type ProductState = {
13
13
  /* Products */
14
14
  recommendedProducts: Product[]
15
15
  recommendedProductsAreLoading: boolean
16
+ freeAddOnProducts: Product[]
17
+ freeAddOnProductsAreLoading: boolean
18
+ freeAddOnProductsPaginationMeta: PaginationResponseV1 | null
16
19
  productsWithContractsSupport: ProductSupportingContractsPartial[]
17
20
  productsWithContractsSupportAreLoading: boolean
18
21
  products: Product[]