@blackcode_sa/metaestetics-api 1.8.11 → 1.8.13
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 +4 -0
- package/dist/admin/index.d.ts +4 -0
- package/dist/backoffice/index.d.mts +1 -0
- package/dist/backoffice/index.d.ts +1 -0
- package/dist/index.d.mts +36 -9
- package/dist/index.d.ts +36 -9
- package/dist/index.js +218 -375
- package/dist/index.mjs +221 -376
- package/package.json +1 -1
- package/src/admin/scripts/migrateProcedures.js +23 -0
- package/src/admin/scripts/serviceAccountKey.json +13 -0
- package/src/services/clinic/clinic.service.ts +33 -0
- package/src/services/clinic/utils/filter.utils.ts +54 -225
- package/src/services/practitioner/practitioner.service.ts +48 -115
- package/src/services/procedure/procedure.service.ts +123 -249
- package/src/types/clinic/index.ts +1 -0
- package/src/types/practitioner/index.ts +1 -0
- package/src/types/procedure/index.ts +6 -0
- package/src/validations/procedure.schema.ts +3 -0
package/dist/admin/index.d.mts
CHANGED
|
@@ -492,6 +492,8 @@ interface Procedure {
|
|
|
492
492
|
id: string;
|
|
493
493
|
/** Name of the procedure */
|
|
494
494
|
name: string;
|
|
495
|
+
/** Lowercase version of the name for case-insensitive search */
|
|
496
|
+
nameLower: string;
|
|
495
497
|
/** Photos of the procedure */
|
|
496
498
|
photos?: MediaResource[];
|
|
497
499
|
/** Detailed description of the procedure */
|
|
@@ -786,6 +788,7 @@ interface Clinic {
|
|
|
786
788
|
id: string;
|
|
787
789
|
clinicGroupId: string;
|
|
788
790
|
name: string;
|
|
791
|
+
nameLower: string;
|
|
789
792
|
description?: string;
|
|
790
793
|
location: ClinicLocation;
|
|
791
794
|
contactInfo: ClinicContactInfo;
|
|
@@ -899,6 +902,7 @@ interface Practitioner {
|
|
|
899
902
|
id: string;
|
|
900
903
|
userRef: string;
|
|
901
904
|
basicInfo: PractitionerBasicInfo;
|
|
905
|
+
fullNameLower: string;
|
|
902
906
|
certification: PractitionerCertification;
|
|
903
907
|
clinics: string[];
|
|
904
908
|
clinicWorkingHours: PractitionerClinicWorkingHours[];
|
package/dist/admin/index.d.ts
CHANGED
|
@@ -492,6 +492,8 @@ interface Procedure {
|
|
|
492
492
|
id: string;
|
|
493
493
|
/** Name of the procedure */
|
|
494
494
|
name: string;
|
|
495
|
+
/** Lowercase version of the name for case-insensitive search */
|
|
496
|
+
nameLower: string;
|
|
495
497
|
/** Photos of the procedure */
|
|
496
498
|
photos?: MediaResource[];
|
|
497
499
|
/** Detailed description of the procedure */
|
|
@@ -786,6 +788,7 @@ interface Clinic {
|
|
|
786
788
|
id: string;
|
|
787
789
|
clinicGroupId: string;
|
|
788
790
|
name: string;
|
|
791
|
+
nameLower: string;
|
|
789
792
|
description?: string;
|
|
790
793
|
location: ClinicLocation;
|
|
791
794
|
contactInfo: ClinicContactInfo;
|
|
@@ -899,6 +902,7 @@ interface Practitioner {
|
|
|
899
902
|
id: string;
|
|
900
903
|
userRef: string;
|
|
901
904
|
basicInfo: PractitionerBasicInfo;
|
|
905
|
+
fullNameLower: string;
|
|
902
906
|
certification: PractitionerCertification;
|
|
903
907
|
clinics: string[];
|
|
904
908
|
clinicWorkingHours: PractitionerClinicWorkingHours[];
|
|
@@ -1187,6 +1187,7 @@ interface Practitioner {
|
|
|
1187
1187
|
id: string;
|
|
1188
1188
|
userRef: string;
|
|
1189
1189
|
basicInfo: PractitionerBasicInfo;
|
|
1190
|
+
fullNameLower: string;
|
|
1190
1191
|
certification: PractitionerCertification;
|
|
1191
1192
|
clinics: string[];
|
|
1192
1193
|
clinicWorkingHours: PractitionerClinicWorkingHours[];
|
|
@@ -1187,6 +1187,7 @@ interface Practitioner {
|
|
|
1187
1187
|
id: string;
|
|
1188
1188
|
userRef: string;
|
|
1189
1189
|
basicInfo: PractitionerBasicInfo;
|
|
1190
|
+
fullNameLower: string;
|
|
1190
1191
|
certification: PractitionerCertification;
|
|
1191
1192
|
clinics: string[];
|
|
1192
1193
|
clinicWorkingHours: PractitionerClinicWorkingHours[];
|
package/dist/index.d.mts
CHANGED
|
@@ -610,6 +610,8 @@ interface Procedure {
|
|
|
610
610
|
id: string;
|
|
611
611
|
/** Name of the procedure */
|
|
612
612
|
name: string;
|
|
613
|
+
/** Lowercase version of the name for case-insensitive search */
|
|
614
|
+
nameLower: string;
|
|
613
615
|
/** Photos of the procedure */
|
|
614
616
|
photos?: MediaResource[];
|
|
615
617
|
/** Detailed description of the procedure */
|
|
@@ -668,6 +670,8 @@ interface Procedure {
|
|
|
668
670
|
*/
|
|
669
671
|
interface CreateProcedureData {
|
|
670
672
|
name: string;
|
|
673
|
+
/** Lowercase version of the name for case-insensitive search */
|
|
674
|
+
nameLower: string;
|
|
671
675
|
description: string;
|
|
672
676
|
family: ProcedureFamily;
|
|
673
677
|
categoryId: string;
|
|
@@ -687,6 +691,8 @@ interface CreateProcedureData {
|
|
|
687
691
|
*/
|
|
688
692
|
interface UpdateProcedureData {
|
|
689
693
|
name?: string;
|
|
694
|
+
/** Lowercase version of the name for case-insensitive search */
|
|
695
|
+
nameLower?: string;
|
|
690
696
|
description?: string;
|
|
691
697
|
price?: number;
|
|
692
698
|
currency?: Currency;
|
|
@@ -1201,6 +1207,7 @@ interface Clinic {
|
|
|
1201
1207
|
id: string;
|
|
1202
1208
|
clinicGroupId: string;
|
|
1203
1209
|
name: string;
|
|
1210
|
+
nameLower: string;
|
|
1204
1211
|
description?: string;
|
|
1205
1212
|
location: ClinicLocation;
|
|
1206
1213
|
contactInfo: ClinicContactInfo;
|
|
@@ -1426,6 +1433,7 @@ interface Practitioner {
|
|
|
1426
1433
|
id: string;
|
|
1427
1434
|
userRef: string;
|
|
1428
1435
|
basicInfo: PractitionerBasicInfo;
|
|
1436
|
+
fullNameLower: string;
|
|
1429
1437
|
certification: PractitionerCertification;
|
|
1430
1438
|
clinics: string[];
|
|
1431
1439
|
clinicWorkingHours: PractitionerClinicWorkingHours[];
|
|
@@ -4094,6 +4102,18 @@ declare class ClinicService extends BaseService {
|
|
|
4094
4102
|
})[];
|
|
4095
4103
|
lastDoc: any;
|
|
4096
4104
|
}>;
|
|
4105
|
+
/**
|
|
4106
|
+
* Gets all clinics with minimal info for map display (id, name, address, latitude, longitude)
|
|
4107
|
+
* This is optimized for mobile map usage to reduce payload size.
|
|
4108
|
+
* @returns Array of minimal clinic info for map
|
|
4109
|
+
*/
|
|
4110
|
+
getClinicsForMap(): Promise<{
|
|
4111
|
+
id: string;
|
|
4112
|
+
name: string;
|
|
4113
|
+
address: string;
|
|
4114
|
+
latitude: number | undefined;
|
|
4115
|
+
longitude: number | undefined;
|
|
4116
|
+
}[]>;
|
|
4097
4117
|
}
|
|
4098
4118
|
|
|
4099
4119
|
declare class ProcedureService extends BaseService {
|
|
@@ -4201,6 +4221,8 @@ declare class ProcedureService extends BaseService {
|
|
|
4201
4221
|
/**
|
|
4202
4222
|
* Searches and filters procedures based on multiple criteria
|
|
4203
4223
|
*
|
|
4224
|
+
* @note Frontend MORA da šalje ceo snapshot (ili barem sva polja po kojima sortiraš, npr. nameLower) kao lastDoc za paginaciju, a ne samo id!
|
|
4225
|
+
*
|
|
4204
4226
|
* @param filters - Various filters to apply
|
|
4205
4227
|
* @param filters.nameSearch - Optional search text for procedure name
|
|
4206
4228
|
* @param filters.treatmentBenefits - Optional array of treatment benefits to filter by
|
|
@@ -4244,15 +4266,6 @@ declare class ProcedureService extends BaseService {
|
|
|
4244
4266
|
})[];
|
|
4245
4267
|
lastDoc: any;
|
|
4246
4268
|
}>;
|
|
4247
|
-
/**
|
|
4248
|
-
* Helper method to apply in-memory filters to procedures
|
|
4249
|
-
* Used by getProceduresByFilters to apply filters that can't be done in Firestore queries
|
|
4250
|
-
*
|
|
4251
|
-
* @param procedures - The procedures to filter
|
|
4252
|
-
* @param filters - The filters to apply
|
|
4253
|
-
* @returns Filtered procedures
|
|
4254
|
-
*/
|
|
4255
|
-
private applyInMemoryFilters;
|
|
4256
4269
|
/**
|
|
4257
4270
|
* Creates a consultation procedure without requiring a product
|
|
4258
4271
|
* This is a special method for consultation procedures that don't use products
|
|
@@ -4260,6 +4273,20 @@ declare class ProcedureService extends BaseService {
|
|
|
4260
4273
|
* @returns The created procedure
|
|
4261
4274
|
*/
|
|
4262
4275
|
createConsultationProcedure(data: Omit<CreateProcedureData, "productId">): Promise<Procedure>;
|
|
4276
|
+
/**
|
|
4277
|
+
* Gets all procedures with minimal info for map display (id, name, clinicId, clinicName, address, latitude, longitude)
|
|
4278
|
+
* This is optimized for mobile map usage to reduce payload size.
|
|
4279
|
+
* @returns Array of minimal procedure info for map
|
|
4280
|
+
*/
|
|
4281
|
+
getProceduresForMap(): Promise<{
|
|
4282
|
+
id: string;
|
|
4283
|
+
name: string;
|
|
4284
|
+
clinicId: string | undefined;
|
|
4285
|
+
clinicName: string | undefined;
|
|
4286
|
+
address: string;
|
|
4287
|
+
latitude: number | undefined;
|
|
4288
|
+
longitude: number | undefined;
|
|
4289
|
+
}[]>;
|
|
4263
4290
|
}
|
|
4264
4291
|
|
|
4265
4292
|
declare class PractitionerService extends BaseService {
|
package/dist/index.d.ts
CHANGED
|
@@ -610,6 +610,8 @@ interface Procedure {
|
|
|
610
610
|
id: string;
|
|
611
611
|
/** Name of the procedure */
|
|
612
612
|
name: string;
|
|
613
|
+
/** Lowercase version of the name for case-insensitive search */
|
|
614
|
+
nameLower: string;
|
|
613
615
|
/** Photos of the procedure */
|
|
614
616
|
photos?: MediaResource[];
|
|
615
617
|
/** Detailed description of the procedure */
|
|
@@ -668,6 +670,8 @@ interface Procedure {
|
|
|
668
670
|
*/
|
|
669
671
|
interface CreateProcedureData {
|
|
670
672
|
name: string;
|
|
673
|
+
/** Lowercase version of the name for case-insensitive search */
|
|
674
|
+
nameLower: string;
|
|
671
675
|
description: string;
|
|
672
676
|
family: ProcedureFamily;
|
|
673
677
|
categoryId: string;
|
|
@@ -687,6 +691,8 @@ interface CreateProcedureData {
|
|
|
687
691
|
*/
|
|
688
692
|
interface UpdateProcedureData {
|
|
689
693
|
name?: string;
|
|
694
|
+
/** Lowercase version of the name for case-insensitive search */
|
|
695
|
+
nameLower?: string;
|
|
690
696
|
description?: string;
|
|
691
697
|
price?: number;
|
|
692
698
|
currency?: Currency;
|
|
@@ -1201,6 +1207,7 @@ interface Clinic {
|
|
|
1201
1207
|
id: string;
|
|
1202
1208
|
clinicGroupId: string;
|
|
1203
1209
|
name: string;
|
|
1210
|
+
nameLower: string;
|
|
1204
1211
|
description?: string;
|
|
1205
1212
|
location: ClinicLocation;
|
|
1206
1213
|
contactInfo: ClinicContactInfo;
|
|
@@ -1426,6 +1433,7 @@ interface Practitioner {
|
|
|
1426
1433
|
id: string;
|
|
1427
1434
|
userRef: string;
|
|
1428
1435
|
basicInfo: PractitionerBasicInfo;
|
|
1436
|
+
fullNameLower: string;
|
|
1429
1437
|
certification: PractitionerCertification;
|
|
1430
1438
|
clinics: string[];
|
|
1431
1439
|
clinicWorkingHours: PractitionerClinicWorkingHours[];
|
|
@@ -4094,6 +4102,18 @@ declare class ClinicService extends BaseService {
|
|
|
4094
4102
|
})[];
|
|
4095
4103
|
lastDoc: any;
|
|
4096
4104
|
}>;
|
|
4105
|
+
/**
|
|
4106
|
+
* Gets all clinics with minimal info for map display (id, name, address, latitude, longitude)
|
|
4107
|
+
* This is optimized for mobile map usage to reduce payload size.
|
|
4108
|
+
* @returns Array of minimal clinic info for map
|
|
4109
|
+
*/
|
|
4110
|
+
getClinicsForMap(): Promise<{
|
|
4111
|
+
id: string;
|
|
4112
|
+
name: string;
|
|
4113
|
+
address: string;
|
|
4114
|
+
latitude: number | undefined;
|
|
4115
|
+
longitude: number | undefined;
|
|
4116
|
+
}[]>;
|
|
4097
4117
|
}
|
|
4098
4118
|
|
|
4099
4119
|
declare class ProcedureService extends BaseService {
|
|
@@ -4201,6 +4221,8 @@ declare class ProcedureService extends BaseService {
|
|
|
4201
4221
|
/**
|
|
4202
4222
|
* Searches and filters procedures based on multiple criteria
|
|
4203
4223
|
*
|
|
4224
|
+
* @note Frontend MORA da šalje ceo snapshot (ili barem sva polja po kojima sortiraš, npr. nameLower) kao lastDoc za paginaciju, a ne samo id!
|
|
4225
|
+
*
|
|
4204
4226
|
* @param filters - Various filters to apply
|
|
4205
4227
|
* @param filters.nameSearch - Optional search text for procedure name
|
|
4206
4228
|
* @param filters.treatmentBenefits - Optional array of treatment benefits to filter by
|
|
@@ -4244,15 +4266,6 @@ declare class ProcedureService extends BaseService {
|
|
|
4244
4266
|
})[];
|
|
4245
4267
|
lastDoc: any;
|
|
4246
4268
|
}>;
|
|
4247
|
-
/**
|
|
4248
|
-
* Helper method to apply in-memory filters to procedures
|
|
4249
|
-
* Used by getProceduresByFilters to apply filters that can't be done in Firestore queries
|
|
4250
|
-
*
|
|
4251
|
-
* @param procedures - The procedures to filter
|
|
4252
|
-
* @param filters - The filters to apply
|
|
4253
|
-
* @returns Filtered procedures
|
|
4254
|
-
*/
|
|
4255
|
-
private applyInMemoryFilters;
|
|
4256
4269
|
/**
|
|
4257
4270
|
* Creates a consultation procedure without requiring a product
|
|
4258
4271
|
* This is a special method for consultation procedures that don't use products
|
|
@@ -4260,6 +4273,20 @@ declare class ProcedureService extends BaseService {
|
|
|
4260
4273
|
* @returns The created procedure
|
|
4261
4274
|
*/
|
|
4262
4275
|
createConsultationProcedure(data: Omit<CreateProcedureData, "productId">): Promise<Procedure>;
|
|
4276
|
+
/**
|
|
4277
|
+
* Gets all procedures with minimal info for map display (id, name, clinicId, clinicName, address, latitude, longitude)
|
|
4278
|
+
* This is optimized for mobile map usage to reduce payload size.
|
|
4279
|
+
* @returns Array of minimal procedure info for map
|
|
4280
|
+
*/
|
|
4281
|
+
getProceduresForMap(): Promise<{
|
|
4282
|
+
id: string;
|
|
4283
|
+
name: string;
|
|
4284
|
+
clinicId: string | undefined;
|
|
4285
|
+
clinicName: string | undefined;
|
|
4286
|
+
address: string;
|
|
4287
|
+
latitude: number | undefined;
|
|
4288
|
+
longitude: number | undefined;
|
|
4289
|
+
}[]>;
|
|
4263
4290
|
}
|
|
4264
4291
|
|
|
4265
4292
|
declare class PractitionerService extends BaseService {
|