Skip to content

[Service] Promotional Boost Contract Service for StarShop Frontend #288

@aguilar1x

Description

@aguilar1x

🎯 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 boost
  • getBoost(boostId) - Get boost details
  • updateBoost(boostId, updates) - Update boost
  • cancelBoost(boostId) - Cancel boost
  • activateBoost(boostId) - Activate boost

2. Visibility Management

  • setVisibilityLevel(productId, level) - Set visibility level
  • getVisibilityLevel(productId) - Get current visibility
  • boostVisibility(productId, duration) - Boost visibility
  • getVisibilityStats(productId) - Get visibility statistics

3. Slot Management

  • reserveSlot(slotType, duration) - Reserve promotional slot
  • getAvailableSlots(slotType) - Get available slots
  • releaseSlot(slotId) - Release slot
  • getSlotStatus(slotId) - Get slot status

4. Payment Processing

  • processBoostPayment(boostId, amount) - Process payment
  • getPaymentStatus(boostId) - Get payment status
  • refundBoostPayment(boostId) - Refund payment
  • getBoostCost(config) - Calculate boost cost

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions