oro-sdk-apis 1.51.0 → 1.54.0-dev1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/models/practice.d.ts +58 -2
- package/dist/models/workflow.d.ts +1 -1
- package/dist/oro-sdk-apis.cjs.development.js +5 -3
- package/dist/oro-sdk-apis.cjs.development.js.map +1 -1
- package/dist/oro-sdk-apis.cjs.production.min.js +1 -1
- package/dist/oro-sdk-apis.cjs.production.min.js.map +1 -1
- package/dist/oro-sdk-apis.esm.js +5 -3
- package/dist/oro-sdk-apis.esm.js.map +1 -1
- package/dist/services/practice.d.ts +4 -4
- package/package.json +1 -1
- package/src/models/practice.ts +68 -0
- package/src/models/workflow.ts +1 -1
- package/src/services/practice.ts +6 -5
@@ -1,5 +1,5 @@
|
|
1
|
-
import {
|
2
|
-
import { Assignment, AssignmentRequest, PlanType, Practice, PracticeConfigKind, PracticeConfigs, PracticeInvoice, PracticePayment, PracticePaymentIntent, PracticePlan, PracticePlanPrices, PracticeWorkflow, PracticeWorkflowWithTagSpecialty, Practitioner, PractitionerLicense, PractitionerPreference, PractitionerQuota, PractitionerRole, WorkflowType } from '../models/practice';
|
1
|
+
import { PracticeAccount, Uuid } from '../models';
|
2
|
+
import { Assignment, AssignmentRequest, PaymentIntentRequestMetadata, PlanType, Practice, PracticeConfigKind, PracticeConfigs, PracticeInvoice, PracticePayment, PracticePaymentIntent, PracticePlan, PracticePlanPrices, PracticeWorkflow, PracticeWorkflowWithTagSpecialty, Practitioner, PractitionerLicense, PractitionerPreference, PractitionerQuota, PractitionerRole, WorkflowType } from '../models/practice';
|
3
3
|
import { APIService } from './api';
|
4
4
|
export declare class PracticeService {
|
5
5
|
private api;
|
@@ -76,10 +76,10 @@ export declare class PracticeService {
|
|
76
76
|
* @param isoLocality (optional) the desired locality
|
77
77
|
* @param url_subdomain (optional) the url of the sub domain (@bruno-morel need you to document that)
|
78
78
|
* @param promotionCode (optional) promotion code to apply
|
79
|
-
* @param
|
79
|
+
* @param requestMetadata (optional) the request metadata to use. If defined, when payment service call our hooks in practice, it will use it to do required action (create a consult, refill a consult, etc.).
|
80
80
|
* @returns
|
81
81
|
*/
|
82
|
-
practiceCreatePaymentsIntent(practiceUuid: Uuid, planId: number, userEmail: string, isoLocality?: string, url_subdomain?: string,
|
82
|
+
practiceCreatePaymentsIntent(practiceUuid: Uuid, planId: number, userEmail: string, isoLocality?: string, url_subdomain?: string, requestMetadata?: PaymentIntentRequestMetadata): Promise<PracticePaymentIntent>;
|
83
83
|
practiceGetPaymentsIntent(practiceUuid: Uuid, paymentIntentId: number): Promise<PracticePaymentIntent>;
|
84
84
|
/**
|
85
85
|
* Updates a PracticePaymentIntent
|
package/package.json
CHANGED
package/src/models/practice.ts
CHANGED
@@ -148,6 +148,8 @@ export enum PracticeConfigKind {
|
|
148
148
|
PractitionerConsultList = 'PractitionerConsultList',
|
149
149
|
PractitionerSearch = 'PractitionerSearch',
|
150
150
|
PracticeRegisterWalkthrough = 'PracticeRegisterWalkthrough',
|
151
|
+
PracticeExamsAndResults = 'PracticeExamsAndResults',
|
152
|
+
PracticeLayout = 'PracticeLayout',
|
151
153
|
}
|
152
154
|
|
153
155
|
/**
|
@@ -375,6 +377,32 @@ export type PracticeConfigPracticeRegisterWalkthrough = PracticeConfig<
|
|
375
377
|
}
|
376
378
|
>
|
377
379
|
|
380
|
+
/**
|
381
|
+
* This config is used for all configs related to the Exams and Results module
|
382
|
+
*/
|
383
|
+
export type PracticeConfigPracticeExamsAndResults = PracticeConfig<
|
384
|
+
PracticeConfigKind.PracticeExamsAndResults,
|
385
|
+
{
|
386
|
+
/**
|
387
|
+
* If true, then show the deprecated URL prescription pad
|
388
|
+
*/
|
389
|
+
showUrlPrescriptionPad?: boolean
|
390
|
+
}
|
391
|
+
>
|
392
|
+
|
393
|
+
/**
|
394
|
+
* This config is used for all configs related to the Layout of the app (Navbar, Footer, etc)
|
395
|
+
*/
|
396
|
+
export type PracticeConfigPracticeLayout = PracticeConfig<
|
397
|
+
PracticeConfigKind.PracticeLayout,
|
398
|
+
{
|
399
|
+
/**
|
400
|
+
* If true, then show the FAQ link in the Navbar
|
401
|
+
*/
|
402
|
+
showFaqLink?: boolean
|
403
|
+
}
|
404
|
+
>
|
405
|
+
|
378
406
|
export type PracticeConfigs =
|
379
407
|
| PracticeConfigPractitionerSearch
|
380
408
|
| PracticeConfigPractitionerConsultList
|
@@ -388,6 +416,8 @@ export type PracticeConfigs =
|
|
388
416
|
| PracticeConfigPracticeConfigExample // Here for integration tests only
|
389
417
|
| PracticeConfigPracticeConsultTabs
|
390
418
|
| PracticeConfigPatientConsultCard
|
419
|
+
| PracticeConfigPracticeExamsAndResults
|
420
|
+
| PracticeConfigPracticeLayout
|
391
421
|
|
392
422
|
export interface PracticeWorkflow {
|
393
423
|
id?: number ///optional for insertion
|
@@ -504,11 +534,47 @@ export interface PracticePaymentIntent {
|
|
504
534
|
* It will be used to create the consult when stripe use our hook.
|
505
535
|
*/
|
506
536
|
export interface ConsultRequestMetadata {
|
537
|
+
/**
|
538
|
+
* Defines the kind of `PaymentIntentRequestMetadata` it is
|
539
|
+
*
|
540
|
+
* Note: it can be `undefined` to handle backward compatibility when this interface didn't had a `kind`
|
541
|
+
*/
|
542
|
+
kind: 'ConsultRequestMetadata' | undefined
|
543
|
+
/**
|
544
|
+
* The specialty required by the consultation
|
545
|
+
*/
|
507
546
|
tagSpecialtyRequired: string
|
547
|
+
/**
|
548
|
+
* The locality required for the consultation in iso. COUNTRY (ISO 3166) - PROVINCE - COUNTY - CITY
|
549
|
+
*/
|
508
550
|
isoLocalityRequired?: string
|
551
|
+
/**
|
552
|
+
* The language required for the consultation. Should respect ISO 639-3 https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes
|
553
|
+
*/
|
509
554
|
isoLanguageRequired: string
|
510
555
|
}
|
511
556
|
|
557
|
+
/**
|
558
|
+
* This interface is used as metadata when creating Stripe Invoice.
|
559
|
+
* It will be used to create the consult when stripe use our hook.
|
560
|
+
*/
|
561
|
+
export interface RefillTreatmentRequestMetadata {
|
562
|
+
/**
|
563
|
+
* Defines the kind of `PaymentIntentRequestMetadata` it is
|
564
|
+
*/
|
565
|
+
kind: 'RefillTreatmentRequestMetadata'
|
566
|
+
/**
|
567
|
+
* The consult uuid to refill
|
568
|
+
*/
|
569
|
+
consultUuid: string
|
570
|
+
}
|
571
|
+
|
572
|
+
/**
|
573
|
+
* This interface is used as metadata when creating Stripe Invoice.
|
574
|
+
* It will be used when stripe use our hook.
|
575
|
+
*/
|
576
|
+
export type PaymentIntentRequestMetadata = ConsultRequestMetadata | RefillTreatmentRequestMetadata
|
577
|
+
|
512
578
|
export interface AssignmentRequest {
|
513
579
|
uuidAssignor: string //defaulting for insertion to the default practice admin
|
514
580
|
uuidPractitioner?: string
|
@@ -603,6 +669,8 @@ export interface HydratedPracticeConfigs {
|
|
603
669
|
[PracticeConfigKind.PractitionerConsultList]?: PracticeConfigPractitionerConsultList
|
604
670
|
[PracticeConfigKind.PractitionerSearch]?: PracticeConfigPractitionerSearch
|
605
671
|
[PracticeConfigKind.PracticeRegisterWalkthrough]?: PracticeConfigPracticeRegisterWalkthrough
|
672
|
+
[PracticeConfigKind.PracticeExamsAndResults]?: PracticeConfigPracticeExamsAndResults
|
673
|
+
[PracticeConfigKind.PracticeLayout]?: PracticeConfigPracticeLayout
|
606
674
|
}
|
607
675
|
|
608
676
|
export interface Practice {
|
package/src/models/workflow.ts
CHANGED
@@ -215,7 +215,7 @@ export declare type QuestionData =
|
|
215
215
|
IndexedData<ChoiceInputData>
|
216
216
|
>
|
217
217
|
| GroupedGenericQuestionData<
|
218
|
-
'radio' | 'hair-selector-women' | 'hair-selector-men' | 'hair-loss-stage',
|
218
|
+
'radio' | 'hair-selector-women' | 'hair-selector-men' | 'hair-loss-stage' | 'hair-loss-other',
|
219
219
|
IndexedData<RadioInputData>
|
220
220
|
>
|
221
221
|
| GroupedGenericQuestionData<'radio-card' | 'profile-selector', IndexedData<RadioCardInputData>>
|
package/src/services/practice.ts
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
import { hashToBase64String } from '../helpers'
|
2
|
-
import {
|
2
|
+
import { PracticeAccount, Uuid } from '../models'
|
3
3
|
import {
|
4
4
|
Assignment,
|
5
5
|
AssignmentRequest,
|
6
|
+
PaymentIntentRequestMetadata,
|
6
7
|
PlanType,
|
7
8
|
Practice,
|
8
9
|
PracticeConfigKind,
|
@@ -122,7 +123,7 @@ export class PracticeService {
|
|
122
123
|
params: { kind },
|
123
124
|
})
|
124
125
|
}
|
125
|
-
|
126
|
+
|
126
127
|
public practiceGetWorkflow(
|
127
128
|
practiceUuid: Uuid,
|
128
129
|
workflowType: WorkflowType
|
@@ -193,7 +194,7 @@ export class PracticeService {
|
|
193
194
|
* @param isoLocality (optional) the desired locality
|
194
195
|
* @param url_subdomain (optional) the url of the sub domain (@bruno-morel need you to document that)
|
195
196
|
* @param promotionCode (optional) promotion code to apply
|
196
|
-
* @param
|
197
|
+
* @param requestMetadata (optional) the request metadata to use. If defined, when payment service call our hooks in practice, it will use it to do required action (create a consult, refill a consult, etc.).
|
197
198
|
* @returns
|
198
199
|
*/
|
199
200
|
public practiceCreatePaymentsIntent(
|
@@ -202,7 +203,7 @@ export class PracticeService {
|
|
202
203
|
userEmail: string,
|
203
204
|
isoLocality?: string,
|
204
205
|
url_subdomain?: string,
|
205
|
-
|
206
|
+
requestMetadata?: PaymentIntentRequestMetadata
|
206
207
|
): Promise<PracticePaymentIntent> {
|
207
208
|
return this.api.post<PracticePaymentIntent>(
|
208
209
|
`${this.baseURL}/v1/practices/${practiceUuid}/payments/intents/`,
|
@@ -210,7 +211,7 @@ export class PracticeService {
|
|
210
211
|
idPlan: planId,
|
211
212
|
hashUserEmail: userEmail ? this.getPaymentIntentHashedEmail(userEmail) : undefined,
|
212
213
|
isoLocality,
|
213
|
-
|
214
|
+
requestMetadata,
|
214
215
|
},
|
215
216
|
{ params: { url_subdomain } }
|
216
217
|
)
|