@blackcode_sa/metaestetics-api 1.7.23 → 1.7.25
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.js +75 -37
- package/dist/admin/index.mjs +75 -37
- package/dist/index.d.mts +189 -1
- package/dist/index.d.ts +189 -1
- package/dist/index.js +983 -576
- package/dist/index.mjs +1110 -692
- package/package.json +1 -1
- package/src/admin/aggregation/clinic/clinic.aggregation.service.ts +106 -45
- package/src/index.ts +8 -0
- package/src/services/clinic/README.md +117 -0
- package/src/services/clinic/practitioner-invite.service.ts +519 -0
- package/src/types/clinic/index.ts +3 -0
- package/src/types/clinic/practitioner-invite.types.ts +91 -0
package/dist/admin/index.js
CHANGED
|
@@ -987,14 +987,19 @@ var ClinicAggregationService = class {
|
|
|
987
987
|
);
|
|
988
988
|
for (const practitionerId of practitionerIds) {
|
|
989
989
|
const practitionerRef = this.db.collection(PRACTITIONERS_COLLECTION).doc(practitionerId);
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
990
|
+
const practitionerDoc = await practitionerRef.get();
|
|
991
|
+
if (practitionerDoc.exists) {
|
|
992
|
+
const practitionerData = practitionerDoc.data();
|
|
993
|
+
const currentClinicsInfo = (practitionerData == null ? void 0 : practitionerData.clinicsInfo) || [];
|
|
994
|
+
const filteredClinicsInfo = currentClinicsInfo.filter(
|
|
995
|
+
(clinic) => clinic.id !== clinicId
|
|
996
|
+
);
|
|
997
|
+
const updatedClinicsInfo = [...filteredClinicsInfo, clinicInfo];
|
|
998
|
+
batch.update(practitionerRef, {
|
|
999
|
+
clinicsInfo: updatedClinicsInfo,
|
|
1000
|
+
updatedAt: admin3.firestore.FieldValue.serverTimestamp()
|
|
1001
|
+
});
|
|
1002
|
+
}
|
|
998
1003
|
}
|
|
999
1004
|
try {
|
|
1000
1005
|
await batch.commit();
|
|
@@ -1058,28 +1063,35 @@ var ClinicAggregationService = class {
|
|
|
1058
1063
|
);
|
|
1059
1064
|
return;
|
|
1060
1065
|
}
|
|
1061
|
-
const batch = this.db.batch();
|
|
1062
1066
|
const clinicId = clinicInfo.id;
|
|
1063
1067
|
const groupRef = this.db.collection(CLINIC_GROUPS_COLLECTION).doc(clinicGroupId);
|
|
1064
1068
|
console.log(
|
|
1065
1069
|
`[ClinicAggregationService] Starting update of ClinicInfo (ID: ${clinicId}) in Clinic Group ${clinicGroupId}.`
|
|
1066
1070
|
);
|
|
1067
|
-
batch.update(groupRef, {
|
|
1068
|
-
clinicsInfo: admin3.firestore.FieldValue.arrayRemove({ id: clinicId }),
|
|
1069
|
-
updatedAt: admin3.firestore.FieldValue.serverTimestamp()
|
|
1070
|
-
});
|
|
1071
|
-
batch.update(groupRef, {
|
|
1072
|
-
clinicsInfo: admin3.firestore.FieldValue.arrayUnion(clinicInfo),
|
|
1073
|
-
updatedAt: admin3.firestore.FieldValue.serverTimestamp()
|
|
1074
|
-
});
|
|
1075
1071
|
try {
|
|
1076
|
-
await
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1072
|
+
const clinicGroupDoc = await groupRef.get();
|
|
1073
|
+
if (clinicGroupDoc.exists) {
|
|
1074
|
+
const clinicGroupData = clinicGroupDoc.data();
|
|
1075
|
+
const currentClinicsInfo = (clinicGroupData == null ? void 0 : clinicGroupData.clinicsInfo) || [];
|
|
1076
|
+
const filteredClinicsInfo = currentClinicsInfo.filter(
|
|
1077
|
+
(clinic) => clinic.id !== clinicId
|
|
1078
|
+
);
|
|
1079
|
+
const updatedClinicsInfo = [...filteredClinicsInfo, clinicInfo];
|
|
1080
|
+
await groupRef.update({
|
|
1081
|
+
clinicsInfo: updatedClinicsInfo,
|
|
1082
|
+
updatedAt: admin3.firestore.FieldValue.serverTimestamp()
|
|
1083
|
+
});
|
|
1084
|
+
console.log(
|
|
1085
|
+
`[ClinicAggregationService] Successfully updated ClinicInfo (ID: ${clinicId}) in Clinic Group ${clinicGroupId}.`
|
|
1086
|
+
);
|
|
1087
|
+
} else {
|
|
1088
|
+
console.warn(
|
|
1089
|
+
`[ClinicAggregationService] Clinic Group ${clinicGroupId} not found. Cannot update clinic info.`
|
|
1090
|
+
);
|
|
1091
|
+
}
|
|
1080
1092
|
} catch (error) {
|
|
1081
1093
|
console.error(
|
|
1082
|
-
`[ClinicAggregationService] Error
|
|
1094
|
+
`[ClinicAggregationService] Error updating ClinicInfo (ID: ${clinicId}) in Clinic Group ${clinicGroupId}:`,
|
|
1083
1095
|
error
|
|
1084
1096
|
);
|
|
1085
1097
|
throw error;
|
|
@@ -1223,12 +1235,23 @@ var ClinicAggregationService = class {
|
|
|
1223
1235
|
);
|
|
1224
1236
|
for (const practitionerId of practitionerIds) {
|
|
1225
1237
|
const practitionerRef = this.db.collection(PRACTITIONERS_COLLECTION).doc(practitionerId);
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1238
|
+
const practitionerDoc = await practitionerRef.get();
|
|
1239
|
+
if (practitionerDoc.exists) {
|
|
1240
|
+
const practitionerData = practitionerDoc.data();
|
|
1241
|
+
const currentClinicIds = (practitionerData == null ? void 0 : practitionerData.clinics) || [];
|
|
1242
|
+
const currentClinicsInfo = (practitionerData == null ? void 0 : practitionerData.clinicsInfo) || [];
|
|
1243
|
+
const filteredClinicIds = currentClinicIds.filter(
|
|
1244
|
+
(id) => id !== clinicId
|
|
1245
|
+
);
|
|
1246
|
+
const filteredClinicsInfo = currentClinicsInfo.filter(
|
|
1247
|
+
(clinic) => clinic.id !== clinicId
|
|
1248
|
+
);
|
|
1249
|
+
batch.update(practitionerRef, {
|
|
1250
|
+
clinics: filteredClinicIds,
|
|
1251
|
+
clinicsInfo: filteredClinicsInfo,
|
|
1252
|
+
updatedAt: admin3.firestore.FieldValue.serverTimestamp()
|
|
1253
|
+
});
|
|
1254
|
+
}
|
|
1232
1255
|
}
|
|
1233
1256
|
try {
|
|
1234
1257
|
await batch.commit();
|
|
@@ -1295,15 +1318,30 @@ var ClinicAggregationService = class {
|
|
|
1295
1318
|
`[ClinicAggregationService] Removing Clinic (ID: ${clinicId}) from Clinic Group ${clinicGroupId}.`
|
|
1296
1319
|
);
|
|
1297
1320
|
try {
|
|
1298
|
-
await groupRef.
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1321
|
+
const clinicGroupDoc = await groupRef.get();
|
|
1322
|
+
if (clinicGroupDoc.exists) {
|
|
1323
|
+
const clinicGroupData = clinicGroupDoc.data();
|
|
1324
|
+
const currentClinicIds = (clinicGroupData == null ? void 0 : clinicGroupData.clinics) || [];
|
|
1325
|
+
const currentClinicsInfo = (clinicGroupData == null ? void 0 : clinicGroupData.clinicsInfo) || [];
|
|
1326
|
+
const filteredClinicIds = currentClinicIds.filter(
|
|
1327
|
+
(id) => id !== clinicId
|
|
1328
|
+
);
|
|
1329
|
+
const filteredClinicsInfo = currentClinicsInfo.filter(
|
|
1330
|
+
(clinic) => clinic.id !== clinicId
|
|
1331
|
+
);
|
|
1332
|
+
await groupRef.update({
|
|
1333
|
+
clinics: filteredClinicIds,
|
|
1334
|
+
clinicsInfo: filteredClinicsInfo,
|
|
1335
|
+
updatedAt: admin3.firestore.FieldValue.serverTimestamp()
|
|
1336
|
+
});
|
|
1337
|
+
console.log(
|
|
1338
|
+
`[ClinicAggregationService] Successfully removed Clinic (ID: ${clinicId}) from Clinic Group ${clinicGroupId}.`
|
|
1339
|
+
);
|
|
1340
|
+
} else {
|
|
1341
|
+
console.warn(
|
|
1342
|
+
`[ClinicAggregationService] Clinic Group ${clinicGroupId} not found. Cannot remove clinic.`
|
|
1343
|
+
);
|
|
1344
|
+
}
|
|
1307
1345
|
} catch (error) {
|
|
1308
1346
|
console.error(
|
|
1309
1347
|
`[ClinicAggregationService] Error removing Clinic (ID: ${clinicId}) from Clinic Group ${clinicGroupId}:`,
|
package/dist/admin/index.mjs
CHANGED
|
@@ -930,14 +930,19 @@ var ClinicAggregationService = class {
|
|
|
930
930
|
);
|
|
931
931
|
for (const practitionerId of practitionerIds) {
|
|
932
932
|
const practitionerRef = this.db.collection(PRACTITIONERS_COLLECTION).doc(practitionerId);
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
933
|
+
const practitionerDoc = await practitionerRef.get();
|
|
934
|
+
if (practitionerDoc.exists) {
|
|
935
|
+
const practitionerData = practitionerDoc.data();
|
|
936
|
+
const currentClinicsInfo = (practitionerData == null ? void 0 : practitionerData.clinicsInfo) || [];
|
|
937
|
+
const filteredClinicsInfo = currentClinicsInfo.filter(
|
|
938
|
+
(clinic) => clinic.id !== clinicId
|
|
939
|
+
);
|
|
940
|
+
const updatedClinicsInfo = [...filteredClinicsInfo, clinicInfo];
|
|
941
|
+
batch.update(practitionerRef, {
|
|
942
|
+
clinicsInfo: updatedClinicsInfo,
|
|
943
|
+
updatedAt: admin3.firestore.FieldValue.serverTimestamp()
|
|
944
|
+
});
|
|
945
|
+
}
|
|
941
946
|
}
|
|
942
947
|
try {
|
|
943
948
|
await batch.commit();
|
|
@@ -1001,28 +1006,35 @@ var ClinicAggregationService = class {
|
|
|
1001
1006
|
);
|
|
1002
1007
|
return;
|
|
1003
1008
|
}
|
|
1004
|
-
const batch = this.db.batch();
|
|
1005
1009
|
const clinicId = clinicInfo.id;
|
|
1006
1010
|
const groupRef = this.db.collection(CLINIC_GROUPS_COLLECTION).doc(clinicGroupId);
|
|
1007
1011
|
console.log(
|
|
1008
1012
|
`[ClinicAggregationService] Starting update of ClinicInfo (ID: ${clinicId}) in Clinic Group ${clinicGroupId}.`
|
|
1009
1013
|
);
|
|
1010
|
-
batch.update(groupRef, {
|
|
1011
|
-
clinicsInfo: admin3.firestore.FieldValue.arrayRemove({ id: clinicId }),
|
|
1012
|
-
updatedAt: admin3.firestore.FieldValue.serverTimestamp()
|
|
1013
|
-
});
|
|
1014
|
-
batch.update(groupRef, {
|
|
1015
|
-
clinicsInfo: admin3.firestore.FieldValue.arrayUnion(clinicInfo),
|
|
1016
|
-
updatedAt: admin3.firestore.FieldValue.serverTimestamp()
|
|
1017
|
-
});
|
|
1018
1014
|
try {
|
|
1019
|
-
await
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1015
|
+
const clinicGroupDoc = await groupRef.get();
|
|
1016
|
+
if (clinicGroupDoc.exists) {
|
|
1017
|
+
const clinicGroupData = clinicGroupDoc.data();
|
|
1018
|
+
const currentClinicsInfo = (clinicGroupData == null ? void 0 : clinicGroupData.clinicsInfo) || [];
|
|
1019
|
+
const filteredClinicsInfo = currentClinicsInfo.filter(
|
|
1020
|
+
(clinic) => clinic.id !== clinicId
|
|
1021
|
+
);
|
|
1022
|
+
const updatedClinicsInfo = [...filteredClinicsInfo, clinicInfo];
|
|
1023
|
+
await groupRef.update({
|
|
1024
|
+
clinicsInfo: updatedClinicsInfo,
|
|
1025
|
+
updatedAt: admin3.firestore.FieldValue.serverTimestamp()
|
|
1026
|
+
});
|
|
1027
|
+
console.log(
|
|
1028
|
+
`[ClinicAggregationService] Successfully updated ClinicInfo (ID: ${clinicId}) in Clinic Group ${clinicGroupId}.`
|
|
1029
|
+
);
|
|
1030
|
+
} else {
|
|
1031
|
+
console.warn(
|
|
1032
|
+
`[ClinicAggregationService] Clinic Group ${clinicGroupId} not found. Cannot update clinic info.`
|
|
1033
|
+
);
|
|
1034
|
+
}
|
|
1023
1035
|
} catch (error) {
|
|
1024
1036
|
console.error(
|
|
1025
|
-
`[ClinicAggregationService] Error
|
|
1037
|
+
`[ClinicAggregationService] Error updating ClinicInfo (ID: ${clinicId}) in Clinic Group ${clinicGroupId}:`,
|
|
1026
1038
|
error
|
|
1027
1039
|
);
|
|
1028
1040
|
throw error;
|
|
@@ -1166,12 +1178,23 @@ var ClinicAggregationService = class {
|
|
|
1166
1178
|
);
|
|
1167
1179
|
for (const practitionerId of practitionerIds) {
|
|
1168
1180
|
const practitionerRef = this.db.collection(PRACTITIONERS_COLLECTION).doc(practitionerId);
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1181
|
+
const practitionerDoc = await practitionerRef.get();
|
|
1182
|
+
if (practitionerDoc.exists) {
|
|
1183
|
+
const practitionerData = practitionerDoc.data();
|
|
1184
|
+
const currentClinicIds = (practitionerData == null ? void 0 : practitionerData.clinics) || [];
|
|
1185
|
+
const currentClinicsInfo = (practitionerData == null ? void 0 : practitionerData.clinicsInfo) || [];
|
|
1186
|
+
const filteredClinicIds = currentClinicIds.filter(
|
|
1187
|
+
(id) => id !== clinicId
|
|
1188
|
+
);
|
|
1189
|
+
const filteredClinicsInfo = currentClinicsInfo.filter(
|
|
1190
|
+
(clinic) => clinic.id !== clinicId
|
|
1191
|
+
);
|
|
1192
|
+
batch.update(practitionerRef, {
|
|
1193
|
+
clinics: filteredClinicIds,
|
|
1194
|
+
clinicsInfo: filteredClinicsInfo,
|
|
1195
|
+
updatedAt: admin3.firestore.FieldValue.serverTimestamp()
|
|
1196
|
+
});
|
|
1197
|
+
}
|
|
1175
1198
|
}
|
|
1176
1199
|
try {
|
|
1177
1200
|
await batch.commit();
|
|
@@ -1238,15 +1261,30 @@ var ClinicAggregationService = class {
|
|
|
1238
1261
|
`[ClinicAggregationService] Removing Clinic (ID: ${clinicId}) from Clinic Group ${clinicGroupId}.`
|
|
1239
1262
|
);
|
|
1240
1263
|
try {
|
|
1241
|
-
await groupRef.
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1264
|
+
const clinicGroupDoc = await groupRef.get();
|
|
1265
|
+
if (clinicGroupDoc.exists) {
|
|
1266
|
+
const clinicGroupData = clinicGroupDoc.data();
|
|
1267
|
+
const currentClinicIds = (clinicGroupData == null ? void 0 : clinicGroupData.clinics) || [];
|
|
1268
|
+
const currentClinicsInfo = (clinicGroupData == null ? void 0 : clinicGroupData.clinicsInfo) || [];
|
|
1269
|
+
const filteredClinicIds = currentClinicIds.filter(
|
|
1270
|
+
(id) => id !== clinicId
|
|
1271
|
+
);
|
|
1272
|
+
const filteredClinicsInfo = currentClinicsInfo.filter(
|
|
1273
|
+
(clinic) => clinic.id !== clinicId
|
|
1274
|
+
);
|
|
1275
|
+
await groupRef.update({
|
|
1276
|
+
clinics: filteredClinicIds,
|
|
1277
|
+
clinicsInfo: filteredClinicsInfo,
|
|
1278
|
+
updatedAt: admin3.firestore.FieldValue.serverTimestamp()
|
|
1279
|
+
});
|
|
1280
|
+
console.log(
|
|
1281
|
+
`[ClinicAggregationService] Successfully removed Clinic (ID: ${clinicId}) from Clinic Group ${clinicGroupId}.`
|
|
1282
|
+
);
|
|
1283
|
+
} else {
|
|
1284
|
+
console.warn(
|
|
1285
|
+
`[ClinicAggregationService] Clinic Group ${clinicGroupId} not found. Cannot remove clinic.`
|
|
1286
|
+
);
|
|
1287
|
+
}
|
|
1250
1288
|
} catch (error) {
|
|
1251
1289
|
console.error(
|
|
1252
1290
|
`[ClinicAggregationService] Error removing Clinic (ID: ${clinicId}) from Clinic Group ${clinicGroupId}:`,
|
package/dist/index.d.mts
CHANGED
|
@@ -845,6 +845,110 @@ declare enum ClinicPhotoTag {
|
|
|
845
845
|
OTHER = "other"
|
|
846
846
|
}
|
|
847
847
|
|
|
848
|
+
declare const PRACTITIONER_INVITES_COLLECTION = "practitioner-invites";
|
|
849
|
+
/**
|
|
850
|
+
* Enum for practitioner invite status
|
|
851
|
+
*/
|
|
852
|
+
declare enum PractitionerInviteStatus {
|
|
853
|
+
PENDING = "pending",
|
|
854
|
+
ACCEPTED = "accepted",
|
|
855
|
+
REJECTED = "rejected",
|
|
856
|
+
CANCELLED = "cancelled"
|
|
857
|
+
}
|
|
858
|
+
/**
|
|
859
|
+
* Interface for proposed working hours in practitioner invite
|
|
860
|
+
*/
|
|
861
|
+
interface ProposedWorkingHours {
|
|
862
|
+
monday: {
|
|
863
|
+
start: string;
|
|
864
|
+
end: string;
|
|
865
|
+
} | null;
|
|
866
|
+
tuesday: {
|
|
867
|
+
start: string;
|
|
868
|
+
end: string;
|
|
869
|
+
} | null;
|
|
870
|
+
wednesday: {
|
|
871
|
+
start: string;
|
|
872
|
+
end: string;
|
|
873
|
+
} | null;
|
|
874
|
+
thursday: {
|
|
875
|
+
start: string;
|
|
876
|
+
end: string;
|
|
877
|
+
} | null;
|
|
878
|
+
friday: {
|
|
879
|
+
start: string;
|
|
880
|
+
end: string;
|
|
881
|
+
} | null;
|
|
882
|
+
saturday: {
|
|
883
|
+
start: string;
|
|
884
|
+
end: string;
|
|
885
|
+
} | null;
|
|
886
|
+
sunday: {
|
|
887
|
+
start: string;
|
|
888
|
+
end: string;
|
|
889
|
+
} | null;
|
|
890
|
+
}
|
|
891
|
+
/**
|
|
892
|
+
* Main interface for practitioner invite
|
|
893
|
+
*/
|
|
894
|
+
interface PractitionerInvite {
|
|
895
|
+
id: string;
|
|
896
|
+
practitionerId: string;
|
|
897
|
+
clinicId: string;
|
|
898
|
+
practitionerInfo: PractitionerProfileInfo;
|
|
899
|
+
clinicInfo: ClinicInfo;
|
|
900
|
+
proposedWorkingHours: ProposedWorkingHours;
|
|
901
|
+
status: PractitionerInviteStatus;
|
|
902
|
+
invitedBy: string;
|
|
903
|
+
message?: string | null;
|
|
904
|
+
rejectionReason?: string | null;
|
|
905
|
+
cancelReason?: string | null;
|
|
906
|
+
createdAt: Timestamp;
|
|
907
|
+
updatedAt: Timestamp;
|
|
908
|
+
acceptedAt?: Timestamp | null;
|
|
909
|
+
rejectedAt?: Timestamp | null;
|
|
910
|
+
cancelledAt?: Timestamp | null;
|
|
911
|
+
}
|
|
912
|
+
/**
|
|
913
|
+
* Interface for creating a practitioner invite
|
|
914
|
+
*/
|
|
915
|
+
interface CreatePractitionerInviteData {
|
|
916
|
+
practitionerId: string;
|
|
917
|
+
clinicId: string;
|
|
918
|
+
practitionerInfo: PractitionerProfileInfo;
|
|
919
|
+
clinicInfo: ClinicInfo;
|
|
920
|
+
proposedWorkingHours: ProposedWorkingHours;
|
|
921
|
+
invitedBy: string;
|
|
922
|
+
message?: string | null;
|
|
923
|
+
status?: PractitionerInviteStatus;
|
|
924
|
+
}
|
|
925
|
+
/**
|
|
926
|
+
* Interface for updating a practitioner invite
|
|
927
|
+
*/
|
|
928
|
+
interface UpdatePractitionerInviteData {
|
|
929
|
+
status?: PractitionerInviteStatus;
|
|
930
|
+
rejectionReason?: string | null;
|
|
931
|
+
cancelReason?: string | null;
|
|
932
|
+
updatedAt?: FieldValue;
|
|
933
|
+
acceptedAt?: Timestamp | null;
|
|
934
|
+
rejectedAt?: Timestamp | null;
|
|
935
|
+
cancelledAt?: Timestamp | null;
|
|
936
|
+
}
|
|
937
|
+
/**
|
|
938
|
+
* Interface for filters when getting invites
|
|
939
|
+
*/
|
|
940
|
+
interface PractitionerInviteFilters {
|
|
941
|
+
status?: PractitionerInviteStatus[];
|
|
942
|
+
practitionerId?: string;
|
|
943
|
+
clinicId?: string;
|
|
944
|
+
invitedBy?: string;
|
|
945
|
+
fromDate?: Timestamp;
|
|
946
|
+
toDate?: Timestamp;
|
|
947
|
+
limit?: number;
|
|
948
|
+
orderBy?: "createdAt" | "updatedAt";
|
|
949
|
+
orderDirection?: "asc" | "desc";
|
|
950
|
+
}
|
|
951
|
+
|
|
848
952
|
declare const CLINIC_GROUPS_COLLECTION = "clinic_groups";
|
|
849
953
|
declare const CLINIC_ADMINS_COLLECTION = "clinic_admins";
|
|
850
954
|
declare const CLINICS_COLLECTION = "clinics";
|
|
@@ -6632,6 +6736,90 @@ declare class ProcedureService extends BaseService {
|
|
|
6632
6736
|
private applyInMemoryFilters;
|
|
6633
6737
|
}
|
|
6634
6738
|
|
|
6739
|
+
declare class PractitionerInviteService extends BaseService {
|
|
6740
|
+
constructor(db: Firestore, auth: Auth, app: FirebaseApp);
|
|
6741
|
+
/**
|
|
6742
|
+
* Creates a new practitioner invite
|
|
6743
|
+
* @param practitionerId - Practitioner ID
|
|
6744
|
+
* @param clinicId - Clinic ID
|
|
6745
|
+
* @param proposedWorkingHours - Proposed working hours
|
|
6746
|
+
* @param invitedBy - Admin ID who creates the invite
|
|
6747
|
+
* @param message - Optional message
|
|
6748
|
+
* @returns Created invite
|
|
6749
|
+
*/
|
|
6750
|
+
createInviteAdmin(practitionerId: string, clinicId: string, proposedWorkingHours: any, invitedBy: string, message?: string): Promise<PractitionerInvite>;
|
|
6751
|
+
/**
|
|
6752
|
+
* Gets all invites for a specific doctor/practitioner
|
|
6753
|
+
* @param practitionerId - Practitioner ID
|
|
6754
|
+
* @param statusFilter - Optional status filter
|
|
6755
|
+
* @returns Array of invites
|
|
6756
|
+
*/
|
|
6757
|
+
getAllInvitesDoctor(practitionerId: string, statusFilter?: PractitionerInviteStatus[]): Promise<PractitionerInvite[]>;
|
|
6758
|
+
/**
|
|
6759
|
+
* Gets all invites for a specific clinic
|
|
6760
|
+
* @param clinicId - Clinic ID
|
|
6761
|
+
* @param statusFilter - Optional status filter
|
|
6762
|
+
* @returns Array of invites
|
|
6763
|
+
*/
|
|
6764
|
+
getAllInvitesClinic(clinicId: string, statusFilter?: PractitionerInviteStatus[]): Promise<PractitionerInvite[]>;
|
|
6765
|
+
/**
|
|
6766
|
+
* Doctor accepts an invite
|
|
6767
|
+
* @param inviteId - Invite ID
|
|
6768
|
+
* @returns Updated invite
|
|
6769
|
+
*/
|
|
6770
|
+
acceptInviteDoctor(inviteId: string): Promise<PractitionerInvite>;
|
|
6771
|
+
/**
|
|
6772
|
+
* Doctor rejects an invite
|
|
6773
|
+
* @param inviteId - Invite ID
|
|
6774
|
+
* @param rejectionReason - Optional reason for rejection
|
|
6775
|
+
* @returns Updated invite
|
|
6776
|
+
*/
|
|
6777
|
+
rejectInviteDoctor(inviteId: string, rejectionReason?: string): Promise<PractitionerInvite>;
|
|
6778
|
+
/**
|
|
6779
|
+
* Admin cancels an invite
|
|
6780
|
+
* @param inviteId - Invite ID
|
|
6781
|
+
* @param cancelReason - Optional reason for cancellation
|
|
6782
|
+
* @returns Updated invite
|
|
6783
|
+
*/
|
|
6784
|
+
cancelInviteAdmin(inviteId: string, cancelReason?: string): Promise<PractitionerInvite>;
|
|
6785
|
+
/**
|
|
6786
|
+
* Gets an invite by ID
|
|
6787
|
+
* @param inviteId - Invite ID
|
|
6788
|
+
* @returns Invite or null if not found
|
|
6789
|
+
*/
|
|
6790
|
+
getInviteById(inviteId: string): Promise<PractitionerInvite | null>;
|
|
6791
|
+
/**
|
|
6792
|
+
* Gets invites with advanced filtering options
|
|
6793
|
+
* @param filters - Filter options
|
|
6794
|
+
* @returns Array of filtered invites
|
|
6795
|
+
*/
|
|
6796
|
+
getInvitesWithFilters(filters: PractitionerInviteFilters): Promise<PractitionerInvite[]>;
|
|
6797
|
+
/**
|
|
6798
|
+
* Deletes an invite (admin only)
|
|
6799
|
+
* @param inviteId - Invite ID
|
|
6800
|
+
*/
|
|
6801
|
+
deleteInvite(inviteId: string): Promise<void>;
|
|
6802
|
+
/**
|
|
6803
|
+
* Gets practitioner by ID
|
|
6804
|
+
* @param practitionerId - Practitioner ID
|
|
6805
|
+
* @returns Practitioner or null
|
|
6806
|
+
*/
|
|
6807
|
+
private getPractitionerById;
|
|
6808
|
+
/**
|
|
6809
|
+
* Gets clinic by ID
|
|
6810
|
+
* @param clinicId - Clinic ID
|
|
6811
|
+
* @returns Clinic or null
|
|
6812
|
+
*/
|
|
6813
|
+
private getClinicById;
|
|
6814
|
+
/**
|
|
6815
|
+
* Finds existing invite between practitioner and clinic
|
|
6816
|
+
* @param practitionerId - Practitioner ID
|
|
6817
|
+
* @param clinicId - Clinic ID
|
|
6818
|
+
* @returns Existing invite or null
|
|
6819
|
+
*/
|
|
6820
|
+
private findExistingInvite;
|
|
6821
|
+
}
|
|
6822
|
+
|
|
6635
6823
|
/**
|
|
6636
6824
|
* Service for managing documentation templates
|
|
6637
6825
|
*/
|
|
@@ -19609,4 +19797,4 @@ declare const createReviewSchema: z.ZodEffects<z.ZodObject<{
|
|
|
19609
19797
|
} | undefined;
|
|
19610
19798
|
}>;
|
|
19611
19799
|
|
|
19612
|
-
export { APPOINTMENTS_COLLECTION, 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 Appointment, type AppointmentReminderNotification, AppointmentService, AppointmentStatus, AuthError, AuthService, type BaseDocumentElement, type BaseNotification, type BinaryChoiceElement, BlockingCondition, type Brand, BrandService, CALENDAR_COLLECTION, CLINICS_COLLECTION, CLINIC_ADMINS_COLLECTION, CLINIC_GROUPS_COLLECTION, type CalendarEvent, CalendarEventStatus, type CalendarEventTime, CalendarEventType, CalendarServiceV2, CalendarSyncStatus, type Category, CategoryService, 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, type ClinicReviewInfo, ClinicService, ClinicTag, type ClinicTags, type ContactPerson, Contraindication, CosmeticAllergySubtype, type CreateAdminTokenData, type CreateAppointmentData, type CreateAppointmentHttpData, 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 CreateProcedureData, type CreateSyncedCalendarData, type CreateUserData, Currency, DOCTOR_FORMS_SUBCOLLECTION, DOCUMENTATION_TEMPLATES_COLLECTION, type DatePickerElement, type DateRange, type DigitalSignatureElement, type DoctorInfo, type DocumentElement, DocumentElementType, type DocumentTemplate, DocumentationTemplateService, type DynamicTextElement, DynamicVariable, type EmergencyContact, EnvironmentalAllergySubtype, FILLED_DOCUMENTS_COLLECTION, type FileUploadElement, type FilledDocument, type FilledDocumentFileValue, FilledDocumentService, FilledDocumentStatus, FirebaseErrorCode, type FirebaseUser, FoodAllergySubtype, type GamificationInfo, Gender, type HeadingElement, HeadingLevel, Language, type ListElement, ListType, type LocationData, MEDIA_METADATA_COLLECTION, MediaAccessLevel, type MediaMetadata, type MediaResource, MediaService, MedicationAllergySubtype, type MultipleChoiceElement, type Notification, NotificationService, NotificationStatus, NotificationType, PATIENTS_COLLECTION, PATIENT_APPOINTMENTS_COLLECTION, PATIENT_LOCATION_INFO_COLLECTION, PATIENT_MEDICAL_HISTORY_COLLECTION, PATIENT_MEDICAL_INFO_COLLECTION, PATIENT_REQUIREMENTS_SUBCOLLECTION_NAME, PATIENT_SENSITIVE_INFO_COLLECTION, PRACTITIONERS_COLLECTION, PROCEDURES_COLLECTION, type ParagraphElement, type PatientClinic, type PatientDoctor, PatientInstructionStatus, type PatientLocationInfo, type PatientMedicalInfo, type PatientProfile, type PatientProfileComplete, type PatientProfileInfo, type PatientRequirementInstance, type PatientRequirementInstruction, PatientRequirementOverallStatus, PatientRequirementsService, type PatientSensitiveInfo, PatientService, PaymentStatus, type PostRequirementNotification, PracticeType, type Practitioner, type PractitionerBasicInfo, type PractitionerCertification, type PractitionerClinicProcedures, type PractitionerClinicWorkingHours, type PractitionerProfileInfo, type PractitionerReview, type PractitionerReviewInfo, PractitionerService, PractitionerStatus, type PractitionerToken, PractitionerTokenStatus, type PractitionerWorkingHours, type PreRequirementNotification, PricingMeasure, type Procedure, type ProcedureCategorization, ProcedureFamily, type ProcedureInfo, type ProcedureReview, type ProcedureReviewInfo, ProcedureService, type Product, ProductService, REGISTER_TOKENS_COLLECTION, REVIEWS_COLLECTION, type RatingScaleElement, type RequesterInfo, type Requirement, RequirementType, type Review, ReviewService, SYNCED_CALENDARS_COLLECTION, type SearchAppointmentsParams, type SearchCalendarEventsParams, SearchLocationEnum, type SearchPatientsParams, type SignatureElement, type SingleChoiceElement, type Subcategory, SubcategoryService, SubscriptionModel, type SyncedCalendar, type SyncedCalendarEvent, SyncedCalendarProvider, SyncedCalendarsService, type Technology, type TechnologyDocumentationTemplate, TechnologyService, type TextInputElement, type TimeSlot, TimeUnit, TreatmentBenefit, USER_ERRORS, USER_FORMS_SUBCOLLECTION, type UpdateAllergyData, type UpdateAppointmentData, 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 UpdateProcedureData, 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, clinicLocationSchema, clinicReviewInfoSchema, clinicReviewSchema, clinicSchema, clinicTagsSchema, contactPersonSchema, contraindicationSchema, createAdminTokenSchema, createAppointmentSchema, createCalendarEventSchema, createClinicAdminSchema, createClinicGroupSchema, createClinicReviewSchema, createClinicSchema, createDefaultClinicGroupSchema, createDocumentTemplateSchema, createDraftPractitionerSchema, createFilledDocumentDataSchema, createPatientLocationInfoSchema, createPatientMedicalInfoSchema, createPatientProfileSchema, createPatientSensitiveInfoSchema, createPractitionerReviewSchema, createPractitionerSchema, createPractitionerTokenSchema, createProcedureReviewSchema, createReviewSchema, createUserOptionsSchema, documentElementSchema, documentElementWithoutIdSchema, documentTemplateSchema, emailSchema, emergencyContactSchema, filledDocumentSchema, filledDocumentStatusSchema, gamificationSchema, getFirebaseApp, getFirebaseAuth, getFirebaseDB, getFirebaseInstance, initializeFirebase, locationDataSchema, medicationSchema, notificationSchema, passwordSchema, patientClinicSchema, patientDoctorSchema, patientLocationInfoSchema, patientMedicalInfoSchema, patientProfileInfoSchema, patientProfileSchema, patientSensitiveInfoSchema, postRequirementNotificationSchema, practitionerBasicInfoSchema, practitionerCertificationSchema, practitionerClinicWorkingHoursSchema, practitionerProfileInfoSchema, practitionerReviewInfoSchema, practitionerReviewSchema, practitionerSchema, practitionerSignupSchema, practitionerTokenSchema, practitionerWorkingHoursSchema, preRequirementNotificationSchema, procedureCategorizationSchema, procedureInfoSchema, procedureReviewInfoSchema, procedureReviewSchema, requesterInfoSchema, requirementInstructionDueNotificationSchema, reviewSchema, searchAppointmentsSchema, searchPatientsSchema, syncedCalendarEventSchema, timeSlotSchema, timestampSchema, updateAllergySchema, updateAppointmentSchema, updateBlockingConditionSchema, updateCalendarEventSchema, updateClinicAdminSchema, updateClinicGroupSchema, updateClinicSchema, updateContraindicationSchema, updateDocumentTemplateSchema, updateFilledDocumentDataSchema, updateMedicationSchema, updatePatientMedicalInfoSchema, updateVitalStatsSchema, userRoleSchema, userRolesSchema, userSchema, vitalStatsSchema, workingHoursSchema };
|
|
19800
|
+
export { APPOINTMENTS_COLLECTION, 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 Appointment, type AppointmentReminderNotification, AppointmentService, AppointmentStatus, AuthError, AuthService, type BaseDocumentElement, type BaseNotification, type BinaryChoiceElement, BlockingCondition, type Brand, BrandService, CALENDAR_COLLECTION, CLINICS_COLLECTION, CLINIC_ADMINS_COLLECTION, CLINIC_GROUPS_COLLECTION, type CalendarEvent, CalendarEventStatus, type CalendarEventTime, CalendarEventType, CalendarServiceV2, CalendarSyncStatus, type Category, CategoryService, 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, type ClinicReviewInfo, ClinicService, ClinicTag, type ClinicTags, type ContactPerson, Contraindication, CosmeticAllergySubtype, type CreateAdminTokenData, type CreateAppointmentData, type CreateAppointmentHttpData, 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 CreatePractitionerInviteData, type CreatePractitionerTokenData, type CreateProcedureData, type CreateSyncedCalendarData, type CreateUserData, Currency, DOCTOR_FORMS_SUBCOLLECTION, DOCUMENTATION_TEMPLATES_COLLECTION, type DatePickerElement, type DateRange, type DigitalSignatureElement, type DoctorInfo, type DocumentElement, DocumentElementType, type DocumentTemplate, DocumentationTemplateService, type DynamicTextElement, DynamicVariable, type EmergencyContact, EnvironmentalAllergySubtype, FILLED_DOCUMENTS_COLLECTION, type FileUploadElement, type FilledDocument, type FilledDocumentFileValue, FilledDocumentService, FilledDocumentStatus, FirebaseErrorCode, type FirebaseUser, FoodAllergySubtype, type GamificationInfo, Gender, type HeadingElement, HeadingLevel, Language, type ListElement, ListType, type LocationData, MEDIA_METADATA_COLLECTION, MediaAccessLevel, type MediaMetadata, type MediaResource, MediaService, MedicationAllergySubtype, type MultipleChoiceElement, type Notification, NotificationService, NotificationStatus, NotificationType, PATIENTS_COLLECTION, PATIENT_APPOINTMENTS_COLLECTION, PATIENT_LOCATION_INFO_COLLECTION, PATIENT_MEDICAL_HISTORY_COLLECTION, PATIENT_MEDICAL_INFO_COLLECTION, PATIENT_REQUIREMENTS_SUBCOLLECTION_NAME, PATIENT_SENSITIVE_INFO_COLLECTION, PRACTITIONERS_COLLECTION, PRACTITIONER_INVITES_COLLECTION, PROCEDURES_COLLECTION, type ParagraphElement, type PatientClinic, type PatientDoctor, PatientInstructionStatus, type PatientLocationInfo, type PatientMedicalInfo, type PatientProfile, type PatientProfileComplete, type PatientProfileInfo, type PatientRequirementInstance, type PatientRequirementInstruction, PatientRequirementOverallStatus, PatientRequirementsService, type PatientSensitiveInfo, PatientService, PaymentStatus, type PostRequirementNotification, PracticeType, type Practitioner, type PractitionerBasicInfo, type PractitionerCertification, type PractitionerClinicProcedures, type PractitionerClinicWorkingHours, type PractitionerInvite, type PractitionerInviteFilters, PractitionerInviteService, PractitionerInviteStatus, type PractitionerProfileInfo, type PractitionerReview, type PractitionerReviewInfo, PractitionerService, PractitionerStatus, type PractitionerToken, PractitionerTokenStatus, type PractitionerWorkingHours, type PreRequirementNotification, PricingMeasure, type Procedure, type ProcedureCategorization, ProcedureFamily, type ProcedureInfo, type ProcedureReview, type ProcedureReviewInfo, ProcedureService, type Product, ProductService, type ProposedWorkingHours, REGISTER_TOKENS_COLLECTION, REVIEWS_COLLECTION, type RatingScaleElement, type RequesterInfo, type Requirement, RequirementType, type Review, ReviewService, SYNCED_CALENDARS_COLLECTION, type SearchAppointmentsParams, type SearchCalendarEventsParams, SearchLocationEnum, type SearchPatientsParams, type SignatureElement, type SingleChoiceElement, type Subcategory, SubcategoryService, SubscriptionModel, type SyncedCalendar, type SyncedCalendarEvent, SyncedCalendarProvider, SyncedCalendarsService, type Technology, type TechnologyDocumentationTemplate, TechnologyService, type TextInputElement, type TimeSlot, TimeUnit, TreatmentBenefit, USER_ERRORS, USER_FORMS_SUBCOLLECTION, type UpdateAllergyData, type UpdateAppointmentData, 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 UpdatePractitionerInviteData, type UpdateProcedureData, 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, clinicLocationSchema, clinicReviewInfoSchema, clinicReviewSchema, clinicSchema, clinicTagsSchema, contactPersonSchema, contraindicationSchema, createAdminTokenSchema, createAppointmentSchema, createCalendarEventSchema, createClinicAdminSchema, createClinicGroupSchema, createClinicReviewSchema, createClinicSchema, createDefaultClinicGroupSchema, createDocumentTemplateSchema, createDraftPractitionerSchema, createFilledDocumentDataSchema, createPatientLocationInfoSchema, createPatientMedicalInfoSchema, createPatientProfileSchema, createPatientSensitiveInfoSchema, createPractitionerReviewSchema, createPractitionerSchema, createPractitionerTokenSchema, createProcedureReviewSchema, createReviewSchema, createUserOptionsSchema, documentElementSchema, documentElementWithoutIdSchema, documentTemplateSchema, emailSchema, emergencyContactSchema, filledDocumentSchema, filledDocumentStatusSchema, gamificationSchema, getFirebaseApp, getFirebaseAuth, getFirebaseDB, getFirebaseInstance, initializeFirebase, locationDataSchema, medicationSchema, notificationSchema, passwordSchema, patientClinicSchema, patientDoctorSchema, patientLocationInfoSchema, patientMedicalInfoSchema, patientProfileInfoSchema, patientProfileSchema, patientSensitiveInfoSchema, postRequirementNotificationSchema, practitionerBasicInfoSchema, practitionerCertificationSchema, practitionerClinicWorkingHoursSchema, practitionerProfileInfoSchema, practitionerReviewInfoSchema, practitionerReviewSchema, practitionerSchema, practitionerSignupSchema, practitionerTokenSchema, practitionerWorkingHoursSchema, preRequirementNotificationSchema, procedureCategorizationSchema, procedureInfoSchema, procedureReviewInfoSchema, procedureReviewSchema, requesterInfoSchema, requirementInstructionDueNotificationSchema, reviewSchema, searchAppointmentsSchema, searchPatientsSchema, syncedCalendarEventSchema, timeSlotSchema, timestampSchema, updateAllergySchema, updateAppointmentSchema, updateBlockingConditionSchema, updateCalendarEventSchema, updateClinicAdminSchema, updateClinicGroupSchema, updateClinicSchema, updateContraindicationSchema, updateDocumentTemplateSchema, updateFilledDocumentDataSchema, updateMedicationSchema, updatePatientMedicalInfoSchema, updateVitalStatsSchema, userRoleSchema, userRolesSchema, userSchema, vitalStatsSchema, workingHoursSchema };
|