@blackcode_sa/metaestetics-api 1.4.15 → 1.4.16

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/index.js CHANGED
@@ -5307,6 +5307,21 @@ var AuthService = class extends BaseService {
5307
5307
  );
5308
5308
  throw adminCreationError;
5309
5309
  }
5310
+ try {
5311
+ console.log("[AUTH] Updating user with admin profile reference");
5312
+ user = await this.userService.updateUser(firebaseUser.uid, {
5313
+ adminProfile: adminProfile.id
5314
+ });
5315
+ console.log(
5316
+ "[AUTH] User updated with admin profile reference successfully"
5317
+ );
5318
+ } catch (userUpdateError) {
5319
+ console.error(
5320
+ "[AUTH] Failed to update user with admin profile:",
5321
+ userUpdateError
5322
+ );
5323
+ throw userUpdateError;
5324
+ }
5310
5325
  const createClinicGroupData = {
5311
5326
  name: data.clinicGroupData.name,
5312
5327
  hqLocation: data.clinicGroupData.hqLocation,
package/dist/index.mjs CHANGED
@@ -5284,6 +5284,21 @@ var AuthService = class extends BaseService {
5284
5284
  );
5285
5285
  throw adminCreationError;
5286
5286
  }
5287
+ try {
5288
+ console.log("[AUTH] Updating user with admin profile reference");
5289
+ user = await this.userService.updateUser(firebaseUser.uid, {
5290
+ adminProfile: adminProfile.id
5291
+ });
5292
+ console.log(
5293
+ "[AUTH] User updated with admin profile reference successfully"
5294
+ );
5295
+ } catch (userUpdateError) {
5296
+ console.error(
5297
+ "[AUTH] Failed to update user with admin profile:",
5298
+ userUpdateError
5299
+ );
5300
+ throw userUpdateError;
5301
+ }
5287
5302
  const createClinicGroupData = {
5288
5303
  name: data.clinicGroupData.name,
5289
5304
  hqLocation: data.clinicGroupData.hqLocation,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@blackcode_sa/metaestetics-api",
3
3
  "private": false,
4
- "version": "1.4.15",
4
+ "version": "1.4.16",
5
5
  "description": "Firebase authentication service with anonymous upgrade support",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.mjs",
@@ -110,7 +110,7 @@ export class AuthService extends BaseService {
110
110
  async signUpClinicAdmin(data: ClinicAdminSignupData): Promise<{
111
111
  user: User;
112
112
  clinicGroup: ClinicGroup;
113
- clinicAdmin: ClinicAdmin; // Using 'any' for now, replace with proper type if available
113
+ clinicAdmin: ClinicAdmin;
114
114
  }> {
115
115
  try {
116
116
  console.log("[AUTH] Starting clinic admin signup process", {
@@ -243,6 +243,23 @@ export class AuthService extends BaseService {
243
243
  throw adminCreationError;
244
244
  }
245
245
 
246
+ // Update user document with admin profile reference
247
+ try {
248
+ console.log("[AUTH] Updating user with admin profile reference");
249
+ user = await this.userService.updateUser(firebaseUser.uid, {
250
+ adminProfile: adminProfile.id,
251
+ });
252
+ console.log(
253
+ "[AUTH] User updated with admin profile reference successfully"
254
+ );
255
+ } catch (userUpdateError) {
256
+ console.error(
257
+ "[AUTH] Failed to update user with admin profile:",
258
+ userUpdateError
259
+ );
260
+ throw userUpdateError;
261
+ }
262
+
246
263
  // Then create clinic group
247
264
  const createClinicGroupData: CreateClinicGroupData = {
248
265
  name: data.clinicGroupData.name,