@blackcode_sa/metaestetics-api 1.13.20 → 1.14.0
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/dist/admin/index.js +13 -2
- package/dist/admin/index.mjs +13 -2
- package/dist/index.d.mts +43 -0
- package/dist/index.d.ts +43 -0
- package/dist/index.js +489 -11
- package/dist/index.mjs +489 -11
- package/package.json +1 -1
- package/src/admin/mailing/practitionerInvite/templates/invitation.template.ts +13 -2
- package/src/services/auth/auth.service.ts +173 -0
- package/src/services/practitioner/practitioner.service.ts +417 -9
- package/src/validations/patient/medical-info.schema.ts +55 -3
package/dist/admin/index.js
CHANGED
|
@@ -11860,10 +11860,21 @@ var practitionerInvitationTemplate = `
|
|
|
11860
11860
|
|
|
11861
11861
|
<p>This token will expire on <strong>{{expirationDate}}</strong>.</p>
|
|
11862
11862
|
|
|
11863
|
-
<p>
|
|
11863
|
+
<p><strong>You have two options to create your account:</strong></p>
|
|
11864
|
+
|
|
11865
|
+
<p><strong>Option 1: Sign in with Google (Recommended)</strong></p>
|
|
11866
|
+
<ol>
|
|
11867
|
+
<li>Open the MetaEsthetics Doctor App</li>
|
|
11868
|
+
<li>Click "Sign in with Google" on the login screen</li>
|
|
11869
|
+
<li>Select your Google account (use the email address: {{practitionerEmail}})</li>
|
|
11870
|
+
<li>You'll see an invitation to join {{clinicName}} - simply select it and join!</li>
|
|
11871
|
+
</ol>
|
|
11872
|
+
|
|
11873
|
+
<p><strong>Option 2: Use Email/Password with Token</strong></p>
|
|
11864
11874
|
<ol>
|
|
11865
11875
|
<li>Visit {{registrationUrl}}</li>
|
|
11866
|
-
<li>
|
|
11876
|
+
<li>Click "Claim Existing Profile with Token"</li>
|
|
11877
|
+
<li>Enter your email ({{practitionerEmail}}) and create a password</li>
|
|
11867
11878
|
<li>When prompted, enter the token above</li>
|
|
11868
11879
|
</ol>
|
|
11869
11880
|
|
package/dist/admin/index.mjs
CHANGED
|
@@ -11787,10 +11787,21 @@ var practitionerInvitationTemplate = `
|
|
|
11787
11787
|
|
|
11788
11788
|
<p>This token will expire on <strong>{{expirationDate}}</strong>.</p>
|
|
11789
11789
|
|
|
11790
|
-
<p>
|
|
11790
|
+
<p><strong>You have two options to create your account:</strong></p>
|
|
11791
|
+
|
|
11792
|
+
<p><strong>Option 1: Sign in with Google (Recommended)</strong></p>
|
|
11793
|
+
<ol>
|
|
11794
|
+
<li>Open the MetaEsthetics Doctor App</li>
|
|
11795
|
+
<li>Click "Sign in with Google" on the login screen</li>
|
|
11796
|
+
<li>Select your Google account (use the email address: {{practitionerEmail}})</li>
|
|
11797
|
+
<li>You'll see an invitation to join {{clinicName}} - simply select it and join!</li>
|
|
11798
|
+
</ol>
|
|
11799
|
+
|
|
11800
|
+
<p><strong>Option 2: Use Email/Password with Token</strong></p>
|
|
11791
11801
|
<ol>
|
|
11792
11802
|
<li>Visit {{registrationUrl}}</li>
|
|
11793
|
-
<li>
|
|
11803
|
+
<li>Click "Claim Existing Profile with Token"</li>
|
|
11804
|
+
<li>Enter your email ({{practitionerEmail}}) and create a password</li>
|
|
11794
11805
|
<li>When prompted, enter the token above</li>
|
|
11795
11806
|
</ol>
|
|
11796
11807
|
|
package/dist/index.d.mts
CHANGED
|
@@ -7029,6 +7029,37 @@ declare class PractitionerService extends BaseService {
|
|
|
7029
7029
|
* - Fields: basicInfo.email (Ascending), status (Ascending), userRef (Ascending)
|
|
7030
7030
|
*/
|
|
7031
7031
|
findDraftPractitionerByEmail(email: string): Promise<Practitioner | null>;
|
|
7032
|
+
/**
|
|
7033
|
+
* Finds all draft practitioner profiles by email address
|
|
7034
|
+
* Used when a doctor signs in with Google to show all clinic invitations
|
|
7035
|
+
*
|
|
7036
|
+
* @param email - Email address to search for
|
|
7037
|
+
* @returns Array of draft practitioner profiles with clinic information
|
|
7038
|
+
*
|
|
7039
|
+
* @remarks
|
|
7040
|
+
* Requires Firestore composite index on:
|
|
7041
|
+
* - Collection: practitioners
|
|
7042
|
+
* - Fields: basicInfo.email (Ascending), status (Ascending), userRef (Ascending)
|
|
7043
|
+
*/
|
|
7044
|
+
getDraftProfilesByEmail(email: string): Promise<Practitioner[]>;
|
|
7045
|
+
/**
|
|
7046
|
+
* Claims a draft practitioner profile and links it to a user account
|
|
7047
|
+
* Used when a doctor selects which clinic(s) to join after Google Sign-In
|
|
7048
|
+
*
|
|
7049
|
+
* @param practitionerId - ID of the draft practitioner profile to claim
|
|
7050
|
+
* @param userId - ID of the user account to link the profile to
|
|
7051
|
+
* @returns The claimed practitioner profile
|
|
7052
|
+
*/
|
|
7053
|
+
claimDraftProfileWithGoogle(practitionerId: string, userId: string): Promise<Practitioner>;
|
|
7054
|
+
/**
|
|
7055
|
+
* Claims multiple draft practitioner profiles and merges them into one profile
|
|
7056
|
+
* Used when a doctor selects multiple clinics to join after Google Sign-In
|
|
7057
|
+
*
|
|
7058
|
+
* @param practitionerIds - Array of draft practitioner profile IDs to claim
|
|
7059
|
+
* @param userId - ID of the user account to link the profiles to
|
|
7060
|
+
* @returns The claimed practitioner profile (first one becomes main, others merged)
|
|
7061
|
+
*/
|
|
7062
|
+
claimMultipleDraftProfilesWithGoogle(practitionerIds: string[], userId: string): Promise<Practitioner>;
|
|
7032
7063
|
/**
|
|
7033
7064
|
* Dohvata sve zdravstvene radnike za određenu kliniku sa statusom ACTIVE
|
|
7034
7065
|
*/
|
|
@@ -8404,6 +8435,18 @@ declare class AuthService extends BaseService {
|
|
|
8404
8435
|
* @returns The signed-in or newly created user.
|
|
8405
8436
|
*/
|
|
8406
8437
|
signInWithGoogleIdToken(idToken: string, initialRole?: UserRole): Promise<User>;
|
|
8438
|
+
/**
|
|
8439
|
+
* Signs up or signs in a practitioner with Google authentication.
|
|
8440
|
+
* Checks for existing practitioner account or draft profiles.
|
|
8441
|
+
*
|
|
8442
|
+
* @param idToken - The Google ID token obtained from the mobile app
|
|
8443
|
+
* @returns Object containing user, practitioner (if exists), and draft profiles (if any)
|
|
8444
|
+
*/
|
|
8445
|
+
signUpPractitionerWithGoogle(idToken: string): Promise<{
|
|
8446
|
+
user: User;
|
|
8447
|
+
practitioner: Practitioner | null;
|
|
8448
|
+
draftProfiles: Practitioner[];
|
|
8449
|
+
}>;
|
|
8407
8450
|
/**
|
|
8408
8451
|
* Links a Google account to the currently signed-in user using an ID token.
|
|
8409
8452
|
* This is used to upgrade an anonymous user or to allow an existing user
|
package/dist/index.d.ts
CHANGED
|
@@ -7029,6 +7029,37 @@ declare class PractitionerService extends BaseService {
|
|
|
7029
7029
|
* - Fields: basicInfo.email (Ascending), status (Ascending), userRef (Ascending)
|
|
7030
7030
|
*/
|
|
7031
7031
|
findDraftPractitionerByEmail(email: string): Promise<Practitioner | null>;
|
|
7032
|
+
/**
|
|
7033
|
+
* Finds all draft practitioner profiles by email address
|
|
7034
|
+
* Used when a doctor signs in with Google to show all clinic invitations
|
|
7035
|
+
*
|
|
7036
|
+
* @param email - Email address to search for
|
|
7037
|
+
* @returns Array of draft practitioner profiles with clinic information
|
|
7038
|
+
*
|
|
7039
|
+
* @remarks
|
|
7040
|
+
* Requires Firestore composite index on:
|
|
7041
|
+
* - Collection: practitioners
|
|
7042
|
+
* - Fields: basicInfo.email (Ascending), status (Ascending), userRef (Ascending)
|
|
7043
|
+
*/
|
|
7044
|
+
getDraftProfilesByEmail(email: string): Promise<Practitioner[]>;
|
|
7045
|
+
/**
|
|
7046
|
+
* Claims a draft practitioner profile and links it to a user account
|
|
7047
|
+
* Used when a doctor selects which clinic(s) to join after Google Sign-In
|
|
7048
|
+
*
|
|
7049
|
+
* @param practitionerId - ID of the draft practitioner profile to claim
|
|
7050
|
+
* @param userId - ID of the user account to link the profile to
|
|
7051
|
+
* @returns The claimed practitioner profile
|
|
7052
|
+
*/
|
|
7053
|
+
claimDraftProfileWithGoogle(practitionerId: string, userId: string): Promise<Practitioner>;
|
|
7054
|
+
/**
|
|
7055
|
+
* Claims multiple draft practitioner profiles and merges them into one profile
|
|
7056
|
+
* Used when a doctor selects multiple clinics to join after Google Sign-In
|
|
7057
|
+
*
|
|
7058
|
+
* @param practitionerIds - Array of draft practitioner profile IDs to claim
|
|
7059
|
+
* @param userId - ID of the user account to link the profiles to
|
|
7060
|
+
* @returns The claimed practitioner profile (first one becomes main, others merged)
|
|
7061
|
+
*/
|
|
7062
|
+
claimMultipleDraftProfilesWithGoogle(practitionerIds: string[], userId: string): Promise<Practitioner>;
|
|
7032
7063
|
/**
|
|
7033
7064
|
* Dohvata sve zdravstvene radnike za određenu kliniku sa statusom ACTIVE
|
|
7034
7065
|
*/
|
|
@@ -8404,6 +8435,18 @@ declare class AuthService extends BaseService {
|
|
|
8404
8435
|
* @returns The signed-in or newly created user.
|
|
8405
8436
|
*/
|
|
8406
8437
|
signInWithGoogleIdToken(idToken: string, initialRole?: UserRole): Promise<User>;
|
|
8438
|
+
/**
|
|
8439
|
+
* Signs up or signs in a practitioner with Google authentication.
|
|
8440
|
+
* Checks for existing practitioner account or draft profiles.
|
|
8441
|
+
*
|
|
8442
|
+
* @param idToken - The Google ID token obtained from the mobile app
|
|
8443
|
+
* @returns Object containing user, practitioner (if exists), and draft profiles (if any)
|
|
8444
|
+
*/
|
|
8445
|
+
signUpPractitionerWithGoogle(idToken: string): Promise<{
|
|
8446
|
+
user: User;
|
|
8447
|
+
practitioner: Practitioner | null;
|
|
8448
|
+
draftProfiles: Practitioner[];
|
|
8449
|
+
}>;
|
|
8407
8450
|
/**
|
|
8408
8451
|
* Links a Google account to the currently signed-in user using an ID token.
|
|
8409
8452
|
* This is used to upgrade an anonymous user or to allow an existing user
|