Skip to content

Commit

Permalink
add products service interface
Browse files Browse the repository at this point in the history
  • Loading branch information
radekm2000 committed Jun 1, 2024
1 parent 42b517d commit ef7ddee
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions server/ecommerce/spi/products.ts
Original file line number Diff line number Diff line change
@@ -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<Product | null>;
getUserProducts(userId: number): Promise<Product[]>;
getAllProducts(): Promise<Product[]>;
getFilteredSearchTextProducts(searchText: string): Promise<Product[]>;
getProductsByCategory(
category: string,
queryParams: QueryParams,
): Promise<Product[]>;
getWomenFilteredProducts(queryParams: QueryParams): Promise<Product[]>;
getMenFilteredProducts(queryParams: QueryParams): Promise<Product[]>;
getMenProducts(): Promise<Product[]>;
deleteProduct(productId: number): Promise<void>;
uploadProduct(
productBody: ProductWithoutImageDto,
file: Express.Multer.File,
userId: number,
): Promise<string>;
getPaginatedProducts(limit: number, offset: number): Promise<Product[]>;
}

0 comments on commit ef7ddee

Please sign in to comment.