@timum/timum_pdk 1.0.7 → 1.0.9
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 +1 -1
- package/src/index.js +58 -5
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -62,18 +62,69 @@ export const timumApiSlice = createApi({
|
|
|
62
62
|
invalidatesTags: (/* result, error, arg */) => [{ type: "Timeslot" }],
|
|
63
63
|
}),
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
/**
|
|
66
|
+
* Returns an object with the following makeup:
|
|
67
|
+
* {
|
|
68
|
+
* contact: {
|
|
69
|
+
* name,
|
|
70
|
+
* email,
|
|
71
|
+
* mobile,
|
|
72
|
+
* phone
|
|
73
|
+
* },
|
|
74
|
+
* resource: {
|
|
75
|
+
* name,
|
|
76
|
+
* description,
|
|
77
|
+
* msgHelpText
|
|
78
|
+
* },
|
|
79
|
+
* provider: {
|
|
80
|
+
* name
|
|
81
|
+
* }
|
|
82
|
+
* }
|
|
83
|
+
*/
|
|
84
|
+
publicData: builder.query({
|
|
66
85
|
query: (props) => ({
|
|
67
|
-
url: constructUrl(`/resources/${props.resourceId}/
|
|
86
|
+
url: constructUrl(`/resources/${props.resourceId}/public_data`),
|
|
68
87
|
}),
|
|
69
88
|
}),
|
|
70
89
|
|
|
71
90
|
identifyCustomer: builder.query({
|
|
72
91
|
query: (props) => ({
|
|
73
92
|
url: constructUrl(
|
|
74
|
-
`/resources/${props.resourceId}/customers/${props.personId}/identify`
|
|
93
|
+
`/crms/${props.crmSlug}/resources/${props.resourceId}/customers/${props.personId}/identify`
|
|
75
94
|
),
|
|
76
95
|
}),
|
|
96
|
+
keepUnusedDataFor: 9999999, // once identifoed it's not going to change
|
|
97
|
+
}),
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* body contain:
|
|
101
|
+
* resource_id*,
|
|
102
|
+
* product_id*,
|
|
103
|
+
* provider_id,
|
|
104
|
+
* timeslotUuid (if available)
|
|
105
|
+
* from* (ISO format),
|
|
106
|
+
* to* (ISO format)
|
|
107
|
+
* -> * marks those which are required.
|
|
108
|
+
*/
|
|
109
|
+
reserveAppoinment: builder.mutation({
|
|
110
|
+
query: (props) => ({
|
|
111
|
+
url: constructUrl(`/resources/${props.resourceId}/reserve_appointment`),
|
|
112
|
+
method: "post",
|
|
113
|
+
body: props.body,
|
|
114
|
+
}),
|
|
115
|
+
}),
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* body must contain:
|
|
119
|
+
* placeholder_id (id created for ephemeral customer during call to),
|
|
120
|
+
* appointment_id
|
|
121
|
+
*/
|
|
122
|
+
revokeAppointmentReservation: builder.mutation({
|
|
123
|
+
query: (props) => ({
|
|
124
|
+
url: constructUrl(`/resources/${props.resourceId}/revoke_reservation`),
|
|
125
|
+
method: "post",
|
|
126
|
+
body: props.body,
|
|
127
|
+
}),
|
|
77
128
|
}),
|
|
78
129
|
|
|
79
130
|
// ##########################################
|
|
@@ -174,8 +225,10 @@ export const {
|
|
|
174
225
|
useCreateAppointmentWithConsumerMutation,
|
|
175
226
|
useIdentifyCustomerQuery,
|
|
176
227
|
useLazyIdentifyCustomerQuery,
|
|
177
|
-
|
|
178
|
-
|
|
228
|
+
usePublicDataQuery,
|
|
229
|
+
useLazyPublicDataQuery,
|
|
230
|
+
useReserveAppoinmentMutation,
|
|
231
|
+
useRevokeAppointmentReservationMutation,
|
|
179
232
|
|
|
180
233
|
// ##########################################
|
|
181
234
|
// # CRM API requests (general api)
|