@workwell-global/component-library 1.1.36 → 1.1.38

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.
@@ -3,6 +3,19 @@ import { createEntityToolkit } from '../helpers/EntityToolkit'
3
3
  import { SimulationToolkit } from './SSimulationAPI'
4
4
  import { d365OwnershipBaseFields } from './bases/SBaseAPI'
5
5
 
6
+ export const Origin = {
7
+ Portal: 127840000,
8
+ Telephone: 127840001,
9
+ Email: 127840002,
10
+ }
11
+
12
+ export const EnquiryStatus = {
13
+ NewEnquiry: 127840000,
14
+ InProgress: 127840001,
15
+ Qualified: 127840002,
16
+ Disqualified: 127840003,
17
+ }
18
+
6
19
  const enquiryFields = {
7
20
  ww_enquiryid: { pretty: 'enquiryId', type: z.string() }, // Required in your type
8
21
  ww_enquirynumber: { pretty: 'enquiryNumber', type: z.string().nullish() },
@@ -6,6 +6,47 @@ import { CurrencyToolkit } from './SCurrencyAPI'
6
6
  import { SolutionToolkit } from './SSolutionAPI'
7
7
  import { d365OwnershipBaseFields } from './bases/SBaseAPI'
8
8
 
9
+ export const SimulationStatus = {
10
+ newSimulation: 127840000,
11
+ draftingSimulation: 127840001,
12
+ pendingApproval: 127840002,
13
+ approved: 127840003,
14
+ rejectedByClient: 127840005,
15
+ rejectedByWWG: 127840006,
16
+ expired: 127840004,
17
+ }
18
+
19
+ export const RoleType = {
20
+ whiteCollar: 127840000,
21
+ blueCollar: 127840001,
22
+ greyCollar: 127840002,
23
+ }
24
+
25
+ export const SimulationBasedOn = {
26
+ totalBillRate: 127840000,
27
+ grossWorkerPayRate: 127840001,
28
+ netWorkerPayRate: 127840002,
29
+ }
30
+
31
+ export const RateFrequency = {
32
+ hourly: 127840000,
33
+ daily: 127840001,
34
+ monthly: 127840002,
35
+ }
36
+
37
+ export const RevenuePaidby = {
38
+ hiringCompany: 1,
39
+ contractor: 2,
40
+ both: 3,
41
+ marginCompany: 4,
42
+ }
43
+
44
+ export const PaymentFrequency = {
45
+ weekly: 1,
46
+ fortnightly: 2,
47
+ monthly: 3,
48
+ }
49
+
9
50
  const simulationFields = {
10
51
  _ww_enquiry_value: {
11
52
  pretty: 'enquiryValue',
@@ -99,9 +99,13 @@ export function create365Schema<TField extends Record<string, FieldObj>>(
99
99
  }
100
100
  }
101
101
 
102
- return z.object(shape) as ZodObject<{
103
- [Key in keyof TField]: ZodTypeAny
104
- }>
102
+ return z.object(shape) as ZodObject<
103
+ {
104
+ [K in keyof TField]: TField[K]['type'] extends ZodTypeAny
105
+ ? TField[K]['type']
106
+ : ZodTypeAny
107
+ } & { [key: string]: ZodTypeAny }
108
+ >
105
109
  }
106
110
 
107
111
  export function createPrettySchema<TField extends Record<string, FieldObj>>(
@@ -123,6 +127,8 @@ export function createPrettySchema<TField extends Record<string, FieldObj>>(
123
127
  }
124
128
 
125
129
  return z.object(shape) as ZodObject<{
126
- [Key in keyof TField as TField[Key]['pretty']]: ZodTypeAny
130
+ [Key in keyof TField as TField[Key]['pretty']]: TField[Key]['type'] extends ZodTypeAny
131
+ ? TField[Key]['type']
132
+ : ZodTypeAny
127
133
  }>
128
134
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workwell-global/component-library",
3
- "version": "1.1.36",
3
+ "version": "1.1.38",
4
4
  "description": "A component library for Workwell",
5
5
  "license": "MIT",
6
6
  "main": "dist/cjs",