@blackcode_sa/metaestetics-api 1.12.66 → 1.12.67

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.
@@ -188,6 +188,11 @@ interface ICategoryService {
188
188
  delete(id: string): Promise<void>;
189
189
  reactivate(id: string): Promise<void>;
190
190
  getById(id: string): Promise<Category | null>;
191
+ findByNameAndFamily(name: string, family: ProcedureFamily): Promise<Category | null>;
192
+ exportToCsv(options?: {
193
+ includeInactive?: boolean;
194
+ includeBom?: boolean;
195
+ }): Promise<string>;
191
196
  }
192
197
 
193
198
  /**
@@ -289,6 +294,14 @@ declare class CategoryService extends BaseService implements ICategoryService {
289
294
  * @returns Kategorija ili null ako ne postoji
290
295
  */
291
296
  getById(id: string): Promise<Category | null>;
297
+ /**
298
+ * Finds a category by exact name match within a specific family.
299
+ * Used for CSV import matching.
300
+ * @param name - Exact name of the category to find
301
+ * @param family - Procedure family to search within
302
+ * @returns Category if found, null otherwise
303
+ */
304
+ findByNameAndFamily(name: string, family: ProcedureFamily): Promise<Category | null>;
292
305
  /**
293
306
  * Exports categories to CSV string, suitable for Excel/Sheets.
294
307
  * Includes headers and optional UTF-8 BOM.
@@ -1077,6 +1090,11 @@ interface ITechnologyService {
1077
1090
  getAllForFilterBySubcategory(subcategoryId: string): Promise<Technology[]>;
1078
1091
  getAllForFilterBySubcategoryId(categoryId: string, subcategoryId: string): Promise<Technology[]>;
1079
1092
  getAllForFilter(): Promise<Technology[]>;
1093
+ findByName(name: string): Promise<Technology | null>;
1094
+ exportToCsv(options?: {
1095
+ includeInactive?: boolean;
1096
+ includeBom?: boolean;
1097
+ }): Promise<string>;
1080
1098
  }
1081
1099
 
1082
1100
  /**
@@ -1976,6 +1994,14 @@ declare class SubcategoryService extends BaseService {
1976
1994
  * @returns Podkategorija ili null ako ne postoji
1977
1995
  */
1978
1996
  getById(categoryId: string, subcategoryId: string): Promise<Subcategory | null>;
1997
+ /**
1998
+ * Finds a subcategory by exact name match within a specific category.
1999
+ * Used for CSV import matching.
2000
+ * @param name - Exact name of the subcategory to find
2001
+ * @param categoryId - ID of the category to search within
2002
+ * @returns Subcategory if found, null otherwise
2003
+ */
2004
+ findByNameAndCategory(name: string, categoryId: string): Promise<Subcategory | null>;
1979
2005
  /**
1980
2006
  * Exports subcategories to CSV string, suitable for Excel/Sheets.
1981
2007
  * Includes headers and optional UTF-8 BOM.
@@ -2101,6 +2127,13 @@ declare class TechnologyService extends BaseService implements ITechnologyServic
2101
2127
  * @returns The technology or null if it doesn't exist.
2102
2128
  */
2103
2129
  getById(id: string): Promise<Technology | null>;
2130
+ /**
2131
+ * Finds a technology by exact name match.
2132
+ * Used for CSV import duplicate detection.
2133
+ * @param name - Exact name of the technology to find
2134
+ * @returns Technology if found, null otherwise
2135
+ */
2136
+ findByName(name: string): Promise<Technology | null>;
2104
2137
  /**
2105
2138
  * Dodaje novi zahtev tehnologiji
2106
2139
  * @param technologyId - ID tehnologije
@@ -188,6 +188,11 @@ interface ICategoryService {
188
188
  delete(id: string): Promise<void>;
189
189
  reactivate(id: string): Promise<void>;
190
190
  getById(id: string): Promise<Category | null>;
191
+ findByNameAndFamily(name: string, family: ProcedureFamily): Promise<Category | null>;
192
+ exportToCsv(options?: {
193
+ includeInactive?: boolean;
194
+ includeBom?: boolean;
195
+ }): Promise<string>;
191
196
  }
192
197
 
193
198
  /**
@@ -289,6 +294,14 @@ declare class CategoryService extends BaseService implements ICategoryService {
289
294
  * @returns Kategorija ili null ako ne postoji
290
295
  */
291
296
  getById(id: string): Promise<Category | null>;
297
+ /**
298
+ * Finds a category by exact name match within a specific family.
299
+ * Used for CSV import matching.
300
+ * @param name - Exact name of the category to find
301
+ * @param family - Procedure family to search within
302
+ * @returns Category if found, null otherwise
303
+ */
304
+ findByNameAndFamily(name: string, family: ProcedureFamily): Promise<Category | null>;
292
305
  /**
293
306
  * Exports categories to CSV string, suitable for Excel/Sheets.
294
307
  * Includes headers and optional UTF-8 BOM.
@@ -1077,6 +1090,11 @@ interface ITechnologyService {
1077
1090
  getAllForFilterBySubcategory(subcategoryId: string): Promise<Technology[]>;
1078
1091
  getAllForFilterBySubcategoryId(categoryId: string, subcategoryId: string): Promise<Technology[]>;
1079
1092
  getAllForFilter(): Promise<Technology[]>;
1093
+ findByName(name: string): Promise<Technology | null>;
1094
+ exportToCsv(options?: {
1095
+ includeInactive?: boolean;
1096
+ includeBom?: boolean;
1097
+ }): Promise<string>;
1080
1098
  }
1081
1099
 
1082
1100
  /**
@@ -1976,6 +1994,14 @@ declare class SubcategoryService extends BaseService {
1976
1994
  * @returns Podkategorija ili null ako ne postoji
1977
1995
  */
1978
1996
  getById(categoryId: string, subcategoryId: string): Promise<Subcategory | null>;
1997
+ /**
1998
+ * Finds a subcategory by exact name match within a specific category.
1999
+ * Used for CSV import matching.
2000
+ * @param name - Exact name of the subcategory to find
2001
+ * @param categoryId - ID of the category to search within
2002
+ * @returns Subcategory if found, null otherwise
2003
+ */
2004
+ findByNameAndCategory(name: string, categoryId: string): Promise<Subcategory | null>;
1979
2005
  /**
1980
2006
  * Exports subcategories to CSV string, suitable for Excel/Sheets.
1981
2007
  * Includes headers and optional UTF-8 BOM.
@@ -2101,6 +2127,13 @@ declare class TechnologyService extends BaseService implements ITechnologyServic
2101
2127
  * @returns The technology or null if it doesn't exist.
2102
2128
  */
2103
2129
  getById(id: string): Promise<Technology | null>;
2130
+ /**
2131
+ * Finds a technology by exact name match.
2132
+ * Used for CSV import duplicate detection.
2133
+ * @param name - Exact name of the technology to find
2134
+ * @returns Technology if found, null otherwise
2135
+ */
2136
+ findByName(name: string): Promise<Technology | null>;
2104
2137
  /**
2105
2138
  * Dodaje novi zahtev tehnologiji
2106
2139
  * @param technologyId - ID tehnologije
@@ -515,6 +515,28 @@ var CategoryService = class extends BaseService {
515
515
  ...docSnap.data()
516
516
  };
517
517
  }
518
+ /**
519
+ * Finds a category by exact name match within a specific family.
520
+ * Used for CSV import matching.
521
+ * @param name - Exact name of the category to find
522
+ * @param family - Procedure family to search within
523
+ * @returns Category if found, null otherwise
524
+ */
525
+ async findByNameAndFamily(name, family) {
526
+ const q = (0, import_firestore2.query)(
527
+ this.categoriesRef,
528
+ (0, import_firestore2.where)("name", "==", name),
529
+ (0, import_firestore2.where)("family", "==", family),
530
+ (0, import_firestore2.where)("isActive", "==", true)
531
+ );
532
+ const snapshot = await (0, import_firestore2.getDocs)(q);
533
+ if (snapshot.empty) return null;
534
+ const doc11 = snapshot.docs[0];
535
+ return {
536
+ id: doc11.id,
537
+ ...doc11.data()
538
+ };
539
+ }
518
540
  /**
519
541
  * Exports categories to CSV string, suitable for Excel/Sheets.
520
542
  * Includes headers and optional UTF-8 BOM.
@@ -2445,6 +2467,27 @@ var SubcategoryService = class extends BaseService {
2445
2467
  ...docSnap.data()
2446
2468
  };
2447
2469
  }
2470
+ /**
2471
+ * Finds a subcategory by exact name match within a specific category.
2472
+ * Used for CSV import matching.
2473
+ * @param name - Exact name of the subcategory to find
2474
+ * @param categoryId - ID of the category to search within
2475
+ * @returns Subcategory if found, null otherwise
2476
+ */
2477
+ async findByNameAndCategory(name, categoryId) {
2478
+ const q = (0, import_firestore10.query)(
2479
+ this.getSubcategoriesRef(categoryId),
2480
+ (0, import_firestore10.where)("name", "==", name),
2481
+ (0, import_firestore10.where)("isActive", "==", true)
2482
+ );
2483
+ const querySnapshot = await (0, import_firestore10.getDocs)(q);
2484
+ if (querySnapshot.empty) return null;
2485
+ const doc11 = querySnapshot.docs[0];
2486
+ return {
2487
+ id: doc11.id,
2488
+ ...doc11.data()
2489
+ };
2490
+ }
2448
2491
  /**
2449
2492
  * Exports subcategories to CSV string, suitable for Excel/Sheets.
2450
2493
  * Includes headers and optional UTF-8 BOM.
@@ -2756,6 +2799,26 @@ var TechnologyService = class extends BaseService {
2756
2799
  ...docSnap.data()
2757
2800
  };
2758
2801
  }
2802
+ /**
2803
+ * Finds a technology by exact name match.
2804
+ * Used for CSV import duplicate detection.
2805
+ * @param name - Exact name of the technology to find
2806
+ * @returns Technology if found, null otherwise
2807
+ */
2808
+ async findByName(name) {
2809
+ const q = (0, import_firestore11.query)(
2810
+ this.technologiesRef,
2811
+ (0, import_firestore11.where)("name", "==", name),
2812
+ (0, import_firestore11.where)("isActive", "==", true)
2813
+ );
2814
+ const snapshot = await (0, import_firestore11.getDocs)(q);
2815
+ if (snapshot.empty) return null;
2816
+ const doc11 = snapshot.docs[0];
2817
+ return {
2818
+ id: doc11.id,
2819
+ ...doc11.data()
2820
+ };
2821
+ }
2759
2822
  /**
2760
2823
  * Dodaje novi zahtev tehnologiji
2761
2824
  * @param technologyId - ID tehnologije
@@ -434,6 +434,28 @@ var CategoryService = class extends BaseService {
434
434
  ...docSnap.data()
435
435
  };
436
436
  }
437
+ /**
438
+ * Finds a category by exact name match within a specific family.
439
+ * Used for CSV import matching.
440
+ * @param name - Exact name of the category to find
441
+ * @param family - Procedure family to search within
442
+ * @returns Category if found, null otherwise
443
+ */
444
+ async findByNameAndFamily(name, family) {
445
+ const q = query2(
446
+ this.categoriesRef,
447
+ where2("name", "==", name),
448
+ where2("family", "==", family),
449
+ where2("isActive", "==", true)
450
+ );
451
+ const snapshot = await getDocs2(q);
452
+ if (snapshot.empty) return null;
453
+ const doc11 = snapshot.docs[0];
454
+ return {
455
+ id: doc11.id,
456
+ ...doc11.data()
457
+ };
458
+ }
437
459
  /**
438
460
  * Exports categories to CSV string, suitable for Excel/Sheets.
439
461
  * Includes headers and optional UTF-8 BOM.
@@ -2448,6 +2470,27 @@ var SubcategoryService = class extends BaseService {
2448
2470
  ...docSnap.data()
2449
2471
  };
2450
2472
  }
2473
+ /**
2474
+ * Finds a subcategory by exact name match within a specific category.
2475
+ * Used for CSV import matching.
2476
+ * @param name - Exact name of the subcategory to find
2477
+ * @param categoryId - ID of the category to search within
2478
+ * @returns Subcategory if found, null otherwise
2479
+ */
2480
+ async findByNameAndCategory(name, categoryId) {
2481
+ const q = query8(
2482
+ this.getSubcategoriesRef(categoryId),
2483
+ where8("name", "==", name),
2484
+ where8("isActive", "==", true)
2485
+ );
2486
+ const querySnapshot = await getDocs8(q);
2487
+ if (querySnapshot.empty) return null;
2488
+ const doc11 = querySnapshot.docs[0];
2489
+ return {
2490
+ id: doc11.id,
2491
+ ...doc11.data()
2492
+ };
2493
+ }
2451
2494
  /**
2452
2495
  * Exports subcategories to CSV string, suitable for Excel/Sheets.
2453
2496
  * Includes headers and optional UTF-8 BOM.
@@ -2774,6 +2817,26 @@ var TechnologyService = class extends BaseService {
2774
2817
  ...docSnap.data()
2775
2818
  };
2776
2819
  }
2820
+ /**
2821
+ * Finds a technology by exact name match.
2822
+ * Used for CSV import duplicate detection.
2823
+ * @param name - Exact name of the technology to find
2824
+ * @returns Technology if found, null otherwise
2825
+ */
2826
+ async findByName(name) {
2827
+ const q = query9(
2828
+ this.technologiesRef,
2829
+ where9("name", "==", name),
2830
+ where9("isActive", "==", true)
2831
+ );
2832
+ const snapshot = await getDocs9(q);
2833
+ if (snapshot.empty) return null;
2834
+ const doc11 = snapshot.docs[0];
2835
+ return {
2836
+ id: doc11.id,
2837
+ ...doc11.data()
2838
+ };
2839
+ }
2777
2840
  /**
2778
2841
  * Dodaje novi zahtev tehnologiji
2779
2842
  * @param technologyId - ID tehnologije
package/dist/index.d.mts CHANGED
@@ -288,6 +288,11 @@ interface ICategoryService {
288
288
  delete(id: string): Promise<void>;
289
289
  reactivate(id: string): Promise<void>;
290
290
  getById(id: string): Promise<Category | null>;
291
+ findByNameAndFamily(name: string, family: ProcedureFamily): Promise<Category | null>;
292
+ exportToCsv(options?: {
293
+ includeInactive?: boolean;
294
+ includeBom?: boolean;
295
+ }): Promise<string>;
291
296
  }
292
297
 
293
298
  /**
@@ -1014,6 +1019,11 @@ interface ITechnologyService {
1014
1019
  getAllForFilterBySubcategory(subcategoryId: string): Promise<Technology[]>;
1015
1020
  getAllForFilterBySubcategoryId(categoryId: string, subcategoryId: string): Promise<Technology[]>;
1016
1021
  getAllForFilter(): Promise<Technology[]>;
1022
+ findByName(name: string): Promise<Technology | null>;
1023
+ exportToCsv(options?: {
1024
+ includeInactive?: boolean;
1025
+ includeBom?: boolean;
1026
+ }): Promise<string>;
1017
1027
  }
1018
1028
 
1019
1029
  /**
@@ -1300,6 +1310,14 @@ declare class CategoryService extends BaseService implements ICategoryService {
1300
1310
  * @returns Kategorija ili null ako ne postoji
1301
1311
  */
1302
1312
  getById(id: string): Promise<Category | null>;
1313
+ /**
1314
+ * Finds a category by exact name match within a specific family.
1315
+ * Used for CSV import matching.
1316
+ * @param name - Exact name of the category to find
1317
+ * @param family - Procedure family to search within
1318
+ * @returns Category if found, null otherwise
1319
+ */
1320
+ findByNameAndFamily(name: string, family: ProcedureFamily): Promise<Category | null>;
1303
1321
  /**
1304
1322
  * Exports categories to CSV string, suitable for Excel/Sheets.
1305
1323
  * Includes headers and optional UTF-8 BOM.
@@ -1822,6 +1840,14 @@ declare class SubcategoryService extends BaseService {
1822
1840
  * @returns Podkategorija ili null ako ne postoji
1823
1841
  */
1824
1842
  getById(categoryId: string, subcategoryId: string): Promise<Subcategory | null>;
1843
+ /**
1844
+ * Finds a subcategory by exact name match within a specific category.
1845
+ * Used for CSV import matching.
1846
+ * @param name - Exact name of the subcategory to find
1847
+ * @param categoryId - ID of the category to search within
1848
+ * @returns Subcategory if found, null otherwise
1849
+ */
1850
+ findByNameAndCategory(name: string, categoryId: string): Promise<Subcategory | null>;
1825
1851
  /**
1826
1852
  * Exports subcategories to CSV string, suitable for Excel/Sheets.
1827
1853
  * Includes headers and optional UTF-8 BOM.
@@ -2248,6 +2274,13 @@ declare class TechnologyService extends BaseService implements ITechnologyServic
2248
2274
  * @returns The technology or null if it doesn't exist.
2249
2275
  */
2250
2276
  getById(id: string): Promise<Technology | null>;
2277
+ /**
2278
+ * Finds a technology by exact name match.
2279
+ * Used for CSV import duplicate detection.
2280
+ * @param name - Exact name of the technology to find
2281
+ * @returns Technology if found, null otherwise
2282
+ */
2283
+ findByName(name: string): Promise<Technology | null>;
2251
2284
  /**
2252
2285
  * Dodaje novi zahtev tehnologiji
2253
2286
  * @param technologyId - ID tehnologije
package/dist/index.d.ts CHANGED
@@ -288,6 +288,11 @@ interface ICategoryService {
288
288
  delete(id: string): Promise<void>;
289
289
  reactivate(id: string): Promise<void>;
290
290
  getById(id: string): Promise<Category | null>;
291
+ findByNameAndFamily(name: string, family: ProcedureFamily): Promise<Category | null>;
292
+ exportToCsv(options?: {
293
+ includeInactive?: boolean;
294
+ includeBom?: boolean;
295
+ }): Promise<string>;
291
296
  }
292
297
 
293
298
  /**
@@ -1014,6 +1019,11 @@ interface ITechnologyService {
1014
1019
  getAllForFilterBySubcategory(subcategoryId: string): Promise<Technology[]>;
1015
1020
  getAllForFilterBySubcategoryId(categoryId: string, subcategoryId: string): Promise<Technology[]>;
1016
1021
  getAllForFilter(): Promise<Technology[]>;
1022
+ findByName(name: string): Promise<Technology | null>;
1023
+ exportToCsv(options?: {
1024
+ includeInactive?: boolean;
1025
+ includeBom?: boolean;
1026
+ }): Promise<string>;
1017
1027
  }
1018
1028
 
1019
1029
  /**
@@ -1300,6 +1310,14 @@ declare class CategoryService extends BaseService implements ICategoryService {
1300
1310
  * @returns Kategorija ili null ako ne postoji
1301
1311
  */
1302
1312
  getById(id: string): Promise<Category | null>;
1313
+ /**
1314
+ * Finds a category by exact name match within a specific family.
1315
+ * Used for CSV import matching.
1316
+ * @param name - Exact name of the category to find
1317
+ * @param family - Procedure family to search within
1318
+ * @returns Category if found, null otherwise
1319
+ */
1320
+ findByNameAndFamily(name: string, family: ProcedureFamily): Promise<Category | null>;
1303
1321
  /**
1304
1322
  * Exports categories to CSV string, suitable for Excel/Sheets.
1305
1323
  * Includes headers and optional UTF-8 BOM.
@@ -1822,6 +1840,14 @@ declare class SubcategoryService extends BaseService {
1822
1840
  * @returns Podkategorija ili null ako ne postoji
1823
1841
  */
1824
1842
  getById(categoryId: string, subcategoryId: string): Promise<Subcategory | null>;
1843
+ /**
1844
+ * Finds a subcategory by exact name match within a specific category.
1845
+ * Used for CSV import matching.
1846
+ * @param name - Exact name of the subcategory to find
1847
+ * @param categoryId - ID of the category to search within
1848
+ * @returns Subcategory if found, null otherwise
1849
+ */
1850
+ findByNameAndCategory(name: string, categoryId: string): Promise<Subcategory | null>;
1825
1851
  /**
1826
1852
  * Exports subcategories to CSV string, suitable for Excel/Sheets.
1827
1853
  * Includes headers and optional UTF-8 BOM.
@@ -2248,6 +2274,13 @@ declare class TechnologyService extends BaseService implements ITechnologyServic
2248
2274
  * @returns The technology or null if it doesn't exist.
2249
2275
  */
2250
2276
  getById(id: string): Promise<Technology | null>;
2277
+ /**
2278
+ * Finds a technology by exact name match.
2279
+ * Used for CSV import duplicate detection.
2280
+ * @param name - Exact name of the technology to find
2281
+ * @returns Technology if found, null otherwise
2282
+ */
2283
+ findByName(name: string): Promise<Technology | null>;
2251
2284
  /**
2252
2285
  * Dodaje novi zahtev tehnologiji
2253
2286
  * @param technologyId - ID tehnologije
package/dist/index.js CHANGED
@@ -18919,6 +18919,28 @@ var CategoryService = class extends BaseService {
18919
18919
  ...docSnap.data()
18920
18920
  };
18921
18921
  }
18922
+ /**
18923
+ * Finds a category by exact name match within a specific family.
18924
+ * Used for CSV import matching.
18925
+ * @param name - Exact name of the category to find
18926
+ * @param family - Procedure family to search within
18927
+ * @returns Category if found, null otherwise
18928
+ */
18929
+ async findByNameAndFamily(name, family) {
18930
+ const q = (0, import_firestore59.query)(
18931
+ this.categoriesRef,
18932
+ (0, import_firestore59.where)("name", "==", name),
18933
+ (0, import_firestore59.where)("family", "==", family),
18934
+ (0, import_firestore59.where)("isActive", "==", true)
18935
+ );
18936
+ const snapshot = await (0, import_firestore59.getDocs)(q);
18937
+ if (snapshot.empty) return null;
18938
+ const doc45 = snapshot.docs[0];
18939
+ return {
18940
+ id: doc45.id,
18941
+ ...doc45.data()
18942
+ };
18943
+ }
18922
18944
  /**
18923
18945
  * Exports categories to CSV string, suitable for Excel/Sheets.
18924
18946
  * Includes headers and optional UTF-8 BOM.
@@ -19211,6 +19233,27 @@ var SubcategoryService = class extends BaseService {
19211
19233
  ...docSnap.data()
19212
19234
  };
19213
19235
  }
19236
+ /**
19237
+ * Finds a subcategory by exact name match within a specific category.
19238
+ * Used for CSV import matching.
19239
+ * @param name - Exact name of the subcategory to find
19240
+ * @param categoryId - ID of the category to search within
19241
+ * @returns Subcategory if found, null otherwise
19242
+ */
19243
+ async findByNameAndCategory(name, categoryId) {
19244
+ const q = (0, import_firestore60.query)(
19245
+ this.getSubcategoriesRef(categoryId),
19246
+ (0, import_firestore60.where)("name", "==", name),
19247
+ (0, import_firestore60.where)("isActive", "==", true)
19248
+ );
19249
+ const querySnapshot = await (0, import_firestore60.getDocs)(q);
19250
+ if (querySnapshot.empty) return null;
19251
+ const doc45 = querySnapshot.docs[0];
19252
+ return {
19253
+ id: doc45.id,
19254
+ ...doc45.data()
19255
+ };
19256
+ }
19214
19257
  /**
19215
19258
  * Exports subcategories to CSV string, suitable for Excel/Sheets.
19216
19259
  * Includes headers and optional UTF-8 BOM.
@@ -19501,6 +19544,26 @@ var TechnologyService = class extends BaseService {
19501
19544
  ...docSnap.data()
19502
19545
  };
19503
19546
  }
19547
+ /**
19548
+ * Finds a technology by exact name match.
19549
+ * Used for CSV import duplicate detection.
19550
+ * @param name - Exact name of the technology to find
19551
+ * @returns Technology if found, null otherwise
19552
+ */
19553
+ async findByName(name) {
19554
+ const q = (0, import_firestore61.query)(
19555
+ this.technologiesRef,
19556
+ (0, import_firestore61.where)("name", "==", name),
19557
+ (0, import_firestore61.where)("isActive", "==", true)
19558
+ );
19559
+ const snapshot = await (0, import_firestore61.getDocs)(q);
19560
+ if (snapshot.empty) return null;
19561
+ const doc45 = snapshot.docs[0];
19562
+ return {
19563
+ id: doc45.id,
19564
+ ...doc45.data()
19565
+ };
19566
+ }
19504
19567
  /**
19505
19568
  * Dodaje novi zahtev tehnologiji
19506
19569
  * @param technologyId - ID tehnologije
package/dist/index.mjs CHANGED
@@ -19203,6 +19203,28 @@ var CategoryService = class extends BaseService {
19203
19203
  ...docSnap.data()
19204
19204
  };
19205
19205
  }
19206
+ /**
19207
+ * Finds a category by exact name match within a specific family.
19208
+ * Used for CSV import matching.
19209
+ * @param name - Exact name of the category to find
19210
+ * @param family - Procedure family to search within
19211
+ * @returns Category if found, null otherwise
19212
+ */
19213
+ async findByNameAndFamily(name, family) {
19214
+ const q = query34(
19215
+ this.categoriesRef,
19216
+ where34("name", "==", name),
19217
+ where34("family", "==", family),
19218
+ where34("isActive", "==", true)
19219
+ );
19220
+ const snapshot = await getDocs34(q);
19221
+ if (snapshot.empty) return null;
19222
+ const doc45 = snapshot.docs[0];
19223
+ return {
19224
+ id: doc45.id,
19225
+ ...doc45.data()
19226
+ };
19227
+ }
19206
19228
  /**
19207
19229
  * Exports categories to CSV string, suitable for Excel/Sheets.
19208
19230
  * Includes headers and optional UTF-8 BOM.
@@ -19511,6 +19533,27 @@ var SubcategoryService = class extends BaseService {
19511
19533
  ...docSnap.data()
19512
19534
  };
19513
19535
  }
19536
+ /**
19537
+ * Finds a subcategory by exact name match within a specific category.
19538
+ * Used for CSV import matching.
19539
+ * @param name - Exact name of the subcategory to find
19540
+ * @param categoryId - ID of the category to search within
19541
+ * @returns Subcategory if found, null otherwise
19542
+ */
19543
+ async findByNameAndCategory(name, categoryId) {
19544
+ const q = query35(
19545
+ this.getSubcategoriesRef(categoryId),
19546
+ where35("name", "==", name),
19547
+ where35("isActive", "==", true)
19548
+ );
19549
+ const querySnapshot = await getDocs35(q);
19550
+ if (querySnapshot.empty) return null;
19551
+ const doc45 = querySnapshot.docs[0];
19552
+ return {
19553
+ id: doc45.id,
19554
+ ...doc45.data()
19555
+ };
19556
+ }
19514
19557
  /**
19515
19558
  * Exports subcategories to CSV string, suitable for Excel/Sheets.
19516
19559
  * Includes headers and optional UTF-8 BOM.
@@ -19816,6 +19859,26 @@ var TechnologyService = class extends BaseService {
19816
19859
  ...docSnap.data()
19817
19860
  };
19818
19861
  }
19862
+ /**
19863
+ * Finds a technology by exact name match.
19864
+ * Used for CSV import duplicate detection.
19865
+ * @param name - Exact name of the technology to find
19866
+ * @returns Technology if found, null otherwise
19867
+ */
19868
+ async findByName(name) {
19869
+ const q = query36(
19870
+ this.technologiesRef,
19871
+ where36("name", "==", name),
19872
+ where36("isActive", "==", true)
19873
+ );
19874
+ const snapshot = await getDocs36(q);
19875
+ if (snapshot.empty) return null;
19876
+ const doc45 = snapshot.docs[0];
19877
+ return {
19878
+ id: doc45.id,
19879
+ ...doc45.data()
19880
+ };
19881
+ }
19819
19882
  /**
19820
19883
  * Dodaje novi zahtev tehnologiji
19821
19884
  * @param technologyId - ID tehnologije
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@blackcode_sa/metaestetics-api",
3
3
  "private": false,
4
- "version": "1.12.66",
4
+ "version": "1.12.67",
5
5
  "description": "Firebase authentication service with anonymous upgrade support",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.mjs",
@@ -232,6 +232,29 @@ export class CategoryService extends BaseService implements ICategoryService {
232
232
  } as Category;
233
233
  }
234
234
 
235
+ /**
236
+ * Finds a category by exact name match within a specific family.
237
+ * Used for CSV import matching.
238
+ * @param name - Exact name of the category to find
239
+ * @param family - Procedure family to search within
240
+ * @returns Category if found, null otherwise
241
+ */
242
+ async findByNameAndFamily(name: string, family: ProcedureFamily): Promise<Category | null> {
243
+ const q = query(
244
+ this.categoriesRef,
245
+ where('name', '==', name),
246
+ where('family', '==', family),
247
+ where('isActive', '==', true),
248
+ );
249
+ const snapshot = await getDocs(q);
250
+ if (snapshot.empty) return null;
251
+ const doc = snapshot.docs[0];
252
+ return {
253
+ id: doc.id,
254
+ ...doc.data(),
255
+ } as Category;
256
+ }
257
+
235
258
  /**
236
259
  * Exports categories to CSV string, suitable for Excel/Sheets.
237
260
  * Includes headers and optional UTF-8 BOM.
@@ -306,6 +306,28 @@ export class SubcategoryService extends BaseService {
306
306
  } as Subcategory;
307
307
  }
308
308
 
309
+ /**
310
+ * Finds a subcategory by exact name match within a specific category.
311
+ * Used for CSV import matching.
312
+ * @param name - Exact name of the subcategory to find
313
+ * @param categoryId - ID of the category to search within
314
+ * @returns Subcategory if found, null otherwise
315
+ */
316
+ async findByNameAndCategory(name: string, categoryId: string): Promise<Subcategory | null> {
317
+ const q = query(
318
+ this.getSubcategoriesRef(categoryId),
319
+ where('name', '==', name),
320
+ where('isActive', '==', true),
321
+ );
322
+ const querySnapshot = await getDocs(q);
323
+ if (querySnapshot.empty) return null;
324
+ const doc = querySnapshot.docs[0];
325
+ return {
326
+ id: doc.id,
327
+ ...doc.data(),
328
+ } as Subcategory;
329
+ }
330
+
309
331
  /**
310
332
  * Exports subcategories to CSV string, suitable for Excel/Sheets.
311
333
  * Includes headers and optional UTF-8 BOM.
@@ -309,6 +309,27 @@ export class TechnologyService extends BaseService implements ITechnologyService
309
309
  } as Technology;
310
310
  }
311
311
 
312
+ /**
313
+ * Finds a technology by exact name match.
314
+ * Used for CSV import duplicate detection.
315
+ * @param name - Exact name of the technology to find
316
+ * @returns Technology if found, null otherwise
317
+ */
318
+ async findByName(name: string): Promise<Technology | null> {
319
+ const q = query(
320
+ this.technologiesRef,
321
+ where('name', '==', name),
322
+ where('isActive', '==', true),
323
+ );
324
+ const snapshot = await getDocs(q);
325
+ if (snapshot.empty) return null;
326
+ const doc = snapshot.docs[0];
327
+ return {
328
+ id: doc.id,
329
+ ...doc.data(),
330
+ } as Technology;
331
+ }
332
+
312
333
  /**
313
334
  * Dodaje novi zahtev tehnologiji
314
335
  * @param technologyId - ID tehnologije
@@ -59,4 +59,9 @@ export interface ICategoryService {
59
59
  delete(id: string): Promise<void>;
60
60
  reactivate(id: string): Promise<void>;
61
61
  getById(id: string): Promise<Category | null>;
62
+ findByNameAndFamily(name: string, family: ProcedureFamily): Promise<Category | null>;
63
+ exportToCsv(options?: {
64
+ includeInactive?: boolean;
65
+ includeBom?: boolean;
66
+ }): Promise<string>;
62
67
  }
@@ -160,4 +160,9 @@ export interface ITechnologyService {
160
160
  getAllForFilterBySubcategory(subcategoryId: string): Promise<Technology[]>;
161
161
  getAllForFilterBySubcategoryId(categoryId: string, subcategoryId: string): Promise<Technology[]>;
162
162
  getAllForFilter(): Promise<Technology[]>;
163
+ findByName(name: string): Promise<Technology | null>;
164
+ exportToCsv(options?: {
165
+ includeInactive?: boolean;
166
+ includeBom?: boolean;
167
+ }): Promise<string>;
163
168
  }