Skip to content

template-apparel-erp: AI demand forecasting on production-order screen (stretch) #1259

@willgriffin

Description

@willgriffin

Parent

Epic: #1245

What to build

Stretch goal — completes the AI showcase by adding a fourth demonstrated capability beyond brand voice / chat / translation.

When creating a ProductionOrder for a Style, an inline agent suggests how to break the total production qty across colorways and sizes based on historical sales velocity. Surfaces as a "Suggest breakdown" button on the production-order form.

Behavior

  • Input: (styleId, totalQty, lookbackDays) — defaults: 200 units, 90 days
  • The agent calls a forecast.styleSizeMix(styleId, days) tool that queries past Orders + WholesaleOrders for that Style's SKUs, computes a colorway-and-size mix percentage with confidence intervals, and returns a recommended breakdown
  • UI shows the recommendation as an editable grid the planner can override
  • A second tool, forecast.seasonalAdjustment(styleId, targetMonth), applies seasonality from prior-year same-month data when the target production date is in a future season

Tier gate

commerce.aiForecasting feature: off for Starter and Growth, on for Enterprise only. Most of the demo runs without it.

Acceptance criteria

  • Two tools registered (forecast.styleSizeMix, forecast.seasonalAdjustment)
  • "Suggest breakdown" button on the production-order form
  • Agent uses real seeded historical data and returns a plausible breakdown
  • Tier gate hides the button when the feature is off
  • Manual verification: with seeded historical data, click "Suggest" on a 200-unit production order, confirm the grid populates with reasonable percentages

Blocked by

  • #1258 — seed data (forecasting needs historical orders to compute against)

Notes

This is explicitly stretch. If timing is tight, defer to the post-v1 backlog. The AI showcase is already strong with brand-voice + chat + translation.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions