@blackcode_sa/metaestetics-api 1.5.3 → 1.5.6

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.
Files changed (32) hide show
  1. package/dist/backoffice/index.d.mts +1306 -63
  2. package/dist/backoffice/index.d.ts +1306 -63
  3. package/dist/backoffice/index.js +35 -26
  4. package/dist/backoffice/index.mjs +35 -26
  5. package/dist/index.d.mts +165 -8
  6. package/dist/index.d.ts +165 -8
  7. package/dist/index.js +726 -414
  8. package/dist/index.mjs +772 -451
  9. package/package.json +1 -1
  10. package/src/backoffice/services/brand.service.ts +2 -4
  11. package/src/backoffice/services/category.service.ts +2 -7
  12. package/src/backoffice/services/product.service.ts +5 -7
  13. package/src/backoffice/services/requirement.service.ts +6 -7
  14. package/src/backoffice/services/subcategory.service.ts +11 -8
  15. package/src/backoffice/services/technology.service.ts +6 -11
  16. package/src/backoffice/types/brand.types.ts +5 -0
  17. package/src/backoffice/types/category.types.ts +5 -0
  18. package/src/backoffice/types/documentation-templates.types.ts +4 -0
  19. package/src/backoffice/types/product.types.ts +5 -0
  20. package/src/backoffice/types/requirement.types.ts +5 -0
  21. package/src/backoffice/types/subcategory.types.ts +5 -0
  22. package/src/backoffice/types/technology.types.ts +10 -0
  23. package/src/backoffice/validations/schemas.ts +2 -0
  24. package/src/errors/auth.errors.ts +7 -0
  25. package/src/index.ts +59 -70
  26. package/src/services/auth.service.ts +94 -0
  27. package/src/services/clinic/clinic.service.ts +6 -0
  28. package/src/services/documentation-templates/documentation-template.service.ts +4 -1
  29. package/src/services/procedure/procedure.service.ts +238 -0
  30. package/src/types/documentation-templates/index.ts +5 -0
  31. package/src/types/procedure/index.ts +104 -0
  32. package/src/validations/procedure.schema.ts +58 -0
@@ -90,17 +90,33 @@ __export(index_exports, {
90
90
  });
91
91
  module.exports = __toCommonJS(index_exports);
92
92
 
93
+ // src/backoffice/types/brand.types.ts
94
+ var BRANDS_COLLECTION = "brands";
95
+
96
+ // src/backoffice/types/category.types.ts
97
+ var CATEGORIES_COLLECTION = "backoffice_categories";
98
+
99
+ // src/backoffice/types/product.types.ts
100
+ var PRODUCTS_COLLECTION = "products";
101
+
93
102
  // src/backoffice/types/requirement.types.ts
94
103
  var TimeUnit = /* @__PURE__ */ ((TimeUnit2) => {
95
104
  TimeUnit2["HOURS"] = "hours";
96
105
  TimeUnit2["DAYS"] = "days";
97
106
  return TimeUnit2;
98
107
  })(TimeUnit || {});
99
- var RequirementType = /* @__PURE__ */ ((RequirementType2) => {
100
- RequirementType2["PRE"] = "pre";
101
- RequirementType2["POST"] = "post";
102
- return RequirementType2;
108
+ var RequirementType = /* @__PURE__ */ ((RequirementType3) => {
109
+ RequirementType3["PRE"] = "pre";
110
+ RequirementType3["POST"] = "post";
111
+ return RequirementType3;
103
112
  })(RequirementType || {});
113
+ var REQUIREMENTS_COLLECTION = "backoffice_requirements";
114
+
115
+ // src/backoffice/types/subcategory.types.ts
116
+ var SUBCATEGORIES_COLLECTION = "subcategories";
117
+
118
+ // src/backoffice/types/technology.types.ts
119
+ var TECHNOLOGIES_COLLECTION = "technologies";
104
120
 
105
121
  // src/backoffice/types/static/blocking-condition.types.ts
106
122
  var BlockingCondition = /* @__PURE__ */ ((BlockingCondition2) => {
@@ -550,6 +566,7 @@ var technologySchema = import_zod2.z.object({
550
566
  }),
551
567
  blockingConditions: import_zod2.z.array(blockingConditionSchema),
552
568
  contraindications: import_zod2.z.array(contraindicationSchema),
569
+ documentationTemplates: import_zod2.z.array(documentTemplateSchema),
553
570
  benefits: import_zod2.z.array(treatmentBenefitSchema),
554
571
  certificationRequirement: certificationRequirementSchema,
555
572
  isActive: import_zod2.z.boolean().default(true)
@@ -600,13 +617,12 @@ var BaseService = class {
600
617
  };
601
618
 
602
619
  // src/backoffice/services/category.service.ts
603
- var COLLECTION = "backoffice_categories";
604
620
  var CategoryService = class extends BaseService {
605
621
  /**
606
622
  * Referenca na Firestore kolekciju kategorija
607
623
  */
608
624
  get categoriesRef() {
609
- return (0, import_firestore.collection)(this.db, COLLECTION);
625
+ return (0, import_firestore.collection)(this.db, CATEGORIES_COLLECTION);
610
626
  }
611
627
  /**
612
628
  * Kreira novu kategoriju u sistemu
@@ -697,15 +713,18 @@ var CategoryService = class extends BaseService {
697
713
 
698
714
  // src/backoffice/services/subcategory.service.ts
699
715
  var import_firestore2 = require("firebase/firestore");
700
- var COLLECTION2 = "backoffice_categories";
701
- var SUB_COLLECTION = "subcategories";
702
716
  var SubcategoryService = class extends BaseService {
703
717
  /**
704
718
  * Vraća referencu na Firestore kolekciju podkategorija za određenu kategoriju
705
719
  * @param categoryId - ID roditeljske kategorije
706
720
  */
707
721
  getSubcategoriesRef(categoryId) {
708
- return (0, import_firestore2.collection)(this.db, COLLECTION2, categoryId, SUB_COLLECTION);
722
+ return (0, import_firestore2.collection)(
723
+ this.db,
724
+ CATEGORIES_COLLECTION,
725
+ categoryId,
726
+ SUBCATEGORIES_COLLECTION
727
+ );
709
728
  }
710
729
  /**
711
730
  * Kreira novu podkategoriju u okviru kategorije
@@ -789,9 +808,6 @@ var SubcategoryService = class extends BaseService {
789
808
 
790
809
  // src/backoffice/services/technology.service.ts
791
810
  var import_firestore3 = require("firebase/firestore");
792
- var COLLECTION3 = "backoffice_categories";
793
- var SUB_COLLECTION_SUBCATEGORIES = "subcategories";
794
- var SUB_COLLECTION_TECHNOLOGIES = "technologies";
795
811
  var DEFAULT_CERTIFICATION_REQUIREMENT2 = {
796
812
  minimumLevel: "aesthetician" /* AESTHETICIAN */,
797
813
  requiredSpecialties: []
@@ -805,11 +821,11 @@ var TechnologyService = class extends BaseService {
805
821
  getTechnologiesRef(categoryId, subcategoryId) {
806
822
  return (0, import_firestore3.collection)(
807
823
  this.db,
808
- COLLECTION3,
824
+ CATEGORIES_COLLECTION,
809
825
  categoryId,
810
- SUB_COLLECTION_SUBCATEGORIES,
826
+ SUBCATEGORIES_COLLECTION,
811
827
  subcategoryId,
812
- SUB_COLLECTION_TECHNOLOGIES
828
+ TECHNOLOGIES_COLLECTION
813
829
  );
814
830
  }
815
831
  /**
@@ -1191,13 +1207,12 @@ var TechnologyService = class extends BaseService {
1191
1207
 
1192
1208
  // src/backoffice/services/requirement.service.ts
1193
1209
  var import_firestore4 = require("firebase/firestore");
1194
- var COLLECTION4 = "backoffice_requirements";
1195
1210
  var RequirementService = class extends BaseService {
1196
1211
  /**
1197
1212
  * Referenca na Firestore kolekciju zahteva
1198
1213
  */
1199
1214
  get requirementsRef() {
1200
- return (0, import_firestore4.collection)(this.db, COLLECTION4);
1215
+ return (0, import_firestore4.collection)(this.db, REQUIREMENTS_COLLECTION);
1201
1216
  }
1202
1217
  /**
1203
1218
  * Kreira novi globalni zahtev
@@ -1288,10 +1303,9 @@ var RequirementService = class extends BaseService {
1288
1303
 
1289
1304
  // src/backoffice/services/brand.service.ts
1290
1305
  var import_firestore5 = require("firebase/firestore");
1291
- var COLLECTION5 = "backoffice_brands";
1292
1306
  var BrandService = class extends BaseService {
1293
1307
  get brandsRef() {
1294
- return (0, import_firestore5.collection)(this.db, COLLECTION5);
1308
+ return (0, import_firestore5.collection)(this.db, BRANDS_COLLECTION);
1295
1309
  }
1296
1310
  async create(brand) {
1297
1311
  const now = /* @__PURE__ */ new Date();
@@ -1339,11 +1353,6 @@ var BrandService = class extends BaseService {
1339
1353
 
1340
1354
  // src/backoffice/services/product.service.ts
1341
1355
  var import_firestore6 = require("firebase/firestore");
1342
- var CATEGORIES_COLLECTION = "backoffice_categories";
1343
- var SUBCATEGORIES_COLLECTION = "subcategories";
1344
- var TECHNOLOGIES_COLLECTION = "technologies";
1345
- var PRODUCTS_COLLECTION = "products";
1346
- var BRANDS_COLLECTION = "backoffice_brands";
1347
1356
  var ProductService = class extends BaseService {
1348
1357
  getProductsRefByTechnology(categoryId, subcategoryId, technologyId) {
1349
1358
  return (0, import_firestore6.collection)(
@@ -1453,7 +1462,7 @@ var ProductService = class extends BaseService {
1453
1462
  var import_firestore7 = require("firebase/firestore");
1454
1463
 
1455
1464
  // src/types/index.ts
1456
- var DOCUMENTATION_TEMPLATES_COLLECTION = "documentation-templates";
1465
+ var DOCUMENTATION_TEMPLATES_COLLECTION2 = "documentation-templates";
1457
1466
 
1458
1467
  // src/services/documentation-templates/documentation-template.service.ts
1459
1468
  var DocumentationTemplateService = class extends BaseService {
@@ -1461,7 +1470,7 @@ var DocumentationTemplateService = class extends BaseService {
1461
1470
  super(...arguments);
1462
1471
  this.collectionRef = (0, import_firestore7.collection)(
1463
1472
  this.db,
1464
- DOCUMENTATION_TEMPLATES_COLLECTION
1473
+ DOCUMENTATION_TEMPLATES_COLLECTION2
1465
1474
  );
1466
1475
  }
1467
1476
  /**
@@ -1,14 +1,30 @@
1
+ // src/backoffice/types/brand.types.ts
2
+ var BRANDS_COLLECTION = "brands";
3
+
4
+ // src/backoffice/types/category.types.ts
5
+ var CATEGORIES_COLLECTION = "backoffice_categories";
6
+
7
+ // src/backoffice/types/product.types.ts
8
+ var PRODUCTS_COLLECTION = "products";
9
+
1
10
  // src/backoffice/types/requirement.types.ts
2
11
  var TimeUnit = /* @__PURE__ */ ((TimeUnit2) => {
3
12
  TimeUnit2["HOURS"] = "hours";
4
13
  TimeUnit2["DAYS"] = "days";
5
14
  return TimeUnit2;
6
15
  })(TimeUnit || {});
7
- var RequirementType = /* @__PURE__ */ ((RequirementType2) => {
8
- RequirementType2["PRE"] = "pre";
9
- RequirementType2["POST"] = "post";
10
- return RequirementType2;
16
+ var RequirementType = /* @__PURE__ */ ((RequirementType3) => {
17
+ RequirementType3["PRE"] = "pre";
18
+ RequirementType3["POST"] = "post";
19
+ return RequirementType3;
11
20
  })(RequirementType || {});
21
+ var REQUIREMENTS_COLLECTION = "backoffice_requirements";
22
+
23
+ // src/backoffice/types/subcategory.types.ts
24
+ var SUBCATEGORIES_COLLECTION = "subcategories";
25
+
26
+ // src/backoffice/types/technology.types.ts
27
+ var TECHNOLOGIES_COLLECTION = "technologies";
12
28
 
13
29
  // src/backoffice/types/static/blocking-condition.types.ts
14
30
  var BlockingCondition = /* @__PURE__ */ ((BlockingCondition2) => {
@@ -458,6 +474,7 @@ var technologySchema = z2.object({
458
474
  }),
459
475
  blockingConditions: z2.array(blockingConditionSchema),
460
476
  contraindications: z2.array(contraindicationSchema),
477
+ documentationTemplates: z2.array(documentTemplateSchema),
461
478
  benefits: z2.array(treatmentBenefitSchema),
462
479
  certificationRequirement: certificationRequirementSchema,
463
480
  isActive: z2.boolean().default(true)
@@ -517,13 +534,12 @@ var BaseService = class {
517
534
  };
518
535
 
519
536
  // src/backoffice/services/category.service.ts
520
- var COLLECTION = "backoffice_categories";
521
537
  var CategoryService = class extends BaseService {
522
538
  /**
523
539
  * Referenca na Firestore kolekciju kategorija
524
540
  */
525
541
  get categoriesRef() {
526
- return collection(this.db, COLLECTION);
542
+ return collection(this.db, CATEGORIES_COLLECTION);
527
543
  }
528
544
  /**
529
545
  * Kreira novu kategoriju u sistemu
@@ -623,15 +639,18 @@ import {
623
639
  updateDoc as updateDoc2,
624
640
  where as where2
625
641
  } from "firebase/firestore";
626
- var COLLECTION2 = "backoffice_categories";
627
- var SUB_COLLECTION = "subcategories";
628
642
  var SubcategoryService = class extends BaseService {
629
643
  /**
630
644
  * Vraća referencu na Firestore kolekciju podkategorija za određenu kategoriju
631
645
  * @param categoryId - ID roditeljske kategorije
632
646
  */
633
647
  getSubcategoriesRef(categoryId) {
634
- return collection2(this.db, COLLECTION2, categoryId, SUB_COLLECTION);
648
+ return collection2(
649
+ this.db,
650
+ CATEGORIES_COLLECTION,
651
+ categoryId,
652
+ SUBCATEGORIES_COLLECTION
653
+ );
635
654
  }
636
655
  /**
637
656
  * Kreira novu podkategoriju u okviru kategorije
@@ -726,9 +745,6 @@ import {
726
745
  arrayUnion,
727
746
  arrayRemove
728
747
  } from "firebase/firestore";
729
- var COLLECTION3 = "backoffice_categories";
730
- var SUB_COLLECTION_SUBCATEGORIES = "subcategories";
731
- var SUB_COLLECTION_TECHNOLOGIES = "technologies";
732
748
  var DEFAULT_CERTIFICATION_REQUIREMENT2 = {
733
749
  minimumLevel: "aesthetician" /* AESTHETICIAN */,
734
750
  requiredSpecialties: []
@@ -742,11 +758,11 @@ var TechnologyService = class extends BaseService {
742
758
  getTechnologiesRef(categoryId, subcategoryId) {
743
759
  return collection3(
744
760
  this.db,
745
- COLLECTION3,
761
+ CATEGORIES_COLLECTION,
746
762
  categoryId,
747
- SUB_COLLECTION_SUBCATEGORIES,
763
+ SUBCATEGORIES_COLLECTION,
748
764
  subcategoryId,
749
- SUB_COLLECTION_TECHNOLOGIES
765
+ TECHNOLOGIES_COLLECTION
750
766
  );
751
767
  }
752
768
  /**
@@ -1137,13 +1153,12 @@ import {
1137
1153
  updateDoc as updateDoc4,
1138
1154
  where as where4
1139
1155
  } from "firebase/firestore";
1140
- var COLLECTION4 = "backoffice_requirements";
1141
1156
  var RequirementService = class extends BaseService {
1142
1157
  /**
1143
1158
  * Referenca na Firestore kolekciju zahteva
1144
1159
  */
1145
1160
  get requirementsRef() {
1146
- return collection4(this.db, COLLECTION4);
1161
+ return collection4(this.db, REQUIREMENTS_COLLECTION);
1147
1162
  }
1148
1163
  /**
1149
1164
  * Kreira novi globalni zahtev
@@ -1243,10 +1258,9 @@ import {
1243
1258
  updateDoc as updateDoc5,
1244
1259
  where as where5
1245
1260
  } from "firebase/firestore";
1246
- var COLLECTION5 = "backoffice_brands";
1247
1261
  var BrandService = class extends BaseService {
1248
1262
  get brandsRef() {
1249
- return collection5(this.db, COLLECTION5);
1263
+ return collection5(this.db, BRANDS_COLLECTION);
1250
1264
  }
1251
1265
  async create(brand) {
1252
1266
  const now = /* @__PURE__ */ new Date();
@@ -1304,11 +1318,6 @@ import {
1304
1318
  updateDoc as updateDoc6,
1305
1319
  where as where6
1306
1320
  } from "firebase/firestore";
1307
- var CATEGORIES_COLLECTION = "backoffice_categories";
1308
- var SUBCATEGORIES_COLLECTION = "subcategories";
1309
- var TECHNOLOGIES_COLLECTION = "technologies";
1310
- var PRODUCTS_COLLECTION = "products";
1311
- var BRANDS_COLLECTION = "backoffice_brands";
1312
1321
  var ProductService = class extends BaseService {
1313
1322
  getProductsRefByTechnology(categoryId, subcategoryId, technologyId) {
1314
1323
  return collection6(
@@ -1431,7 +1440,7 @@ import {
1431
1440
  } from "firebase/firestore";
1432
1441
 
1433
1442
  // src/types/index.ts
1434
- var DOCUMENTATION_TEMPLATES_COLLECTION = "documentation-templates";
1443
+ var DOCUMENTATION_TEMPLATES_COLLECTION2 = "documentation-templates";
1435
1444
 
1436
1445
  // src/services/documentation-templates/documentation-template.service.ts
1437
1446
  var DocumentationTemplateService = class extends BaseService {
@@ -1439,7 +1448,7 @@ var DocumentationTemplateService = class extends BaseService {
1439
1448
  super(...arguments);
1440
1449
  this.collectionRef = collection7(
1441
1450
  this.db,
1442
- DOCUMENTATION_TEMPLATES_COLLECTION
1451
+ DOCUMENTATION_TEMPLATES_COLLECTION2
1443
1452
  );
1444
1453
  }
1445
1454
  /**
package/dist/index.d.mts CHANGED
@@ -26,9 +26,6 @@ declare const getFirebaseAuth: () => Promise<Auth>;
26
26
  declare const getFirebaseDB: () => Promise<Firestore>;
27
27
  declare const getFirebaseApp: () => Promise<FirebaseApp>;
28
28
 
29
- /**
30
- * Types for the Medical Documentation Templating System
31
- */
32
29
  /**
33
30
  * Enum for element types in documentation templates
34
31
  */
@@ -1692,6 +1689,7 @@ interface Subcategory {
1692
1689
  * @property contraindications - List of conditions requiring special attention
1693
1690
  * @property benefits - List of expected benefits from the procedure
1694
1691
  * @property certificationRequirement - Required certification level and specialties
1692
+ * @property documentationTemplates - List of documentation templates required for this technology
1695
1693
  * @property isActive - Whether the technology is active in the system
1696
1694
  * @property createdAt - Creation date
1697
1695
  * @property updatedAt - Last update date
@@ -1720,6 +1718,8 @@ interface Technology {
1720
1718
  benefits: TreatmentBenefit[];
1721
1719
  /** Potrebna sertifikacija za korišćenje tehnologije */
1722
1720
  certificationRequirement: CertificationRequirement;
1721
+ /** Dokumentacioni šabloni potrebni za ovu tehnologiju */
1722
+ documentationTemplates?: DocumentTemplate[];
1723
1723
  /** Da li je tehnologija trenutno aktivna */
1724
1724
  isActive: boolean;
1725
1725
  /** Datum kreiranja */
@@ -4108,6 +4108,19 @@ declare class AuthService extends BaseService {
4108
4108
  * Prijavljuje korisnika sa email-om i lozinkom
4109
4109
  */
4110
4110
  signIn(email: string, password: string): Promise<User>;
4111
+ /**
4112
+ * Prijavljuje korisnika sa email-om i lozinkom samo za clinic_admin role
4113
+ * @param email - Email korisnika
4114
+ * @param password - Lozinka korisnika
4115
+ * @returns Objekat koji sadrži korisnika, admin profil i grupu klinika
4116
+ * @throws {AUTH_ERRORS.INVALID_ROLE} Ako korisnik nema clinic_admin rolu
4117
+ * @throws {AUTH_ERRORS.NOT_FOUND} Ako admin profil nije pronađen
4118
+ */
4119
+ signInClinicAdmin(email: string, password: string): Promise<{
4120
+ user: User;
4121
+ clinicAdmin: ClinicAdmin;
4122
+ clinicGroup: ClinicGroup;
4123
+ }>;
4111
4124
  /**
4112
4125
  * Prijavljuje korisnika sa Facebook-om
4113
4126
  */
@@ -4323,6 +4336,149 @@ declare class NotificationService extends BaseService {
4323
4336
  getAppointmentNotifications(appointmentId: string): Promise<Notification[]>;
4324
4337
  }
4325
4338
 
4339
+ /**
4340
+ * Procedure represents a specific medical procedure that can be performed by a practitioner in a clinic
4341
+ * It inherits properties from technology and adds clinic/practitioner specific details
4342
+ */
4343
+ interface Procedure {
4344
+ /** Unique identifier of the procedure */
4345
+ id: string;
4346
+ /** Name of the procedure */
4347
+ name: string;
4348
+ /** Detailed description of the procedure */
4349
+ description: string;
4350
+ /** Family of procedures this belongs to (aesthetics/surgery) */
4351
+ family: ProcedureFamily;
4352
+ /** Category this procedure belongs to */
4353
+ category: Category;
4354
+ /** Subcategory this procedure belongs to */
4355
+ subcategory: Subcategory;
4356
+ /** Technology used in this procedure */
4357
+ technology: Technology;
4358
+ /** Product used in this procedure */
4359
+ product: Product;
4360
+ /** Price of the procedure */
4361
+ price: number;
4362
+ /** Currency for the price */
4363
+ currency: Currency;
4364
+ /** How the price is measured (per ml, per zone, etc.) */
4365
+ pricingMeasure: PricingMeasure;
4366
+ /** Duration of the procedure in minutes */
4367
+ duration: number;
4368
+ /** Blocking conditions that prevent this procedure */
4369
+ blockingConditions: BlockingCondition[];
4370
+ /** Treatment benefits of this procedure */
4371
+ treatmentBenefits: TreatmentBenefit[];
4372
+ /** Pre-procedure requirements */
4373
+ preRequirements: Requirement[];
4374
+ /** Post-procedure requirements */
4375
+ postRequirements: Requirement[];
4376
+ /** Certification requirements for performing this procedure */
4377
+ certificationRequirement: CertificationRequirement;
4378
+ /** Documentation templates required for this procedure */
4379
+ documentationTemplates: DocumentTemplate[];
4380
+ /** ID of the practitioner who performs this procedure */
4381
+ practitionerId: string;
4382
+ /** ID of the clinic branch where this procedure is performed */
4383
+ clinicBranchId: string;
4384
+ /** Whether this procedure is active */
4385
+ isActive: boolean;
4386
+ /** When this procedure was created */
4387
+ createdAt: Date;
4388
+ /** When this procedure was last updated */
4389
+ updatedAt: Date;
4390
+ }
4391
+ /**
4392
+ * Data required to create a new procedure
4393
+ */
4394
+ interface CreateProcedureData {
4395
+ name: string;
4396
+ description: string;
4397
+ family: ProcedureFamily;
4398
+ categoryId: string;
4399
+ subcategoryId: string;
4400
+ technologyId: string;
4401
+ productId: string;
4402
+ price: number;
4403
+ currency: Currency;
4404
+ pricingMeasure: PricingMeasure;
4405
+ duration: number;
4406
+ practitionerId: string;
4407
+ clinicBranchId: string;
4408
+ }
4409
+ /**
4410
+ * Data that can be updated for an existing procedure
4411
+ */
4412
+ interface UpdateProcedureData {
4413
+ name?: string;
4414
+ description?: string;
4415
+ price?: number;
4416
+ currency?: Currency;
4417
+ pricingMeasure?: PricingMeasure;
4418
+ duration?: number;
4419
+ isActive?: boolean;
4420
+ }
4421
+
4422
+ declare class ProcedureService extends BaseService {
4423
+ constructor(db: Firestore, auth: Auth, app: FirebaseApp);
4424
+ /**
4425
+ * Creates a new procedure
4426
+ * @param data - The data for creating a new procedure
4427
+ * @returns The created procedure
4428
+ */
4429
+ createProcedure(data: CreateProcedureData): Promise<Procedure>;
4430
+ /**
4431
+ * Gets a procedure by ID
4432
+ * @param id - The ID of the procedure to get
4433
+ * @returns The procedure if found, null otherwise
4434
+ */
4435
+ getProcedure(id: string): Promise<Procedure | null>;
4436
+ /**
4437
+ * Gets all procedures for a clinic branch
4438
+ * @param clinicBranchId - The ID of the clinic branch
4439
+ * @returns List of procedures
4440
+ */
4441
+ getProceduresByClinicBranch(clinicBranchId: string): Promise<Procedure[]>;
4442
+ /**
4443
+ * Gets all procedures for a practitioner
4444
+ * @param practitionerId - The ID of the practitioner
4445
+ * @returns List of procedures
4446
+ */
4447
+ getProceduresByPractitioner(practitionerId: string): Promise<Procedure[]>;
4448
+ /**
4449
+ * Updates a procedure
4450
+ * @param id - The ID of the procedure to update
4451
+ * @param data - The data to update
4452
+ * @returns The updated procedure
4453
+ */
4454
+ updateProcedure(id: string, data: UpdateProcedureData): Promise<Procedure>;
4455
+ /**
4456
+ * Deactivates a procedure
4457
+ * @param id - The ID of the procedure to deactivate
4458
+ */
4459
+ deactivateProcedure(id: string): Promise<void>;
4460
+ /**
4461
+ * Gets a category by ID
4462
+ * @private
4463
+ */
4464
+ private getCategory;
4465
+ /**
4466
+ * Gets a subcategory by ID
4467
+ * @private
4468
+ */
4469
+ private getSubcategory;
4470
+ /**
4471
+ * Gets a technology by ID
4472
+ * @private
4473
+ */
4474
+ private getTechnology;
4475
+ /**
4476
+ * Gets a product by ID
4477
+ * @private
4478
+ */
4479
+ private getProduct;
4480
+ }
4481
+
4326
4482
  /**
4327
4483
  * Service for managing documentation templates
4328
4484
  */
@@ -4978,6 +5134,7 @@ declare const AUTH_ERRORS: {
4978
5134
  readonly REQUIRES_RECENT_LOGIN: AuthError;
4979
5135
  readonly INVALID_PROVIDER: AuthError;
4980
5136
  readonly INVALID_CREDENTIAL: AuthError;
5137
+ readonly NOT_FOUND: AuthError;
4981
5138
  readonly PASSWORD_LENGTH_ERROR: AuthError;
4982
5139
  readonly PASSWORD_UPPERCASE_ERROR: AuthError;
4983
5140
  readonly PASSWORD_NUMBER_ERROR: AuthError;
@@ -14449,6 +14606,7 @@ declare const createCalendarEventSchema: z.ZodObject<{
14449
14606
  description?: string | undefined;
14450
14607
  createdAt?: any;
14451
14608
  appointmentId?: string | null | undefined;
14609
+ clinicBranchId?: string | null | undefined;
14452
14610
  procedureId?: string | null | undefined;
14453
14611
  eventLocation?: {
14454
14612
  latitude: number;
@@ -14459,7 +14617,6 @@ declare const createCalendarEventSchema: z.ZodObject<{
14459
14617
  postalCode: string;
14460
14618
  geohash?: string | null | undefined;
14461
14619
  } | undefined;
14462
- clinicBranchId?: string | null | undefined;
14463
14620
  clinicBranchInfo?: any;
14464
14621
  practitionerProfileId?: string | null | undefined;
14465
14622
  practitionerProfileInfo?: {
@@ -14506,6 +14663,7 @@ declare const createCalendarEventSchema: z.ZodObject<{
14506
14663
  description?: string | undefined;
14507
14664
  createdAt?: any;
14508
14665
  appointmentId?: string | null | undefined;
14666
+ clinicBranchId?: string | null | undefined;
14509
14667
  procedureId?: string | null | undefined;
14510
14668
  eventLocation?: {
14511
14669
  latitude: number;
@@ -14516,7 +14674,6 @@ declare const createCalendarEventSchema: z.ZodObject<{
14516
14674
  postalCode: string;
14517
14675
  geohash?: string | null | undefined;
14518
14676
  } | undefined;
14519
- clinicBranchId?: string | null | undefined;
14520
14677
  clinicBranchInfo?: any;
14521
14678
  practitionerProfileId?: string | null | undefined;
14522
14679
  practitionerProfileInfo?: {
@@ -14845,6 +15002,7 @@ declare const calendarEventSchema: z.ZodObject<{
14845
15002
  eventType: CalendarEventType;
14846
15003
  description?: string | undefined;
14847
15004
  appointmentId?: string | null | undefined;
15005
+ clinicBranchId?: string | null | undefined;
14848
15006
  procedureId?: string | null | undefined;
14849
15007
  eventLocation?: {
14850
15008
  latitude: number;
@@ -14855,7 +15013,6 @@ declare const calendarEventSchema: z.ZodObject<{
14855
15013
  postalCode: string;
14856
15014
  geohash?: string | null | undefined;
14857
15015
  } | undefined;
14858
- clinicBranchId?: string | null | undefined;
14859
15016
  clinicBranchInfo?: any;
14860
15017
  practitionerProfileId?: string | null | undefined;
14861
15018
  practitionerProfileInfo?: {
@@ -14916,6 +15073,7 @@ declare const calendarEventSchema: z.ZodObject<{
14916
15073
  eventType: CalendarEventType;
14917
15074
  description?: string | undefined;
14918
15075
  appointmentId?: string | null | undefined;
15076
+ clinicBranchId?: string | null | undefined;
14919
15077
  procedureId?: string | null | undefined;
14920
15078
  eventLocation?: {
14921
15079
  latitude: number;
@@ -14926,7 +15084,6 @@ declare const calendarEventSchema: z.ZodObject<{
14926
15084
  postalCode: string;
14927
15085
  geohash?: string | null | undefined;
14928
15086
  } | undefined;
14929
- clinicBranchId?: string | null | undefined;
14930
15087
  clinicBranchInfo?: any;
14931
15088
  practitionerProfileId?: string | null | undefined;
14932
15089
  practitionerProfileInfo?: {
@@ -15104,4 +15261,4 @@ declare enum FirebaseErrorCode {
15104
15261
  POPUP_ALREADY_OPEN = "auth/cancelled-popup-request"
15105
15262
  }
15106
15263
 
15107
- export { AUTH_ERRORS, type AddAllergyData, type AddBlockingConditionData, type AddContraindicationData, type AddMedicationData, type AddressData, type AdminInfo, type AdminToken, AdminTokenStatus, type Allergy, type AllergySubtype, AllergyType, type AllergyTypeWithSubtype, type AppointmentNotification, type AppointmentReminderNotification, AuthError, AuthService, type BaseNotification, BlockingCondition, type Brand, CALENDAR_COLLECTION, CLINICS_COLLECTION, CLINIC_ADMINS_COLLECTION, CLINIC_GROUPS_COLLECTION, type CalendarEvent, CalendarEventStatus, type CalendarEventTime, CalendarEventType, CalendarServiceV2, CalendarSyncStatus, type Category, CertificationLevel, CertificationSpecialty, type Clinic, type ClinicAdmin, ClinicAdminService, type ClinicAdminSignupData, type ClinicBranchSetupData, type ClinicContactInfo, type ClinicGroup, ClinicGroupService, type ClinicGroupSetupData, type ClinicInfo, type ClinicLocation, ClinicPhotoTag, type ClinicReview, ClinicService, ClinicTag, type ClinicTags, type ContactPerson, Contraindication, CosmeticAllergySubtype, type CreateAdminTokenData, type CreateAppointmentParams, type CreateCalendarEventData, type CreateClinicAdminData, type CreateClinicData, type CreateClinicGroupData, type CreateDefaultClinicGroupData, type CreateDocumentTemplateData, type CreateDraftPractitionerData, type CreatePatientLocationInfoData, type CreatePatientMedicalInfoData, type CreatePatientProfileData, type CreatePatientSensitiveInfoData, type CreatePractitionerData, type CreatePractitionerTokenData, type CreateSyncedCalendarData, type CreateUserData, Currency, DOCUMENTATION_TEMPLATES_COLLECTION, type DoctorInfo, type DocumentElement, DocumentElementType, type DocumentTemplate, DocumentationTemplateService, DynamicVariable, type EmergencyContact, EnvironmentalAllergySubtype, FILLED_DOCUMENTS_COLLECTION, type FilledDocument, FilledDocumentService, FilledDocumentStatus, FirebaseErrorCode, type FirebaseUser, FoodAllergySubtype, type GamificationInfo, Gender, HeadingLevel, Language, ListType, type LocationData, MedicationAllergySubtype, type Notification, NotificationService, NotificationStatus, NotificationType, PATIENTS_COLLECTION, PATIENT_APPOINTMENTS_COLLECTION, PATIENT_LOCATION_INFO_COLLECTION, PATIENT_MEDICAL_HISTORY_COLLECTION, PATIENT_MEDICAL_INFO_COLLECTION, PATIENT_SENSITIVE_INFO_COLLECTION, PRACTITIONERS_COLLECTION, type PatientClinic, type PatientDoctor, type PatientLocationInfo, type PatientMedicalInfo, type PatientProfile, type PatientProfileComplete, type PatientProfileInfo, type PatientSensitiveInfo, PatientService, type PostRequirementNotification, PracticeType, type Practitioner, type PractitionerBasicInfo, type PractitionerCertification, type PractitionerClinicProcedures, type PractitionerClinicWorkingHours, type PractitionerProfileInfo, type PractitionerReview, PractitionerService, PractitionerStatus, type PractitionerToken, PractitionerTokenStatus, type PractitionerWorkingHours, type PreRequirementNotification, PricingMeasure, type ProcedureCategorization, ProcedureFamily, type ProcedureInfo, type Product, REGISTER_TOKENS_COLLECTION, type Requirement, type ReviewInfo, SYNCED_CALENDARS_COLLECTION, type ServiceInfo, type Subcategory, SubscriptionModel, type SyncedCalendar, type SyncedCalendarEvent, SyncedCalendarProvider, SyncedCalendarsService, type Technology, type TimeSlot, TreatmentBenefit, USER_ERRORS, type UpdateAllergyData, type UpdateAppointmentParams, type UpdateBlockingConditionData, type UpdateCalendarEventData, type UpdateClinicAdminData, type UpdateClinicData, type UpdateClinicGroupData, type UpdateContraindicationData, type UpdateDocumentTemplateData, type UpdateMedicationData, type UpdatePatientLocationInfoData, type UpdatePatientMedicalInfoData, type UpdatePatientProfileData, type UpdatePatientSensitiveInfoData, type UpdatePractitionerData, type UpdateSyncedCalendarData, type UpdateVitalStatsData, type User, UserRole, UserService, type ValidationSchema, type VitalStats, type WorkingHours, addAllergySchema, addBlockingConditionSchema, addContraindicationSchema, addMedicationSchema, addressDataSchema, adminInfoSchema, adminTokenSchema, allergySchema, allergySubtypeSchema, appointmentNotificationSchema, appointmentReminderNotificationSchema, baseNotificationSchema, blockingConditionSchema, calendarEventSchema, calendarEventTimeSchema, clinicAdminOptionsSchema, clinicAdminSchema, clinicAdminSignupSchema, clinicBranchSetupSchema, clinicContactInfoSchema, clinicGroupSchema, clinicGroupSetupSchema, clinicInfoSchema, clinicLocationSchema, clinicReviewSchema, clinicSchema, clinicTagsSchema, contactPersonSchema, contraindicationSchema, createAdminTokenSchema, createAppointmentSchema, createCalendarEventSchema, createClinicAdminSchema, createClinicGroupSchema, createClinicSchema, createDefaultClinicGroupSchema, createDocumentTemplateSchema, createDraftPractitionerSchema, createPatientLocationInfoSchema, createPatientMedicalInfoSchema, createPatientProfileSchema, createPatientSensitiveInfoSchema, createPractitionerSchema, createPractitionerTokenSchema, createUserOptionsSchema, doctorInfoSchema, documentElementSchema, documentElementWithoutIdSchema, documentTemplateSchema, emailSchema, emergencyContactSchema, gamificationSchema, getFirebaseApp, getFirebaseAuth, getFirebaseDB, getFirebaseInstance, initializeFirebase, locationDataSchema, medicationSchema, notificationSchema, passwordSchema, patientClinicSchema, patientDoctorSchema, patientLocationInfoSchema, patientMedicalInfoSchema, patientProfileInfoSchema, patientProfileSchema, patientSensitiveInfoSchema, postRequirementNotificationSchema, practitionerBasicInfoSchema, practitionerCertificationSchema, practitionerClinicProceduresSchema, practitionerClinicWorkingHoursSchema, practitionerProfileInfoSchema, practitionerReviewSchema, practitionerSchema, practitionerTokenSchema, practitionerWorkingHoursSchema, preRequirementNotificationSchema, procedureCategorizationSchema, procedureInfoSchema, reviewInfoSchema, serviceInfoSchema, syncedCalendarEventSchema, timeSlotSchema, timestampSchema, updateAllergySchema, updateAppointmentSchema, updateBlockingConditionSchema, updateCalendarEventSchema, updateClinicAdminSchema, updateClinicGroupSchema, updateClinicSchema, updateContraindicationSchema, updateDocumentTemplateSchema, updateMedicationSchema, updatePatientMedicalInfoSchema, updateVitalStatsSchema, userRoleSchema, userRolesSchema, userSchema, vitalStatsSchema, workingHoursSchema };
15264
+ export { AUTH_ERRORS, type AddAllergyData, type AddBlockingConditionData, type AddContraindicationData, type AddMedicationData, type AddressData, type AdminInfo, type AdminToken, AdminTokenStatus, type Allergy, type AllergySubtype, AllergyType, type AllergyTypeWithSubtype, type AppointmentNotification, type AppointmentReminderNotification, AuthError, AuthService, type BaseNotification, BlockingCondition, type Brand, CALENDAR_COLLECTION, CLINICS_COLLECTION, CLINIC_ADMINS_COLLECTION, CLINIC_GROUPS_COLLECTION, type CalendarEvent, CalendarEventStatus, type CalendarEventTime, CalendarEventType, CalendarServiceV2, CalendarSyncStatus, type Category, CertificationLevel, CertificationSpecialty, type Clinic, type ClinicAdmin, ClinicAdminService, type ClinicAdminSignupData, type ClinicBranchSetupData, type ClinicContactInfo, type ClinicGroup, ClinicGroupService, type ClinicGroupSetupData, type ClinicInfo, type ClinicLocation, ClinicPhotoTag, type ClinicReview, ClinicService, ClinicTag, type ClinicTags, type ContactPerson, Contraindication, CosmeticAllergySubtype, type CreateAdminTokenData, type CreateAppointmentParams, type CreateCalendarEventData, type CreateClinicAdminData, type CreateClinicData, type CreateClinicGroupData, type CreateDefaultClinicGroupData, type CreateDocumentTemplateData, type CreateDraftPractitionerData, type CreatePatientLocationInfoData, type CreatePatientMedicalInfoData, type CreatePatientProfileData, type CreatePatientSensitiveInfoData, type CreatePractitionerData, type CreatePractitionerTokenData, type CreateSyncedCalendarData, type CreateUserData, Currency, DOCUMENTATION_TEMPLATES_COLLECTION, type DoctorInfo, type DocumentElement, DocumentElementType, type DocumentTemplate, DocumentationTemplateService, DynamicVariable, type EmergencyContact, EnvironmentalAllergySubtype, FILLED_DOCUMENTS_COLLECTION, type FilledDocument, FilledDocumentService, FilledDocumentStatus, FirebaseErrorCode, type FirebaseUser, FoodAllergySubtype, type GamificationInfo, Gender, HeadingLevel, Language, ListType, type LocationData, MedicationAllergySubtype, type Notification, NotificationService, NotificationStatus, NotificationType, PATIENTS_COLLECTION, PATIENT_APPOINTMENTS_COLLECTION, PATIENT_LOCATION_INFO_COLLECTION, PATIENT_MEDICAL_HISTORY_COLLECTION, PATIENT_MEDICAL_INFO_COLLECTION, PATIENT_SENSITIVE_INFO_COLLECTION, PRACTITIONERS_COLLECTION, type PatientClinic, type PatientDoctor, type PatientLocationInfo, type PatientMedicalInfo, type PatientProfile, type PatientProfileComplete, type PatientProfileInfo, type PatientSensitiveInfo, PatientService, type PostRequirementNotification, PracticeType, type Practitioner, type PractitionerBasicInfo, type PractitionerCertification, type PractitionerClinicProcedures, type PractitionerClinicWorkingHours, type PractitionerProfileInfo, type PractitionerReview, PractitionerService, PractitionerStatus, type PractitionerToken, PractitionerTokenStatus, type PractitionerWorkingHours, type PreRequirementNotification, PricingMeasure, type ProcedureCategorization, ProcedureFamily, type ProcedureInfo, ProcedureService, type Product, REGISTER_TOKENS_COLLECTION, type Requirement, type ReviewInfo, SYNCED_CALENDARS_COLLECTION, type ServiceInfo, type Subcategory, SubscriptionModel, type SyncedCalendar, type SyncedCalendarEvent, SyncedCalendarProvider, SyncedCalendarsService, type Technology, type TimeSlot, TreatmentBenefit, USER_ERRORS, type UpdateAllergyData, type UpdateAppointmentParams, type UpdateBlockingConditionData, type UpdateCalendarEventData, type UpdateClinicAdminData, type UpdateClinicData, type UpdateClinicGroupData, type UpdateContraindicationData, type UpdateDocumentTemplateData, type UpdateMedicationData, type UpdatePatientLocationInfoData, type UpdatePatientMedicalInfoData, type UpdatePatientProfileData, type UpdatePatientSensitiveInfoData, type UpdatePractitionerData, type UpdateSyncedCalendarData, type UpdateVitalStatsData, type User, UserRole, UserService, type ValidationSchema, type VitalStats, type WorkingHours, addAllergySchema, addBlockingConditionSchema, addContraindicationSchema, addMedicationSchema, addressDataSchema, adminInfoSchema, adminTokenSchema, allergySchema, allergySubtypeSchema, appointmentNotificationSchema, appointmentReminderNotificationSchema, baseNotificationSchema, blockingConditionSchema, calendarEventSchema, calendarEventTimeSchema, clinicAdminOptionsSchema, clinicAdminSchema, clinicAdminSignupSchema, clinicBranchSetupSchema, clinicContactInfoSchema, clinicGroupSchema, clinicGroupSetupSchema, clinicInfoSchema, clinicLocationSchema, clinicReviewSchema, clinicSchema, clinicTagsSchema, contactPersonSchema, contraindicationSchema, createAdminTokenSchema, createAppointmentSchema, createCalendarEventSchema, createClinicAdminSchema, createClinicGroupSchema, createClinicSchema, createDefaultClinicGroupSchema, createDocumentTemplateSchema, createDraftPractitionerSchema, createPatientLocationInfoSchema, createPatientMedicalInfoSchema, createPatientProfileSchema, createPatientSensitiveInfoSchema, createPractitionerSchema, createPractitionerTokenSchema, createUserOptionsSchema, doctorInfoSchema, documentElementSchema, documentElementWithoutIdSchema, documentTemplateSchema, emailSchema, emergencyContactSchema, gamificationSchema, getFirebaseApp, getFirebaseAuth, getFirebaseDB, getFirebaseInstance, initializeFirebase, locationDataSchema, medicationSchema, notificationSchema, passwordSchema, patientClinicSchema, patientDoctorSchema, patientLocationInfoSchema, patientMedicalInfoSchema, patientProfileInfoSchema, patientProfileSchema, patientSensitiveInfoSchema, postRequirementNotificationSchema, practitionerBasicInfoSchema, practitionerCertificationSchema, practitionerClinicProceduresSchema, practitionerClinicWorkingHoursSchema, practitionerProfileInfoSchema, practitionerReviewSchema, practitionerSchema, practitionerTokenSchema, practitionerWorkingHoursSchema, preRequirementNotificationSchema, procedureCategorizationSchema, procedureInfoSchema, reviewInfoSchema, serviceInfoSchema, syncedCalendarEventSchema, timeSlotSchema, timestampSchema, updateAllergySchema, updateAppointmentSchema, updateBlockingConditionSchema, updateCalendarEventSchema, updateClinicAdminSchema, updateClinicGroupSchema, updateClinicSchema, updateContraindicationSchema, updateDocumentTemplateSchema, updateMedicationSchema, updatePatientMedicalInfoSchema, updateVitalStatsSchema, userRoleSchema, userRolesSchema, userSchema, vitalStatsSchema, workingHoursSchema };