feat(catalog): implement sprint 10 advanced search experience
Some checks failed
Architecture Governance / architecture (push) Has been cancelled

This commit is contained in:
sdarbinyan
2026-07-09 00:55:50 +04:00
parent 3ef0bd711d
commit 1a8f916942
40 changed files with 1917 additions and 70 deletions

View File

@@ -296,6 +296,21 @@
"enabled": true
}
],
"catalog": {
"layout": "grid",
"navigationMode": "default",
"defaultSort": "relevance",
"availableSorts": ["relevance", "latest", "price_asc", "price_desc", "rating", "popular", "discount"],
"enabledFilters": ["price", "availability", "rating", "brand", "category", "subcategory", "discount", "new", "color", "size", "attributes"],
"showBreadcrumbs": true,
"showCategoryBanner": true,
"showSubcategoryChips": true,
"showRatings": true,
"showDiscounts": true,
"showAvailability": true,
"suggestionsEnabled": true,
"searchHistoryEnabled": true
},
"productPage": {
"rating": { "enabled": true },
"reviews": {

View File

@@ -54,6 +54,7 @@ Bootstrap JSON является главным конфигурационным
- branding
- navigation
- footer
- catalog
- productPage
- staticPages
- widgetRegistry
@@ -71,6 +72,22 @@ Bootstrap JSON является главным конфигурационным
- Для footer links/legal/payout icons источник истины — bootstrap JSON.
- Для staticPages контент поддерживается в формате multilingual HTML и рендерится только через safe sanitizer.
- Для productPage допускаются только feature-конфиги (enabled/pageSize/tabs/showSummary), без доменных данных отзывов и вопросов.
- Для catalog допускаются только UI/feature-конфиги (layout/sorts/filters/visibility toggles), без товарных данных.
### Catalog Config (опционально)
- catalog.layout: grid | large-grid | compact-grid | list
- catalog.navigationMode: default | left-category-navigation | mega-category-layout | top-category-carousel
- catalog.defaultSort: relevance | latest | price_asc | price_desc | rating | popular | discount
- catalog.availableSorts: string[]
- catalog.enabledFilters: string[]
- catalog.showBreadcrumbs: boolean
- catalog.showCategoryBanner: boolean
- catalog.showSubcategoryChips: boolean
- catalog.showRatings: boolean
- catalog.showDiscounts: boolean
- catalog.showAvailability: boolean
- catalog.suggestionsEnabled: boolean
- catalog.searchHistoryEnabled: boolean
### Product Engagement Config (опционально)
- productPage.rating.enabled: boolean

View File

@@ -39,6 +39,17 @@
Правило:
- Feature UI не вызывает API напрямую; запросы идут через ProductFacade -> domain service -> provider/repository.
## Advanced Catalog/Search Expectations
- Suggestions endpoint (future-ready):
- GET /search/suggestions?q={term}
- response: suggestion strings with optional popularity/count metadata.
- Dynamic filter metadata endpoint (future-ready):
- GET /catalog/filters?category={id}&q={term}
- response: filter definitions/options that frontend can render without hardcoded filter schema.
- Sort extension contract:
- Backend may introduce new sort IDs via bootstrap `catalog.availableSorts`.
- Frontend must render unknown sort keys safely if label mapping is provided.
## Пример API ответа: категории
```json
{

View File

@@ -9,37 +9,47 @@
- API возвращает содержимое: товары, категории, метаданные фильтров.
## Обязательные JSON-свойства каталога
- catalog.settings.defaultSort
- catalog.settings.pageSize
- catalog.routes.list
- catalog.routes.details
- catalog.defaultSort
- catalog.availableSorts
- catalog.enabledFilters
- catalog.layout
## Опциональные свойства
- catalog.filters.available
- catalog.facets
- catalog.badges
- catalog.promotions
- catalog.navigationMode
- catalog.showBreadcrumbs
- catalog.showCategoryBanner
- catalog.showSubcategoryChips
- catalog.showRatings
- catalog.showDiscounts
- catalog.showAvailability
- catalog.suggestionsEnabled
- catalog.searchHistoryEnabled
- catalog.facets (future backend-driven)
## Строгие правила
- Каталог не содержит tenant-specific условий в frontend-коде.
- Сортировка и фильтры должны быть согласованы между frontend и backend.
- Видимость товаров контролируется данными backend, а не frontend-хардкодом.
## Reusable Domain Models
- SearchCriteria
- FilterDefinition
- FilterOption
- SortDefinition
- CatalogView
- SearchResult
## Пример catalog JSON (bootstrap fragment)
```json
{
"catalog": {
"settings": {
"defaultSort": "priority_desc",
"pageSize": 20
},
"routes": {
"list": "/catalog",
"details": "/product/:id"
},
"filters": {
"available": ["price", "brand", "availability"]
}
"layout": "grid",
"defaultSort": "relevance",
"availableSorts": ["relevance", "latest", "price_asc", "price_desc", "rating", "popular", "discount"],
"enabledFilters": ["price", "availability", "rating", "brand", "category", "subcategory", "discount", "new", "color", "size", "attributes"],
"showBreadcrumbs": true,
"showCategoryBanner": true,
"showSubcategoryChips": true
}
}
```

View File

@@ -9,6 +9,7 @@
- API категорий, товаров, карточек, поисковых выборок.
- Выдача навигации, статических страниц и feature flags.
- Product Engagement API для рейтинга, отзывов и вопросов.
- Advanced Search API для keyword/suggestions/filter metadata/sorting.
### Контракт статических страниц
Backend должен поддерживать формат:
@@ -40,6 +41,18 @@ Backend должен поддерживать формат:
- POST /products/{id}/reviews
- POST /products/{id}/questions
## Обязательные Catalog/Search endpoints (current + future-ready)
- GET /searchitems
- GET /category/{id}
- GET /items/randomitems
- GET /search/suggestions?q={term} (future-ready)
- GET /catalog/filters?category={id}&q={term} (future-ready)
## Catalog bootstrap contract expectations
- Backend should populate `catalog.availableSorts` and `catalog.enabledFilters`.
- Backend should not include product list or filter results inside bootstrap.
- Bootstrap remains feature-configuration only.
## Опциональные JSON-контракты
- Персонализированные рекомендации.
- Расширенные facets/filters.