@blackcode_sa/metaestetics-api 1.5.35 → 1.5.37
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 +1829 -1514
- package/dist/index.d.ts +1829 -1514
- package/dist/index.js +2055 -1118
- package/dist/index.mjs +2071 -1123
- package/package.json +1 -1
- package/src/index.ts +26 -0
- package/src/services/appointment/appointment.service.ts +8 -0
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { UserRole } from "./types";
|
|
2
2
|
import { Category } from "./backoffice/types/category.types";
|
|
3
|
+
import {
|
|
4
|
+
createAppointmentSchema as appointmentCreateSchema,
|
|
5
|
+
updateAppointmentSchema as appointmentUpdateSchema,
|
|
6
|
+
searchAppointmentsSchema,
|
|
7
|
+
} from "./validations/appointment.schema";
|
|
3
8
|
|
|
4
9
|
// Firebase
|
|
5
10
|
export {
|
|
@@ -27,6 +32,7 @@ export {
|
|
|
27
32
|
export { CalendarServiceV2 } from "./services/calendar/calendar-refactored.service";
|
|
28
33
|
export { SyncedCalendarsService } from "./services/calendar/synced-calendars.service";
|
|
29
34
|
export { ReviewService } from "./services/reviews/reviews.service";
|
|
35
|
+
export { AppointmentService } from "./services/appointment/appointment.service";
|
|
30
36
|
|
|
31
37
|
// Backoffice services
|
|
32
38
|
export { BrandService } from "./backoffice/services/brand.service";
|
|
@@ -54,6 +60,13 @@ export {
|
|
|
54
60
|
} from "./validations/profile-info.schema";
|
|
55
61
|
export { FirebaseErrorCode } from "./errors/firebase.errors";
|
|
56
62
|
|
|
63
|
+
// Appointment schemas
|
|
64
|
+
export {
|
|
65
|
+
appointmentCreateSchema as createAppointmentSchema,
|
|
66
|
+
appointmentUpdateSchema as updateAppointmentSchema,
|
|
67
|
+
searchAppointmentsSchema,
|
|
68
|
+
};
|
|
69
|
+
|
|
57
70
|
// Notification types
|
|
58
71
|
export type {
|
|
59
72
|
Notification,
|
|
@@ -110,6 +123,19 @@ export {
|
|
|
110
123
|
PATIENT_APPOINTMENTS_COLLECTION,
|
|
111
124
|
} from "./types/patient";
|
|
112
125
|
|
|
126
|
+
// Appointment types
|
|
127
|
+
export type {
|
|
128
|
+
Appointment,
|
|
129
|
+
CreateAppointmentData,
|
|
130
|
+
UpdateAppointmentData,
|
|
131
|
+
SearchAppointmentsParams,
|
|
132
|
+
} from "./types/appointment";
|
|
133
|
+
export {
|
|
134
|
+
AppointmentStatus,
|
|
135
|
+
PaymentStatus,
|
|
136
|
+
APPOINTMENTS_COLLECTION,
|
|
137
|
+
} from "./types/appointment";
|
|
138
|
+
|
|
113
139
|
// Allergy tipovi
|
|
114
140
|
export type {
|
|
115
141
|
AllergyTypeWithSubtype,
|
|
@@ -123,6 +123,14 @@ export class AppointmentService extends BaseService {
|
|
|
123
123
|
throw new Error("End date must be after start date");
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
+
// Check if user is authenticated
|
|
127
|
+
const currentUser = this.auth.currentUser;
|
|
128
|
+
if (!currentUser) {
|
|
129
|
+
throw new Error(
|
|
130
|
+
"User must be authenticated to get available booking slots"
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
|
|
126
134
|
// Create a callable function reference
|
|
127
135
|
const getAvailableBookingSlotsFunction = httpsCallable(
|
|
128
136
|
this.functions,
|