@blackcode_sa/metaestetics-api 1.13.3 → 1.13.4

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
@@ -6794,9 +6794,10 @@ declare class ProcedureService extends BaseService {
6794
6794
  /**
6795
6795
  * Gets all procedures for a practitioner
6796
6796
  * @param practitionerId - The ID of the practitioner
6797
+ * @param clinicBranchId - Optional clinic branch ID to filter by
6797
6798
  * @returns List of procedures
6798
6799
  */
6799
- getProceduresByPractitioner(practitionerId: string): Promise<Procedure[]>;
6800
+ getProceduresByPractitioner(practitionerId: string, clinicBranchId?: string): Promise<Procedure[]>;
6800
6801
  /**
6801
6802
  * Gets all inactive procedures for a practitioner
6802
6803
  * @param practitionerId - The ID of the practitioner
package/dist/index.d.ts CHANGED
@@ -6794,9 +6794,10 @@ declare class ProcedureService extends BaseService {
6794
6794
  /**
6795
6795
  * Gets all procedures for a practitioner
6796
6796
  * @param practitionerId - The ID of the practitioner
6797
+ * @param clinicBranchId - Optional clinic branch ID to filter by
6797
6798
  * @returns List of procedures
6798
6799
  */
6799
- getProceduresByPractitioner(practitionerId: string): Promise<Procedure[]>;
6800
+ getProceduresByPractitioner(practitionerId: string, clinicBranchId?: string): Promise<Procedure[]>;
6800
6801
  /**
6801
6802
  * Gets all inactive procedures for a practitioner
6802
6803
  * @param practitionerId - The ID of the practitioner
package/dist/index.js CHANGED
@@ -20631,13 +20631,20 @@ var ProcedureService = class extends BaseService {
20631
20631
  /**
20632
20632
  * Gets all procedures for a practitioner
20633
20633
  * @param practitionerId - The ID of the practitioner
20634
+ * @param clinicBranchId - Optional clinic branch ID to filter by
20634
20635
  * @returns List of procedures
20635
20636
  */
20636
- async getProceduresByPractitioner(practitionerId) {
20637
- const q = (0, import_firestore58.query)(
20638
- (0, import_firestore58.collection)(this.db, PROCEDURES_COLLECTION),
20637
+ async getProceduresByPractitioner(practitionerId, clinicBranchId) {
20638
+ const constraints = [
20639
20639
  (0, import_firestore58.where)("practitionerId", "==", practitionerId),
20640
20640
  (0, import_firestore58.where)("isActive", "==", true)
20641
+ ];
20642
+ if (clinicBranchId) {
20643
+ constraints.push((0, import_firestore58.where)("clinicBranchId", "==", clinicBranchId));
20644
+ }
20645
+ const q = (0, import_firestore58.query)(
20646
+ (0, import_firestore58.collection)(this.db, PROCEDURES_COLLECTION),
20647
+ ...constraints
20641
20648
  );
20642
20649
  const snapshot = await (0, import_firestore58.getDocs)(q);
20643
20650
  return snapshot.docs.map((doc47) => doc47.data());
package/dist/index.mjs CHANGED
@@ -20867,13 +20867,20 @@ var ProcedureService = class extends BaseService {
20867
20867
  /**
20868
20868
  * Gets all procedures for a practitioner
20869
20869
  * @param practitionerId - The ID of the practitioner
20870
+ * @param clinicBranchId - Optional clinic branch ID to filter by
20870
20871
  * @returns List of procedures
20871
20872
  */
20872
- async getProceduresByPractitioner(practitionerId) {
20873
- const q = query33(
20874
- collection33(this.db, PROCEDURES_COLLECTION),
20873
+ async getProceduresByPractitioner(practitionerId, clinicBranchId) {
20874
+ const constraints = [
20875
20875
  where33("practitionerId", "==", practitionerId),
20876
20876
  where33("isActive", "==", true)
20877
+ ];
20878
+ if (clinicBranchId) {
20879
+ constraints.push(where33("clinicBranchId", "==", clinicBranchId));
20880
+ }
20881
+ const q = query33(
20882
+ collection33(this.db, PROCEDURES_COLLECTION),
20883
+ ...constraints
20877
20884
  );
20878
20885
  const snapshot = await getDocs33(q);
20879
20886
  return snapshot.docs.map((doc47) => doc47.data());
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.3",
4
+ "version": "1.13.4",
5
5
  "description": "Firebase authentication service with anonymous upgrade support",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.mjs",
@@ -999,13 +999,22 @@ export class ProcedureService extends BaseService {
999
999
  /**
1000
1000
  * Gets all procedures for a practitioner
1001
1001
  * @param practitionerId - The ID of the practitioner
1002
+ * @param clinicBranchId - Optional clinic branch ID to filter by
1002
1003
  * @returns List of procedures
1003
1004
  */
1004
- async getProceduresByPractitioner(practitionerId: string): Promise<Procedure[]> {
1005
- const q = query(
1006
- collection(this.db, PROCEDURES_COLLECTION),
1005
+ async getProceduresByPractitioner(practitionerId: string, clinicBranchId?: string): Promise<Procedure[]> {
1006
+ const constraints: QueryConstraint[] = [
1007
1007
  where('practitionerId', '==', practitionerId),
1008
1008
  where('isActive', '==', true),
1009
+ ];
1010
+
1011
+ if (clinicBranchId) {
1012
+ constraints.push(where('clinicBranchId', '==', clinicBranchId));
1013
+ }
1014
+
1015
+ const q = query(
1016
+ collection(this.db, PROCEDURES_COLLECTION),
1017
+ ...constraints
1009
1018
  );
1010
1019
  const snapshot = await getDocs(q);
1011
1020
  return snapshot.docs.map(doc => doc.data() as Procedure);