@blackcode_sa/metaestetics-api 1.5.29 → 1.5.31
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/admin/index.d.mts +126 -1
- package/dist/admin/index.d.ts +126 -1
- package/dist/admin/index.js +347 -10
- package/dist/admin/index.mjs +345 -10
- package/dist/index.d.mts +64 -71
- package/dist/index.d.ts +64 -71
- package/dist/index.js +327 -710
- package/dist/index.mjs +363 -750
- package/package.json +2 -1
- package/src/admin/aggregation/README.md +79 -0
- package/src/admin/aggregation/clinic/README.md +52 -0
- package/src/admin/aggregation/patient/README.md +27 -0
- package/src/admin/aggregation/practitioner/README.md +42 -0
- package/src/admin/aggregation/procedure/README.md +43 -0
- package/src/admin/index.ts +17 -2
- package/src/admin/mailing/README.md +95 -0
- package/src/admin/mailing/base.mailing.service.ts +131 -0
- package/src/admin/mailing/index.ts +2 -0
- package/src/admin/mailing/practitionerInvite/index.ts +1 -0
- package/src/admin/mailing/practitionerInvite/practitionerInvite.mailing.ts +256 -0
- package/src/admin/mailing/practitionerInvite/templates/invitation.template.ts +101 -0
- package/src/services/README.md +106 -0
- package/src/services/calendar/utils/appointment.utils.ts +42 -91
- package/src/services/clinic/README.md +87 -0
- package/src/services/clinic/clinic.service.ts +3 -126
- package/src/services/clinic/utils/clinic.utils.ts +2 -2
- package/src/services/practitioner/README.md +145 -0
- package/src/services/practitioner/practitioner.service.ts +119 -395
- package/src/services/procedure/README.md +88 -0
- package/src/services/procedure/procedure.service.ts +332 -369
package/dist/index.d.ts
CHANGED
|
@@ -4545,31 +4545,16 @@ declare class ClinicService extends BaseService {
|
|
|
4545
4545
|
private clinicGroupService;
|
|
4546
4546
|
private clinicAdminService;
|
|
4547
4547
|
constructor(db: Firestore, auth: Auth, app: FirebaseApp, clinicGroupService: ClinicGroupService, clinicAdminService: ClinicAdminService);
|
|
4548
|
-
/**
|
|
4549
|
-
* Creates an aggregated ClinicInfo object from Clinic data.
|
|
4550
|
-
* @param clinic The clinic object
|
|
4551
|
-
* @returns ClinicInfo object
|
|
4552
|
-
*/
|
|
4553
|
-
private _createClinicInfoForAggregation;
|
|
4554
|
-
/**
|
|
4555
|
-
* Updates the ClinicInfo within the clinicsInfo array for multiple practitioners.
|
|
4556
|
-
* @param practitionerIds IDs of practitioners to update
|
|
4557
|
-
* @param clinicInfo The updated ClinicInfo object
|
|
4558
|
-
*/
|
|
4559
|
-
private _updateClinicInfoInPractitioners;
|
|
4560
4548
|
/**
|
|
4561
4549
|
* Creates a new clinic.
|
|
4562
|
-
* Initializes empty doctorsInfo and proceduresInfo.
|
|
4563
|
-
* Aggregation into Clinic happens via PractitionerService and ProcedureService.
|
|
4564
4550
|
*/
|
|
4565
4551
|
createClinic(data: CreateClinicData, creatorAdminId: string): Promise<Clinic>;
|
|
4566
4552
|
/**
|
|
4567
|
-
* Updates a clinic
|
|
4553
|
+
* Updates a clinic.
|
|
4568
4554
|
*/
|
|
4569
4555
|
updateClinic(clinicId: string, data: Partial<Omit<Clinic, "id" | "createdAt" | "clinicGroupId">>, adminId: string): Promise<Clinic>;
|
|
4570
4556
|
/**
|
|
4571
4557
|
* Deactivates a clinic.
|
|
4572
|
-
* Note: Does not currently remove ClinicInfo from practitioners (might be desired).
|
|
4573
4558
|
*/
|
|
4574
4559
|
deactivateClinic(clinicId: string, adminId: string): Promise<void>;
|
|
4575
4560
|
/**
|
|
@@ -4582,7 +4567,6 @@ declare class ClinicService extends BaseService {
|
|
|
4582
4567
|
getClinicsByGroup(groupId: string): Promise<Clinic[]>;
|
|
4583
4568
|
/**
|
|
4584
4569
|
* Pretražuje klinike u određenom radijusu
|
|
4585
|
-
* REVIEW: SearchUtils.findClinicsInRadius might need updating for filters.
|
|
4586
4570
|
*/
|
|
4587
4571
|
findClinicsInRadius(center: {
|
|
4588
4572
|
latitude: number;
|
|
@@ -4708,28 +4692,9 @@ declare class PractitionerService extends BaseService {
|
|
|
4708
4692
|
private clinicService?;
|
|
4709
4693
|
constructor(db: Firestore, auth: Auth, app: FirebaseApp, clinicService?: ClinicService);
|
|
4710
4694
|
private getClinicService;
|
|
4711
|
-
/**
|
|
4712
|
-
* Postavlja referencu na ClinicService nakon inicijalizacije
|
|
4713
|
-
*/
|
|
4714
4695
|
setClinicService(clinicService: ClinicService): void;
|
|
4715
4696
|
/**
|
|
4716
|
-
*
|
|
4717
|
-
* @param clinicIds Array of clinic IDs the practitioner works at
|
|
4718
|
-
* @returns Array of ClinicInfo objects
|
|
4719
|
-
*/
|
|
4720
|
-
private aggregateClinicInfo;
|
|
4721
|
-
/**
|
|
4722
|
-
* @deprecated Aggregation of procedure info is now handled by ProcedureService.
|
|
4723
|
-
*/
|
|
4724
|
-
private aggregateProcedureInfo;
|
|
4725
|
-
/**
|
|
4726
|
-
* Updates aggregated data (clinics and procedures) for a practitioner
|
|
4727
|
-
* @param practitionerId ID of the practitioner to update
|
|
4728
|
-
* @returns Updated practitioner
|
|
4729
|
-
*/
|
|
4730
|
-
updateAggregatedData(practitionerId: string): Promise<Practitioner | null>;
|
|
4731
|
-
/**
|
|
4732
|
-
* Kreira novog zdravstvenog radnika
|
|
4697
|
+
* Creates a new practitioner
|
|
4733
4698
|
*/
|
|
4734
4699
|
createPractitioner(data: CreatePractitionerData): Promise<Practitioner>;
|
|
4735
4700
|
/**
|
|
@@ -4791,15 +4756,15 @@ declare class PractitionerService extends BaseService {
|
|
|
4791
4756
|
*/
|
|
4792
4757
|
getDraftPractitionersByClinic(clinicId: string): Promise<Practitioner[]>;
|
|
4793
4758
|
/**
|
|
4794
|
-
*
|
|
4759
|
+
* Updates a practitioner
|
|
4795
4760
|
*/
|
|
4796
4761
|
updatePractitioner(practitionerId: string, data: UpdatePractitionerData): Promise<Practitioner>;
|
|
4797
4762
|
/**
|
|
4798
|
-
*
|
|
4763
|
+
* Adds a clinic to a practitioner
|
|
4799
4764
|
*/
|
|
4800
4765
|
addClinic(practitionerId: string, clinicId: string): Promise<void>;
|
|
4801
4766
|
/**
|
|
4802
|
-
*
|
|
4767
|
+
* Removes a clinic from a practitioner
|
|
4803
4768
|
*/
|
|
4804
4769
|
removeClinic(practitionerId: string, clinicId: string): Promise<void>;
|
|
4805
4770
|
/**
|
|
@@ -4880,30 +4845,6 @@ declare class PractitionerService extends BaseService {
|
|
|
4880
4845
|
practitioners: Practitioner[];
|
|
4881
4846
|
lastDoc: any;
|
|
4882
4847
|
}>;
|
|
4883
|
-
/**
|
|
4884
|
-
* Aggregates essential clinic information for embedding in Practitioner.
|
|
4885
|
-
* @param clinicIds Array of clinic IDs the practitioner works at
|
|
4886
|
-
* @returns Array of ClinicInfo objects
|
|
4887
|
-
*/
|
|
4888
|
-
private _aggregateClinicInfoForPractitioner;
|
|
4889
|
-
/**
|
|
4890
|
-
* Creates an aggregated DoctorInfo object from Practitioner data.
|
|
4891
|
-
* @param practitioner The practitioner object
|
|
4892
|
-
* @returns DoctorInfo object
|
|
4893
|
-
*/
|
|
4894
|
-
private _createDoctorInfoForClinic;
|
|
4895
|
-
/**
|
|
4896
|
-
* Updates the DoctorInfo within the doctorsInfo array for multiple clinics.
|
|
4897
|
-
* @param clinicIds IDs of clinics to update
|
|
4898
|
-
* @param doctorInfo The updated DoctorInfo object
|
|
4899
|
-
*/
|
|
4900
|
-
private _updateDoctorInfoInClinics;
|
|
4901
|
-
/**
|
|
4902
|
-
* Removes DoctorInfo from the doctorsInfo array for multiple clinics.
|
|
4903
|
-
* @param clinicIds IDs of clinics to update
|
|
4904
|
-
* @param practitionerId ID of the practitioner whose info should be removed
|
|
4905
|
-
*/
|
|
4906
|
-
private _removeDoctorInfoFromClinics;
|
|
4907
4848
|
}
|
|
4908
4849
|
|
|
4909
4850
|
declare class UserService extends BaseService {
|
|
@@ -5225,11 +5166,8 @@ declare class ProcedureService extends BaseService {
|
|
|
5225
5166
|
private technologyService;
|
|
5226
5167
|
private productService;
|
|
5227
5168
|
constructor(db: Firestore, auth: Auth, app: FirebaseApp, categoryService: CategoryService, subcategoryService: SubcategoryService, technologyService: TechnologyService, productService: ProductService);
|
|
5228
|
-
private _createProcedureSummaryInfo;
|
|
5229
|
-
private _updatePractitionerProcedures;
|
|
5230
|
-
private _updateClinicProcedures;
|
|
5231
5169
|
/**
|
|
5232
|
-
* Creates a new procedure
|
|
5170
|
+
* Creates a new procedure
|
|
5233
5171
|
* @param data - The data for creating a new procedure
|
|
5234
5172
|
* @returns The created procedure
|
|
5235
5173
|
*/
|
|
@@ -5253,19 +5191,19 @@ declare class ProcedureService extends BaseService {
|
|
|
5253
5191
|
*/
|
|
5254
5192
|
getProceduresByPractitioner(practitionerId: string): Promise<Procedure[]>;
|
|
5255
5193
|
/**
|
|
5256
|
-
* Updates a procedure
|
|
5194
|
+
* Updates a procedure
|
|
5257
5195
|
* @param id - The ID of the procedure to update
|
|
5258
5196
|
* @param data - The data to update the procedure with
|
|
5259
5197
|
* @returns The updated procedure
|
|
5260
5198
|
*/
|
|
5261
5199
|
updateProcedure(id: string, data: UpdateProcedureData): Promise<Procedure>;
|
|
5262
5200
|
/**
|
|
5263
|
-
* Deactivates a procedure (soft delete)
|
|
5201
|
+
* Deactivates a procedure (soft delete)
|
|
5264
5202
|
* @param id - The ID of the procedure to deactivate
|
|
5265
5203
|
*/
|
|
5266
5204
|
deactivateProcedure(id: string): Promise<void>;
|
|
5267
5205
|
/**
|
|
5268
|
-
* Deletes a procedure permanently
|
|
5206
|
+
* Deletes a procedure permanently
|
|
5269
5207
|
* @param id - The ID of the procedure to delete
|
|
5270
5208
|
* @returns A boolean indicating if the deletion was successful
|
|
5271
5209
|
*/
|
|
@@ -5292,6 +5230,61 @@ declare class ProcedureService extends BaseService {
|
|
|
5292
5230
|
procedures: Procedure[];
|
|
5293
5231
|
lastDoc: any;
|
|
5294
5232
|
}>;
|
|
5233
|
+
/**
|
|
5234
|
+
* Searches and filters procedures based on multiple criteria
|
|
5235
|
+
*
|
|
5236
|
+
* @param filters - Various filters to apply
|
|
5237
|
+
* @param filters.nameSearch - Optional search text for procedure name
|
|
5238
|
+
* @param filters.treatmentBenefits - Optional array of treatment benefits to filter by
|
|
5239
|
+
* @param filters.procedureFamily - Optional procedure family to filter by
|
|
5240
|
+
* @param filters.procedureCategory - Optional procedure category to filter by
|
|
5241
|
+
* @param filters.procedureSubcategory - Optional procedure subcategory to filter by
|
|
5242
|
+
* @param filters.procedureTechnology - Optional procedure technology to filter by
|
|
5243
|
+
* @param filters.location - Optional location for distance-based search
|
|
5244
|
+
* @param filters.radiusInKm - Optional radius in kilometers (required if location is provided)
|
|
5245
|
+
* @param filters.minPrice - Optional minimum price
|
|
5246
|
+
* @param filters.maxPrice - Optional maximum price
|
|
5247
|
+
* @param filters.minRating - Optional minimum rating (0-5)
|
|
5248
|
+
* @param filters.maxRating - Optional maximum rating (0-5)
|
|
5249
|
+
* @param filters.pagination - Optional number of results per page
|
|
5250
|
+
* @param filters.lastDoc - Optional last document for pagination
|
|
5251
|
+
* @param filters.isActive - Optional filter for active procedures only
|
|
5252
|
+
* @returns Filtered procedures and the last document for pagination
|
|
5253
|
+
*/
|
|
5254
|
+
getProceduresByFilters(filters: {
|
|
5255
|
+
nameSearch?: string;
|
|
5256
|
+
treatmentBenefits?: TreatmentBenefit[];
|
|
5257
|
+
procedureFamily?: ProcedureFamily;
|
|
5258
|
+
procedureCategory?: string;
|
|
5259
|
+
procedureSubcategory?: string;
|
|
5260
|
+
procedureTechnology?: string;
|
|
5261
|
+
location?: {
|
|
5262
|
+
latitude: number;
|
|
5263
|
+
longitude: number;
|
|
5264
|
+
};
|
|
5265
|
+
radiusInKm?: number;
|
|
5266
|
+
minPrice?: number;
|
|
5267
|
+
maxPrice?: number;
|
|
5268
|
+
minRating?: number;
|
|
5269
|
+
maxRating?: number;
|
|
5270
|
+
pagination?: number;
|
|
5271
|
+
lastDoc?: any;
|
|
5272
|
+
isActive?: boolean;
|
|
5273
|
+
}): Promise<{
|
|
5274
|
+
procedures: (Procedure & {
|
|
5275
|
+
distance?: number;
|
|
5276
|
+
})[];
|
|
5277
|
+
lastDoc: any;
|
|
5278
|
+
}>;
|
|
5279
|
+
/**
|
|
5280
|
+
* Helper method to apply in-memory filters to procedures
|
|
5281
|
+
* Used by getProceduresByFilters to apply filters that can't be done in Firestore queries
|
|
5282
|
+
*
|
|
5283
|
+
* @param procedures - The procedures to filter
|
|
5284
|
+
* @param filters - The filters to apply
|
|
5285
|
+
* @returns Filtered procedures
|
|
5286
|
+
*/
|
|
5287
|
+
private applyInMemoryFilters;
|
|
5295
5288
|
}
|
|
5296
5289
|
|
|
5297
5290
|
/**
|