@blackcode_sa/metaestetics-api 1.13.14 → 1.13.16
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 +125 -127
- package/dist/admin/index.d.ts +125 -127
- package/dist/backoffice/index.d.mts +23 -23
- package/dist/backoffice/index.d.ts +23 -23
- package/dist/index.d.mts +0 -2
- package/dist/index.d.ts +0 -2
- package/dist/index.js +21 -38
- package/dist/index.mjs +21 -38
- package/package.json +1 -1
- package/src/services/clinic/utils/clinic.utils.ts +7 -19
- package/src/services/procedure/procedure.service.ts +45 -32
- package/src/types/clinic/index.ts +0 -3
package/dist/admin/index.d.mts
CHANGED
|
@@ -843,131 +843,6 @@ interface ProcedureSummaryInfo {
|
|
|
843
843
|
practitionerName: string;
|
|
844
844
|
}
|
|
845
845
|
|
|
846
|
-
/**
|
|
847
|
-
* Osnovne informacije o zdravstvenom radniku
|
|
848
|
-
*/
|
|
849
|
-
interface PractitionerBasicInfo {
|
|
850
|
-
firstName: string;
|
|
851
|
-
lastName: string;
|
|
852
|
-
title: string;
|
|
853
|
-
email: string;
|
|
854
|
-
phoneNumber: string | null;
|
|
855
|
-
dateOfBirth: Timestamp | Date | null;
|
|
856
|
-
gender: "male" | "female" | "other";
|
|
857
|
-
profileImageUrl?: MediaResource | null;
|
|
858
|
-
bio?: string;
|
|
859
|
-
languages: string[];
|
|
860
|
-
}
|
|
861
|
-
/**
|
|
862
|
-
* Sertifikacija zdravstvenog radnika
|
|
863
|
-
*/
|
|
864
|
-
interface PractitionerCertification {
|
|
865
|
-
level: CertificationLevel;
|
|
866
|
-
specialties: CertificationSpecialty[];
|
|
867
|
-
licenseNumber: string;
|
|
868
|
-
issuingAuthority: string;
|
|
869
|
-
issueDate: Timestamp | Date;
|
|
870
|
-
expiryDate?: Timestamp | Date | null;
|
|
871
|
-
verificationStatus: "pending" | "verified" | "rejected";
|
|
872
|
-
}
|
|
873
|
-
/**
|
|
874
|
-
* Interfejs za radno vreme zdravstvenog radnika u klinici
|
|
875
|
-
*/
|
|
876
|
-
interface PractitionerClinicWorkingHours {
|
|
877
|
-
clinicId: string;
|
|
878
|
-
workingHours: {
|
|
879
|
-
monday: {
|
|
880
|
-
start: string;
|
|
881
|
-
end: string;
|
|
882
|
-
} | null;
|
|
883
|
-
tuesday: {
|
|
884
|
-
start: string;
|
|
885
|
-
end: string;
|
|
886
|
-
} | null;
|
|
887
|
-
wednesday: {
|
|
888
|
-
start: string;
|
|
889
|
-
end: string;
|
|
890
|
-
} | null;
|
|
891
|
-
thursday: {
|
|
892
|
-
start: string;
|
|
893
|
-
end: string;
|
|
894
|
-
} | null;
|
|
895
|
-
friday: {
|
|
896
|
-
start: string;
|
|
897
|
-
end: string;
|
|
898
|
-
} | null;
|
|
899
|
-
saturday: {
|
|
900
|
-
start: string;
|
|
901
|
-
end: string;
|
|
902
|
-
} | null;
|
|
903
|
-
sunday: {
|
|
904
|
-
start: string;
|
|
905
|
-
end: string;
|
|
906
|
-
} | null;
|
|
907
|
-
};
|
|
908
|
-
isActive: boolean;
|
|
909
|
-
createdAt: Timestamp | Date;
|
|
910
|
-
updatedAt: Timestamp | Date;
|
|
911
|
-
}
|
|
912
|
-
/**
|
|
913
|
-
* Status of practitioner profile
|
|
914
|
-
*/
|
|
915
|
-
declare enum PractitionerStatus {
|
|
916
|
-
DRAFT = "draft",
|
|
917
|
-
ACTIVE = "active"
|
|
918
|
-
}
|
|
919
|
-
/**
|
|
920
|
-
* Token status for practitioner invitations
|
|
921
|
-
*/
|
|
922
|
-
declare enum PractitionerTokenStatus {
|
|
923
|
-
ACTIVE = "active",
|
|
924
|
-
USED = "used",
|
|
925
|
-
EXPIRED = "expired",
|
|
926
|
-
REVOKED = "revoked"
|
|
927
|
-
}
|
|
928
|
-
/**
|
|
929
|
-
* Interfejs za zdravstvenog radnika
|
|
930
|
-
*/
|
|
931
|
-
interface Practitioner {
|
|
932
|
-
id: string;
|
|
933
|
-
userRef: string;
|
|
934
|
-
basicInfo: PractitionerBasicInfo;
|
|
935
|
-
fullNameLower: string;
|
|
936
|
-
certification: PractitionerCertification;
|
|
937
|
-
clinics: string[];
|
|
938
|
-
clinicWorkingHours: PractitionerClinicWorkingHours[];
|
|
939
|
-
clinicsInfo: ClinicInfo[];
|
|
940
|
-
procedures: string[];
|
|
941
|
-
freeConsultations?: Record<string, string> | null;
|
|
942
|
-
proceduresInfo: ProcedureSummaryInfo[];
|
|
943
|
-
reviewInfo: PractitionerReviewInfo;
|
|
944
|
-
isActive: boolean;
|
|
945
|
-
isVerified: boolean;
|
|
946
|
-
status: PractitionerStatus;
|
|
947
|
-
createdAt: Timestamp;
|
|
948
|
-
updatedAt: Timestamp;
|
|
949
|
-
}
|
|
950
|
-
/**
|
|
951
|
-
* Token za pozivanje zdravstvenog radnika
|
|
952
|
-
*/
|
|
953
|
-
interface PractitionerToken {
|
|
954
|
-
id: string;
|
|
955
|
-
token: string;
|
|
956
|
-
practitionerId: string;
|
|
957
|
-
email: string;
|
|
958
|
-
clinicId: string;
|
|
959
|
-
status: PractitionerTokenStatus;
|
|
960
|
-
createdBy: string;
|
|
961
|
-
createdAt: Timestamp;
|
|
962
|
-
expiresAt: Timestamp;
|
|
963
|
-
usedBy?: string;
|
|
964
|
-
usedAt?: Timestamp;
|
|
965
|
-
emailSent?: boolean;
|
|
966
|
-
emailSentAt?: Timestamp;
|
|
967
|
-
emailError?: string;
|
|
968
|
-
emailErrorAt?: Timestamp;
|
|
969
|
-
}
|
|
970
|
-
|
|
971
846
|
/**
|
|
972
847
|
* Enum for all possible clinic tags
|
|
973
848
|
*/
|
|
@@ -1266,8 +1141,6 @@ interface DoctorInfo {
|
|
|
1266
1141
|
photo: string | null;
|
|
1267
1142
|
rating: number;
|
|
1268
1143
|
services: string[];
|
|
1269
|
-
status?: PractitionerStatus;
|
|
1270
|
-
isActive?: boolean;
|
|
1271
1144
|
}
|
|
1272
1145
|
/**
|
|
1273
1146
|
* Interface for clinic
|
|
@@ -1301,6 +1174,131 @@ interface Clinic {
|
|
|
1301
1174
|
logo?: MediaResource | null;
|
|
1302
1175
|
}
|
|
1303
1176
|
|
|
1177
|
+
/**
|
|
1178
|
+
* Osnovne informacije o zdravstvenom radniku
|
|
1179
|
+
*/
|
|
1180
|
+
interface PractitionerBasicInfo {
|
|
1181
|
+
firstName: string;
|
|
1182
|
+
lastName: string;
|
|
1183
|
+
title: string;
|
|
1184
|
+
email: string;
|
|
1185
|
+
phoneNumber: string | null;
|
|
1186
|
+
dateOfBirth: Timestamp | Date | null;
|
|
1187
|
+
gender: "male" | "female" | "other";
|
|
1188
|
+
profileImageUrl?: MediaResource | null;
|
|
1189
|
+
bio?: string;
|
|
1190
|
+
languages: string[];
|
|
1191
|
+
}
|
|
1192
|
+
/**
|
|
1193
|
+
* Sertifikacija zdravstvenog radnika
|
|
1194
|
+
*/
|
|
1195
|
+
interface PractitionerCertification {
|
|
1196
|
+
level: CertificationLevel;
|
|
1197
|
+
specialties: CertificationSpecialty[];
|
|
1198
|
+
licenseNumber: string;
|
|
1199
|
+
issuingAuthority: string;
|
|
1200
|
+
issueDate: Timestamp | Date;
|
|
1201
|
+
expiryDate?: Timestamp | Date | null;
|
|
1202
|
+
verificationStatus: "pending" | "verified" | "rejected";
|
|
1203
|
+
}
|
|
1204
|
+
/**
|
|
1205
|
+
* Interfejs za radno vreme zdravstvenog radnika u klinici
|
|
1206
|
+
*/
|
|
1207
|
+
interface PractitionerClinicWorkingHours {
|
|
1208
|
+
clinicId: string;
|
|
1209
|
+
workingHours: {
|
|
1210
|
+
monday: {
|
|
1211
|
+
start: string;
|
|
1212
|
+
end: string;
|
|
1213
|
+
} | null;
|
|
1214
|
+
tuesday: {
|
|
1215
|
+
start: string;
|
|
1216
|
+
end: string;
|
|
1217
|
+
} | null;
|
|
1218
|
+
wednesday: {
|
|
1219
|
+
start: string;
|
|
1220
|
+
end: string;
|
|
1221
|
+
} | null;
|
|
1222
|
+
thursday: {
|
|
1223
|
+
start: string;
|
|
1224
|
+
end: string;
|
|
1225
|
+
} | null;
|
|
1226
|
+
friday: {
|
|
1227
|
+
start: string;
|
|
1228
|
+
end: string;
|
|
1229
|
+
} | null;
|
|
1230
|
+
saturday: {
|
|
1231
|
+
start: string;
|
|
1232
|
+
end: string;
|
|
1233
|
+
} | null;
|
|
1234
|
+
sunday: {
|
|
1235
|
+
start: string;
|
|
1236
|
+
end: string;
|
|
1237
|
+
} | null;
|
|
1238
|
+
};
|
|
1239
|
+
isActive: boolean;
|
|
1240
|
+
createdAt: Timestamp | Date;
|
|
1241
|
+
updatedAt: Timestamp | Date;
|
|
1242
|
+
}
|
|
1243
|
+
/**
|
|
1244
|
+
* Status of practitioner profile
|
|
1245
|
+
*/
|
|
1246
|
+
declare enum PractitionerStatus {
|
|
1247
|
+
DRAFT = "draft",
|
|
1248
|
+
ACTIVE = "active"
|
|
1249
|
+
}
|
|
1250
|
+
/**
|
|
1251
|
+
* Token status for practitioner invitations
|
|
1252
|
+
*/
|
|
1253
|
+
declare enum PractitionerTokenStatus {
|
|
1254
|
+
ACTIVE = "active",
|
|
1255
|
+
USED = "used",
|
|
1256
|
+
EXPIRED = "expired",
|
|
1257
|
+
REVOKED = "revoked"
|
|
1258
|
+
}
|
|
1259
|
+
/**
|
|
1260
|
+
* Interfejs za zdravstvenog radnika
|
|
1261
|
+
*/
|
|
1262
|
+
interface Practitioner {
|
|
1263
|
+
id: string;
|
|
1264
|
+
userRef: string;
|
|
1265
|
+
basicInfo: PractitionerBasicInfo;
|
|
1266
|
+
fullNameLower: string;
|
|
1267
|
+
certification: PractitionerCertification;
|
|
1268
|
+
clinics: string[];
|
|
1269
|
+
clinicWorkingHours: PractitionerClinicWorkingHours[];
|
|
1270
|
+
clinicsInfo: ClinicInfo[];
|
|
1271
|
+
procedures: string[];
|
|
1272
|
+
freeConsultations?: Record<string, string> | null;
|
|
1273
|
+
proceduresInfo: ProcedureSummaryInfo[];
|
|
1274
|
+
reviewInfo: PractitionerReviewInfo;
|
|
1275
|
+
isActive: boolean;
|
|
1276
|
+
isVerified: boolean;
|
|
1277
|
+
status: PractitionerStatus;
|
|
1278
|
+
createdAt: Timestamp;
|
|
1279
|
+
updatedAt: Timestamp;
|
|
1280
|
+
}
|
|
1281
|
+
/**
|
|
1282
|
+
* Token za pozivanje zdravstvenog radnika
|
|
1283
|
+
*/
|
|
1284
|
+
interface PractitionerToken {
|
|
1285
|
+
id: string;
|
|
1286
|
+
token: string;
|
|
1287
|
+
practitionerId: string;
|
|
1288
|
+
email: string;
|
|
1289
|
+
clinicId: string;
|
|
1290
|
+
status: PractitionerTokenStatus;
|
|
1291
|
+
createdBy: string;
|
|
1292
|
+
createdAt: Timestamp;
|
|
1293
|
+
expiresAt: Timestamp;
|
|
1294
|
+
usedBy?: string;
|
|
1295
|
+
usedAt?: Timestamp;
|
|
1296
|
+
emailSent?: boolean;
|
|
1297
|
+
emailSentAt?: Timestamp;
|
|
1298
|
+
emailError?: string;
|
|
1299
|
+
emailErrorAt?: Timestamp;
|
|
1300
|
+
}
|
|
1301
|
+
|
|
1304
1302
|
declare enum AllergyType {
|
|
1305
1303
|
MEDICATION = "medication",
|
|
1306
1304
|
FOOD = "food",
|
package/dist/admin/index.d.ts
CHANGED
|
@@ -843,131 +843,6 @@ interface ProcedureSummaryInfo {
|
|
|
843
843
|
practitionerName: string;
|
|
844
844
|
}
|
|
845
845
|
|
|
846
|
-
/**
|
|
847
|
-
* Osnovne informacije o zdravstvenom radniku
|
|
848
|
-
*/
|
|
849
|
-
interface PractitionerBasicInfo {
|
|
850
|
-
firstName: string;
|
|
851
|
-
lastName: string;
|
|
852
|
-
title: string;
|
|
853
|
-
email: string;
|
|
854
|
-
phoneNumber: string | null;
|
|
855
|
-
dateOfBirth: Timestamp | Date | null;
|
|
856
|
-
gender: "male" | "female" | "other";
|
|
857
|
-
profileImageUrl?: MediaResource | null;
|
|
858
|
-
bio?: string;
|
|
859
|
-
languages: string[];
|
|
860
|
-
}
|
|
861
|
-
/**
|
|
862
|
-
* Sertifikacija zdravstvenog radnika
|
|
863
|
-
*/
|
|
864
|
-
interface PractitionerCertification {
|
|
865
|
-
level: CertificationLevel;
|
|
866
|
-
specialties: CertificationSpecialty[];
|
|
867
|
-
licenseNumber: string;
|
|
868
|
-
issuingAuthority: string;
|
|
869
|
-
issueDate: Timestamp | Date;
|
|
870
|
-
expiryDate?: Timestamp | Date | null;
|
|
871
|
-
verificationStatus: "pending" | "verified" | "rejected";
|
|
872
|
-
}
|
|
873
|
-
/**
|
|
874
|
-
* Interfejs za radno vreme zdravstvenog radnika u klinici
|
|
875
|
-
*/
|
|
876
|
-
interface PractitionerClinicWorkingHours {
|
|
877
|
-
clinicId: string;
|
|
878
|
-
workingHours: {
|
|
879
|
-
monday: {
|
|
880
|
-
start: string;
|
|
881
|
-
end: string;
|
|
882
|
-
} | null;
|
|
883
|
-
tuesday: {
|
|
884
|
-
start: string;
|
|
885
|
-
end: string;
|
|
886
|
-
} | null;
|
|
887
|
-
wednesday: {
|
|
888
|
-
start: string;
|
|
889
|
-
end: string;
|
|
890
|
-
} | null;
|
|
891
|
-
thursday: {
|
|
892
|
-
start: string;
|
|
893
|
-
end: string;
|
|
894
|
-
} | null;
|
|
895
|
-
friday: {
|
|
896
|
-
start: string;
|
|
897
|
-
end: string;
|
|
898
|
-
} | null;
|
|
899
|
-
saturday: {
|
|
900
|
-
start: string;
|
|
901
|
-
end: string;
|
|
902
|
-
} | null;
|
|
903
|
-
sunday: {
|
|
904
|
-
start: string;
|
|
905
|
-
end: string;
|
|
906
|
-
} | null;
|
|
907
|
-
};
|
|
908
|
-
isActive: boolean;
|
|
909
|
-
createdAt: Timestamp | Date;
|
|
910
|
-
updatedAt: Timestamp | Date;
|
|
911
|
-
}
|
|
912
|
-
/**
|
|
913
|
-
* Status of practitioner profile
|
|
914
|
-
*/
|
|
915
|
-
declare enum PractitionerStatus {
|
|
916
|
-
DRAFT = "draft",
|
|
917
|
-
ACTIVE = "active"
|
|
918
|
-
}
|
|
919
|
-
/**
|
|
920
|
-
* Token status for practitioner invitations
|
|
921
|
-
*/
|
|
922
|
-
declare enum PractitionerTokenStatus {
|
|
923
|
-
ACTIVE = "active",
|
|
924
|
-
USED = "used",
|
|
925
|
-
EXPIRED = "expired",
|
|
926
|
-
REVOKED = "revoked"
|
|
927
|
-
}
|
|
928
|
-
/**
|
|
929
|
-
* Interfejs za zdravstvenog radnika
|
|
930
|
-
*/
|
|
931
|
-
interface Practitioner {
|
|
932
|
-
id: string;
|
|
933
|
-
userRef: string;
|
|
934
|
-
basicInfo: PractitionerBasicInfo;
|
|
935
|
-
fullNameLower: string;
|
|
936
|
-
certification: PractitionerCertification;
|
|
937
|
-
clinics: string[];
|
|
938
|
-
clinicWorkingHours: PractitionerClinicWorkingHours[];
|
|
939
|
-
clinicsInfo: ClinicInfo[];
|
|
940
|
-
procedures: string[];
|
|
941
|
-
freeConsultations?: Record<string, string> | null;
|
|
942
|
-
proceduresInfo: ProcedureSummaryInfo[];
|
|
943
|
-
reviewInfo: PractitionerReviewInfo;
|
|
944
|
-
isActive: boolean;
|
|
945
|
-
isVerified: boolean;
|
|
946
|
-
status: PractitionerStatus;
|
|
947
|
-
createdAt: Timestamp;
|
|
948
|
-
updatedAt: Timestamp;
|
|
949
|
-
}
|
|
950
|
-
/**
|
|
951
|
-
* Token za pozivanje zdravstvenog radnika
|
|
952
|
-
*/
|
|
953
|
-
interface PractitionerToken {
|
|
954
|
-
id: string;
|
|
955
|
-
token: string;
|
|
956
|
-
practitionerId: string;
|
|
957
|
-
email: string;
|
|
958
|
-
clinicId: string;
|
|
959
|
-
status: PractitionerTokenStatus;
|
|
960
|
-
createdBy: string;
|
|
961
|
-
createdAt: Timestamp;
|
|
962
|
-
expiresAt: Timestamp;
|
|
963
|
-
usedBy?: string;
|
|
964
|
-
usedAt?: Timestamp;
|
|
965
|
-
emailSent?: boolean;
|
|
966
|
-
emailSentAt?: Timestamp;
|
|
967
|
-
emailError?: string;
|
|
968
|
-
emailErrorAt?: Timestamp;
|
|
969
|
-
}
|
|
970
|
-
|
|
971
846
|
/**
|
|
972
847
|
* Enum for all possible clinic tags
|
|
973
848
|
*/
|
|
@@ -1266,8 +1141,6 @@ interface DoctorInfo {
|
|
|
1266
1141
|
photo: string | null;
|
|
1267
1142
|
rating: number;
|
|
1268
1143
|
services: string[];
|
|
1269
|
-
status?: PractitionerStatus;
|
|
1270
|
-
isActive?: boolean;
|
|
1271
1144
|
}
|
|
1272
1145
|
/**
|
|
1273
1146
|
* Interface for clinic
|
|
@@ -1301,6 +1174,131 @@ interface Clinic {
|
|
|
1301
1174
|
logo?: MediaResource | null;
|
|
1302
1175
|
}
|
|
1303
1176
|
|
|
1177
|
+
/**
|
|
1178
|
+
* Osnovne informacije o zdravstvenom radniku
|
|
1179
|
+
*/
|
|
1180
|
+
interface PractitionerBasicInfo {
|
|
1181
|
+
firstName: string;
|
|
1182
|
+
lastName: string;
|
|
1183
|
+
title: string;
|
|
1184
|
+
email: string;
|
|
1185
|
+
phoneNumber: string | null;
|
|
1186
|
+
dateOfBirth: Timestamp | Date | null;
|
|
1187
|
+
gender: "male" | "female" | "other";
|
|
1188
|
+
profileImageUrl?: MediaResource | null;
|
|
1189
|
+
bio?: string;
|
|
1190
|
+
languages: string[];
|
|
1191
|
+
}
|
|
1192
|
+
/**
|
|
1193
|
+
* Sertifikacija zdravstvenog radnika
|
|
1194
|
+
*/
|
|
1195
|
+
interface PractitionerCertification {
|
|
1196
|
+
level: CertificationLevel;
|
|
1197
|
+
specialties: CertificationSpecialty[];
|
|
1198
|
+
licenseNumber: string;
|
|
1199
|
+
issuingAuthority: string;
|
|
1200
|
+
issueDate: Timestamp | Date;
|
|
1201
|
+
expiryDate?: Timestamp | Date | null;
|
|
1202
|
+
verificationStatus: "pending" | "verified" | "rejected";
|
|
1203
|
+
}
|
|
1204
|
+
/**
|
|
1205
|
+
* Interfejs za radno vreme zdravstvenog radnika u klinici
|
|
1206
|
+
*/
|
|
1207
|
+
interface PractitionerClinicWorkingHours {
|
|
1208
|
+
clinicId: string;
|
|
1209
|
+
workingHours: {
|
|
1210
|
+
monday: {
|
|
1211
|
+
start: string;
|
|
1212
|
+
end: string;
|
|
1213
|
+
} | null;
|
|
1214
|
+
tuesday: {
|
|
1215
|
+
start: string;
|
|
1216
|
+
end: string;
|
|
1217
|
+
} | null;
|
|
1218
|
+
wednesday: {
|
|
1219
|
+
start: string;
|
|
1220
|
+
end: string;
|
|
1221
|
+
} | null;
|
|
1222
|
+
thursday: {
|
|
1223
|
+
start: string;
|
|
1224
|
+
end: string;
|
|
1225
|
+
} | null;
|
|
1226
|
+
friday: {
|
|
1227
|
+
start: string;
|
|
1228
|
+
end: string;
|
|
1229
|
+
} | null;
|
|
1230
|
+
saturday: {
|
|
1231
|
+
start: string;
|
|
1232
|
+
end: string;
|
|
1233
|
+
} | null;
|
|
1234
|
+
sunday: {
|
|
1235
|
+
start: string;
|
|
1236
|
+
end: string;
|
|
1237
|
+
} | null;
|
|
1238
|
+
};
|
|
1239
|
+
isActive: boolean;
|
|
1240
|
+
createdAt: Timestamp | Date;
|
|
1241
|
+
updatedAt: Timestamp | Date;
|
|
1242
|
+
}
|
|
1243
|
+
/**
|
|
1244
|
+
* Status of practitioner profile
|
|
1245
|
+
*/
|
|
1246
|
+
declare enum PractitionerStatus {
|
|
1247
|
+
DRAFT = "draft",
|
|
1248
|
+
ACTIVE = "active"
|
|
1249
|
+
}
|
|
1250
|
+
/**
|
|
1251
|
+
* Token status for practitioner invitations
|
|
1252
|
+
*/
|
|
1253
|
+
declare enum PractitionerTokenStatus {
|
|
1254
|
+
ACTIVE = "active",
|
|
1255
|
+
USED = "used",
|
|
1256
|
+
EXPIRED = "expired",
|
|
1257
|
+
REVOKED = "revoked"
|
|
1258
|
+
}
|
|
1259
|
+
/**
|
|
1260
|
+
* Interfejs za zdravstvenog radnika
|
|
1261
|
+
*/
|
|
1262
|
+
interface Practitioner {
|
|
1263
|
+
id: string;
|
|
1264
|
+
userRef: string;
|
|
1265
|
+
basicInfo: PractitionerBasicInfo;
|
|
1266
|
+
fullNameLower: string;
|
|
1267
|
+
certification: PractitionerCertification;
|
|
1268
|
+
clinics: string[];
|
|
1269
|
+
clinicWorkingHours: PractitionerClinicWorkingHours[];
|
|
1270
|
+
clinicsInfo: ClinicInfo[];
|
|
1271
|
+
procedures: string[];
|
|
1272
|
+
freeConsultations?: Record<string, string> | null;
|
|
1273
|
+
proceduresInfo: ProcedureSummaryInfo[];
|
|
1274
|
+
reviewInfo: PractitionerReviewInfo;
|
|
1275
|
+
isActive: boolean;
|
|
1276
|
+
isVerified: boolean;
|
|
1277
|
+
status: PractitionerStatus;
|
|
1278
|
+
createdAt: Timestamp;
|
|
1279
|
+
updatedAt: Timestamp;
|
|
1280
|
+
}
|
|
1281
|
+
/**
|
|
1282
|
+
* Token za pozivanje zdravstvenog radnika
|
|
1283
|
+
*/
|
|
1284
|
+
interface PractitionerToken {
|
|
1285
|
+
id: string;
|
|
1286
|
+
token: string;
|
|
1287
|
+
practitionerId: string;
|
|
1288
|
+
email: string;
|
|
1289
|
+
clinicId: string;
|
|
1290
|
+
status: PractitionerTokenStatus;
|
|
1291
|
+
createdBy: string;
|
|
1292
|
+
createdAt: Timestamp;
|
|
1293
|
+
expiresAt: Timestamp;
|
|
1294
|
+
usedBy?: string;
|
|
1295
|
+
usedAt?: Timestamp;
|
|
1296
|
+
emailSent?: boolean;
|
|
1297
|
+
emailSentAt?: Timestamp;
|
|
1298
|
+
emailError?: string;
|
|
1299
|
+
emailErrorAt?: Timestamp;
|
|
1300
|
+
}
|
|
1301
|
+
|
|
1304
1302
|
declare enum AllergyType {
|
|
1305
1303
|
MEDICATION = "medication",
|
|
1306
1304
|
FOOD = "food",
|
|
@@ -1307,6 +1307,29 @@ interface ProcedureSummaryInfo {
|
|
|
1307
1307
|
practitionerName: string;
|
|
1308
1308
|
}
|
|
1309
1309
|
|
|
1310
|
+
/**
|
|
1311
|
+
* Interface for clinic contact information
|
|
1312
|
+
*/
|
|
1313
|
+
interface ClinicContactInfo {
|
|
1314
|
+
email: string;
|
|
1315
|
+
phoneNumber: string;
|
|
1316
|
+
alternativePhoneNumber?: string | null;
|
|
1317
|
+
website?: string | null;
|
|
1318
|
+
}
|
|
1319
|
+
/**
|
|
1320
|
+
* Interface for clinic location
|
|
1321
|
+
*/
|
|
1322
|
+
interface ClinicLocation {
|
|
1323
|
+
address: string;
|
|
1324
|
+
city: string;
|
|
1325
|
+
country: string;
|
|
1326
|
+
postalCode: string;
|
|
1327
|
+
latitude: number;
|
|
1328
|
+
longitude: number;
|
|
1329
|
+
geohash?: string | null;
|
|
1330
|
+
tz?: string | null;
|
|
1331
|
+
}
|
|
1332
|
+
|
|
1310
1333
|
/**
|
|
1311
1334
|
* Osnovne informacije o zdravstvenom radniku
|
|
1312
1335
|
*/
|
|
@@ -1403,29 +1426,6 @@ interface Practitioner {
|
|
|
1403
1426
|
updatedAt: Timestamp;
|
|
1404
1427
|
}
|
|
1405
1428
|
|
|
1406
|
-
/**
|
|
1407
|
-
* Interface for clinic contact information
|
|
1408
|
-
*/
|
|
1409
|
-
interface ClinicContactInfo {
|
|
1410
|
-
email: string;
|
|
1411
|
-
phoneNumber: string;
|
|
1412
|
-
alternativePhoneNumber?: string | null;
|
|
1413
|
-
website?: string | null;
|
|
1414
|
-
}
|
|
1415
|
-
/**
|
|
1416
|
-
* Interface for clinic location
|
|
1417
|
-
*/
|
|
1418
|
-
interface ClinicLocation {
|
|
1419
|
-
address: string;
|
|
1420
|
-
city: string;
|
|
1421
|
-
country: string;
|
|
1422
|
-
postalCode: string;
|
|
1423
|
-
latitude: number;
|
|
1424
|
-
longitude: number;
|
|
1425
|
-
geohash?: string | null;
|
|
1426
|
-
tz?: string | null;
|
|
1427
|
-
}
|
|
1428
|
-
|
|
1429
1429
|
/**
|
|
1430
1430
|
* Interface for clinic profile information
|
|
1431
1431
|
*/
|
|
@@ -1307,6 +1307,29 @@ interface ProcedureSummaryInfo {
|
|
|
1307
1307
|
practitionerName: string;
|
|
1308
1308
|
}
|
|
1309
1309
|
|
|
1310
|
+
/**
|
|
1311
|
+
* Interface for clinic contact information
|
|
1312
|
+
*/
|
|
1313
|
+
interface ClinicContactInfo {
|
|
1314
|
+
email: string;
|
|
1315
|
+
phoneNumber: string;
|
|
1316
|
+
alternativePhoneNumber?: string | null;
|
|
1317
|
+
website?: string | null;
|
|
1318
|
+
}
|
|
1319
|
+
/**
|
|
1320
|
+
* Interface for clinic location
|
|
1321
|
+
*/
|
|
1322
|
+
interface ClinicLocation {
|
|
1323
|
+
address: string;
|
|
1324
|
+
city: string;
|
|
1325
|
+
country: string;
|
|
1326
|
+
postalCode: string;
|
|
1327
|
+
latitude: number;
|
|
1328
|
+
longitude: number;
|
|
1329
|
+
geohash?: string | null;
|
|
1330
|
+
tz?: string | null;
|
|
1331
|
+
}
|
|
1332
|
+
|
|
1310
1333
|
/**
|
|
1311
1334
|
* Osnovne informacije o zdravstvenom radniku
|
|
1312
1335
|
*/
|
|
@@ -1403,29 +1426,6 @@ interface Practitioner {
|
|
|
1403
1426
|
updatedAt: Timestamp;
|
|
1404
1427
|
}
|
|
1405
1428
|
|
|
1406
|
-
/**
|
|
1407
|
-
* Interface for clinic contact information
|
|
1408
|
-
*/
|
|
1409
|
-
interface ClinicContactInfo {
|
|
1410
|
-
email: string;
|
|
1411
|
-
phoneNumber: string;
|
|
1412
|
-
alternativePhoneNumber?: string | null;
|
|
1413
|
-
website?: string | null;
|
|
1414
|
-
}
|
|
1415
|
-
/**
|
|
1416
|
-
* Interface for clinic location
|
|
1417
|
-
*/
|
|
1418
|
-
interface ClinicLocation {
|
|
1419
|
-
address: string;
|
|
1420
|
-
city: string;
|
|
1421
|
-
country: string;
|
|
1422
|
-
postalCode: string;
|
|
1423
|
-
latitude: number;
|
|
1424
|
-
longitude: number;
|
|
1425
|
-
geohash?: string | null;
|
|
1426
|
-
tz?: string | null;
|
|
1427
|
-
}
|
|
1428
|
-
|
|
1429
1429
|
/**
|
|
1430
1430
|
* Interface for clinic profile information
|
|
1431
1431
|
*/
|
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -13532,19 +13532,9 @@ var import_geofire_common4 = require("geofire-common");
|
|
|
13532
13532
|
var import_zod20 = require("zod");
|
|
13533
13533
|
function filterDoctorsInfo(doctorsInfo) {
|
|
13534
13534
|
if (!doctorsInfo || doctorsInfo.length === 0) {
|
|
13535
|
-
return [];
|
|
13535
|
+
return doctorsInfo || [];
|
|
13536
13536
|
}
|
|
13537
|
-
return doctorsInfo
|
|
13538
|
-
if (doctor.status === "draft" /* DRAFT */) {
|
|
13539
|
-
console.log(`[CLINIC_UTILS] Filtering out draft practitioner ${doctor.id} from doctorsInfo`);
|
|
13540
|
-
return false;
|
|
13541
|
-
}
|
|
13542
|
-
if (doctor.isActive === false) {
|
|
13543
|
-
console.log(`[CLINIC_UTILS] Filtering out inactive practitioner ${doctor.id} from doctorsInfo`);
|
|
13544
|
-
return false;
|
|
13545
|
-
}
|
|
13546
|
-
return true;
|
|
13547
|
-
});
|
|
13537
|
+
return doctorsInfo;
|
|
13548
13538
|
}
|
|
13549
13539
|
function filterClinicEmbeddedArrays(clinic, excludeDraftPractitioners = false) {
|
|
13550
13540
|
if (!clinic) {
|
|
@@ -20331,11 +20321,7 @@ var ProcedureService = class extends BaseService {
|
|
|
20331
20321
|
photo: typeof practitioner.basicInfo.profileImageUrl === "string" ? practitioner.basicInfo.profileImageUrl : "",
|
|
20332
20322
|
// Default to empty string if not a processed URL
|
|
20333
20323
|
rating: ((_a = practitioner.reviewInfo) == null ? void 0 : _a.averageRating) || 0,
|
|
20334
|
-
services: practitioner.procedures || []
|
|
20335
|
-
status: practitioner.status,
|
|
20336
|
-
// Include practitioner status for client-side filtering
|
|
20337
|
-
isActive: practitioner.isActive
|
|
20338
|
-
// Include isActive flag for client-side filtering
|
|
20324
|
+
services: practitioner.procedures || []
|
|
20339
20325
|
};
|
|
20340
20326
|
const { productsMetadata: _, productId: __, photos: ___, ...validatedDataWithoutProductsMetadata } = validatedData;
|
|
20341
20327
|
const newProcedure = {
|
|
@@ -20494,9 +20480,7 @@ var ProcedureService = class extends BaseService {
|
|
|
20494
20480
|
description: practitioner.basicInfo.bio || "",
|
|
20495
20481
|
photo: typeof practitioner.basicInfo.profileImageUrl === "string" ? practitioner.basicInfo.profileImageUrl : "",
|
|
20496
20482
|
rating: ((_c = practitioner.reviewInfo) == null ? void 0 : _c.averageRating) || 0,
|
|
20497
|
-
services: practitioner.procedures || []
|
|
20498
|
-
status: practitioner.status,
|
|
20499
|
-
isActive: practitioner.isActive
|
|
20483
|
+
services: practitioner.procedures || []
|
|
20500
20484
|
};
|
|
20501
20485
|
const newProcedure = {
|
|
20502
20486
|
...sourceProcedure,
|
|
@@ -20993,9 +20977,7 @@ var ProcedureService = class extends BaseService {
|
|
|
20993
20977
|
photo: typeof newPractitioner.basicInfo.profileImageUrl === "string" ? newPractitioner.basicInfo.profileImageUrl : "",
|
|
20994
20978
|
// Default to empty string if not a processed URL
|
|
20995
20979
|
rating: ((_b = newPractitioner.reviewInfo) == null ? void 0 : _b.averageRating) || 0,
|
|
20996
|
-
services: newPractitioner.procedures || []
|
|
20997
|
-
status: newPractitioner.status,
|
|
20998
|
-
isActive: newPractitioner.isActive
|
|
20980
|
+
services: newPractitioner.procedures || []
|
|
20999
20981
|
};
|
|
21000
20982
|
}
|
|
21001
20983
|
if (validatedData.clinicBranchId && validatedData.clinicBranchId !== oldClinicId) {
|
|
@@ -21143,7 +21125,6 @@ var ProcedureService = class extends BaseService {
|
|
|
21143
21125
|
proceduresQuery = (0, import_firestore58.query)(proceduresCollection, (0, import_firestore58.orderBy)("name"));
|
|
21144
21126
|
}
|
|
21145
21127
|
const proceduresSnapshot = await (0, import_firestore58.getDocs)(proceduresQuery);
|
|
21146
|
-
const lastVisible = proceduresSnapshot.docs[proceduresSnapshot.docs.length - 1];
|
|
21147
21128
|
let procedures = proceduresSnapshot.docs.map((doc47) => {
|
|
21148
21129
|
const data = doc47.data();
|
|
21149
21130
|
return {
|
|
@@ -21155,9 +21136,10 @@ var ProcedureService = class extends BaseService {
|
|
|
21155
21136
|
if (excludeDraftPractitioners) {
|
|
21156
21137
|
procedures = await this.filterDraftPractitionerProcedures(procedures);
|
|
21157
21138
|
}
|
|
21139
|
+
const lastDocForPagination = pagination && pagination > 0 && proceduresSnapshot.docs.length < pagination ? null : proceduresSnapshot.docs.length > 0 ? proceduresSnapshot.docs[proceduresSnapshot.docs.length - 1] : null;
|
|
21158
21140
|
return {
|
|
21159
21141
|
procedures,
|
|
21160
|
-
lastDoc:
|
|
21142
|
+
lastDoc: lastDocForPagination
|
|
21161
21143
|
};
|
|
21162
21144
|
} catch (error) {
|
|
21163
21145
|
console.error("[PROCEDURE_SERVICE] Error getting all procedures:", error);
|
|
@@ -21283,11 +21265,11 @@ var ProcedureService = class extends BaseService {
|
|
|
21283
21265
|
if (filters.excludeDraftPractitioners) {
|
|
21284
21266
|
procedures = await this.filterDraftPractitionerProcedures(procedures);
|
|
21285
21267
|
}
|
|
21286
|
-
|
|
21287
|
-
|
|
21288
|
-
if (procedures.length < (filters.pagination || 10)) {
|
|
21268
|
+
console.log(`[PROCEDURE_SERVICE] Strategy 1 success: ${procedures.length} procedures (${querySnapshot.docs.length} from query)`);
|
|
21269
|
+
if (querySnapshot.docs.length < (filters.pagination || 10)) {
|
|
21289
21270
|
return { procedures, lastDoc: null };
|
|
21290
21271
|
}
|
|
21272
|
+
const lastDoc = querySnapshot.docs.length > 0 ? querySnapshot.docs[querySnapshot.docs.length - 1] : null;
|
|
21291
21273
|
return { procedures, lastDoc };
|
|
21292
21274
|
} catch (error) {
|
|
21293
21275
|
console.log("[PROCEDURE_SERVICE] Strategy 1 failed:", error);
|
|
@@ -21326,11 +21308,11 @@ var ProcedureService = class extends BaseService {
|
|
|
21326
21308
|
if (filters.excludeDraftPractitioners) {
|
|
21327
21309
|
procedures = await this.filterDraftPractitionerProcedures(procedures);
|
|
21328
21310
|
}
|
|
21329
|
-
|
|
21330
|
-
|
|
21331
|
-
if (procedures.length < (filters.pagination || 10)) {
|
|
21311
|
+
console.log(`[PROCEDURE_SERVICE] Strategy 2 success: ${procedures.length} procedures (${querySnapshot.docs.length} from query)`);
|
|
21312
|
+
if (querySnapshot.docs.length < (filters.pagination || 10)) {
|
|
21332
21313
|
return { procedures, lastDoc: null };
|
|
21333
21314
|
}
|
|
21315
|
+
const lastDoc = querySnapshot.docs.length > 0 ? querySnapshot.docs[querySnapshot.docs.length - 1] : null;
|
|
21334
21316
|
return { procedures, lastDoc };
|
|
21335
21317
|
} catch (error) {
|
|
21336
21318
|
console.log("[PROCEDURE_SERVICE] Strategy 2 failed:", error);
|
|
@@ -21410,13 +21392,14 @@ var ProcedureService = class extends BaseService {
|
|
|
21410
21392
|
procedures = await this.filterDraftPractitionerProcedures(procedures);
|
|
21411
21393
|
}
|
|
21412
21394
|
console.log("[PROCEDURE_SERVICE] After applyInMemoryFilters (Strategy 3):", {
|
|
21413
|
-
procedureCount: procedures.length
|
|
21395
|
+
procedureCount: procedures.length,
|
|
21396
|
+
queryDocCount: querySnapshot.docs.length
|
|
21414
21397
|
});
|
|
21415
|
-
|
|
21416
|
-
|
|
21417
|
-
if (procedures.length < (filters.pagination || 10)) {
|
|
21398
|
+
console.log(`[PROCEDURE_SERVICE] Strategy 3 success: ${procedures.length} procedures (${querySnapshot.docs.length} from query)`);
|
|
21399
|
+
if (querySnapshot.docs.length < (filters.pagination || 10)) {
|
|
21418
21400
|
return { procedures, lastDoc: null };
|
|
21419
21401
|
}
|
|
21402
|
+
const lastDoc = querySnapshot.docs.length > 0 ? querySnapshot.docs[querySnapshot.docs.length - 1] : null;
|
|
21420
21403
|
return { procedures, lastDoc };
|
|
21421
21404
|
} catch (error) {
|
|
21422
21405
|
console.log("[PROCEDURE_SERVICE] Strategy 3 failed:", error);
|
|
@@ -21443,11 +21426,11 @@ var ProcedureService = class extends BaseService {
|
|
|
21443
21426
|
if (filters.excludeDraftPractitioners) {
|
|
21444
21427
|
procedures = await this.filterDraftPractitionerProcedures(procedures);
|
|
21445
21428
|
}
|
|
21446
|
-
|
|
21447
|
-
|
|
21448
|
-
if (procedures.length < (filters.pagination || 10)) {
|
|
21429
|
+
console.log(`[PROCEDURE_SERVICE] Strategy 4 success: ${procedures.length} procedures (${querySnapshot.docs.length} from query)`);
|
|
21430
|
+
if (querySnapshot.docs.length < (filters.pagination || 10)) {
|
|
21449
21431
|
return { procedures, lastDoc: null };
|
|
21450
21432
|
}
|
|
21433
|
+
const lastDoc = querySnapshot.docs.length > 0 ? querySnapshot.docs[querySnapshot.docs.length - 1] : null;
|
|
21451
21434
|
return { procedures, lastDoc };
|
|
21452
21435
|
} catch (error) {
|
|
21453
21436
|
console.log("[PROCEDURE_SERVICE] Strategy 4 failed:", error);
|
package/dist/index.mjs
CHANGED
|
@@ -13606,19 +13606,9 @@ import {
|
|
|
13606
13606
|
import { z as z20 } from "zod";
|
|
13607
13607
|
function filterDoctorsInfo(doctorsInfo) {
|
|
13608
13608
|
if (!doctorsInfo || doctorsInfo.length === 0) {
|
|
13609
|
-
return [];
|
|
13609
|
+
return doctorsInfo || [];
|
|
13610
13610
|
}
|
|
13611
|
-
return doctorsInfo
|
|
13612
|
-
if (doctor.status === "draft" /* DRAFT */) {
|
|
13613
|
-
console.log(`[CLINIC_UTILS] Filtering out draft practitioner ${doctor.id} from doctorsInfo`);
|
|
13614
|
-
return false;
|
|
13615
|
-
}
|
|
13616
|
-
if (doctor.isActive === false) {
|
|
13617
|
-
console.log(`[CLINIC_UTILS] Filtering out inactive practitioner ${doctor.id} from doctorsInfo`);
|
|
13618
|
-
return false;
|
|
13619
|
-
}
|
|
13620
|
-
return true;
|
|
13621
|
-
});
|
|
13611
|
+
return doctorsInfo;
|
|
13622
13612
|
}
|
|
13623
13613
|
function filterClinicEmbeddedArrays(clinic, excludeDraftPractitioners = false) {
|
|
13624
13614
|
if (!clinic) {
|
|
@@ -20567,11 +20557,7 @@ var ProcedureService = class extends BaseService {
|
|
|
20567
20557
|
photo: typeof practitioner.basicInfo.profileImageUrl === "string" ? practitioner.basicInfo.profileImageUrl : "",
|
|
20568
20558
|
// Default to empty string if not a processed URL
|
|
20569
20559
|
rating: ((_a = practitioner.reviewInfo) == null ? void 0 : _a.averageRating) || 0,
|
|
20570
|
-
services: practitioner.procedures || []
|
|
20571
|
-
status: practitioner.status,
|
|
20572
|
-
// Include practitioner status for client-side filtering
|
|
20573
|
-
isActive: practitioner.isActive
|
|
20574
|
-
// Include isActive flag for client-side filtering
|
|
20560
|
+
services: practitioner.procedures || []
|
|
20575
20561
|
};
|
|
20576
20562
|
const { productsMetadata: _, productId: __, photos: ___, ...validatedDataWithoutProductsMetadata } = validatedData;
|
|
20577
20563
|
const newProcedure = {
|
|
@@ -20730,9 +20716,7 @@ var ProcedureService = class extends BaseService {
|
|
|
20730
20716
|
description: practitioner.basicInfo.bio || "",
|
|
20731
20717
|
photo: typeof practitioner.basicInfo.profileImageUrl === "string" ? practitioner.basicInfo.profileImageUrl : "",
|
|
20732
20718
|
rating: ((_c = practitioner.reviewInfo) == null ? void 0 : _c.averageRating) || 0,
|
|
20733
|
-
services: practitioner.procedures || []
|
|
20734
|
-
status: practitioner.status,
|
|
20735
|
-
isActive: practitioner.isActive
|
|
20719
|
+
services: practitioner.procedures || []
|
|
20736
20720
|
};
|
|
20737
20721
|
const newProcedure = {
|
|
20738
20722
|
...sourceProcedure,
|
|
@@ -21229,9 +21213,7 @@ var ProcedureService = class extends BaseService {
|
|
|
21229
21213
|
photo: typeof newPractitioner.basicInfo.profileImageUrl === "string" ? newPractitioner.basicInfo.profileImageUrl : "",
|
|
21230
21214
|
// Default to empty string if not a processed URL
|
|
21231
21215
|
rating: ((_b = newPractitioner.reviewInfo) == null ? void 0 : _b.averageRating) || 0,
|
|
21232
|
-
services: newPractitioner.procedures || []
|
|
21233
|
-
status: newPractitioner.status,
|
|
21234
|
-
isActive: newPractitioner.isActive
|
|
21216
|
+
services: newPractitioner.procedures || []
|
|
21235
21217
|
};
|
|
21236
21218
|
}
|
|
21237
21219
|
if (validatedData.clinicBranchId && validatedData.clinicBranchId !== oldClinicId) {
|
|
@@ -21379,7 +21361,6 @@ var ProcedureService = class extends BaseService {
|
|
|
21379
21361
|
proceduresQuery = query33(proceduresCollection, orderBy18("name"));
|
|
21380
21362
|
}
|
|
21381
21363
|
const proceduresSnapshot = await getDocs33(proceduresQuery);
|
|
21382
|
-
const lastVisible = proceduresSnapshot.docs[proceduresSnapshot.docs.length - 1];
|
|
21383
21364
|
let procedures = proceduresSnapshot.docs.map((doc47) => {
|
|
21384
21365
|
const data = doc47.data();
|
|
21385
21366
|
return {
|
|
@@ -21391,9 +21372,10 @@ var ProcedureService = class extends BaseService {
|
|
|
21391
21372
|
if (excludeDraftPractitioners) {
|
|
21392
21373
|
procedures = await this.filterDraftPractitionerProcedures(procedures);
|
|
21393
21374
|
}
|
|
21375
|
+
const lastDocForPagination = pagination && pagination > 0 && proceduresSnapshot.docs.length < pagination ? null : proceduresSnapshot.docs.length > 0 ? proceduresSnapshot.docs[proceduresSnapshot.docs.length - 1] : null;
|
|
21394
21376
|
return {
|
|
21395
21377
|
procedures,
|
|
21396
|
-
lastDoc:
|
|
21378
|
+
lastDoc: lastDocForPagination
|
|
21397
21379
|
};
|
|
21398
21380
|
} catch (error) {
|
|
21399
21381
|
console.error("[PROCEDURE_SERVICE] Error getting all procedures:", error);
|
|
@@ -21519,11 +21501,11 @@ var ProcedureService = class extends BaseService {
|
|
|
21519
21501
|
if (filters.excludeDraftPractitioners) {
|
|
21520
21502
|
procedures = await this.filterDraftPractitionerProcedures(procedures);
|
|
21521
21503
|
}
|
|
21522
|
-
|
|
21523
|
-
|
|
21524
|
-
if (procedures.length < (filters.pagination || 10)) {
|
|
21504
|
+
console.log(`[PROCEDURE_SERVICE] Strategy 1 success: ${procedures.length} procedures (${querySnapshot.docs.length} from query)`);
|
|
21505
|
+
if (querySnapshot.docs.length < (filters.pagination || 10)) {
|
|
21525
21506
|
return { procedures, lastDoc: null };
|
|
21526
21507
|
}
|
|
21508
|
+
const lastDoc = querySnapshot.docs.length > 0 ? querySnapshot.docs[querySnapshot.docs.length - 1] : null;
|
|
21527
21509
|
return { procedures, lastDoc };
|
|
21528
21510
|
} catch (error) {
|
|
21529
21511
|
console.log("[PROCEDURE_SERVICE] Strategy 1 failed:", error);
|
|
@@ -21562,11 +21544,11 @@ var ProcedureService = class extends BaseService {
|
|
|
21562
21544
|
if (filters.excludeDraftPractitioners) {
|
|
21563
21545
|
procedures = await this.filterDraftPractitionerProcedures(procedures);
|
|
21564
21546
|
}
|
|
21565
|
-
|
|
21566
|
-
|
|
21567
|
-
if (procedures.length < (filters.pagination || 10)) {
|
|
21547
|
+
console.log(`[PROCEDURE_SERVICE] Strategy 2 success: ${procedures.length} procedures (${querySnapshot.docs.length} from query)`);
|
|
21548
|
+
if (querySnapshot.docs.length < (filters.pagination || 10)) {
|
|
21568
21549
|
return { procedures, lastDoc: null };
|
|
21569
21550
|
}
|
|
21551
|
+
const lastDoc = querySnapshot.docs.length > 0 ? querySnapshot.docs[querySnapshot.docs.length - 1] : null;
|
|
21570
21552
|
return { procedures, lastDoc };
|
|
21571
21553
|
} catch (error) {
|
|
21572
21554
|
console.log("[PROCEDURE_SERVICE] Strategy 2 failed:", error);
|
|
@@ -21646,13 +21628,14 @@ var ProcedureService = class extends BaseService {
|
|
|
21646
21628
|
procedures = await this.filterDraftPractitionerProcedures(procedures);
|
|
21647
21629
|
}
|
|
21648
21630
|
console.log("[PROCEDURE_SERVICE] After applyInMemoryFilters (Strategy 3):", {
|
|
21649
|
-
procedureCount: procedures.length
|
|
21631
|
+
procedureCount: procedures.length,
|
|
21632
|
+
queryDocCount: querySnapshot.docs.length
|
|
21650
21633
|
});
|
|
21651
|
-
|
|
21652
|
-
|
|
21653
|
-
if (procedures.length < (filters.pagination || 10)) {
|
|
21634
|
+
console.log(`[PROCEDURE_SERVICE] Strategy 3 success: ${procedures.length} procedures (${querySnapshot.docs.length} from query)`);
|
|
21635
|
+
if (querySnapshot.docs.length < (filters.pagination || 10)) {
|
|
21654
21636
|
return { procedures, lastDoc: null };
|
|
21655
21637
|
}
|
|
21638
|
+
const lastDoc = querySnapshot.docs.length > 0 ? querySnapshot.docs[querySnapshot.docs.length - 1] : null;
|
|
21656
21639
|
return { procedures, lastDoc };
|
|
21657
21640
|
} catch (error) {
|
|
21658
21641
|
console.log("[PROCEDURE_SERVICE] Strategy 3 failed:", error);
|
|
@@ -21679,11 +21662,11 @@ var ProcedureService = class extends BaseService {
|
|
|
21679
21662
|
if (filters.excludeDraftPractitioners) {
|
|
21680
21663
|
procedures = await this.filterDraftPractitionerProcedures(procedures);
|
|
21681
21664
|
}
|
|
21682
|
-
|
|
21683
|
-
|
|
21684
|
-
if (procedures.length < (filters.pagination || 10)) {
|
|
21665
|
+
console.log(`[PROCEDURE_SERVICE] Strategy 4 success: ${procedures.length} procedures (${querySnapshot.docs.length} from query)`);
|
|
21666
|
+
if (querySnapshot.docs.length < (filters.pagination || 10)) {
|
|
21685
21667
|
return { procedures, lastDoc: null };
|
|
21686
21668
|
}
|
|
21669
|
+
const lastDoc = querySnapshot.docs.length > 0 ? querySnapshot.docs[querySnapshot.docs.length - 1] : null;
|
|
21687
21670
|
return { procedures, lastDoc };
|
|
21688
21671
|
} catch (error) {
|
|
21689
21672
|
console.log("[PROCEDURE_SERVICE] Strategy 4 failed:", error);
|
package/package.json
CHANGED
|
@@ -26,7 +26,6 @@ import {
|
|
|
26
26
|
ClinicLocation,
|
|
27
27
|
DoctorInfo,
|
|
28
28
|
} from "../../../types/clinic";
|
|
29
|
-
import { PractitionerStatus } from "../../../types/practitioner";
|
|
30
29
|
import {
|
|
31
30
|
geohashForLocation,
|
|
32
31
|
distanceBetween,
|
|
@@ -388,30 +387,19 @@ export async function createClinic(
|
|
|
388
387
|
*/
|
|
389
388
|
/**
|
|
390
389
|
* Filters out draft/inactive practitioners from doctorsInfo array
|
|
390
|
+
* Note: Since doctorInfo no longer contains status/isActive fields,
|
|
391
|
+
* filtering is handled at the procedure level by ProcedureService.
|
|
392
|
+
* This function now returns all doctors as-is.
|
|
391
393
|
* @param doctorsInfo Array of doctor info objects
|
|
392
|
-
* @returns
|
|
394
|
+
* @returns Array of doctor info objects (no filtering applied)
|
|
393
395
|
*/
|
|
394
396
|
function filterDoctorsInfo(doctorsInfo: DoctorInfo[]): DoctorInfo[] {
|
|
395
397
|
if (!doctorsInfo || doctorsInfo.length === 0) {
|
|
396
|
-
return [];
|
|
398
|
+
return doctorsInfo || [];
|
|
397
399
|
}
|
|
398
400
|
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
if (doctor.status === PractitionerStatus.DRAFT) {
|
|
402
|
-
console.log(`[CLINIC_UTILS] Filtering out draft practitioner ${doctor.id} from doctorsInfo`);
|
|
403
|
-
return false;
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
// Filter out if isActive is explicitly false
|
|
407
|
-
if (doctor.isActive === false) {
|
|
408
|
-
console.log(`[CLINIC_UTILS] Filtering out inactive practitioner ${doctor.id} from doctorsInfo`);
|
|
409
|
-
return false;
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
// Include if status is ACTIVE or undefined (backward compatibility) and isActive is true or undefined
|
|
413
|
-
return true;
|
|
414
|
-
});
|
|
401
|
+
// Return all doctors - filtering is handled at procedure level
|
|
402
|
+
return doctorsInfo;
|
|
415
403
|
}
|
|
416
404
|
|
|
417
405
|
/**
|
|
@@ -443,8 +443,6 @@ export class ProcedureService extends BaseService {
|
|
|
443
443
|
: '', // Default to empty string if not a processed URL
|
|
444
444
|
rating: practitioner.reviewInfo?.averageRating || 0,
|
|
445
445
|
services: practitioner.procedures || [],
|
|
446
|
-
status: practitioner.status, // Include practitioner status for client-side filtering
|
|
447
|
-
isActive: practitioner.isActive, // Include isActive flag for client-side filtering
|
|
448
446
|
};
|
|
449
447
|
|
|
450
448
|
// Create the procedure object
|
|
@@ -634,8 +632,6 @@ export class ProcedureService extends BaseService {
|
|
|
634
632
|
: '',
|
|
635
633
|
rating: practitioner.reviewInfo?.averageRating || 0,
|
|
636
634
|
services: practitioner.procedures || [],
|
|
637
|
-
status: practitioner.status,
|
|
638
|
-
isActive: practitioner.isActive,
|
|
639
635
|
};
|
|
640
636
|
|
|
641
637
|
// Construct the new procedure object
|
|
@@ -1273,8 +1269,6 @@ export class ProcedureService extends BaseService {
|
|
|
1273
1269
|
: '', // Default to empty string if not a processed URL
|
|
1274
1270
|
rating: newPractitioner.reviewInfo?.averageRating || 0,
|
|
1275
1271
|
services: newPractitioner.procedures || [],
|
|
1276
|
-
status: newPractitioner.status,
|
|
1277
|
-
isActive: newPractitioner.isActive,
|
|
1278
1272
|
};
|
|
1279
1273
|
}
|
|
1280
1274
|
|
|
@@ -1471,7 +1465,6 @@ export class ProcedureService extends BaseService {
|
|
|
1471
1465
|
}
|
|
1472
1466
|
|
|
1473
1467
|
const proceduresSnapshot = await getDocs(proceduresQuery);
|
|
1474
|
-
const lastVisible = proceduresSnapshot.docs[proceduresSnapshot.docs.length - 1];
|
|
1475
1468
|
|
|
1476
1469
|
let procedures = proceduresSnapshot.docs.map(doc => {
|
|
1477
1470
|
const data = doc.data() as Procedure;
|
|
@@ -1486,9 +1479,17 @@ export class ProcedureService extends BaseService {
|
|
|
1486
1479
|
procedures = await this.filterDraftPractitionerProcedures(procedures);
|
|
1487
1480
|
}
|
|
1488
1481
|
|
|
1482
|
+
// Fix lastDoc - if we got fewer documents from Firestore than requested, no more pages
|
|
1483
|
+
const lastDocForPagination =
|
|
1484
|
+
pagination && pagination > 0 && proceduresSnapshot.docs.length < pagination
|
|
1485
|
+
? null
|
|
1486
|
+
: proceduresSnapshot.docs.length > 0
|
|
1487
|
+
? proceduresSnapshot.docs[proceduresSnapshot.docs.length - 1]
|
|
1488
|
+
: null;
|
|
1489
|
+
|
|
1489
1490
|
return {
|
|
1490
1491
|
procedures,
|
|
1491
|
-
lastDoc:
|
|
1492
|
+
lastDoc: lastDocForPagination,
|
|
1492
1493
|
};
|
|
1493
1494
|
} catch (error) {
|
|
1494
1495
|
console.error('[PROCEDURE_SERVICE] Error getting all procedures:', error);
|
|
@@ -1663,17 +1664,20 @@ export class ProcedureService extends BaseService {
|
|
|
1663
1664
|
procedures = await this.filterDraftPractitionerProcedures(procedures);
|
|
1664
1665
|
}
|
|
1665
1666
|
|
|
1667
|
+
console.log(`[PROCEDURE_SERVICE] Strategy 1 success: ${procedures.length} procedures (${querySnapshot.docs.length} from query)`);
|
|
1668
|
+
|
|
1669
|
+
// Fix Load More - if we got fewer documents from Firestore than requested, no more pages
|
|
1670
|
+
if (querySnapshot.docs.length < (filters.pagination || 10)) {
|
|
1671
|
+
return { procedures, lastDoc: null };
|
|
1672
|
+
}
|
|
1673
|
+
|
|
1674
|
+
// If we filtered out some procedures but got full query results, use last doc for pagination
|
|
1675
|
+
// This allows fetching more pages to get enough filtered results
|
|
1666
1676
|
const lastDoc =
|
|
1667
1677
|
querySnapshot.docs.length > 0
|
|
1668
1678
|
? querySnapshot.docs[querySnapshot.docs.length - 1]
|
|
1669
1679
|
: null;
|
|
1670
|
-
|
|
1671
|
-
console.log(`[PROCEDURE_SERVICE] Strategy 1 success: ${procedures.length} procedures`);
|
|
1672
|
-
|
|
1673
|
-
// Fix Load More - ako je broj rezultata manji od pagination, nema više
|
|
1674
|
-
if (procedures.length < (filters.pagination || 10)) {
|
|
1675
|
-
return { procedures, lastDoc: null };
|
|
1676
|
-
}
|
|
1680
|
+
|
|
1677
1681
|
return { procedures, lastDoc };
|
|
1678
1682
|
} catch (error) {
|
|
1679
1683
|
console.log('[PROCEDURE_SERVICE] Strategy 1 failed:', error);
|
|
@@ -1725,17 +1729,19 @@ export class ProcedureService extends BaseService {
|
|
|
1725
1729
|
procedures = await this.filterDraftPractitionerProcedures(procedures);
|
|
1726
1730
|
}
|
|
1727
1731
|
|
|
1732
|
+
console.log(`[PROCEDURE_SERVICE] Strategy 2 success: ${procedures.length} procedures (${querySnapshot.docs.length} from query)`);
|
|
1733
|
+
|
|
1734
|
+
// Fix Load More - if we got fewer documents from Firestore than requested, no more pages
|
|
1735
|
+
if (querySnapshot.docs.length < (filters.pagination || 10)) {
|
|
1736
|
+
return { procedures, lastDoc: null };
|
|
1737
|
+
}
|
|
1738
|
+
|
|
1739
|
+
// If we filtered out some procedures but got full query results, use last doc for pagination
|
|
1728
1740
|
const lastDoc =
|
|
1729
1741
|
querySnapshot.docs.length > 0
|
|
1730
1742
|
? querySnapshot.docs[querySnapshot.docs.length - 1]
|
|
1731
1743
|
: null;
|
|
1732
|
-
|
|
1733
|
-
console.log(`[PROCEDURE_SERVICE] Strategy 2 success: ${procedures.length} procedures`);
|
|
1734
|
-
|
|
1735
|
-
// Fix Load More - ako je broj rezultata manji od pagination, nema više
|
|
1736
|
-
if (procedures.length < (filters.pagination || 10)) {
|
|
1737
|
-
return { procedures, lastDoc: null };
|
|
1738
|
-
}
|
|
1744
|
+
|
|
1739
1745
|
return { procedures, lastDoc };
|
|
1740
1746
|
} catch (error) {
|
|
1741
1747
|
console.log('[PROCEDURE_SERVICE] Strategy 2 failed:', error);
|
|
@@ -1842,16 +1848,20 @@ export class ProcedureService extends BaseService {
|
|
|
1842
1848
|
|
|
1843
1849
|
console.log('[PROCEDURE_SERVICE] After applyInMemoryFilters (Strategy 3):', {
|
|
1844
1850
|
procedureCount: procedures.length,
|
|
1851
|
+
queryDocCount: querySnapshot.docs.length,
|
|
1845
1852
|
});
|
|
1846
1853
|
|
|
1847
|
-
|
|
1848
|
-
querySnapshot.docs.length > 0 ? querySnapshot.docs[querySnapshot.docs.length - 1] : null;
|
|
1849
|
-
console.log(`[PROCEDURE_SERVICE] Strategy 3 success: ${procedures.length} procedures`);
|
|
1854
|
+
console.log(`[PROCEDURE_SERVICE] Strategy 3 success: ${procedures.length} procedures (${querySnapshot.docs.length} from query)`);
|
|
1850
1855
|
|
|
1851
|
-
// Fix Load More -
|
|
1852
|
-
if (
|
|
1856
|
+
// Fix Load More - if we got fewer documents from Firestore than requested, no more pages
|
|
1857
|
+
if (querySnapshot.docs.length < (filters.pagination || 10)) {
|
|
1853
1858
|
return { procedures, lastDoc: null };
|
|
1854
1859
|
}
|
|
1860
|
+
|
|
1861
|
+
// If we filtered out some procedures but got full query results, use last doc for pagination
|
|
1862
|
+
const lastDoc =
|
|
1863
|
+
querySnapshot.docs.length > 0 ? querySnapshot.docs[querySnapshot.docs.length - 1] : null;
|
|
1864
|
+
|
|
1855
1865
|
return { procedures, lastDoc };
|
|
1856
1866
|
} catch (error) {
|
|
1857
1867
|
console.log('[PROCEDURE_SERVICE] Strategy 3 failed:', error);
|
|
@@ -1886,14 +1896,17 @@ export class ProcedureService extends BaseService {
|
|
|
1886
1896
|
procedures = await this.filterDraftPractitionerProcedures(procedures);
|
|
1887
1897
|
}
|
|
1888
1898
|
|
|
1889
|
-
|
|
1890
|
-
querySnapshot.docs.length > 0 ? querySnapshot.docs[querySnapshot.docs.length - 1] : null;
|
|
1891
|
-
console.log(`[PROCEDURE_SERVICE] Strategy 4 success: ${procedures.length} procedures`);
|
|
1899
|
+
console.log(`[PROCEDURE_SERVICE] Strategy 4 success: ${procedures.length} procedures (${querySnapshot.docs.length} from query)`);
|
|
1892
1900
|
|
|
1893
|
-
// Fix Load More -
|
|
1894
|
-
if (
|
|
1901
|
+
// Fix Load More - if we got fewer documents from Firestore than requested, no more pages
|
|
1902
|
+
if (querySnapshot.docs.length < (filters.pagination || 10)) {
|
|
1895
1903
|
return { procedures, lastDoc: null };
|
|
1896
1904
|
}
|
|
1905
|
+
|
|
1906
|
+
// If we filtered out some procedures but got full query results, use last doc for pagination
|
|
1907
|
+
const lastDoc =
|
|
1908
|
+
querySnapshot.docs.length > 0 ? querySnapshot.docs[querySnapshot.docs.length - 1] : null;
|
|
1909
|
+
|
|
1897
1910
|
return { procedures, lastDoc };
|
|
1898
1911
|
} catch (error) {
|
|
1899
1912
|
console.log('[PROCEDURE_SERVICE] Strategy 4 failed:', error);
|
|
@@ -3,7 +3,6 @@ import { Timestamp, FieldValue } from 'firebase/firestore';
|
|
|
3
3
|
import type { ClinicInfo } from '../profile';
|
|
4
4
|
import { ClinicReviewInfo } from '../reviews';
|
|
5
5
|
import { ProcedureSummaryInfo } from '../procedure';
|
|
6
|
-
import { PractitionerStatus } from '../practitioner';
|
|
7
6
|
|
|
8
7
|
export const CLINIC_GROUPS_COLLECTION = 'clinic_groups';
|
|
9
8
|
export const CLINIC_ADMINS_COLLECTION = 'clinic_admins';
|
|
@@ -352,8 +351,6 @@ export interface DoctorInfo {
|
|
|
352
351
|
photo: string | null;
|
|
353
352
|
rating: number;
|
|
354
353
|
services: string[]; // Used for search and filtering
|
|
355
|
-
status?: PractitionerStatus; // Practitioner status (DRAFT, ACTIVE, etc.)
|
|
356
|
-
isActive?: boolean; // Whether practitioner is active
|
|
357
354
|
// TODO: Add aggregated fields, like rating, reviews, services this doctor provides in this clinic and similar
|
|
358
355
|
}
|
|
359
356
|
|