oro-sdk-apis 1.37.0 → 1.38.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -75,7 +75,17 @@ export declare class PracticeService {
75
75
  */
76
76
  practiceCreatePaymentsIntent(practiceUuid: Uuid, planId: number, userEmail: string, isoLocality?: string, url_subdomain?: string, consultRequest?: ConsultRequestMetadata): Promise<PracticePaymentIntent>;
77
77
  practiceGetPaymentsIntent(practiceUuid: Uuid, paymentIntentId: number): Promise<PracticePaymentIntent>;
78
- practiceUpdatePaymentsIntent(practiceUuid: string, idPraticePaymentIntent: number, practicePaymentIntent: PracticePaymentIntent, userEmail: string, promotionCode?: string): Promise<PracticePaymentIntent>;
78
+ /**
79
+ * Updates a PracticePaymentIntent
80
+ * @param practiceUuid the practice uuid
81
+ * @param idPraticePaymentIntent the id of the PracticePaymentIntent to update
82
+ * @param practicePaymentIntent the desired PracticePaymentIntent
83
+ * @param userEmail the email of the user
84
+ * @param promotionCode (optional) promotional code to apply
85
+ * @param finalize (optional) if true will finalize the PracticePaymentIntent and related Stripe.Invoice. Once, finalized you cannot modify the PracticePaymentIntent anymore.
86
+ * @returns the updated PracticePaymentIntent
87
+ */
88
+ practiceUpdatePaymentsIntent(practiceUuid: string, idPraticePaymentIntent: number, practicePaymentIntent: PracticePaymentIntent, userEmail: string, promotionCode?: string, finalize?: boolean): Promise<PracticePaymentIntent>;
79
89
  /**
80
90
  * Invoice
81
91
  * @param practiceUuid UUID of the practice to get the invoice from
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.37.0",
2
+ "version": "1.38.2",
3
3
  "main": "dist/index.js",
4
4
  "typings": "dist/index.d.ts",
5
5
  "files": [
@@ -11,3 +11,4 @@ export * from './workflow'
11
11
  export * from './external'
12
12
  export * from './user'
13
13
  export * from './teller'
14
+ export * from './search'
@@ -143,40 +143,40 @@ export enum PracticeConfigKind {
143
143
  PracticePharmacyPicker = 'PracticePharmacyPicker',
144
144
  PracticePrescriptionFields = 'PracticePrescriptionFields',
145
145
  PractitionerChatbox = 'PractitionerChatbox',
146
- PractitionerConsultList = 'PractitionerConsultList'
146
+ PractitionerConsultList = 'PractitionerConsultList',
147
147
  }
148
148
 
149
149
  /**
150
150
  * Defines the close consultation types to hide in the close consultation modal of a practice
151
151
  */
152
- export type PracticeConfigPracticeCloseConsultationTypes = PracticeConfig<
153
- PracticeConfigKind.PracticeCloseConsultationTypes,
154
- {
155
- /**
156
- * Should hide item with value "Completed"
157
- */
158
- hideCompleted?: boolean
159
-
160
- /**
161
- * Should hide item with value "Requires-in-person"
162
- */
163
- hideRequiresInPerson?: boolean
164
-
165
- /**
166
- * Should hide item with value "Other"
167
- */
168
- hideOther?: boolean
169
-
170
- /**
171
- * Should hide item with value "Not-a-disease"
172
- */
173
- hideNotADisease?: boolean
174
-
175
- /**
176
- * Should hide item with value "Appropriate-for-virtual"
177
- */
178
- hideNotAppropriateForVirtual?: boolean
179
- }
152
+ export type PracticeConfigPracticeCloseConsultationTypes = PracticeConfig<
153
+ PracticeConfigKind.PracticeCloseConsultationTypes,
154
+ {
155
+ /**
156
+ * Should hide item with value "Completed"
157
+ */
158
+ hideCompleted?: boolean
159
+
160
+ /**
161
+ * Should hide item with value "Requires-in-person"
162
+ */
163
+ hideRequiresInPerson?: boolean
164
+
165
+ /**
166
+ * Should hide item with value "Other"
167
+ */
168
+ hideOther?: boolean
169
+
170
+ /**
171
+ * Should hide item with value "Not-a-disease"
172
+ */
173
+ hideNotADisease?: boolean
174
+
175
+ /**
176
+ * Should hide item with value "Appropriate-for-virtual"
177
+ */
178
+ hideNotAppropriateForVirtual?: boolean
179
+ }
180
180
  >
181
181
 
182
182
  /**
@@ -202,95 +202,95 @@ export interface PracticeConfig<K, T> {
202
202
 
203
203
  /**
204
204
  * This type is for test (do not remove without updating the integration tests)
205
- */
206
- export type PracticeConfigPracticeConfigExample = PracticeConfig<
207
- PracticeConfigKind.PracticeConfigExample,
208
- { primaryColor?: string }
205
+ */
206
+ export type PracticeConfigPracticeConfigExample = PracticeConfig<
207
+ PracticeConfigKind.PracticeConfigExample,
208
+ { primaryColor?: string }
209
209
  >
210
210
 
211
211
  /**
212
212
  * Defines the practice cookie banner
213
213
  */
214
- export type PracticeConfigPracticeCookieBanner = PracticeConfig<
215
- PracticeConfigKind.PracticeCookieBanner,
216
- {
217
- showCookieBanner?: boolean
218
- policyLink?: string
219
- useOfCookieLink?: string
220
- }
214
+ export type PracticeConfigPracticeCookieBanner = PracticeConfig<
215
+ PracticeConfigKind.PracticeCookieBanner,
216
+ {
217
+ showCookieBanner?: boolean
218
+ policyLink?: string
219
+ useOfCookieLink?: string
220
+ }
221
221
  >
222
222
 
223
223
  /**
224
224
  * This interface describes all practice css variables
225
225
  * The keys should reflect the exact css name
226
226
  */
227
- export type PracticeConfigPracticeCssVariables = PracticeConfig<
228
- PracticeConfigKind.PracticeCssVariables,
229
- Record<string, string>
227
+ export type PracticeConfigPracticeCssVariables = PracticeConfig<
228
+ PracticeConfigKind.PracticeCssVariables,
229
+ Record<string, string>
230
230
  >
231
231
 
232
232
  /**
233
233
  * Defines the font of the practice css url
234
234
  */
235
- export type PracticeConfigPracticeFontsLinks = PracticeConfig<
236
- PracticeConfigKind.PracticeFontsLinks,
237
- {
238
- /**
239
- * sans serif font family
240
- */
241
- sansSerif?: string
242
- /**
243
- * serif font family
244
- */
245
- serif?: string
246
- }
235
+ export type PracticeConfigPracticeFontsLinks = PracticeConfig<
236
+ PracticeConfigKind.PracticeFontsLinks,
237
+ {
238
+ /**
239
+ * sans serif font family
240
+ */
241
+ sansSerif?: string
242
+ /**
243
+ * serif font family
244
+ */
245
+ serif?: string
246
+ }
247
247
  >
248
248
 
249
249
  /**
250
250
  * Defines the locale switcher config
251
251
  */
252
- export type PracticeConfigPracticeLocaleSwitcher = PracticeConfig<
253
- PracticeConfigKind.PracticeLocaleSwitcher,
254
- {
255
- /**
256
- * Should hide the locale switcher
257
- */
258
- hideLocaleSwitcher?: boolean
259
- }
252
+ export type PracticeConfigPracticeLocaleSwitcher = PracticeConfig<
253
+ PracticeConfigKind.PracticeLocaleSwitcher,
254
+ {
255
+ /**
256
+ * Should hide the locale switcher
257
+ */
258
+ hideLocaleSwitcher?: boolean
259
+ }
260
260
  >
261
261
 
262
262
  /**
263
- * Defines the online pharmacy address of the practice
263
+ * Defines the online pharmacy address of the practice
264
264
  */
265
- export type PracticeConfigPracticeOnlinePharmacy = PracticeConfig<
266
- PracticeConfigKind.PracticePharmacyPicker,
267
- {
268
- /**
269
- * The address of the online pharmacy
270
- */
271
- onlinePharmacy?: PlaceData
272
- }
265
+ export type PracticeConfigPracticeOnlinePharmacy = PracticeConfig<
266
+ PracticeConfigKind.PracticePharmacyPicker,
267
+ {
268
+ /**
269
+ * The address of the online pharmacy
270
+ */
271
+ onlinePharmacy?: PlaceData
272
+ }
273
273
  >
274
274
 
275
275
  /**
276
276
  * Defines the consultation chatbox configs
277
277
  */
278
- export type PracticeConfigPractitionerChatbox = PracticeConfig<
279
- PracticeConfigKind.PractitionerChatbox,
280
- {
281
- /**
282
- * If defined will replace the automatic chatbox comment notifiying the patient a new treatment plan has been added. Indexed by locale.
283
- */
284
- planAddedMessage?: { [languageISO639_3: string]: string }
285
- /**
286
- * If defined will replace the automatic chatbox comment notifiying the patient a new treatment plan has been updated. Indexed by locale.
287
- */
288
- planUpdatedMessage?: { [languageISO639_3: string]: string }
289
- /**
290
- * If defined will replace the automatic chatbox comment notifiying the patient a new exam has been dispatched. Indexed by locale.
291
- */
292
- examsUpdatedMessage?: { [languageISO639_3: string]: string }
293
- }
278
+ export type PracticeConfigPractitionerChatbox = PracticeConfig<
279
+ PracticeConfigKind.PractitionerChatbox,
280
+ {
281
+ /**
282
+ * If defined will replace the automatic chatbox comment notifiying the patient a new treatment plan has been added. Indexed by locale.
283
+ */
284
+ planAddedMessage?: { [languageISO639_3: string]: string }
285
+ /**
286
+ * If defined will replace the automatic chatbox comment notifiying the patient a new treatment plan has been updated. Indexed by locale.
287
+ */
288
+ planUpdatedMessage?: { [languageISO639_3: string]: string }
289
+ /**
290
+ * If defined will replace the automatic chatbox comment notifiying the patient a new exam has been dispatched. Indexed by locale.
291
+ */
292
+ examsUpdatedMessage?: { [languageISO639_3: string]: string }
293
+ }
294
294
  >
295
295
 
296
296
  /**
@@ -329,7 +329,7 @@ export type PracticeConfigPracticePrescriptionFields = PracticeConfig<
329
329
  */
330
330
  yCoordinate?: number
331
331
  }
332
- >
332
+ >
333
333
 
334
334
  export type PracticeConfigs =
335
335
  | PracticeConfigPractitionerConsultList
@@ -444,7 +444,10 @@ export interface PracticePaymentIntent {
444
444
  numPlatformFeeAmount: number
445
445
  idStripeInvoice: string
446
446
  idStripePaymtIntent: string
447
- stripeClientSecret: string
447
+ /**
448
+ * This value is set only after the PracticePaymentIntent has been finalized and ready to be paid
449
+ */
450
+ stripeClientSecret?: string
448
451
  dateCreatedAt?: Date
449
452
  dateUpdateAt?: Date
450
453
  }
@@ -612,4 +615,4 @@ export interface PracticeInvoice {
612
615
  subtotal: number
613
616
  currency: string
614
617
  discount: number
615
- }
618
+ }
@@ -7,7 +7,7 @@ export interface SearchResponse {
7
7
  }
8
8
 
9
9
  export interface SearchResult {
10
- consultUUID: string
10
+ consultUuid: string
11
11
  kind: string
12
12
  score: number
13
13
  }
@@ -215,12 +215,23 @@ export class PracticeService {
215
215
  )
216
216
  }
217
217
 
218
+ /**
219
+ * Updates a PracticePaymentIntent
220
+ * @param practiceUuid the practice uuid
221
+ * @param idPraticePaymentIntent the id of the PracticePaymentIntent to update
222
+ * @param practicePaymentIntent the desired PracticePaymentIntent
223
+ * @param userEmail the email of the user
224
+ * @param promotionCode (optional) promotional code to apply
225
+ * @param finalize (optional) if true will finalize the PracticePaymentIntent and related Stripe.Invoice. Once, finalized you cannot modify the PracticePaymentIntent anymore.
226
+ * @returns the updated PracticePaymentIntent
227
+ */
218
228
  public practiceUpdatePaymentsIntent(
219
229
  practiceUuid: string,
220
230
  idPraticePaymentIntent: number,
221
231
  practicePaymentIntent: PracticePaymentIntent,
222
232
  userEmail: string,
223
- promotionCode?: string
233
+ promotionCode?: string,
234
+ finalize?: boolean
224
235
  ) {
225
236
  return this.api.put<PracticePaymentIntent>(
226
237
  `${this.baseURL}/v1/practices/${practiceUuid}/payments/intents/${idPraticePaymentIntent}`,
@@ -228,7 +239,7 @@ export class PracticeService {
228
239
  ...practicePaymentIntent,
229
240
  hashUserEmail: userEmail ? this.getPaymentIntentHashedEmail(userEmail) : undefined,
230
241
  },
231
- { params: { promotionCode } }
242
+ { params: { promotionCode, finalize } }
232
243
  )
233
244
  }
234
245