@blackcode_sa/metaestetics-api 1.5.13 → 1.5.15

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
@@ -4463,11 +4463,15 @@ declare class PractitionerService extends BaseService {
4463
4463
  */
4464
4464
  getPractitionerByUserRef(userRef: string): Promise<Practitioner | null>;
4465
4465
  /**
4466
- * Dohvata sve zdravstvene radnike za određenu kliniku
4466
+ * Dohvata sve zdravstvene radnike za određenu kliniku sa statusom ACTIVE
4467
4467
  */
4468
4468
  getPractitionersByClinic(clinicId: string): Promise<Practitioner[]>;
4469
4469
  /**
4470
- * Dohvata sve draft zdravstvene radnike za određenu kliniku
4470
+ * Dohvata sve zdravstvene radnike za određenu kliniku
4471
+ */
4472
+ getAllPractitionersByClinic(clinicId: string): Promise<Practitioner[]>;
4473
+ /**
4474
+ * Dohvata sve draft zdravstvene radnike za određenu kliniku sa statusom DRAFT
4471
4475
  */
4472
4476
  getDraftPractitionersByClinic(clinicId: string): Promise<Practitioner[]>;
4473
4477
  /**
@@ -4966,8 +4970,8 @@ declare class ProcedureService extends BaseService {
4966
4970
  * console.log(allowedProcedures.categories); // ["category1", "category2"]
4967
4971
  * console.log(allowedProcedures.subcategories); // ["subcategory1", "subcategory2"]
4968
4972
  */
4969
- getAllowedProcedures(practitioner: Practitioner): Promise<{
4970
- procedures: Procedure[];
4973
+ getAllowedTechnologies(practitioner: Practitioner): Promise<{
4974
+ technologies: Technology[];
4971
4975
  families: ProcedureFamily[];
4972
4976
  categories: string[];
4973
4977
  subcategories: string[];
package/dist/index.d.ts CHANGED
@@ -4463,11 +4463,15 @@ declare class PractitionerService extends BaseService {
4463
4463
  */
4464
4464
  getPractitionerByUserRef(userRef: string): Promise<Practitioner | null>;
4465
4465
  /**
4466
- * Dohvata sve zdravstvene radnike za određenu kliniku
4466
+ * Dohvata sve zdravstvene radnike za određenu kliniku sa statusom ACTIVE
4467
4467
  */
4468
4468
  getPractitionersByClinic(clinicId: string): Promise<Practitioner[]>;
4469
4469
  /**
4470
- * Dohvata sve draft zdravstvene radnike za određenu kliniku
4470
+ * Dohvata sve zdravstvene radnike za određenu kliniku
4471
+ */
4472
+ getAllPractitionersByClinic(clinicId: string): Promise<Practitioner[]>;
4473
+ /**
4474
+ * Dohvata sve draft zdravstvene radnike za određenu kliniku sa statusom DRAFT
4471
4475
  */
4472
4476
  getDraftPractitionersByClinic(clinicId: string): Promise<Practitioner[]>;
4473
4477
  /**
@@ -4966,8 +4970,8 @@ declare class ProcedureService extends BaseService {
4966
4970
  * console.log(allowedProcedures.categories); // ["category1", "category2"]
4967
4971
  * console.log(allowedProcedures.subcategories); // ["subcategory1", "subcategory2"]
4968
4972
  */
4969
- getAllowedProcedures(practitioner: Practitioner): Promise<{
4970
- procedures: Procedure[];
4973
+ getAllowedTechnologies(practitioner: Practitioner): Promise<{
4974
+ technologies: Technology[];
4971
4975
  families: ProcedureFamily[];
4972
4976
  categories: string[];
4973
4977
  subcategories: string[];
package/dist/index.js CHANGED
@@ -3617,7 +3617,7 @@ var PractitionerService = class extends BaseService {
3617
3617
  return querySnapshot.docs[0].data();
3618
3618
  }
3619
3619
  /**
3620
- * Dohvata sve zdravstvene radnike za određenu kliniku
3620
+ * Dohvata sve zdravstvene radnike za određenu kliniku sa statusom ACTIVE
3621
3621
  */
3622
3622
  async getPractitionersByClinic(clinicId) {
3623
3623
  const q = (0, import_firestore13.query)(
@@ -3630,7 +3630,19 @@ var PractitionerService = class extends BaseService {
3630
3630
  return querySnapshot.docs.map((doc26) => doc26.data());
3631
3631
  }
3632
3632
  /**
3633
- * Dohvata sve draft zdravstvene radnike za određenu kliniku
3633
+ * Dohvata sve zdravstvene radnike za određenu kliniku
3634
+ */
3635
+ async getAllPractitionersByClinic(clinicId) {
3636
+ const q = (0, import_firestore13.query)(
3637
+ (0, import_firestore13.collection)(this.db, PRACTITIONERS_COLLECTION),
3638
+ (0, import_firestore13.where)("clinics", "array-contains", clinicId),
3639
+ (0, import_firestore13.where)("isActive", "==", true)
3640
+ );
3641
+ const querySnapshot = await (0, import_firestore13.getDocs)(q);
3642
+ return querySnapshot.docs.map((doc26) => doc26.data());
3643
+ }
3644
+ /**
3645
+ * Dohvata sve draft zdravstvene radnike za određenu kliniku sa statusom DRAFT
3634
3646
  */
3635
3647
  async getDraftPractitionersByClinic(clinicId) {
3636
3648
  const q = (0, import_firestore13.query)(
@@ -6585,22 +6597,10 @@ var ProcedureService = class extends BaseService {
6585
6597
  * console.log(allowedProcedures.categories); // ["category1", "category2"]
6586
6598
  * console.log(allowedProcedures.subcategories); // ["subcategory1", "subcategory2"]
6587
6599
  */
6588
- async getAllowedProcedures(practitioner) {
6600
+ async getAllowedTechnologies(practitioner) {
6589
6601
  const { technologies, families, categories, subcategories } = await this.technologyService.getAllowedTechnologies(practitioner);
6590
- const procedures = await Promise.all(
6591
- technologies.map(async (technology) => {
6592
- const q = (0, import_firestore21.query)(
6593
- (0, import_firestore21.collection)(this.db, PROCEDURES_COLLECTION),
6594
- (0, import_firestore21.where)("technologyId", "==", technology.id),
6595
- (0, import_firestore21.where)("isActive", "==", true)
6596
- );
6597
- const snapshot = await (0, import_firestore21.getDocs)(q);
6598
- return snapshot.docs.map((doc26) => doc26.data());
6599
- })
6600
- );
6601
- const flattenedProcedures = procedures.flat();
6602
6602
  return {
6603
- procedures: flattenedProcedures,
6603
+ technologies,
6604
6604
  families,
6605
6605
  categories,
6606
6606
  subcategories
package/dist/index.mjs CHANGED
@@ -3522,7 +3522,7 @@ var PractitionerService = class extends BaseService {
3522
3522
  return querySnapshot.docs[0].data();
3523
3523
  }
3524
3524
  /**
3525
- * Dohvata sve zdravstvene radnike za određenu kliniku
3525
+ * Dohvata sve zdravstvene radnike za određenu kliniku sa statusom ACTIVE
3526
3526
  */
3527
3527
  async getPractitionersByClinic(clinicId) {
3528
3528
  const q = query3(
@@ -3535,7 +3535,19 @@ var PractitionerService = class extends BaseService {
3535
3535
  return querySnapshot.docs.map((doc26) => doc26.data());
3536
3536
  }
3537
3537
  /**
3538
- * Dohvata sve draft zdravstvene radnike za određenu kliniku
3538
+ * Dohvata sve zdravstvene radnike za određenu kliniku
3539
+ */
3540
+ async getAllPractitionersByClinic(clinicId) {
3541
+ const q = query3(
3542
+ collection3(this.db, PRACTITIONERS_COLLECTION),
3543
+ where3("clinics", "array-contains", clinicId),
3544
+ where3("isActive", "==", true)
3545
+ );
3546
+ const querySnapshot = await getDocs3(q);
3547
+ return querySnapshot.docs.map((doc26) => doc26.data());
3548
+ }
3549
+ /**
3550
+ * Dohvata sve draft zdravstvene radnike za određenu kliniku sa statusom DRAFT
3539
3551
  */
3540
3552
  async getDraftPractitionersByClinic(clinicId) {
3541
3553
  const q = query3(
@@ -6550,22 +6562,10 @@ var ProcedureService = class extends BaseService {
6550
6562
  * console.log(allowedProcedures.categories); // ["category1", "category2"]
6551
6563
  * console.log(allowedProcedures.subcategories); // ["subcategory1", "subcategory2"]
6552
6564
  */
6553
- async getAllowedProcedures(practitioner) {
6565
+ async getAllowedTechnologies(practitioner) {
6554
6566
  const { technologies, families, categories, subcategories } = await this.technologyService.getAllowedTechnologies(practitioner);
6555
- const procedures = await Promise.all(
6556
- technologies.map(async (technology) => {
6557
- const q = query10(
6558
- collection11(this.db, PROCEDURES_COLLECTION),
6559
- where10("technologyId", "==", technology.id),
6560
- where10("isActive", "==", true)
6561
- );
6562
- const snapshot = await getDocs10(q);
6563
- return snapshot.docs.map((doc26) => doc26.data());
6564
- })
6565
- );
6566
- const flattenedProcedures = procedures.flat();
6567
6567
  return {
6568
- procedures: flattenedProcedures,
6568
+ technologies,
6569
6569
  families,
6570
6570
  categories,
6571
6571
  subcategories
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.13",
4
+ "version": "1.5.15",
5
5
  "description": "Firebase authentication service with anonymous upgrade support",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.mjs",
@@ -443,7 +443,7 @@ export class PractitionerService extends BaseService {
443
443
  }
444
444
 
445
445
  /**
446
- * Dohvata sve zdravstvene radnike za određenu kliniku
446
+ * Dohvata sve zdravstvene radnike za određenu kliniku sa statusom ACTIVE
447
447
  */
448
448
  async getPractitionersByClinic(clinicId: string): Promise<Practitioner[]> {
449
449
  const q = query(
@@ -458,7 +458,21 @@ export class PractitionerService extends BaseService {
458
458
  }
459
459
 
460
460
  /**
461
- * Dohvata sve draft zdravstvene radnike za određenu kliniku
461
+ * Dohvata sve zdravstvene radnike za određenu kliniku
462
+ */
463
+ async getAllPractitionersByClinic(clinicId: string): Promise<Practitioner[]> {
464
+ const q = query(
465
+ collection(this.db, PRACTITIONERS_COLLECTION),
466
+ where("clinics", "array-contains", clinicId),
467
+ where("isActive", "==", true)
468
+ );
469
+
470
+ const querySnapshot = await getDocs(q);
471
+ return querySnapshot.docs.map((doc) => doc.data() as Practitioner);
472
+ }
473
+
474
+ /**
475
+ * Dohvata sve draft zdravstvene radnike za određenu kliniku sa statusom DRAFT
462
476
  */
463
477
  async getDraftPractitionersByClinic(
464
478
  clinicId: string
@@ -250,8 +250,8 @@ export class ProcedureService extends BaseService {
250
250
  * console.log(allowedProcedures.categories); // ["category1", "category2"]
251
251
  * console.log(allowedProcedures.subcategories); // ["subcategory1", "subcategory2"]
252
252
  */
253
- async getAllowedProcedures(practitioner: Practitioner): Promise<{
254
- procedures: Procedure[];
253
+ async getAllowedTechnologies(practitioner: Practitioner): Promise<{
254
+ technologies: Technology[];
255
255
  families: ProcedureFamily[];
256
256
  categories: string[];
257
257
  subcategories: string[];
@@ -260,24 +260,8 @@ export class ProcedureService extends BaseService {
260
260
  const { technologies, families, categories, subcategories } =
261
261
  await this.technologyService.getAllowedTechnologies(practitioner);
262
262
 
263
- // Get all procedures for these technologies
264
- const procedures = await Promise.all(
265
- technologies.map(async (technology) => {
266
- const q = query(
267
- collection(this.db, PROCEDURES_COLLECTION),
268
- where("technologyId", "==", technology.id),
269
- where("isActive", "==", true)
270
- );
271
- const snapshot = await getDocs(q);
272
- return snapshot.docs.map((doc) => doc.data() as Procedure);
273
- })
274
- );
275
-
276
- // Flatten the array of procedure arrays
277
- const flattenedProcedures = procedures.flat();
278
-
279
263
  return {
280
- procedures: flattenedProcedures,
264
+ technologies,
281
265
  families,
282
266
  categories,
283
267
  subcategories,