@blackcode_sa/metaestetics-api 1.15.17-staging.5 → 1.15.17-staging.6

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.
@@ -4961,7 +4961,7 @@ var ClinicAggregationService = class {
4961
4961
  try {
4962
4962
  await groupRef.update({
4963
4963
  clinicsInfo: admin8.firestore.FieldValue.arrayUnion(clinicInfo),
4964
- clinicIds: admin8.firestore.FieldValue.arrayUnion(clinicId),
4964
+ clinics: admin8.firestore.FieldValue.arrayUnion(clinicId),
4965
4965
  updatedAt: admin8.firestore.FieldValue.serverTimestamp()
4966
4966
  });
4967
4967
  console.log(
@@ -4883,7 +4883,7 @@ var ClinicAggregationService = class {
4883
4883
  try {
4884
4884
  await groupRef.update({
4885
4885
  clinicsInfo: admin8.firestore.FieldValue.arrayUnion(clinicInfo),
4886
- clinicIds: admin8.firestore.FieldValue.arrayUnion(clinicId),
4886
+ clinics: admin8.firestore.FieldValue.arrayUnion(clinicId),
4887
4887
  updatedAt: admin8.firestore.FieldValue.serverTimestamp()
4888
4888
  });
4889
4889
  console.log(
package/dist/index.js CHANGED
@@ -17799,7 +17799,6 @@ var AuthService = class extends BaseService {
17799
17799
  });
17800
17800
  console.log("[AUTH] Updating admin with clinic group ID");
17801
17801
  await clinicAdminService.updateClinicAdmin(adminProfile.id, {
17802
- // Use admin profile ID, not user UID
17803
17802
  clinicGroupId: clinicGroup.id
17804
17803
  });
17805
17804
  console.log("[AUTH] Admin updated with clinic group ID successfully");
package/dist/index.mjs CHANGED
@@ -17868,7 +17868,6 @@ var AuthService = class extends BaseService {
17868
17868
  });
17869
17869
  console.log("[AUTH] Updating admin with clinic group ID");
17870
17870
  await clinicAdminService.updateClinicAdmin(adminProfile.id, {
17871
- // Use admin profile ID, not user UID
17872
17871
  clinicGroupId: clinicGroup.id
17873
17872
  });
17874
17873
  console.log("[AUTH] Admin updated with clinic group ID successfully");
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@blackcode_sa/metaestetics-api",
3
3
  "private": false,
4
- "version": "1.15.17-staging.5",
4
+ "version": "1.15.17-staging.6",
5
5
  "description": "Firebase authentication service with anonymous upgrade support",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.mjs",
@@ -59,7 +59,7 @@ export class ClinicAggregationService {
59
59
  try {
60
60
  await groupRef.update({
61
61
  clinicsInfo: admin.firestore.FieldValue.arrayUnion(clinicInfo),
62
- clinicIds: admin.firestore.FieldValue.arrayUnion(clinicId),
62
+ clinics: admin.firestore.FieldValue.arrayUnion(clinicId),
63
63
  updatedAt: admin.firestore.FieldValue.serverTimestamp(),
64
64
  });
65
65
 
@@ -319,11 +319,12 @@ export class AuthService extends BaseService {
319
319
  // Now update the admin with the group ID
320
320
  console.log('[AUTH] Updating admin with clinic group ID');
321
321
  await clinicAdminService.updateClinicAdmin(adminProfile.id, {
322
- // Use admin profile ID, not user UID
323
322
  clinicGroupId: clinicGroup.id,
324
323
  });
325
324
  console.log('[AUTH] Admin updated with clinic group ID successfully');
326
325
 
326
+ // adminsInfo is populated by onCreateClinicAdmin Firestore trigger
327
+
327
328
  // Get the updated admin profile
328
329
  adminProfile = await clinicAdminService.getClinicAdmin(adminProfile.id);
329
330
  } catch (groupCreationError) {
@@ -372,9 +372,10 @@ export async function addAdminToGroup(
372
372
  adminId,
373
373
  groupId,
374
374
  });
375
- return; // Admin is already in the group
375
+ return;
376
376
  }
377
377
 
378
+ // Only add the admin ID — adminsInfo is populated by onCreateClinicAdmin trigger
378
379
  console.log("[CLINIC_GROUP] Updating group with new admin");
379
380
  await updateClinicGroup(
380
381
  db,