@blackcode_sa/metaestetics-api 1.5.18 → 1.5.25

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
@@ -7617,7 +7617,7 @@ async function searchCalendarEventsUtil(db, params) {
7617
7617
  "Clinic ID (entityId) is required when searching clinic-related events."
7618
7618
  );
7619
7619
  }
7620
- baseCollectionPath = CALENDAR_COLLECTION;
7620
+ baseCollectionPath = `${CLINICS_COLLECTION}/${entityId}/${CALENDAR_COLLECTION}`;
7621
7621
  constraints.push((0, import_firestore30.where)("clinicBranchId", "==", entityId));
7622
7622
  if (filters.clinicId && filters.clinicId !== entityId) {
7623
7623
  console.warn(
@@ -9492,7 +9492,8 @@ var CalendarServiceV2 = class extends BaseService {
9492
9492
  * @returns Updated calendar event
9493
9493
  */
9494
9494
  async updateAppointmentStatus(appointmentId, clinicId, status) {
9495
- const appointmentRef = (0, import_firestore34.doc)(this.db, CALENDAR_COLLECTION, appointmentId);
9495
+ const baseCollectionPath = `${CLINICS_COLLECTION}/${clinicId}/${CALENDAR_COLLECTION}`;
9496
+ const appointmentRef = (0, import_firestore34.doc)(this.db, baseCollectionPath, appointmentId);
9496
9497
  const appointmentDoc = await (0, import_firestore34.getDoc)(appointmentRef);
9497
9498
  if (!appointmentDoc.exists()) {
9498
9499
  throw new Error(`Appointment with ID ${appointmentId} not found`);
package/dist/index.mjs CHANGED
@@ -7666,7 +7666,7 @@ async function searchCalendarEventsUtil(db, params) {
7666
7666
  "Clinic ID (entityId) is required when searching clinic-related events."
7667
7667
  );
7668
7668
  }
7669
- baseCollectionPath = CALENDAR_COLLECTION;
7669
+ baseCollectionPath = `${CLINICS_COLLECTION}/${entityId}/${CALENDAR_COLLECTION}`;
7670
7670
  constraints.push(where17("clinicBranchId", "==", entityId));
7671
7671
  if (filters.clinicId && filters.clinicId !== entityId) {
7672
7672
  console.warn(
@@ -9552,7 +9552,8 @@ var CalendarServiceV2 = class extends BaseService {
9552
9552
  * @returns Updated calendar event
9553
9553
  */
9554
9554
  async updateAppointmentStatus(appointmentId, clinicId, status) {
9555
- const appointmentRef = doc22(this.db, CALENDAR_COLLECTION, appointmentId);
9555
+ const baseCollectionPath = `${CLINICS_COLLECTION}/${clinicId}/${CALENDAR_COLLECTION}`;
9556
+ const appointmentRef = doc22(this.db, baseCollectionPath, appointmentId);
9556
9557
  const appointmentDoc = await getDoc24(appointmentRef);
9557
9558
  if (!appointmentDoc.exists()) {
9558
9559
  throw new Error(`Appointment with ID ${appointmentId} not found`);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@blackcode_sa/metaestetics-api",
3
3
  "private": false,
4
- "version": "1.5.18",
4
+ "version": "1.5.25",
5
5
  "description": "Firebase authentication service with anonymous upgrade support",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.mjs",
@@ -44,7 +44,8 @@
44
44
  "src"
45
45
  ],
46
46
  "publishConfig": {
47
- "access": "restricted"
47
+ "access": "public",
48
+ "registry": "https://registry.npmjs.org/"
48
49
  },
49
50
  "keywords": [
50
51
  "firebase",
@@ -1084,7 +1084,8 @@ export class CalendarServiceV2 extends BaseService {
1084
1084
  status: CalendarEventStatus
1085
1085
  ): Promise<CalendarEvent> {
1086
1086
  // Get the appointment
1087
- const appointmentRef = doc(this.db, CALENDAR_COLLECTION, appointmentId);
1087
+ const baseCollectionPath = `${CLINICS_COLLECTION}/${clinicId}/${CALENDAR_COLLECTION}`;
1088
+ const appointmentRef = doc(this.db, baseCollectionPath, appointmentId);
1088
1089
  const appointmentDoc = await getDoc(appointmentRef);
1089
1090
 
1090
1091
  if (!appointmentDoc.exists()) {
@@ -579,8 +579,8 @@ export async function searchCalendarEventsUtil(
579
579
  "Clinic ID (entityId) is required when searching clinic-related events."
580
580
  );
581
581
  }
582
- // Search the root CALENDAR_COLLECTION for events associated with the clinic
583
- baseCollectionPath = CALENDAR_COLLECTION;
582
+ // Search the clinic's calendar collection
583
+ baseCollectionPath = `${CLINICS_COLLECTION}/${entityId}/${CALENDAR_COLLECTION}`;
584
584
  constraints.push(where("clinicBranchId", "==", entityId));
585
585
  // If clinicId filter is provided, it must match the entityId for this search location
586
586
  if (filters.clinicId && filters.clinicId !== entityId) {