-
Notifications
You must be signed in to change notification settings - Fork 115
Open
Labels
Description
🎯 Objective
Develop a comprehensive TypeScript service layer for the Promotional Boost Contract that manages promotional campaigns, visibility boosts, payment processing, and slot management within the StarShop marketplace.
🏗 Service Structure
src/shared/services/promotional_boost/
boost.service.ts // Main service class
types/
boost.types.ts // TypeScript interfaces
visibility.types.ts // Visibility types
payments.types.ts // Payment types
utils/
boost.utils.ts // Helper functions
constants/
boost.constants.ts // Contract addresses, error codes🗂 Requirements
1. Boost Management
createBoost(config)- Create promotional boostgetBoost(boostId)- Get boost detailsupdateBoost(boostId, updates)- Update boostcancelBoost(boostId)- Cancel boostactivateBoost(boostId)- Activate boost
2. Visibility Management
setVisibilityLevel(productId, level)- Set visibility levelgetVisibilityLevel(productId)- Get current visibilityboostVisibility(productId, duration)- Boost visibilitygetVisibilityStats(productId)- Get visibility statistics
3. Slot Management
reserveSlot(slotType, duration)- Reserve promotional slotgetAvailableSlots(slotType)- Get available slotsreleaseSlot(slotId)- Release slotgetSlotStatus(slotId)- Get slot status
4. Payment Processing
processBoostPayment(boostId, amount)- Process paymentgetPaymentStatus(boostId)- Get payment statusrefundBoostPayment(boostId)- Refund paymentgetBoostCost(config)- Calculate boost cost