import { Observable } from 'rxjs';
import { Product, ProductCategory, ProductListQuery, ProductListResult, ProductSearchQuery, RelatedProductsQuery } from '../models/product-domain.model';
import { EngagementListQuery, EngagementListResult, Question, RatingSummary, Review, SubmitQuestionInput, SubmitReviewInput } from '../models/product-engagement.model';

export interface ProductDataProvider {
  getProducts(query?: ProductListQuery): Observable<ProductListResult>;
  getProduct(productID: number): Observable<Product>;
  getCategories(): Observable<ProductCategory[]>;
  searchProducts(query: ProductSearchQuery): Observable<ProductListResult>;
  getFeaturedProducts(query?: ProductListQuery): Observable<ProductListResult>;
  getLatestProducts(query?: ProductListQuery): Observable<ProductListResult>;
  getProductsByCategory(categoryID: number, query?: ProductListQuery): Observable<ProductListResult>;
  getRelatedProducts(query: RelatedProductsQuery): Observable<ProductListResult>;
  loadRating(productID: number): Observable<RatingSummary>;
  loadReviews(productID: number, query?: EngagementListQuery): Observable<EngagementListResult<Review>>;
  loadQuestions(productID: number, query?: EngagementListQuery): Observable<EngagementListResult<Question>>;
  submitReview(productID: number, input: SubmitReviewInput): Observable<void>;
  submitQuestion(productID: number, input: SubmitQuestionInput): Observable<void>;
}
