@blackcode_sa/metaestetics-api 1.5.43 → 1.5.44
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 +12 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +42 -0
- package/dist/index.mjs +43 -1
- package/package.json +1 -1
- package/src/services/appointment/appointment.service.ts +55 -0
package/dist/index.d.mts
CHANGED
|
@@ -6374,6 +6374,18 @@ declare class AppointmentService extends BaseService {
|
|
|
6374
6374
|
* @param clinicService Clinic service instance
|
|
6375
6375
|
*/
|
|
6376
6376
|
constructor(db: Firestore, auth: Auth, app: FirebaseApp, calendarService: CalendarServiceV2, patientService: PatientService, practitionerService: PractitionerService, clinicService: ClinicService);
|
|
6377
|
+
/**
|
|
6378
|
+
* Test method using the callable function version of getAvailableBookingSlots
|
|
6379
|
+
* For development and testing purposes only - not for production use
|
|
6380
|
+
*
|
|
6381
|
+
* @param clinicId ID of the clinic
|
|
6382
|
+
* @param practitionerId ID of the practitioner
|
|
6383
|
+
* @param procedureId ID of the procedure
|
|
6384
|
+
* @param startDate Start date of the time range to check
|
|
6385
|
+
* @param endDate End date of the time range to check
|
|
6386
|
+
* @returns Test result from the callable function
|
|
6387
|
+
*/
|
|
6388
|
+
testGetAvailableBookingSlots(clinicId: string, practitionerId: string, procedureId: string, startDate: Date, endDate: Date): Promise<any>;
|
|
6377
6389
|
/**
|
|
6378
6390
|
* Gets available booking slots for a specific clinic, practitioner, and procedure.
|
|
6379
6391
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -6374,6 +6374,18 @@ declare class AppointmentService extends BaseService {
|
|
|
6374
6374
|
* @param clinicService Clinic service instance
|
|
6375
6375
|
*/
|
|
6376
6376
|
constructor(db: Firestore, auth: Auth, app: FirebaseApp, calendarService: CalendarServiceV2, patientService: PatientService, practitionerService: PractitionerService, clinicService: ClinicService);
|
|
6377
|
+
/**
|
|
6378
|
+
* Test method using the callable function version of getAvailableBookingSlots
|
|
6379
|
+
* For development and testing purposes only - not for production use
|
|
6380
|
+
*
|
|
6381
|
+
* @param clinicId ID of the clinic
|
|
6382
|
+
* @param practitionerId ID of the practitioner
|
|
6383
|
+
* @param procedureId ID of the procedure
|
|
6384
|
+
* @param startDate Start date of the time range to check
|
|
6385
|
+
* @param endDate End date of the time range to check
|
|
6386
|
+
* @returns Test result from the callable function
|
|
6387
|
+
*/
|
|
6388
|
+
testGetAvailableBookingSlots(clinicId: string, practitionerId: string, procedureId: string, startDate: Date, endDate: Date): Promise<any>;
|
|
6377
6389
|
/**
|
|
6378
6390
|
* Gets available booking slots for a specific clinic, practitioner, and procedure.
|
|
6379
6391
|
*
|
package/dist/index.js
CHANGED
|
@@ -11771,6 +11771,48 @@ var AppointmentService = class extends BaseService {
|
|
|
11771
11771
|
this.clinicService = clinicService;
|
|
11772
11772
|
this.functions = (0, import_functions.getFunctions)(app, "europe-west6");
|
|
11773
11773
|
}
|
|
11774
|
+
/**
|
|
11775
|
+
* Test method using the callable function version of getAvailableBookingSlots
|
|
11776
|
+
* For development and testing purposes only - not for production use
|
|
11777
|
+
*
|
|
11778
|
+
* @param clinicId ID of the clinic
|
|
11779
|
+
* @param practitionerId ID of the practitioner
|
|
11780
|
+
* @param procedureId ID of the procedure
|
|
11781
|
+
* @param startDate Start date of the time range to check
|
|
11782
|
+
* @param endDate End date of the time range to check
|
|
11783
|
+
* @returns Test result from the callable function
|
|
11784
|
+
*/
|
|
11785
|
+
async testGetAvailableBookingSlots(clinicId, practitionerId, procedureId, startDate, endDate) {
|
|
11786
|
+
try {
|
|
11787
|
+
console.log(
|
|
11788
|
+
`[APPOINTMENT_SERVICE] Testing callable function for clinic: ${clinicId}, practitioner: ${practitionerId}, procedure: ${procedureId}`
|
|
11789
|
+
);
|
|
11790
|
+
const getAvailableBookingSlotsCallable = (0, import_functions.httpsCallable)(
|
|
11791
|
+
this.functions,
|
|
11792
|
+
"getAvailableBookingSlots"
|
|
11793
|
+
);
|
|
11794
|
+
const result = await getAvailableBookingSlotsCallable({
|
|
11795
|
+
clinicId,
|
|
11796
|
+
practitionerId,
|
|
11797
|
+
procedureId,
|
|
11798
|
+
timeframe: {
|
|
11799
|
+
start: startDate.getTime(),
|
|
11800
|
+
end: endDate.getTime()
|
|
11801
|
+
}
|
|
11802
|
+
});
|
|
11803
|
+
console.log(
|
|
11804
|
+
"[APPOINTMENT_SERVICE] Callable function test result:",
|
|
11805
|
+
result.data
|
|
11806
|
+
);
|
|
11807
|
+
return result.data;
|
|
11808
|
+
} catch (error) {
|
|
11809
|
+
console.error(
|
|
11810
|
+
"[APPOINTMENT_SERVICE] Error testing callable function:",
|
|
11811
|
+
error
|
|
11812
|
+
);
|
|
11813
|
+
throw error;
|
|
11814
|
+
}
|
|
11815
|
+
}
|
|
11774
11816
|
/**
|
|
11775
11817
|
* Gets available booking slots for a specific clinic, practitioner, and procedure.
|
|
11776
11818
|
*
|
package/dist/index.mjs
CHANGED
|
@@ -11471,7 +11471,7 @@ var ReviewService = class extends BaseService {
|
|
|
11471
11471
|
import {
|
|
11472
11472
|
Timestamp as Timestamp28
|
|
11473
11473
|
} from "firebase/firestore";
|
|
11474
|
-
import { getFunctions } from "firebase/functions";
|
|
11474
|
+
import { getFunctions, httpsCallable } from "firebase/functions";
|
|
11475
11475
|
|
|
11476
11476
|
// src/services/appointment/utils/appointment.utils.ts
|
|
11477
11477
|
import {
|
|
@@ -11860,6 +11860,48 @@ var AppointmentService = class extends BaseService {
|
|
|
11860
11860
|
this.clinicService = clinicService;
|
|
11861
11861
|
this.functions = getFunctions(app, "europe-west6");
|
|
11862
11862
|
}
|
|
11863
|
+
/**
|
|
11864
|
+
* Test method using the callable function version of getAvailableBookingSlots
|
|
11865
|
+
* For development and testing purposes only - not for production use
|
|
11866
|
+
*
|
|
11867
|
+
* @param clinicId ID of the clinic
|
|
11868
|
+
* @param practitionerId ID of the practitioner
|
|
11869
|
+
* @param procedureId ID of the procedure
|
|
11870
|
+
* @param startDate Start date of the time range to check
|
|
11871
|
+
* @param endDate End date of the time range to check
|
|
11872
|
+
* @returns Test result from the callable function
|
|
11873
|
+
*/
|
|
11874
|
+
async testGetAvailableBookingSlots(clinicId, practitionerId, procedureId, startDate, endDate) {
|
|
11875
|
+
try {
|
|
11876
|
+
console.log(
|
|
11877
|
+
`[APPOINTMENT_SERVICE] Testing callable function for clinic: ${clinicId}, practitioner: ${practitionerId}, procedure: ${procedureId}`
|
|
11878
|
+
);
|
|
11879
|
+
const getAvailableBookingSlotsCallable = httpsCallable(
|
|
11880
|
+
this.functions,
|
|
11881
|
+
"getAvailableBookingSlots"
|
|
11882
|
+
);
|
|
11883
|
+
const result = await getAvailableBookingSlotsCallable({
|
|
11884
|
+
clinicId,
|
|
11885
|
+
practitionerId,
|
|
11886
|
+
procedureId,
|
|
11887
|
+
timeframe: {
|
|
11888
|
+
start: startDate.getTime(),
|
|
11889
|
+
end: endDate.getTime()
|
|
11890
|
+
}
|
|
11891
|
+
});
|
|
11892
|
+
console.log(
|
|
11893
|
+
"[APPOINTMENT_SERVICE] Callable function test result:",
|
|
11894
|
+
result.data
|
|
11895
|
+
);
|
|
11896
|
+
return result.data;
|
|
11897
|
+
} catch (error) {
|
|
11898
|
+
console.error(
|
|
11899
|
+
"[APPOINTMENT_SERVICE] Error testing callable function:",
|
|
11900
|
+
error
|
|
11901
|
+
);
|
|
11902
|
+
throw error;
|
|
11903
|
+
}
|
|
11904
|
+
}
|
|
11863
11905
|
/**
|
|
11864
11906
|
* Gets available booking slots for a specific clinic, practitioner, and procedure.
|
|
11865
11907
|
*
|
package/package.json
CHANGED
|
@@ -84,6 +84,61 @@ export class AppointmentService extends BaseService {
|
|
|
84
84
|
this.functions = getFunctions(app, "europe-west6"); // Initialize Firebase Functions with the correct region
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
+
/**
|
|
88
|
+
* Test method using the callable function version of getAvailableBookingSlots
|
|
89
|
+
* For development and testing purposes only - not for production use
|
|
90
|
+
*
|
|
91
|
+
* @param clinicId ID of the clinic
|
|
92
|
+
* @param practitionerId ID of the practitioner
|
|
93
|
+
* @param procedureId ID of the procedure
|
|
94
|
+
* @param startDate Start date of the time range to check
|
|
95
|
+
* @param endDate End date of the time range to check
|
|
96
|
+
* @returns Test result from the callable function
|
|
97
|
+
*/
|
|
98
|
+
async testGetAvailableBookingSlots(
|
|
99
|
+
clinicId: string,
|
|
100
|
+
practitionerId: string,
|
|
101
|
+
procedureId: string,
|
|
102
|
+
startDate: Date,
|
|
103
|
+
endDate: Date
|
|
104
|
+
): Promise<any> {
|
|
105
|
+
try {
|
|
106
|
+
console.log(
|
|
107
|
+
`[APPOINTMENT_SERVICE] Testing callable function for clinic: ${clinicId}, practitioner: ${practitionerId}, procedure: ${procedureId}`
|
|
108
|
+
);
|
|
109
|
+
|
|
110
|
+
// Get the callable function
|
|
111
|
+
const getAvailableBookingSlotsCallable = httpsCallable(
|
|
112
|
+
this.functions,
|
|
113
|
+
"getAvailableBookingSlots"
|
|
114
|
+
);
|
|
115
|
+
|
|
116
|
+
// Call the function with the required parameters
|
|
117
|
+
const result = await getAvailableBookingSlotsCallable({
|
|
118
|
+
clinicId,
|
|
119
|
+
practitionerId,
|
|
120
|
+
procedureId,
|
|
121
|
+
timeframe: {
|
|
122
|
+
start: startDate.getTime(),
|
|
123
|
+
end: endDate.getTime(),
|
|
124
|
+
},
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
console.log(
|
|
128
|
+
"[APPOINTMENT_SERVICE] Callable function test result:",
|
|
129
|
+
result.data
|
|
130
|
+
);
|
|
131
|
+
|
|
132
|
+
return result.data;
|
|
133
|
+
} catch (error) {
|
|
134
|
+
console.error(
|
|
135
|
+
"[APPOINTMENT_SERVICE] Error testing callable function:",
|
|
136
|
+
error
|
|
137
|
+
);
|
|
138
|
+
throw error;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
87
142
|
/**
|
|
88
143
|
* Gets available booking slots for a specific clinic, practitioner, and procedure.
|
|
89
144
|
*
|