@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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +58 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@timum/timum_pdk",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "license": "MIT",
5
5
  "description": "Contains timum public and general api endpoints",
6
6
  "homepage": "https://www.timum.de",
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
- publicContactData: builder.query({
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}/public_contact_data`),
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
- usePublicContactDataQuery,
178
- useLazyPublicContactDataQuery,
228
+ usePublicDataQuery,
229
+ useLazyPublicDataQuery,
230
+ useReserveAppoinmentMutation,
231
+ useRevokeAppointmentReservationMutation,
179
232
 
180
233
  // ##########################################
181
234
  // # CRM API requests (general api)