@blackcode_sa/metaestetics-api 1.5.12 → 1.5.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/index.d.mts CHANGED
@@ -1562,23 +1562,23 @@ interface Category {
1562
1562
  }
1563
1563
 
1564
1564
  /**
1565
- * Proizvod koji se koristi u procedurama
1566
- * Može biti potrošni materijal, oprema ili bilo koji drugi proizvod potreban za izvođenje procedure
1565
+ * Product used in procedures
1566
+ * Can be consumables, equipment, or any other product needed for performing procedures
1567
1567
  *
1568
- * @property id - Jedinstveni identifikator proizvoda
1569
- * @property name - Naziv proizvoda
1570
- * @property description - Detaljan opis proizvoda i njegove namene
1571
- * @property brandId - ID brenda koji proizvodi ovaj proizvod
1572
- * @property technologyId - ID tehnologije sa kojom se proizvod koristi
1573
- * @property technicalDetails - Tehnički detalji i specifikacije proizvoda
1574
- * @property warnings - Lista upozorenja vezanih za korišćenje proizvoda
1575
- * @property dosage - Informacije o doziranju (ako je primenljivo)
1576
- * @property composition - Sastav proizvoda
1577
- * @property indications - Lista indikacija za korišćenje
1578
- * @property contraindications - Lista kontraindikacija
1579
- * @property isActive - Da li je proizvod aktivan u sistemu
1580
- * @property createdAt - Datum kreiranja
1581
- * @property updatedAt - Datum poslednjeg ažuriranja
1568
+ * @property id - Unique identifier of the product
1569
+ * @property name - Name of the product
1570
+ * @property description - Detailed description of the product and its purpose
1571
+ * @property brandId - ID of the brand that manufactures this product
1572
+ * @property technologyId - ID of the technology this product is used with
1573
+ * @property technicalDetails - Technical details and specifications
1574
+ * @property warnings - List of warnings related to product use
1575
+ * @property dosage - Dosage information (if applicable)
1576
+ * @property composition - Product composition
1577
+ * @property indications - List of indications for use
1578
+ * @property contraindications - List of contraindications
1579
+ * @property isActive - Whether the product is active in the system
1580
+ * @property createdAt - Creation date
1581
+ * @property updatedAt - Last update date
1582
1582
  */
1583
1583
  interface Product {
1584
1584
  id?: string;
@@ -1596,6 +1596,47 @@ interface Product {
1596
1596
  indications?: string[];
1597
1597
  contraindications?: string[];
1598
1598
  }
1599
+ /**
1600
+ * Interface for the ProductService class
1601
+ */
1602
+ interface IProductService {
1603
+ /**
1604
+ * Creates a new product
1605
+ * @param technologyId - ID of the technology this product is used with
1606
+ * @param brandId - ID of the brand that manufactures this product
1607
+ * @param product - Product data
1608
+ */
1609
+ create(technologyId: string, brandId: string, product: Omit<Product, "id" | "createdAt" | "updatedAt" | "brandId" | "technologyId">): Promise<Product>;
1610
+ /**
1611
+ * Gets all products for a technology
1612
+ * @param technologyId - ID of the technology
1613
+ */
1614
+ getAllByTechnology(technologyId: string): Promise<Product[]>;
1615
+ /**
1616
+ * Gets all products for a brand
1617
+ * @param brandId - ID of the brand
1618
+ */
1619
+ getAllByBrand(brandId: string): Promise<Product[]>;
1620
+ /**
1621
+ * Updates a product
1622
+ * @param technologyId - ID of the technology
1623
+ * @param productId - ID of the product to update
1624
+ * @param product - Updated product data
1625
+ */
1626
+ update(technologyId: string, productId: string, product: Partial<Omit<Product, "id" | "createdAt" | "brandId" | "technologyId">>): Promise<Product | null>;
1627
+ /**
1628
+ * Deletes a product (soft delete)
1629
+ * @param technologyId - ID of the technology
1630
+ * @param productId - ID of the product to delete
1631
+ */
1632
+ delete(technologyId: string, productId: string): Promise<void>;
1633
+ /**
1634
+ * Gets a product by ID
1635
+ * @param technologyId - ID of the technology
1636
+ * @param productId - ID of the product
1637
+ */
1638
+ getById(technologyId: string, productId: string): Promise<Product | null>;
1639
+ }
1599
1640
 
1600
1641
  /**
1601
1642
  * Jedinica mere za vremenski period
@@ -1705,40 +1746,24 @@ interface Subcategory {
1705
1746
  * @property updatedAt - Last update date
1706
1747
  */
1707
1748
  interface Technology {
1708
- /** Jedinstveni identifikator tehnologije (automatski generisan od strane Firestore) */
1709
1749
  id?: string;
1710
- /** Naziv tehnologije */
1711
1750
  name: string;
1712
- /** Detaljan opis tehnologije */
1713
1751
  description: string;
1714
- /** Familija procedura kojoj tehnologija pripada */
1715
1752
  family: ProcedureFamily;
1716
- /** ID kategorije kojoj tehnologija pripada */
1717
1753
  categoryId: string;
1718
- /** ID potkategorije kojoj tehnologija pripada */
1719
1754
  subcategoryId: string;
1720
- /** Tehnički detalji i specifikacije */
1721
1755
  technicalDetails?: string;
1722
- /** Zahtevi pre i posle tretmana */
1723
1756
  requirements: {
1724
1757
  pre: Requirement[];
1725
1758
  post: Requirement[];
1726
1759
  };
1727
- /** Apsolutne kontraindikacije koje sprečavaju tretman */
1728
1760
  blockingConditions: BlockingCondition[];
1729
- /** Relativne kontraindikacije koje zahtevaju posebnu pažnju */
1730
1761
  contraindications: Contraindication[];
1731
- /** Očekivane dobrobiti tretmana */
1732
1762
  benefits: TreatmentBenefit[];
1733
- /** Potrebna sertifikacija za korišćenje tehnologije */
1734
1763
  certificationRequirement: CertificationRequirement;
1735
- /** Dokumentacioni šabloni potrebni za ovu tehnologiju */
1736
1764
  documentationTemplates?: DocumentTemplate[];
1737
- /** Da li je tehnologija trenutno aktivna */
1738
1765
  isActive: boolean;
1739
- /** Datum kreiranja */
1740
1766
  createdAt: Date;
1741
- /** Datum poslednjeg ažuriranja */
1742
1767
  updatedAt: Date;
1743
1768
  }
1744
1769
 
@@ -3257,6 +3282,7 @@ declare const documentTemplateSchema: z.ZodObject<{
3257
3282
  id: string;
3258
3283
  isActive: boolean;
3259
3284
  updatedAt: number;
3285
+ createdAt: number;
3260
3286
  title: string;
3261
3287
  elements: ({
3262
3288
  type: DocumentElementType.HEADING;
@@ -3336,7 +3362,6 @@ declare const documentTemplateSchema: z.ZodObject<{
3336
3362
  allowedFileTypes?: string[] | undefined;
3337
3363
  maxFileSizeMB?: number | undefined;
3338
3364
  })[];
3339
- createdAt: number;
3340
3365
  createdBy: string;
3341
3366
  version: number;
3342
3367
  description?: string | undefined;
@@ -3345,6 +3370,7 @@ declare const documentTemplateSchema: z.ZodObject<{
3345
3370
  id: string;
3346
3371
  isActive: boolean;
3347
3372
  updatedAt: number;
3373
+ createdAt: number;
3348
3374
  title: string;
3349
3375
  elements: ({
3350
3376
  type: DocumentElementType.HEADING;
@@ -3424,7 +3450,6 @@ declare const documentTemplateSchema: z.ZodObject<{
3424
3450
  allowedFileTypes?: string[] | undefined;
3425
3451
  maxFileSizeMB?: number | undefined;
3426
3452
  })[];
3427
- createdAt: number;
3428
3453
  createdBy: string;
3429
3454
  version: number;
3430
3455
  description?: string | undefined;
@@ -3821,7 +3846,13 @@ declare class TechnologyService extends BaseService {
3821
3846
  }
3822
3847
 
3823
3848
  declare class BrandService extends BaseService {
3824
- private get brandsRef();
3849
+ /**
3850
+ * Gets reference to brands collection
3851
+ */
3852
+ private getBrandsRef;
3853
+ /**
3854
+ * Creates a new brand
3855
+ */
3825
3856
  create(brand: Omit<Brand, "id" | "createdAt" | "updatedAt">): Promise<{
3826
3857
  isActive: boolean;
3827
3858
  updatedAt: Date;
@@ -3832,36 +3863,55 @@ declare class BrandService extends BaseService {
3832
3863
  website?: string | undefined;
3833
3864
  id: string;
3834
3865
  }>;
3866
+ /**
3867
+ * Gets all active brands
3868
+ */
3835
3869
  getAll(): Promise<Brand[]>;
3836
- update(id: string, brand: Partial<Omit<Brand, "id" | "createdAt">>): Promise<Brand | null>;
3837
- delete(id: string): Promise<void>;
3838
- getById(id: string): Promise<Brand | null>;
3870
+ /**
3871
+ * Updates a brand
3872
+ */
3873
+ update(brandId: string, brand: Partial<Omit<Brand, "id" | "createdAt">>): Promise<Brand | null>;
3874
+ /**
3875
+ * Soft deletes a brand
3876
+ */
3877
+ delete(brandId: string): Promise<void>;
3878
+ /**
3879
+ * Gets a brand by ID
3880
+ */
3881
+ getById(brandId: string): Promise<Brand | null>;
3839
3882
  }
3840
3883
 
3841
- declare class ProductService extends BaseService {
3842
- private getProductsRefByTechnology;
3843
- private getProductsRefByBrand;
3844
- create(categoryId: string, subcategoryId: string, technologyId: string, brandId: string, product: Omit<Product, "id" | "createdAt" | "updatedAt" | "brandId" | "technologyId">): Promise<{
3845
- isActive: boolean;
3846
- updatedAt: Date;
3847
- contraindications?: string[] | undefined;
3848
- name: string;
3849
- dosage?: string | undefined;
3850
- description?: string | undefined;
3851
- createdAt: Date;
3852
- technicalDetails?: string | undefined;
3853
- brandId: string;
3854
- technologyId: string;
3855
- warnings?: string[] | undefined;
3856
- composition?: string | undefined;
3857
- indications?: string[] | undefined;
3858
- id: string;
3859
- }>;
3860
- getAllByTechnology(categoryId: string, subcategoryId: string, technologyId: string): Promise<Product[]>;
3884
+ declare class ProductService extends BaseService implements IProductService {
3885
+ /**
3886
+ * Gets reference to products collection under a technology
3887
+ * @param technologyId - ID of the technology
3888
+ * @returns Firestore collection reference
3889
+ */
3890
+ private getProductsRef;
3891
+ /**
3892
+ * Creates a new product under technology
3893
+ */
3894
+ create(technologyId: string, brandId: string, product: Omit<Product, "id" | "createdAt" | "updatedAt" | "brandId" | "technologyId">): Promise<Product>;
3895
+ /**
3896
+ * Gets all products for a technology
3897
+ */
3898
+ getAllByTechnology(technologyId: string): Promise<Product[]>;
3899
+ /**
3900
+ * Gets all products for a brand by filtering through all technologies
3901
+ */
3861
3902
  getAllByBrand(brandId: string): Promise<Product[]>;
3862
- update(categoryId: string, subcategoryId: string, technologyId: string, productId: string, product: Partial<Omit<Product, "id" | "createdAt" | "brandId" | "technologyId">>): Promise<Product | null>;
3863
- delete(categoryId: string, subcategoryId: string, technologyId: string, productId: string): Promise<void>;
3864
- getById(categoryId: string, subcategoryId: string, technologyId: string, productId: string): Promise<Product | null>;
3903
+ /**
3904
+ * Updates a product
3905
+ */
3906
+ update(technologyId: string, productId: string, product: Partial<Omit<Product, "id" | "createdAt" | "brandId" | "technologyId">>): Promise<Product | null>;
3907
+ /**
3908
+ * Soft deletes a product
3909
+ */
3910
+ delete(technologyId: string, productId: string): Promise<void>;
3911
+ /**
3912
+ * Gets a product by ID
3913
+ */
3914
+ getById(technologyId: string, productId: string): Promise<Product | null>;
3865
3915
  }
3866
3916
 
3867
3917
  /**
package/dist/index.d.ts CHANGED
@@ -1562,23 +1562,23 @@ interface Category {
1562
1562
  }
1563
1563
 
1564
1564
  /**
1565
- * Proizvod koji se koristi u procedurama
1566
- * Može biti potrošni materijal, oprema ili bilo koji drugi proizvod potreban za izvođenje procedure
1565
+ * Product used in procedures
1566
+ * Can be consumables, equipment, or any other product needed for performing procedures
1567
1567
  *
1568
- * @property id - Jedinstveni identifikator proizvoda
1569
- * @property name - Naziv proizvoda
1570
- * @property description - Detaljan opis proizvoda i njegove namene
1571
- * @property brandId - ID brenda koji proizvodi ovaj proizvod
1572
- * @property technologyId - ID tehnologije sa kojom se proizvod koristi
1573
- * @property technicalDetails - Tehnički detalji i specifikacije proizvoda
1574
- * @property warnings - Lista upozorenja vezanih za korišćenje proizvoda
1575
- * @property dosage - Informacije o doziranju (ako je primenljivo)
1576
- * @property composition - Sastav proizvoda
1577
- * @property indications - Lista indikacija za korišćenje
1578
- * @property contraindications - Lista kontraindikacija
1579
- * @property isActive - Da li je proizvod aktivan u sistemu
1580
- * @property createdAt - Datum kreiranja
1581
- * @property updatedAt - Datum poslednjeg ažuriranja
1568
+ * @property id - Unique identifier of the product
1569
+ * @property name - Name of the product
1570
+ * @property description - Detailed description of the product and its purpose
1571
+ * @property brandId - ID of the brand that manufactures this product
1572
+ * @property technologyId - ID of the technology this product is used with
1573
+ * @property technicalDetails - Technical details and specifications
1574
+ * @property warnings - List of warnings related to product use
1575
+ * @property dosage - Dosage information (if applicable)
1576
+ * @property composition - Product composition
1577
+ * @property indications - List of indications for use
1578
+ * @property contraindications - List of contraindications
1579
+ * @property isActive - Whether the product is active in the system
1580
+ * @property createdAt - Creation date
1581
+ * @property updatedAt - Last update date
1582
1582
  */
1583
1583
  interface Product {
1584
1584
  id?: string;
@@ -1596,6 +1596,47 @@ interface Product {
1596
1596
  indications?: string[];
1597
1597
  contraindications?: string[];
1598
1598
  }
1599
+ /**
1600
+ * Interface for the ProductService class
1601
+ */
1602
+ interface IProductService {
1603
+ /**
1604
+ * Creates a new product
1605
+ * @param technologyId - ID of the technology this product is used with
1606
+ * @param brandId - ID of the brand that manufactures this product
1607
+ * @param product - Product data
1608
+ */
1609
+ create(technologyId: string, brandId: string, product: Omit<Product, "id" | "createdAt" | "updatedAt" | "brandId" | "technologyId">): Promise<Product>;
1610
+ /**
1611
+ * Gets all products for a technology
1612
+ * @param technologyId - ID of the technology
1613
+ */
1614
+ getAllByTechnology(technologyId: string): Promise<Product[]>;
1615
+ /**
1616
+ * Gets all products for a brand
1617
+ * @param brandId - ID of the brand
1618
+ */
1619
+ getAllByBrand(brandId: string): Promise<Product[]>;
1620
+ /**
1621
+ * Updates a product
1622
+ * @param technologyId - ID of the technology
1623
+ * @param productId - ID of the product to update
1624
+ * @param product - Updated product data
1625
+ */
1626
+ update(technologyId: string, productId: string, product: Partial<Omit<Product, "id" | "createdAt" | "brandId" | "technologyId">>): Promise<Product | null>;
1627
+ /**
1628
+ * Deletes a product (soft delete)
1629
+ * @param technologyId - ID of the technology
1630
+ * @param productId - ID of the product to delete
1631
+ */
1632
+ delete(technologyId: string, productId: string): Promise<void>;
1633
+ /**
1634
+ * Gets a product by ID
1635
+ * @param technologyId - ID of the technology
1636
+ * @param productId - ID of the product
1637
+ */
1638
+ getById(technologyId: string, productId: string): Promise<Product | null>;
1639
+ }
1599
1640
 
1600
1641
  /**
1601
1642
  * Jedinica mere za vremenski period
@@ -1705,40 +1746,24 @@ interface Subcategory {
1705
1746
  * @property updatedAt - Last update date
1706
1747
  */
1707
1748
  interface Technology {
1708
- /** Jedinstveni identifikator tehnologije (automatski generisan od strane Firestore) */
1709
1749
  id?: string;
1710
- /** Naziv tehnologije */
1711
1750
  name: string;
1712
- /** Detaljan opis tehnologije */
1713
1751
  description: string;
1714
- /** Familija procedura kojoj tehnologija pripada */
1715
1752
  family: ProcedureFamily;
1716
- /** ID kategorije kojoj tehnologija pripada */
1717
1753
  categoryId: string;
1718
- /** ID potkategorije kojoj tehnologija pripada */
1719
1754
  subcategoryId: string;
1720
- /** Tehnički detalji i specifikacije */
1721
1755
  technicalDetails?: string;
1722
- /** Zahtevi pre i posle tretmana */
1723
1756
  requirements: {
1724
1757
  pre: Requirement[];
1725
1758
  post: Requirement[];
1726
1759
  };
1727
- /** Apsolutne kontraindikacije koje sprečavaju tretman */
1728
1760
  blockingConditions: BlockingCondition[];
1729
- /** Relativne kontraindikacije koje zahtevaju posebnu pažnju */
1730
1761
  contraindications: Contraindication[];
1731
- /** Očekivane dobrobiti tretmana */
1732
1762
  benefits: TreatmentBenefit[];
1733
- /** Potrebna sertifikacija za korišćenje tehnologije */
1734
1763
  certificationRequirement: CertificationRequirement;
1735
- /** Dokumentacioni šabloni potrebni za ovu tehnologiju */
1736
1764
  documentationTemplates?: DocumentTemplate[];
1737
- /** Da li je tehnologija trenutno aktivna */
1738
1765
  isActive: boolean;
1739
- /** Datum kreiranja */
1740
1766
  createdAt: Date;
1741
- /** Datum poslednjeg ažuriranja */
1742
1767
  updatedAt: Date;
1743
1768
  }
1744
1769
 
@@ -3257,6 +3282,7 @@ declare const documentTemplateSchema: z.ZodObject<{
3257
3282
  id: string;
3258
3283
  isActive: boolean;
3259
3284
  updatedAt: number;
3285
+ createdAt: number;
3260
3286
  title: string;
3261
3287
  elements: ({
3262
3288
  type: DocumentElementType.HEADING;
@@ -3336,7 +3362,6 @@ declare const documentTemplateSchema: z.ZodObject<{
3336
3362
  allowedFileTypes?: string[] | undefined;
3337
3363
  maxFileSizeMB?: number | undefined;
3338
3364
  })[];
3339
- createdAt: number;
3340
3365
  createdBy: string;
3341
3366
  version: number;
3342
3367
  description?: string | undefined;
@@ -3345,6 +3370,7 @@ declare const documentTemplateSchema: z.ZodObject<{
3345
3370
  id: string;
3346
3371
  isActive: boolean;
3347
3372
  updatedAt: number;
3373
+ createdAt: number;
3348
3374
  title: string;
3349
3375
  elements: ({
3350
3376
  type: DocumentElementType.HEADING;
@@ -3424,7 +3450,6 @@ declare const documentTemplateSchema: z.ZodObject<{
3424
3450
  allowedFileTypes?: string[] | undefined;
3425
3451
  maxFileSizeMB?: number | undefined;
3426
3452
  })[];
3427
- createdAt: number;
3428
3453
  createdBy: string;
3429
3454
  version: number;
3430
3455
  description?: string | undefined;
@@ -3821,7 +3846,13 @@ declare class TechnologyService extends BaseService {
3821
3846
  }
3822
3847
 
3823
3848
  declare class BrandService extends BaseService {
3824
- private get brandsRef();
3849
+ /**
3850
+ * Gets reference to brands collection
3851
+ */
3852
+ private getBrandsRef;
3853
+ /**
3854
+ * Creates a new brand
3855
+ */
3825
3856
  create(brand: Omit<Brand, "id" | "createdAt" | "updatedAt">): Promise<{
3826
3857
  isActive: boolean;
3827
3858
  updatedAt: Date;
@@ -3832,36 +3863,55 @@ declare class BrandService extends BaseService {
3832
3863
  website?: string | undefined;
3833
3864
  id: string;
3834
3865
  }>;
3866
+ /**
3867
+ * Gets all active brands
3868
+ */
3835
3869
  getAll(): Promise<Brand[]>;
3836
- update(id: string, brand: Partial<Omit<Brand, "id" | "createdAt">>): Promise<Brand | null>;
3837
- delete(id: string): Promise<void>;
3838
- getById(id: string): Promise<Brand | null>;
3870
+ /**
3871
+ * Updates a brand
3872
+ */
3873
+ update(brandId: string, brand: Partial<Omit<Brand, "id" | "createdAt">>): Promise<Brand | null>;
3874
+ /**
3875
+ * Soft deletes a brand
3876
+ */
3877
+ delete(brandId: string): Promise<void>;
3878
+ /**
3879
+ * Gets a brand by ID
3880
+ */
3881
+ getById(brandId: string): Promise<Brand | null>;
3839
3882
  }
3840
3883
 
3841
- declare class ProductService extends BaseService {
3842
- private getProductsRefByTechnology;
3843
- private getProductsRefByBrand;
3844
- create(categoryId: string, subcategoryId: string, technologyId: string, brandId: string, product: Omit<Product, "id" | "createdAt" | "updatedAt" | "brandId" | "technologyId">): Promise<{
3845
- isActive: boolean;
3846
- updatedAt: Date;
3847
- contraindications?: string[] | undefined;
3848
- name: string;
3849
- dosage?: string | undefined;
3850
- description?: string | undefined;
3851
- createdAt: Date;
3852
- technicalDetails?: string | undefined;
3853
- brandId: string;
3854
- technologyId: string;
3855
- warnings?: string[] | undefined;
3856
- composition?: string | undefined;
3857
- indications?: string[] | undefined;
3858
- id: string;
3859
- }>;
3860
- getAllByTechnology(categoryId: string, subcategoryId: string, technologyId: string): Promise<Product[]>;
3884
+ declare class ProductService extends BaseService implements IProductService {
3885
+ /**
3886
+ * Gets reference to products collection under a technology
3887
+ * @param technologyId - ID of the technology
3888
+ * @returns Firestore collection reference
3889
+ */
3890
+ private getProductsRef;
3891
+ /**
3892
+ * Creates a new product under technology
3893
+ */
3894
+ create(technologyId: string, brandId: string, product: Omit<Product, "id" | "createdAt" | "updatedAt" | "brandId" | "technologyId">): Promise<Product>;
3895
+ /**
3896
+ * Gets all products for a technology
3897
+ */
3898
+ getAllByTechnology(technologyId: string): Promise<Product[]>;
3899
+ /**
3900
+ * Gets all products for a brand by filtering through all technologies
3901
+ */
3861
3902
  getAllByBrand(brandId: string): Promise<Product[]>;
3862
- update(categoryId: string, subcategoryId: string, technologyId: string, productId: string, product: Partial<Omit<Product, "id" | "createdAt" | "brandId" | "technologyId">>): Promise<Product | null>;
3863
- delete(categoryId: string, subcategoryId: string, technologyId: string, productId: string): Promise<void>;
3864
- getById(categoryId: string, subcategoryId: string, technologyId: string, productId: string): Promise<Product | null>;
3903
+ /**
3904
+ * Updates a product
3905
+ */
3906
+ update(technologyId: string, productId: string, product: Partial<Omit<Product, "id" | "createdAt" | "brandId" | "technologyId">>): Promise<Product | null>;
3907
+ /**
3908
+ * Soft deletes a product
3909
+ */
3910
+ delete(technologyId: string, productId: string): Promise<void>;
3911
+ /**
3912
+ * Gets a product by ID
3913
+ */
3914
+ getById(technologyId: string, productId: string): Promise<Product | null>;
3865
3915
  }
3866
3916
 
3867
3917
  /**