@blackcode_sa/metaestetics-api 1.12.52 → 1.12.54

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
@@ -16558,7 +16558,7 @@ var ProcedureService = class extends BaseService {
16558
16558
  rating: ((_a = practitioner.reviewInfo) == null ? void 0 : _a.averageRating) || 0,
16559
16559
  services: practitioner.procedures || []
16560
16560
  };
16561
- const { productsMetadata: _, productId: __, ...validatedDataWithoutProductsMetadata } = validatedData;
16561
+ const { productsMetadata: _, productId: __, photos: ___, ...validatedDataWithoutProductsMetadata } = validatedData;
16562
16562
  const newProcedure = {
16563
16563
  id: procedureId,
16564
16564
  ...validatedDataWithoutProductsMetadata,
@@ -16600,6 +16600,19 @@ var ProcedureService = class extends BaseService {
16600
16600
  isActive: true
16601
16601
  // Default to active
16602
16602
  };
16603
+ console.log("\u{1F525}\u{1F525}\u{1F525} CREATE PROCEDURE - Processing procedure:", procedureId);
16604
+ console.log("\u{1F525}\u{1F525}\u{1F525} FULL PROCEDURE OBJECT:", JSON.stringify(newProcedure, null, 2));
16605
+ const undefinedFields = [];
16606
+ Object.entries(newProcedure).forEach(([key, value]) => {
16607
+ if (value === void 0) {
16608
+ undefinedFields.push(key);
16609
+ }
16610
+ });
16611
+ if (undefinedFields.length > 0) {
16612
+ console.error("\u{1F525}\u{1F525}\u{1F525} UNDEFINED FIELDS DETECTED:", undefinedFields);
16613
+ throw new Error(`Cannot write procedure with undefined fields: ${undefinedFields.join(", ")}`);
16614
+ }
16615
+ console.log("\u{1F525}\u{1F525}\u{1F525} NO UNDEFINED FIELDS - Proceeding with setDoc");
16603
16616
  const procedureRef = (0, import_firestore55.doc)(this.db, PROCEDURES_COLLECTION, procedureId);
16604
16617
  await (0, import_firestore55.setDoc)(procedureRef, {
16605
16618
  ...newProcedure,
@@ -16707,7 +16720,7 @@ var ProcedureService = class extends BaseService {
16707
16720
  const procedureId = this.generateId();
16708
16721
  createdProcedureIds.push(procedureId);
16709
16722
  const procedureRef = (0, import_firestore55.doc)(this.db, PROCEDURES_COLLECTION, procedureId);
16710
- const { productsMetadata: _, productId: __, ...validatedDataWithoutProductsMetadata } = validatedData;
16723
+ const { productsMetadata: _, productId: __, photos: ___, ...validatedDataWithoutProductsMetadata } = validatedData;
16711
16724
  const newProcedure = {
16712
16725
  id: procedureId,
16713
16726
  ...validatedDataWithoutProductsMetadata,
@@ -16746,6 +16759,19 @@ var ProcedureService = class extends BaseService {
16746
16759
  },
16747
16760
  isActive: true
16748
16761
  };
16762
+ console.log("\u{1F525}\u{1F525}\u{1F525} BULK CREATE - Processing procedure:", procedureId, "for practitioner:", practitionerId);
16763
+ console.log("\u{1F525}\u{1F525}\u{1F525} FULL PROCEDURE OBJECT:", JSON.stringify(newProcedure, null, 2));
16764
+ const undefinedFields = [];
16765
+ Object.entries(newProcedure).forEach(([key, value]) => {
16766
+ if (value === void 0) {
16767
+ undefinedFields.push(key);
16768
+ }
16769
+ });
16770
+ if (undefinedFields.length > 0) {
16771
+ console.error("\u{1F525}\u{1F525}\u{1F525} UNDEFINED FIELDS DETECTED:", undefinedFields);
16772
+ throw new Error(`Cannot write procedure with undefined fields: ${undefinedFields.join(", ")}`);
16773
+ }
16774
+ console.log("\u{1F525}\u{1F525}\u{1F525} NO UNDEFINED FIELDS - Proceeding with batch.set");
16749
16775
  batch.set(procedureRef, {
16750
16776
  ...newProcedure,
16751
16777
  createdAt: (0, import_firestore55.serverTimestamp)(),
package/dist/index.mjs CHANGED
@@ -16806,7 +16806,7 @@ var ProcedureService = class extends BaseService {
16806
16806
  rating: ((_a = practitioner.reviewInfo) == null ? void 0 : _a.averageRating) || 0,
16807
16807
  services: practitioner.procedures || []
16808
16808
  };
16809
- const { productsMetadata: _, productId: __, ...validatedDataWithoutProductsMetadata } = validatedData;
16809
+ const { productsMetadata: _, productId: __, photos: ___, ...validatedDataWithoutProductsMetadata } = validatedData;
16810
16810
  const newProcedure = {
16811
16811
  id: procedureId,
16812
16812
  ...validatedDataWithoutProductsMetadata,
@@ -16848,6 +16848,19 @@ var ProcedureService = class extends BaseService {
16848
16848
  isActive: true
16849
16849
  // Default to active
16850
16850
  };
16851
+ console.log("\u{1F525}\u{1F525}\u{1F525} CREATE PROCEDURE - Processing procedure:", procedureId);
16852
+ console.log("\u{1F525}\u{1F525}\u{1F525} FULL PROCEDURE OBJECT:", JSON.stringify(newProcedure, null, 2));
16853
+ const undefinedFields = [];
16854
+ Object.entries(newProcedure).forEach(([key, value]) => {
16855
+ if (value === void 0) {
16856
+ undefinedFields.push(key);
16857
+ }
16858
+ });
16859
+ if (undefinedFields.length > 0) {
16860
+ console.error("\u{1F525}\u{1F525}\u{1F525} UNDEFINED FIELDS DETECTED:", undefinedFields);
16861
+ throw new Error(`Cannot write procedure with undefined fields: ${undefinedFields.join(", ")}`);
16862
+ }
16863
+ console.log("\u{1F525}\u{1F525}\u{1F525} NO UNDEFINED FIELDS - Proceeding with setDoc");
16851
16864
  const procedureRef = doc36(this.db, PROCEDURES_COLLECTION, procedureId);
16852
16865
  await setDoc27(procedureRef, {
16853
16866
  ...newProcedure,
@@ -16955,7 +16968,7 @@ var ProcedureService = class extends BaseService {
16955
16968
  const procedureId = this.generateId();
16956
16969
  createdProcedureIds.push(procedureId);
16957
16970
  const procedureRef = doc36(this.db, PROCEDURES_COLLECTION, procedureId);
16958
- const { productsMetadata: _, productId: __, ...validatedDataWithoutProductsMetadata } = validatedData;
16971
+ const { productsMetadata: _, productId: __, photos: ___, ...validatedDataWithoutProductsMetadata } = validatedData;
16959
16972
  const newProcedure = {
16960
16973
  id: procedureId,
16961
16974
  ...validatedDataWithoutProductsMetadata,
@@ -16994,6 +17007,19 @@ var ProcedureService = class extends BaseService {
16994
17007
  },
16995
17008
  isActive: true
16996
17009
  };
17010
+ console.log("\u{1F525}\u{1F525}\u{1F525} BULK CREATE - Processing procedure:", procedureId, "for practitioner:", practitionerId);
17011
+ console.log("\u{1F525}\u{1F525}\u{1F525} FULL PROCEDURE OBJECT:", JSON.stringify(newProcedure, null, 2));
17012
+ const undefinedFields = [];
17013
+ Object.entries(newProcedure).forEach(([key, value]) => {
17014
+ if (value === void 0) {
17015
+ undefinedFields.push(key);
17016
+ }
17017
+ });
17018
+ if (undefinedFields.length > 0) {
17019
+ console.error("\u{1F525}\u{1F525}\u{1F525} UNDEFINED FIELDS DETECTED:", undefinedFields);
17020
+ throw new Error(`Cannot write procedure with undefined fields: ${undefinedFields.join(", ")}`);
17021
+ }
17022
+ console.log("\u{1F525}\u{1F525}\u{1F525} NO UNDEFINED FIELDS - Proceeding with batch.set");
16997
17023
  batch.set(procedureRef, {
16998
17024
  ...newProcedure,
16999
17025
  createdAt: serverTimestamp31(),
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@blackcode_sa/metaestetics-api",
3
3
  "private": false,
4
- "version": "1.12.52",
4
+ "version": "1.12.54",
5
5
  "description": "Firebase authentication service with anonymous upgrade support",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.mjs",
@@ -291,7 +291,7 @@ export class ProcedureService extends BaseService {
291
291
  };
292
292
 
293
293
  // Create the procedure object
294
- const { productsMetadata: _, productId: __, ...validatedDataWithoutProductsMetadata } = validatedData;
294
+ const { productsMetadata: _, productId: __, photos: ___, ...validatedDataWithoutProductsMetadata } = validatedData;
295
295
  const newProcedure: Omit<Procedure, 'createdAt' | 'updatedAt'> = {
296
296
  id: procedureId,
297
297
  ...validatedDataWithoutProductsMetadata,
@@ -328,6 +328,22 @@ export class ProcedureService extends BaseService {
328
328
  isActive: true, // Default to active
329
329
  };
330
330
 
331
+ // 🔥 DEBUG: Find undefined fields before writing to Firestore
332
+ console.log('🔥🔥🔥 CREATE PROCEDURE - Processing procedure:', procedureId);
333
+ console.log('🔥🔥🔥 FULL PROCEDURE OBJECT:', JSON.stringify(newProcedure, null, 2));
334
+
335
+ const undefinedFields: string[] = [];
336
+ Object.entries(newProcedure).forEach(([key, value]) => {
337
+ if (value === undefined) {
338
+ undefinedFields.push(key);
339
+ }
340
+ });
341
+ if (undefinedFields.length > 0) {
342
+ console.error('🔥🔥🔥 UNDEFINED FIELDS DETECTED:', undefinedFields);
343
+ throw new Error(`Cannot write procedure with undefined fields: ${undefinedFields.join(', ')}`);
344
+ }
345
+ console.log('🔥🔥🔥 NO UNDEFINED FIELDS - Proceeding with setDoc');
346
+
331
347
  // Create the procedure document
332
348
  const procedureRef = doc(this.db, PROCEDURES_COLLECTION, procedureId);
333
349
  await setDoc(procedureRef, {
@@ -484,7 +500,7 @@ export class ProcedureService extends BaseService {
484
500
  const procedureRef = doc(this.db, PROCEDURES_COLLECTION, procedureId);
485
501
 
486
502
  // Construct the new procedure, reusing common data
487
- const { productsMetadata: _, productId: __, ...validatedDataWithoutProductsMetadata } = validatedData;
503
+ const { productsMetadata: _, productId: __, photos: ___, ...validatedDataWithoutProductsMetadata } = validatedData;
488
504
  const newProcedure: Omit<Procedure, 'createdAt' | 'updatedAt'> = {
489
505
  id: procedureId,
490
506
  ...validatedDataWithoutProductsMetadata,
@@ -520,6 +536,22 @@ export class ProcedureService extends BaseService {
520
536
  isActive: true,
521
537
  };
522
538
 
539
+ // 🔥 DEBUG: Find undefined fields before writing to Firestore
540
+ console.log('🔥🔥🔥 BULK CREATE - Processing procedure:', procedureId, 'for practitioner:', practitionerId);
541
+ console.log('🔥🔥🔥 FULL PROCEDURE OBJECT:', JSON.stringify(newProcedure, null, 2));
542
+
543
+ const undefinedFields: string[] = [];
544
+ Object.entries(newProcedure).forEach(([key, value]) => {
545
+ if (value === undefined) {
546
+ undefinedFields.push(key);
547
+ }
548
+ });
549
+ if (undefinedFields.length > 0) {
550
+ console.error('🔥🔥🔥 UNDEFINED FIELDS DETECTED:', undefinedFields);
551
+ throw new Error(`Cannot write procedure with undefined fields: ${undefinedFields.join(', ')}`);
552
+ }
553
+ console.log('🔥🔥🔥 NO UNDEFINED FIELDS - Proceeding with batch.set');
554
+
523
555
  batch.set(procedureRef, {
524
556
  ...newProcedure,
525
557
  createdAt: serverTimestamp(),