@blackcode_sa/metaestetics-api 1.13.17 → 1.13.18

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.d.mts CHANGED
@@ -6793,9 +6793,10 @@ declare class ProcedureService extends BaseService {
6793
6793
  /**
6794
6794
  * Gets all procedures for a clinic branch
6795
6795
  * @param clinicBranchId - The ID of the clinic branch
6796
+ * @param excludeDraftPractitioners - Whether to exclude procedures if the practitioner is in DRAFT status (default: false for admin views)
6796
6797
  * @returns List of procedures
6797
6798
  */
6798
- getProceduresByClinicBranch(clinicBranchId: string): Promise<Procedure[]>;
6799
+ getProceduresByClinicBranch(clinicBranchId: string, excludeDraftPractitioners?: boolean): Promise<Procedure[]>;
6799
6800
  /**
6800
6801
  * Gets all procedures for a practitioner
6801
6802
  * @param practitionerId - The ID of the practitioner
package/dist/index.d.ts CHANGED
@@ -6793,9 +6793,10 @@ declare class ProcedureService extends BaseService {
6793
6793
  /**
6794
6794
  * Gets all procedures for a clinic branch
6795
6795
  * @param clinicBranchId - The ID of the clinic branch
6796
+ * @param excludeDraftPractitioners - Whether to exclude procedures if the practitioner is in DRAFT status (default: false for admin views)
6796
6797
  * @returns List of procedures
6797
6798
  */
6798
- getProceduresByClinicBranch(clinicBranchId: string): Promise<Procedure[]>;
6799
+ getProceduresByClinicBranch(clinicBranchId: string, excludeDraftPractitioners?: boolean): Promise<Procedure[]>;
6799
6800
  /**
6800
6801
  * Gets all procedures for a practitioner
6801
6802
  * @param practitionerId - The ID of the practitioner
package/dist/index.js CHANGED
@@ -20878,9 +20878,10 @@ var ProcedureService = class extends BaseService {
20878
20878
  /**
20879
20879
  * Gets all procedures for a clinic branch
20880
20880
  * @param clinicBranchId - The ID of the clinic branch
20881
+ * @param excludeDraftPractitioners - Whether to exclude procedures if the practitioner is in DRAFT status (default: false for admin views)
20881
20882
  * @returns List of procedures
20882
20883
  */
20883
- async getProceduresByClinicBranch(clinicBranchId) {
20884
+ async getProceduresByClinicBranch(clinicBranchId, excludeDraftPractitioners = false) {
20884
20885
  const q = (0, import_firestore58.query)(
20885
20886
  (0, import_firestore58.collection)(this.db, PROCEDURES_COLLECTION),
20886
20887
  (0, import_firestore58.where)("clinicBranchId", "==", clinicBranchId),
@@ -20888,7 +20889,10 @@ var ProcedureService = class extends BaseService {
20888
20889
  );
20889
20890
  const snapshot = await (0, import_firestore58.getDocs)(q);
20890
20891
  const procedures = snapshot.docs.map((doc47) => doc47.data());
20891
- return await this.filterDraftPractitionerProcedures(procedures);
20892
+ if (excludeDraftPractitioners) {
20893
+ return await this.filterDraftPractitionerProcedures(procedures);
20894
+ }
20895
+ return procedures;
20892
20896
  }
20893
20897
  /**
20894
20898
  * Gets all procedures for a practitioner
package/dist/index.mjs CHANGED
@@ -21114,9 +21114,10 @@ var ProcedureService = class extends BaseService {
21114
21114
  /**
21115
21115
  * Gets all procedures for a clinic branch
21116
21116
  * @param clinicBranchId - The ID of the clinic branch
21117
+ * @param excludeDraftPractitioners - Whether to exclude procedures if the practitioner is in DRAFT status (default: false for admin views)
21117
21118
  * @returns List of procedures
21118
21119
  */
21119
- async getProceduresByClinicBranch(clinicBranchId) {
21120
+ async getProceduresByClinicBranch(clinicBranchId, excludeDraftPractitioners = false) {
21120
21121
  const q = query33(
21121
21122
  collection33(this.db, PROCEDURES_COLLECTION),
21122
21123
  where33("clinicBranchId", "==", clinicBranchId),
@@ -21124,7 +21125,10 @@ var ProcedureService = class extends BaseService {
21124
21125
  );
21125
21126
  const snapshot = await getDocs33(q);
21126
21127
  const procedures = snapshot.docs.map((doc47) => doc47.data());
21127
- return await this.filterDraftPractitionerProcedures(procedures);
21128
+ if (excludeDraftPractitioners) {
21129
+ return await this.filterDraftPractitionerProcedures(procedures);
21130
+ }
21131
+ return procedures;
21128
21132
  }
21129
21133
  /**
21130
21134
  * Gets all procedures for a practitioner
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@blackcode_sa/metaestetics-api",
3
3
  "private": false,
4
- "version": "1.13.17",
4
+ "version": "1.13.18",
5
5
  "description": "Firebase authentication service with anonymous upgrade support",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.mjs",
@@ -1109,9 +1109,13 @@ export class ProcedureService extends BaseService {
1109
1109
  /**
1110
1110
  * Gets all procedures for a clinic branch
1111
1111
  * @param clinicBranchId - The ID of the clinic branch
1112
+ * @param excludeDraftPractitioners - Whether to exclude procedures if the practitioner is in DRAFT status (default: false for admin views)
1112
1113
  * @returns List of procedures
1113
1114
  */
1114
- async getProceduresByClinicBranch(clinicBranchId: string): Promise<Procedure[]> {
1115
+ async getProceduresByClinicBranch(
1116
+ clinicBranchId: string,
1117
+ excludeDraftPractitioners: boolean = false
1118
+ ): Promise<Procedure[]> {
1115
1119
  const q = query(
1116
1120
  collection(this.db, PROCEDURES_COLLECTION),
1117
1121
  where('clinicBranchId', '==', clinicBranchId),
@@ -1120,8 +1124,12 @@ export class ProcedureService extends BaseService {
1120
1124
  const snapshot = await getDocs(q);
1121
1125
  const procedures = snapshot.docs.map(doc => doc.data() as Procedure);
1122
1126
 
1123
- // Filter out procedures from draft practitioners
1124
- return await this.filterDraftPractitionerProcedures(procedures);
1127
+ // Filter out procedures from draft practitioners only if explicitly requested (for patient-facing apps)
1128
+ if (excludeDraftPractitioners) {
1129
+ return await this.filterDraftPractitionerProcedures(procedures);
1130
+ }
1131
+
1132
+ return procedures;
1125
1133
  }
1126
1134
 
1127
1135
  /**