Boost Offers/Options Implementation Notes ======================================== Backend: Key Endpoints ---------------------- - Buyer product detail: `GET /api/products/{productId}/detail` - Controller: `app/Http/Controllers/Api/ProductDetailController.php` - Uses `OfferMatchingService` + `OfferPricingService` to filter offers and compute final price + breakdown. - Seller offer form data: `GET /api/seller/offers/form-data?product_id=...` - Controller: `app/Http/Controllers/Api/OfferController.php` (`offerFormData`) - Returns product, options, level values, bindings, additional items, offer, feature flags. - Seller offer create/update: `POST /api/seller/offers`, `PUT /api/seller/offers/{id}` - Controller: `app/Http/Controllers/Api/OfferController.php` (`storeOffer`, `updateOffer`) - Handles base fields + modifiers + level pricing. - Seller offer types: `POST /api/seller/offers/types` - Controller: `app/Http/Controllers/Api/OfferController.php` (`storeOfferTypes`) - Seller additional items: `POST /api/seller/additional-items` - Controller: `app/Http/Controllers/Api/SellerAdditionalItemController.php` - Offer CSV (seller): `GET /api/seller/offers/template`, `GET /api/seller/offers/export`, `POST /api/seller/offers/import`, `GET /api/seller/offers/imports/{id}` - Controller: `app/Http/Controllers/Api/OfferController.php` Admin: Key Endpoints + UI ------------------------- - Option bindings (seller_type -> option, seller_type_item -> option_item): - Controller: `app/Http/Controllers/Admin/OptionBindingController.php` - Routes: `routes/admin.php` under `option-binding/*` - Views: `resources/views/admin/optionBinding/*` - Seller additional items moderation: - Controller: `app/Http/Controllers/Admin/SellerAdditionalItemController.php` - Routes: `routes/admin.php` under `seller-additional-items/*` - Views: `resources/views/admin/sellerAdditionalItems/*` - Option + level config UI: - Controller: `app/Http/Controllers/Admin/OptionController.php` - Views: `resources/views/admin/option/*` - Seller types UI: - Controller: `app/Http/Controllers/Admin/SellerTypeControoler.php` - Views: `resources/views/admin/sellerType/*` Matching + Pricing Services --------------------------- - Matching: `app/Services/OfferMatchingService.php` - Uses `OfferMatchingEvaluator` to validate selections vs offer configuration. - Pricing: `app/Services/OfferPricingService.php` - Applies seller modifiers and level pricing rules. - Core math helpers: `app/Services/OfferPricingCalculator.php` Caching (Product Detail) ------------------------ - `ProductDetailController::show` caches: - `option_item_price_products` by product id. - option items by product id (based on item ids). - seller additional items by product id. Frontend: Key Screens --------------------- - Buyer product detail UI: - `Frontend/src/app/product/[categorySlug]/[productSlug]/page.tsx` - Renders options, level range UI modes, additional items, and offers list. - Seller offer editor modal: - `Frontend/src/components/modals/SellerOfferTypeModal.tsx` - Uses `/api/seller/offers/form-data` and handles modifiers, level rules, and additional items. - Seller offers list: - `Frontend/src/app/offers/page.tsx` - Handles base offer fields + CSV import/export. Where to Change Next -------------------- - Buyer detail computation: `app/Http/Controllers/Api/ProductDetailController.php` - Matching and pricing: `app/Services/OfferMatchingService.php`, `app/Services/OfferPricingService.php` - Seller offer save: `app/Http/Controllers/Api/OfferController.php` - Admin moderation + bindings: `app/Http/Controllers/Admin/OptionBindingController.php`, `app/Http/Controllers/Admin/SellerAdditionalItemController.php`