diff --git a/server/ecommerce/spi/products.ts b/server/ecommerce/spi/products.ts new file mode 100644 index 0000000..d9af0b8 --- /dev/null +++ b/server/ecommerce/spi/products.ts @@ -0,0 +1,26 @@ +import { ProductWithoutImageDto } from 'src/utils/dtos/product.dto'; +import { QueryParams } from 'src/utils/dtos/types'; +import { Product } from 'src/utils/entities/product.entity'; + +export const IProductsService = Symbol('ProductsService'); + +export interface IProductsService { + findProduct(productId: number): Promise; + getUserProducts(userId: number): Promise; + getAllProducts(): Promise; + getFilteredSearchTextProducts(searchText: string): Promise; + getProductsByCategory( + category: string, + queryParams: QueryParams, + ): Promise; + getWomenFilteredProducts(queryParams: QueryParams): Promise; + getMenFilteredProducts(queryParams: QueryParams): Promise; + getMenProducts(): Promise; + deleteProduct(productId: number): Promise; + uploadProduct( + productBody: ProductWithoutImageDto, + file: Express.Multer.File, + userId: number, + ): Promise; + getPaginatedProducts(limit: number, offset: number): Promise; +}