Skip to content

[Phase 3] Epic: Multi-Channel Sales #35

@syed-reza98

Description

@syed-reza98

Priority: P3

Phase: 3
Type: Epic

Overview

Epic Goal: Synchronize inventory and product data across multiple sales channels (Shopify, WooCommerce, Facebook Shop, Instagram Shopping, TikTok Shop) from a single StormCom dashboard, preventing overselling and enabling omnichannel commerce.

This epic targets merchants selling on 3+ platforms simultaneously, addressing the #1 pain point: inventory inconsistency causing overselling, customer disappointment, and manual reconciliation work.

Business Value

  • Market Need: 65% of merchants sell on 2+ channels (2024 survey)
  • Overselling Prevention: Reduce overselling incidents by 95%
  • Time Savings: Eliminate 10+ hours/week of manual inventory updates
  • Revenue Increase: +20% sales by listing on all channels without inventory fear
  • Competitive Advantage: 80% of competitors lack real-time sync

Child Issues

Phase 3.1 - Core Sync Engine (3 issues, 6 days)

Phase 3.2 - Channel Integrations (4 issues, 10 days)

Phase 3.3 - Advanced Features (3 issues, 6 days)

  • Issue [Phase 1] PaymentAttempt & PaymentTransaction State Machine #63: Channel-Specific Pricing (2 days)

    • Set different prices per channel (Shopify: $99, Amazon: $89)
    • Currency conversion (USD, EUR, GBP, BDT)
    • Bulk price updates (increase all Shopify prices by 10%)
    • Price sync schedule (daily at 12am UTC)
  • Issue [Phase 1] Inventory Reservation & Hold System #64: Order Consolidation Dashboard (2 days)

    • View orders from all channels in one place
    • Filter by channel (show only Shopify orders)
    • Unified order status (map Shopify "fulfilled" → StormCom "SHIPPED")
    • Export multi-channel orders (CSV, Excel)
  • Issue [WIP] Add inventory reservation and hold system #65: Channel Performance Analytics (2 days)

    • Revenue by channel (pie chart: Shopify 40%, Facebook 30%, etc.)
    • Conversion rate by channel
    • Best-selling products per channel
    • Inventory turnover rate

Acceptance Criteria (Epic Level)

  1. Inventory Synchronization

    • ✅ Real-time inventory updates (<30 seconds across all channels)
    • ✅ Support 5+ channels simultaneously
    • ✅ Prevent overselling (central inventory as single source of truth)
    • ✅ Low stock alerts when total quantity <10 units
  2. Channel Connections

    • ✅ One-click OAuth connection for Shopify, Facebook, Instagram
    • ✅ REST API connection for WooCommerce
    • ✅ Connection health monitoring (last sync time, error count)
    • ✅ Automatic reconnection on token expiry
  3. Order Management

    • ✅ Import orders from all channels hourly
    • ✅ Deduplicate orders (same customer email + order total)
    • ✅ Unified order fulfillment (mark as shipped → update all channels)
    • ✅ Track order source (Order.source = "SHOPIFY", "FACEBOOK", etc.)
  4. Conflict Resolution

    • ✅ StormCom inventory as source of truth (always)
    • ✅ Handle simultaneous edits (last-write-wins on channels)
    • ✅ Manual override option (force channel inventory to match StormCom)
    • ✅ Conflict log (audit trail of inventory changes)
  5. Performance

    • ✅ Sync 1,000 products to 5 channels in <10 minutes
    • ✅ Inventory update latency <30 seconds
    • ✅ Webhook processing <5 seconds
    • ✅ Support 100,000 orders/month across all channels
  6. Analytics

    • ✅ Revenue by channel (last 30 days)
    • ✅ Inventory distribution (how many units on each channel)
    • ✅ Channel conversion rate comparison
    • ✅ Overselling incident tracking (goal: 0 incidents/month)

Technical Architecture

Inventory Sync Flow

Product inventory updated in StormCom
                ↓
    InventoryService.updateStock(productId, newQuantity)
                ↓
    For each connected channel:
        - ShopifyConnector.updateInventory(productId, newQuantity)
        - WooCommerceConnector.updateInventory(productId, newQuantity)
        - FacebookConnector.updateInventory(productId, newQuantity)
                ↓
    Update InventorySnapshot table (per channel)
                ↓
    If sync fails:
        - Retry 3 times (exponential backoff)
        - Log error
        - Alert merchant (email notification)

Order Import Flow

Shopify Order Created → Shopify webhook → StormCom /api/webhooks/shopify
                                                    ↓
                                        Deduplicate order (email + total)
                                                    ↓
                                        If duplicate:
                                            - Skip import
                                            - Log warning
                                        Else:
                                            - Create Order (source=SHOPIFY)
                                            - Decrement inventory
                                            - Send confirmation email

Channel Abstraction

interface ChannelConnector {
  connect(credentials: OAuth2Credentials): Promise<void>;
  syncProducts(products: Product[]): Promise<SyncResult>;
  updateInventory(productId: string, quantity: number): Promise<void>;
  importOrders(since: Date): Promise<Order[]>;
  disconnect(): Promise<void>;
}

class ShopifyConnector implements ChannelConnector {
  async connect(credentials) { /* OAuth flow */ }
  async syncProducts(products) { /* GraphQL mutation */ }
  async updateInventory(productId, quantity) { 
    // POST /admin/api/2024-01/inventory_levels/set.json
  }
}

Success Metrics

Metric Target Measurement
Channels Connected 3+ per merchant Avg connected channels per user
Overselling Incidents 0 per month Track customer complaints
Sync Latency <30 seconds Time from StormCom edit to channel update
Order Deduplication >99% accuracy (Duplicates caught / Total duplicates) × 100
Revenue from Multi-Channel +20% Compare before/after multi-channel
Time Saved 10+ hours/week Survey merchant time savings

Dependencies

Blocks:

  • None (optional feature for advanced merchants)

Blocked By:

Enhances:

  • All StormCom features available across all channels
  • Centralized inventory management

References

Risk Mitigation

Risk Impact Mitigation
Channel API downtime High Retry queue, fallback to manual sync
Webhook delivery failures Medium Polling fallback (hourly sync)
Rate limiting (API) Medium Queue with exponential backoff
Duplicate orders High Email + total matching, 5-minute window
Inventory race conditions High Database transactions, pessimistic locking

Testing Strategy

  • Integration Tests: Mock Shopify/Facebook/WooCommerce APIs
  • Sync Tests: Update inventory, verify all channels updated
  • Conflict Tests: Simultaneous edits on 2 channels
  • Load Tests: Sync 10,000 products to 5 channels
  • Deduplication Tests: Create duplicate orders, verify caught

Current Status

🔴 Not Started - Planned for Phase 3

Estimated Timeline

  • Phase 3.1 (Core Sync Engine): 6 days (3 issues)
  • Phase 3.2 (Channel Integrations): 10 days (4 issues)
  • Phase 3.3 (Advanced Features): 6 days (3 issues)
  • Testing & QA: 4 days
  • Total: 26 days (~5 weeks)

Strategic Note: Multi-channel inventory is a competitive moat. Most competitors offer one-way sync or 15-minute delays. Real-time sync (<30 seconds) prevents overselling and builds merchant trust. Target merchants with $50K+/month revenue across 3+ channels - they're willing to pay premium ($199/mo) for reliable sync. Shopify + Facebook Shop + WooCommerce = 80% of multi-channel merchants.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

Status

In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions