@blackcode_sa/metaestetics-api 1.12.1 → 1.12.3
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/backoffice/index.d.mts +64 -14
- package/dist/backoffice/index.d.ts +64 -14
- package/dist/backoffice/index.js +72 -53
- package/dist/backoffice/index.mjs +72 -53
- package/dist/index.d.mts +131 -19
- package/dist/index.d.ts +131 -19
- package/dist/index.js +141 -261
- package/dist/index.mjs +141 -261
- package/package.json +1 -1
- package/src/backoffice/services/FIXES_README.md +102 -0
- package/src/backoffice/services/category.service.ts +46 -27
- package/src/backoffice/services/product.service.ts +52 -74
- package/src/backoffice/services/technology.service.ts +99 -116
- package/src/backoffice/types/category.types.ts +28 -2
- package/src/backoffice/types/product.types.ts +10 -9
- package/src/backoffice/types/technology.types.ts +31 -59
- package/src/services/procedure/procedure.service.ts +275 -472
package/dist/index.d.ts
CHANGED
|
@@ -254,6 +254,35 @@ interface Category {
|
|
|
254
254
|
/** Flag koji označava da li je kategorija aktivna */
|
|
255
255
|
isActive: boolean;
|
|
256
256
|
}
|
|
257
|
+
/**
|
|
258
|
+
* Interface for the CategoryService class
|
|
259
|
+
*/
|
|
260
|
+
interface ICategoryService {
|
|
261
|
+
create(category: Omit<Category, 'id' | 'createdAt' | 'updatedAt'>): Promise<Category>;
|
|
262
|
+
getCategoryCounts(active?: boolean): Promise<Record<string, number>>;
|
|
263
|
+
getAllForFilter(): Promise<Category[]>;
|
|
264
|
+
getAllForFilterByFamily(family: ProcedureFamily): Promise<Category[]>;
|
|
265
|
+
getAll(options?: {
|
|
266
|
+
active?: boolean;
|
|
267
|
+
limit?: number;
|
|
268
|
+
lastVisible?: any;
|
|
269
|
+
}): Promise<{
|
|
270
|
+
categories: Category[];
|
|
271
|
+
lastVisible: any;
|
|
272
|
+
}>;
|
|
273
|
+
getAllByFamily(family: ProcedureFamily, options?: {
|
|
274
|
+
active?: boolean;
|
|
275
|
+
limit?: number;
|
|
276
|
+
lastVisible?: any;
|
|
277
|
+
}): Promise<{
|
|
278
|
+
categories: Category[];
|
|
279
|
+
lastVisible: any;
|
|
280
|
+
}>;
|
|
281
|
+
update(id: string, category: Partial<Omit<Category, 'id' | 'createdAt'>>): Promise<Category | null>;
|
|
282
|
+
delete(id: string): Promise<void>;
|
|
283
|
+
reactivate(id: string): Promise<void>;
|
|
284
|
+
getById(id: string): Promise<Category | null>;
|
|
285
|
+
}
|
|
257
286
|
|
|
258
287
|
/**
|
|
259
288
|
* Types for the Medical Documentation Templating System
|
|
@@ -575,7 +604,7 @@ interface IProductService {
|
|
|
575
604
|
* @param brandId - ID of the brand that manufactures this product
|
|
576
605
|
* @param product - Product data
|
|
577
606
|
*/
|
|
578
|
-
create(technologyId: string, brandId: string, product: Omit<Product,
|
|
607
|
+
create(technologyId: string, brandId: string, product: Omit<Product, 'id' | 'createdAt' | 'updatedAt' | 'brandId' | 'technologyId'>): Promise<Product>;
|
|
579
608
|
/**
|
|
580
609
|
* Gets a paginated list of all products, with optional filters.
|
|
581
610
|
*/
|
|
@@ -605,6 +634,11 @@ interface IProductService {
|
|
|
605
634
|
bySubcategory: Record<string, number>;
|
|
606
635
|
byTechnology: Record<string, number>;
|
|
607
636
|
}>;
|
|
637
|
+
/**
|
|
638
|
+
* Gets all products for a specific technology (non-paginated, for filters/dropdowns)
|
|
639
|
+
* @param technologyId - ID of the technology
|
|
640
|
+
*/
|
|
641
|
+
getAllByTechnology(technologyId: string): Promise<Product[]>;
|
|
608
642
|
/**
|
|
609
643
|
* Gets all products for a brand
|
|
610
644
|
* @param brandId - ID of the brand
|
|
@@ -616,7 +650,7 @@ interface IProductService {
|
|
|
616
650
|
* @param productId - ID of the product to update
|
|
617
651
|
* @param product - Updated product data
|
|
618
652
|
*/
|
|
619
|
-
update(technologyId: string, productId: string, product: Partial<Omit<Product,
|
|
653
|
+
update(technologyId: string, productId: string, product: Partial<Omit<Product, 'id' | 'createdAt' | 'brandId' | 'technologyId'>>): Promise<Product | null>;
|
|
620
654
|
/**
|
|
621
655
|
* Deletes a product (soft delete)
|
|
622
656
|
* @param technologyId - ID of the technology
|
|
@@ -830,6 +864,69 @@ interface Technology {
|
|
|
830
864
|
createdAt: Date;
|
|
831
865
|
updatedAt: Date;
|
|
832
866
|
}
|
|
867
|
+
/**
|
|
868
|
+
* Interface for the TechnologyService class
|
|
869
|
+
*/
|
|
870
|
+
interface ITechnologyService {
|
|
871
|
+
create(technology: Omit<Technology, 'id' | 'createdAt' | 'updatedAt'>): Promise<Technology>;
|
|
872
|
+
getTechnologyCounts(active?: boolean): Promise<Record<string, number>>;
|
|
873
|
+
getTechnologyCountsByCategory(active?: boolean): Promise<Record<string, number>>;
|
|
874
|
+
getAll(options?: {
|
|
875
|
+
active?: boolean;
|
|
876
|
+
limit?: number;
|
|
877
|
+
lastVisible?: any;
|
|
878
|
+
}): Promise<{
|
|
879
|
+
technologies: Technology[];
|
|
880
|
+
lastVisible: any;
|
|
881
|
+
}>;
|
|
882
|
+
getAllByCategoryId(categoryId: string, options?: {
|
|
883
|
+
active?: boolean;
|
|
884
|
+
limit?: number;
|
|
885
|
+
lastVisible?: any;
|
|
886
|
+
}): Promise<{
|
|
887
|
+
technologies: Technology[];
|
|
888
|
+
lastVisible: any;
|
|
889
|
+
}>;
|
|
890
|
+
getAllBySubcategoryId(subcategoryId: string, options?: {
|
|
891
|
+
active?: boolean;
|
|
892
|
+
limit?: number;
|
|
893
|
+
lastVisible?: any;
|
|
894
|
+
}): Promise<{
|
|
895
|
+
technologies: Technology[];
|
|
896
|
+
lastVisible: any;
|
|
897
|
+
}>;
|
|
898
|
+
update(id: string, technology: Partial<Omit<Technology, 'id' | 'createdAt'>>): Promise<Technology | null>;
|
|
899
|
+
delete(id: string): Promise<void>;
|
|
900
|
+
reactivate(id: string): Promise<void>;
|
|
901
|
+
getById(id: string): Promise<Technology | null>;
|
|
902
|
+
addRequirement(technologyId: string, requirement: Requirement): Promise<Technology | null>;
|
|
903
|
+
removeRequirement(technologyId: string, requirement: Requirement): Promise<Technology | null>;
|
|
904
|
+
getRequirements(technologyId: string, type?: 'pre' | 'post'): Promise<Requirement[]>;
|
|
905
|
+
updateRequirement(technologyId: string, oldRequirement: Requirement, newRequirement: Requirement): Promise<Technology | null>;
|
|
906
|
+
addBlockingCondition(technologyId: string, condition: BlockingCondition): Promise<Technology | null>;
|
|
907
|
+
removeBlockingCondition(technologyId: string, condition: BlockingCondition): Promise<Technology | null>;
|
|
908
|
+
addContraindication(technologyId: string, contraindication: ContraindicationDynamic): Promise<Technology | null>;
|
|
909
|
+
removeContraindication(technologyId: string, contraindication: ContraindicationDynamic): Promise<Technology | null>;
|
|
910
|
+
updateContraindication(technologyId: string, contraindication: ContraindicationDynamic): Promise<Technology | null>;
|
|
911
|
+
addBenefit(technologyId: string, benefit: TreatmentBenefitDynamic): Promise<Technology | null>;
|
|
912
|
+
removeBenefit(technologyId: string, benefit: TreatmentBenefitDynamic): Promise<Technology | null>;
|
|
913
|
+
updateBenefit(technologyId: string, benefit: TreatmentBenefitDynamic): Promise<Technology | null>;
|
|
914
|
+
getBlockingConditions(technologyId: string): Promise<BlockingCondition[]>;
|
|
915
|
+
getContraindications(technologyId: string): Promise<ContraindicationDynamic[]>;
|
|
916
|
+
getBenefits(technologyId: string): Promise<TreatmentBenefitDynamic[]>;
|
|
917
|
+
updateCertificationRequirement(technologyId: string, certificationRequirement: CertificationRequirement): Promise<Technology | null>;
|
|
918
|
+
getCertificationRequirement(technologyId: string): Promise<CertificationRequirement | null>;
|
|
919
|
+
validateCertification(requiredCertification: CertificationRequirement, practitionerCertification: any): boolean;
|
|
920
|
+
getAllowedTechnologies(practitioner: any): Promise<{
|
|
921
|
+
technologies: Technology[];
|
|
922
|
+
families: ProcedureFamily[];
|
|
923
|
+
categories: string[];
|
|
924
|
+
subcategories: string[];
|
|
925
|
+
}>;
|
|
926
|
+
getAllForFilterBySubcategory(subcategoryId: string): Promise<Technology[]>;
|
|
927
|
+
getAllForFilterBySubcategoryId(categoryId: string, subcategoryId: string): Promise<Technology[]>;
|
|
928
|
+
getAllForFilter(): Promise<Technology[]>;
|
|
929
|
+
}
|
|
833
930
|
|
|
834
931
|
/**
|
|
835
932
|
* @deprecated
|
|
@@ -964,8 +1061,8 @@ declare class BrandService extends BaseService {
|
|
|
964
1061
|
createdAt: Date;
|
|
965
1062
|
updatedAt: Date;
|
|
966
1063
|
name: string;
|
|
967
|
-
isActive: boolean;
|
|
968
1064
|
description?: string | undefined;
|
|
1065
|
+
isActive: boolean;
|
|
969
1066
|
name_lowercase: string;
|
|
970
1067
|
manufacturer: string;
|
|
971
1068
|
website?: string | undefined;
|
|
@@ -1017,7 +1114,7 @@ declare class BrandService extends BaseService {
|
|
|
1017
1114
|
* family: ProcedureFamily.AESTHETICS
|
|
1018
1115
|
* });
|
|
1019
1116
|
*/
|
|
1020
|
-
declare class CategoryService extends BaseService {
|
|
1117
|
+
declare class CategoryService extends BaseService implements ICategoryService {
|
|
1021
1118
|
/**
|
|
1022
1119
|
* Referenca na Firestore kolekciju kategorija
|
|
1023
1120
|
*/
|
|
@@ -1027,13 +1124,13 @@ declare class CategoryService extends BaseService {
|
|
|
1027
1124
|
* @param category - Podaci za novu kategoriju
|
|
1028
1125
|
* @returns Kreirana kategorija sa generisanim ID-em
|
|
1029
1126
|
*/
|
|
1030
|
-
create(category: Omit<Category,
|
|
1127
|
+
create(category: Omit<Category, 'id' | 'createdAt' | 'updatedAt'>): Promise<{
|
|
1031
1128
|
createdAt: Date;
|
|
1032
1129
|
updatedAt: Date;
|
|
1033
1130
|
name: string;
|
|
1034
|
-
isActive: boolean;
|
|
1035
1131
|
description: string;
|
|
1036
1132
|
family: ProcedureFamily;
|
|
1133
|
+
isActive: boolean;
|
|
1037
1134
|
id: string;
|
|
1038
1135
|
}>;
|
|
1039
1136
|
/**
|
|
@@ -1047,6 +1144,12 @@ declare class CategoryService extends BaseService {
|
|
|
1047
1144
|
* @returns Lista svih aktivnih kategorija
|
|
1048
1145
|
*/
|
|
1049
1146
|
getAllForFilter(): Promise<Category[]>;
|
|
1147
|
+
/**
|
|
1148
|
+
* Vraća sve kategorije za određenu familiju za potrebe filtera (bez paginacije)
|
|
1149
|
+
* @param family - Familija procedura (aesthetics/surgery)
|
|
1150
|
+
* @returns Lista aktivnih kategorija koje pripadaju traženoj familiji
|
|
1151
|
+
*/
|
|
1152
|
+
getAllForFilterByFamily(family: ProcedureFamily): Promise<Category[]>;
|
|
1050
1153
|
/**
|
|
1051
1154
|
* Vraća sve kategorije sa paginacijom
|
|
1052
1155
|
* @param options - Pagination and filter options
|
|
@@ -1080,7 +1183,7 @@ declare class CategoryService extends BaseService {
|
|
|
1080
1183
|
* @param category - Novi podaci za kategoriju
|
|
1081
1184
|
* @returns Ažurirana kategorija
|
|
1082
1185
|
*/
|
|
1083
|
-
update(id: string, category: Partial<Omit<Category,
|
|
1186
|
+
update(id: string, category: Partial<Omit<Category, 'id' | 'createdAt'>>): Promise<Category | null>;
|
|
1084
1187
|
/**
|
|
1085
1188
|
* Soft delete kategorije (postavlja isActive na false)
|
|
1086
1189
|
* @param id - ID kategorije koja se briše
|
|
@@ -1381,7 +1484,7 @@ declare class ProductService extends BaseService implements IProductService {
|
|
|
1381
1484
|
/**
|
|
1382
1485
|
* Creates a new product under technology
|
|
1383
1486
|
*/
|
|
1384
|
-
create(technologyId: string, brandId: string, product: Omit<Product,
|
|
1487
|
+
create(technologyId: string, brandId: string, product: Omit<Product, 'id' | 'createdAt' | 'updatedAt' | 'brandId' | 'technologyId'>): Promise<Product>;
|
|
1385
1488
|
/**
|
|
1386
1489
|
* Gets a paginated list of all products, with optional filters.
|
|
1387
1490
|
* This uses a collectionGroup query to search across all technologies.
|
|
@@ -1413,6 +1516,10 @@ declare class ProductService extends BaseService implements IProductService {
|
|
|
1413
1516
|
bySubcategory: Record<string, number>;
|
|
1414
1517
|
byTechnology: Record<string, number>;
|
|
1415
1518
|
}>;
|
|
1519
|
+
/**
|
|
1520
|
+
* Gets all products for a specific technology (non-paginated, for filters/dropdowns)
|
|
1521
|
+
*/
|
|
1522
|
+
getAllByTechnology(technologyId: string): Promise<Product[]>;
|
|
1416
1523
|
/**
|
|
1417
1524
|
* Gets all products for a brand by filtering through all technologies
|
|
1418
1525
|
*/
|
|
@@ -1420,7 +1527,7 @@ declare class ProductService extends BaseService implements IProductService {
|
|
|
1420
1527
|
/**
|
|
1421
1528
|
* Updates a product
|
|
1422
1529
|
*/
|
|
1423
|
-
update(technologyId: string, productId: string, product: Partial<Omit<Product,
|
|
1530
|
+
update(technologyId: string, productId: string, product: Partial<Omit<Product, 'id' | 'createdAt' | 'brandId' | 'technologyId'>>): Promise<Product | null>;
|
|
1424
1531
|
/**
|
|
1425
1532
|
* Soft deletes a product
|
|
1426
1533
|
*/
|
|
@@ -1460,9 +1567,9 @@ declare class SubcategoryService extends BaseService {
|
|
|
1460
1567
|
createdAt: Date;
|
|
1461
1568
|
updatedAt: Date;
|
|
1462
1569
|
name: string;
|
|
1463
|
-
categoryId: string;
|
|
1464
|
-
isActive: boolean;
|
|
1465
1570
|
description?: string | undefined;
|
|
1571
|
+
isActive: boolean;
|
|
1572
|
+
categoryId: string;
|
|
1466
1573
|
id: string;
|
|
1467
1574
|
}>;
|
|
1468
1575
|
/**
|
|
@@ -1845,7 +1952,7 @@ interface CreatePractitionerTokenData {
|
|
|
1845
1952
|
/**
|
|
1846
1953
|
* Service for managing technologies.
|
|
1847
1954
|
*/
|
|
1848
|
-
declare class TechnologyService extends BaseService {
|
|
1955
|
+
declare class TechnologyService extends BaseService implements ITechnologyService {
|
|
1849
1956
|
/**
|
|
1850
1957
|
* Reference to the Firestore collection of technologies.
|
|
1851
1958
|
*/
|
|
@@ -1855,17 +1962,17 @@ declare class TechnologyService extends BaseService {
|
|
|
1855
1962
|
* @param technology - Data for the new technology.
|
|
1856
1963
|
* @returns The created technology with its generated ID.
|
|
1857
1964
|
*/
|
|
1858
|
-
create(technology: Omit<Technology,
|
|
1965
|
+
create(technology: Omit<Technology, 'id' | 'createdAt' | 'updatedAt'>): Promise<{
|
|
1859
1966
|
createdAt: Date;
|
|
1860
1967
|
updatedAt: Date;
|
|
1861
1968
|
name: string;
|
|
1969
|
+
description: string;
|
|
1970
|
+
family: ProcedureFamily;
|
|
1971
|
+
isActive: boolean;
|
|
1862
1972
|
categoryId: string;
|
|
1863
1973
|
subcategoryId: string;
|
|
1864
|
-
isActive: boolean;
|
|
1865
|
-
description: string;
|
|
1866
1974
|
technicalDetails?: string | undefined;
|
|
1867
1975
|
contraindications: ContraindicationDynamic[];
|
|
1868
|
-
family: ProcedureFamily;
|
|
1869
1976
|
requirements: {
|
|
1870
1977
|
pre: Requirement[];
|
|
1871
1978
|
post: Requirement[];
|
|
@@ -1935,7 +2042,7 @@ declare class TechnologyService extends BaseService {
|
|
|
1935
2042
|
* @param technology - New data for the technology.
|
|
1936
2043
|
* @returns The updated technology.
|
|
1937
2044
|
*/
|
|
1938
|
-
update(id: string, technology: Partial<Omit<Technology,
|
|
2045
|
+
update(id: string, technology: Partial<Omit<Technology, 'id' | 'createdAt'>>): Promise<Technology | null>;
|
|
1939
2046
|
/**
|
|
1940
2047
|
* Soft deletes a technology.
|
|
1941
2048
|
* @param id - The ID of the technology to delete.
|
|
@@ -2119,6 +2226,11 @@ declare class TechnologyService extends BaseService {
|
|
|
2119
2226
|
categories: string[];
|
|
2120
2227
|
subcategories: string[];
|
|
2121
2228
|
}>;
|
|
2229
|
+
/**
|
|
2230
|
+
* Gets all active technologies for a subcategory for filter dropdowns (by subcategory only).
|
|
2231
|
+
* @param subcategoryId - The ID of the subcategory.
|
|
2232
|
+
*/
|
|
2233
|
+
getAllForFilterBySubcategory(subcategoryId: string): Promise<Technology[]>;
|
|
2122
2234
|
/**
|
|
2123
2235
|
* Gets all active technologies for a subcategory for filter dropdowns.
|
|
2124
2236
|
* @param categoryId - The ID of the parent category.
|
|
@@ -5152,7 +5264,7 @@ declare class ProcedureService extends BaseService {
|
|
|
5152
5264
|
* @param practitionerIds - An array of practitioner IDs for whom the procedures will be created.
|
|
5153
5265
|
* @returns A promise that resolves to an array of the newly created procedures.
|
|
5154
5266
|
*/
|
|
5155
|
-
bulkCreateProcedures(baseData: Omit<CreateProcedureData,
|
|
5267
|
+
bulkCreateProcedures(baseData: Omit<CreateProcedureData, 'practitionerId'>, practitionerIds: string[]): Promise<Procedure[]>;
|
|
5156
5268
|
/**
|
|
5157
5269
|
* Gets a procedure by ID
|
|
5158
5270
|
* @param id - The ID of the procedure to get
|
|
@@ -5277,7 +5389,7 @@ declare class ProcedureService extends BaseService {
|
|
|
5277
5389
|
* @param data - The data for creating a consultation procedure (without productId)
|
|
5278
5390
|
* @returns The created procedure
|
|
5279
5391
|
*/
|
|
5280
|
-
createConsultationProcedure(data: Omit<CreateProcedureData,
|
|
5392
|
+
createConsultationProcedure(data: Omit<CreateProcedureData, 'productId'>): Promise<Procedure>;
|
|
5281
5393
|
/**
|
|
5282
5394
|
* Gets all procedures with minimal info for map display (id, name, clinicId, clinicName, address, latitude, longitude)
|
|
5283
5395
|
* This is optimized for mobile map usage to reduce payload size.
|