import { Controller, Get, Param, Query } from '@nestjs/common';
import { CatalogService } from './catalog.service';

@Controller('public/catalog')
export class PublicCatalogController {
  constructor(private readonly catalogService: CatalogService) {}

  @Get('store/:slug')
  getStore(@Param('slug') slug: string) {
    return this.catalogService.getPublicStorefront(slug);
  }

  @Get('stores')
  listStores(
    @Query('city') city?: string,
    @Query('search') search?: string,
    @Query('category') category?: string,
  ) {
    return this.catalogService.listPublicStores(city, search, category);
  }
}
