@blackcode_sa/metaestetics-api 1.5.25 → 1.5.28

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
@@ -4426,6 +4426,46 @@ declare class ClinicService extends BaseService {
4426
4426
  * @returns The created clinic
4427
4427
  */
4428
4428
  createClinicBranch(clinicGroupId: string, setupData: ClinicBranchSetupData, adminId: string): Promise<Clinic>;
4429
+ /**
4430
+ * Retrieves a clinic by its ID
4431
+ *
4432
+ * @param clinicId - ID of the clinic to retrieve
4433
+ * @returns The clinic if found, null otherwise
4434
+ */
4435
+ getClinicById(clinicId: string): Promise<Clinic | null>;
4436
+ /**
4437
+ * Retrieves all clinics with optional pagination
4438
+ *
4439
+ * @param pagination - Optional number of clinics per page (0 or undefined returns all)
4440
+ * @param lastDoc - Optional last document for pagination (if continuing from a previous page)
4441
+ * @returns Array of clinics and the last document for pagination
4442
+ */
4443
+ getAllClinics(pagination?: number, lastDoc?: any): Promise<{
4444
+ clinics: Clinic[];
4445
+ lastDoc: any;
4446
+ }>;
4447
+ /**
4448
+ * Retrieves all clinics within a specified range from a location with optional pagination
4449
+ *
4450
+ * @param center - The center location coordinates {latitude, longitude}
4451
+ * @param rangeInKm - The range in kilometers to search within
4452
+ * @param pagination - Optional number of clinics per page (0 or undefined returns all)
4453
+ * @param lastDoc - Optional last document for pagination (if continuing from a previous page)
4454
+ * @param filters - Optional filters to apply to the search (isActive, tags, etc.)
4455
+ * @returns Array of clinics with distance information and the last document for pagination
4456
+ */
4457
+ getAllClinicsInRange(center: {
4458
+ latitude: number;
4459
+ longitude: number;
4460
+ }, rangeInKm: number, pagination?: number, lastDoc?: any, filters?: {
4461
+ isActive?: boolean;
4462
+ tags?: ClinicTag[];
4463
+ }): Promise<{
4464
+ clinics: (Clinic & {
4465
+ distance: number;
4466
+ })[];
4467
+ lastDoc: any;
4468
+ }>;
4429
4469
  }
4430
4470
 
4431
4471
  declare class ClinicAdminService extends BaseService {
@@ -4952,6 +4992,10 @@ interface Procedure {
4952
4992
  practitionerId: string;
4953
4993
  /** ID of the clinic branch where this procedure is performed */
4954
4994
  clinicBranchId: string;
4995
+ /** Aggregated clinic information */
4996
+ clinicInfo: ClinicInfo;
4997
+ /** Aggregated doctor information */
4998
+ doctorInfo: DoctorInfo;
4955
4999
  /** Whether this procedure is active */
4956
5000
  isActive: boolean;
4957
5001
  /** When this procedure was created */
@@ -5063,6 +5107,49 @@ declare class ProcedureService extends BaseService {
5063
5107
  categories: string[];
5064
5108
  subcategories: string[];
5065
5109
  }>;
5110
+ /**
5111
+ * Gets all procedures with optional pagination
5112
+ *
5113
+ * @param pagination - Optional number of procedures per page (0 or undefined returns all)
5114
+ * @param lastDoc - Optional last document for pagination (if continuing from a previous page)
5115
+ * @returns Object containing procedures array and the last document for pagination
5116
+ */
5117
+ getAllProcedures(pagination?: number, lastDoc?: any): Promise<{
5118
+ procedures: Procedure[];
5119
+ lastDoc: any;
5120
+ }>;
5121
+ /**
5122
+ * Updates the clinicInfo and doctorInfo fields in procedures when the source data changes
5123
+ *
5124
+ * @param entityType - The type of entity that changed ("clinic" or "doctor")
5125
+ * @param entityId - The ID of the entity that changed
5126
+ * @param updatedData - The updated data for the entity
5127
+ * @returns Number of procedures updated
5128
+ */
5129
+ updateProcedureAggregateData(entityType: "clinic" | "doctor", entityId: string, updatedData: any): Promise<number>;
5130
+ /**
5131
+ * Updates the clinicInfo for all procedures associated with a specific clinic
5132
+ *
5133
+ * @param clinicId - The ID of the clinic that was updated
5134
+ * @param clinicData - The updated clinic data
5135
+ * @returns Number of procedures updated
5136
+ */
5137
+ updateClinicInfoInProcedures(clinicId: string, clinicData: any): Promise<number>;
5138
+ /**
5139
+ * Updates the doctorInfo for all procedures associated with a specific practitioner
5140
+ *
5141
+ * @param practitionerId - The ID of the practitioner that was updated
5142
+ * @param practitionerData - The updated practitioner data
5143
+ * @returns Number of procedures updated
5144
+ */
5145
+ updateDoctorInfoInProcedures(practitionerId: string, practitionerData: any): Promise<number>;
5146
+ /**
5147
+ * Updates all existing procedures to include clinicInfo and doctorInfo
5148
+ * This is a migration helper method that can be used to update existing procedures
5149
+ *
5150
+ * @returns Number of procedures updated
5151
+ */
5152
+ migrateAllProceduresWithAggregateData(): Promise<number>;
5066
5153
  }
5067
5154
 
5068
5155
  /**
package/dist/index.d.ts CHANGED
@@ -4426,6 +4426,46 @@ declare class ClinicService extends BaseService {
4426
4426
  * @returns The created clinic
4427
4427
  */
4428
4428
  createClinicBranch(clinicGroupId: string, setupData: ClinicBranchSetupData, adminId: string): Promise<Clinic>;
4429
+ /**
4430
+ * Retrieves a clinic by its ID
4431
+ *
4432
+ * @param clinicId - ID of the clinic to retrieve
4433
+ * @returns The clinic if found, null otherwise
4434
+ */
4435
+ getClinicById(clinicId: string): Promise<Clinic | null>;
4436
+ /**
4437
+ * Retrieves all clinics with optional pagination
4438
+ *
4439
+ * @param pagination - Optional number of clinics per page (0 or undefined returns all)
4440
+ * @param lastDoc - Optional last document for pagination (if continuing from a previous page)
4441
+ * @returns Array of clinics and the last document for pagination
4442
+ */
4443
+ getAllClinics(pagination?: number, lastDoc?: any): Promise<{
4444
+ clinics: Clinic[];
4445
+ lastDoc: any;
4446
+ }>;
4447
+ /**
4448
+ * Retrieves all clinics within a specified range from a location with optional pagination
4449
+ *
4450
+ * @param center - The center location coordinates {latitude, longitude}
4451
+ * @param rangeInKm - The range in kilometers to search within
4452
+ * @param pagination - Optional number of clinics per page (0 or undefined returns all)
4453
+ * @param lastDoc - Optional last document for pagination (if continuing from a previous page)
4454
+ * @param filters - Optional filters to apply to the search (isActive, tags, etc.)
4455
+ * @returns Array of clinics with distance information and the last document for pagination
4456
+ */
4457
+ getAllClinicsInRange(center: {
4458
+ latitude: number;
4459
+ longitude: number;
4460
+ }, rangeInKm: number, pagination?: number, lastDoc?: any, filters?: {
4461
+ isActive?: boolean;
4462
+ tags?: ClinicTag[];
4463
+ }): Promise<{
4464
+ clinics: (Clinic & {
4465
+ distance: number;
4466
+ })[];
4467
+ lastDoc: any;
4468
+ }>;
4429
4469
  }
4430
4470
 
4431
4471
  declare class ClinicAdminService extends BaseService {
@@ -4952,6 +4992,10 @@ interface Procedure {
4952
4992
  practitionerId: string;
4953
4993
  /** ID of the clinic branch where this procedure is performed */
4954
4994
  clinicBranchId: string;
4995
+ /** Aggregated clinic information */
4996
+ clinicInfo: ClinicInfo;
4997
+ /** Aggregated doctor information */
4998
+ doctorInfo: DoctorInfo;
4955
4999
  /** Whether this procedure is active */
4956
5000
  isActive: boolean;
4957
5001
  /** When this procedure was created */
@@ -5063,6 +5107,49 @@ declare class ProcedureService extends BaseService {
5063
5107
  categories: string[];
5064
5108
  subcategories: string[];
5065
5109
  }>;
5110
+ /**
5111
+ * Gets all procedures with optional pagination
5112
+ *
5113
+ * @param pagination - Optional number of procedures per page (0 or undefined returns all)
5114
+ * @param lastDoc - Optional last document for pagination (if continuing from a previous page)
5115
+ * @returns Object containing procedures array and the last document for pagination
5116
+ */
5117
+ getAllProcedures(pagination?: number, lastDoc?: any): Promise<{
5118
+ procedures: Procedure[];
5119
+ lastDoc: any;
5120
+ }>;
5121
+ /**
5122
+ * Updates the clinicInfo and doctorInfo fields in procedures when the source data changes
5123
+ *
5124
+ * @param entityType - The type of entity that changed ("clinic" or "doctor")
5125
+ * @param entityId - The ID of the entity that changed
5126
+ * @param updatedData - The updated data for the entity
5127
+ * @returns Number of procedures updated
5128
+ */
5129
+ updateProcedureAggregateData(entityType: "clinic" | "doctor", entityId: string, updatedData: any): Promise<number>;
5130
+ /**
5131
+ * Updates the clinicInfo for all procedures associated with a specific clinic
5132
+ *
5133
+ * @param clinicId - The ID of the clinic that was updated
5134
+ * @param clinicData - The updated clinic data
5135
+ * @returns Number of procedures updated
5136
+ */
5137
+ updateClinicInfoInProcedures(clinicId: string, clinicData: any): Promise<number>;
5138
+ /**
5139
+ * Updates the doctorInfo for all procedures associated with a specific practitioner
5140
+ *
5141
+ * @param practitionerId - The ID of the practitioner that was updated
5142
+ * @param practitionerData - The updated practitioner data
5143
+ * @returns Number of procedures updated
5144
+ */
5145
+ updateDoctorInfoInProcedures(practitionerId: string, practitionerData: any): Promise<number>;
5146
+ /**
5147
+ * Updates all existing procedures to include clinicInfo and doctorInfo
5148
+ * This is a migration helper method that can be used to update existing procedures
5149
+ *
5150
+ * @returns Number of procedures updated
5151
+ */
5152
+ migrateAllProceduresWithAggregateData(): Promise<number>;
5066
5153
  }
5067
5154
 
5068
5155
  /**