What problem does it solve?
This Skill encapsulates the Bitrix AI Challenge wishlist module, detailing how to store favorites for authenticated users via ORM and guests via encrypted cookies, plus migration, API, and admin UI requirements to deliver a production-grade solution.
Core Features & Use Cases
- Storage: authenticated users use a dedicated ORM DataManager table; guests use encrypted cookies.
- Migration: move guest favorites to DB on user login via OnAfterUserAuthorize; avoid duplicates.
- REST API: expose POST favorites.add, POST favorites.remove, GET favorites.list, GET favorites.getProducts via \Bitrix\Main\Engine\Controller with proper CSRF and auth checks.
- Public Component: vendor:favorites.button for add/remove with AJAX, parameterized by PRODUCT_ID, SHOW_COUNTER, and BUTTON_SIZE; responsive UI.
- Caching & Invalidation: cache wishlist for users; invalidate on IBlock element updates/deletes via tagged cache; events OnAfterIBlockElementDelete and OnAfterIBlockElementUpdate.
- Admin Settings: module settings page to select catalog info-block, guest cookie TTL, and enable/disable module features.
- Non-functional: API calls <= 100ms, strong validation, CSRF protection, cookie encryption.
Quick Start
Install and configure the Wishlist module following bitrix_ai_challenge.md, then test via the REST API and the public component.