Spensara Spensara Knowledge Base & Documentation Repository

Repository Docs & Knowledge Base

Consolidated Spensara documentation repository (722 Markdown & architecture documents in ../repository)
Built Word Documents (.docx): Spensara Overview (.docx) Capability Assessment (.docx) Brink POS Ingestion Analysis (.docx) The Borg Ingestion Architecture (.docx)

Branches (328)

Branch-specific documentation across extract-raw-xml, feature-fleet-import, kds_cdc_improvments, life-cycle, and tenat-admin.
branches/kds_cdc_improvments/monitor-specs/backend/Kds.Ai.Data/MonitorSpecs/seasonality-trends.md 3,763 bytes · Updated Oct 23, 2026 10:44 AM EDT
Raw File

id: 3e9b5c41-6a27-4f7c-b0d8-9d2e6f1a8c73 name: Incorporate seasonality, trends, and special events kind: ForecastEnhancement cron: 0 0 6 * * * analysis_window: 90d comparison_periods: [7d, 28d]


Incorporate seasonality, long-term trends, and special events into sales forecasting to improve prediction accuracy and better reflect real-world demand fluctuations.

Process should analyze historical order behavior and adjust baseline forecasts to reflect predictable seasonal patterns, demand trends, and event-driven demand changes.

Output must contain adjusted forecast data only, without explanations or descriptions of methodology.

Known Tables & Columns

curated.pos_orders

  • created_at (timestamp) - local order timestamp for time-based patterns
  • created_at_utc (timestamp) - UTC timestamp when normalization is needed
  • business_date (date) - business trading date
  • total (decimal) - order revenue
  • service_channel (varchar) - dine-in, pickup, delivery, or similar channel label when populated
  • fulfillment_channel (varchar) - downstream fulfillment grouping when populated

curated.pos_order_items (optional demand-mix enrichment)

  • order_id (varchar) - join key to curated.pos_orders.order_id
  • item_id (integer) - menu item identifier
  • quantity (integer) - sold quantity
  • unit_price (decimal) - observed sold unit price
  • category_name (varchar) - sold item category when populated

curated.pos_menu_items (optional metadata enrichment)

  • item_id (integer) - menu item identifier
  • category_name (varchar) - configured category

Analysis Approach

  1. Extract historical sales data from last 90 days using curated.pos_orders.
  1. Identify seasonal demand patterns, including:
  2. weekday vs weekend behavior
  3. recurring weekly cycles
  4. recurring monthly demand patterns.
  1. Detect long-term sales trends, such as:
  2. gradual growth in revenue
  3. gradual decline in demand
  4. sustained shifts in purchasing behavior.
  1. Detect recent anomalies within historical window such as:
  2. unusual spikes or drops in sales
  3. short-term effects caused by promotions or special events.
  1. Use business_date as primary date dimension. Use created_at or created_at_utc when hourly or intraday alignment is needed.
  1. Use curated.pos_order_items and curated.pos_menu_items only when item or category mix materially explains seasonality changes that are not visible from order totals alone.
  1. Enrich dataset using external signals, including:
  2. holidays and public events
  3. seasonal periods
  4. local events such as sports games or festivals.
  1. Retrieve short-term contextual signals using get_weather_forecast to determine whether upcoming demand may deviate from historical baselines.
  1. Evaluate how past holidays and events affected demand, identifying whether they caused:
  2. revenue spikes
  3. revenue drops
  4. demand shifts between days or channels.
  1. Adjust baseline forecast values to account for:
  2. seasonal demand patterns
  3. detected growth or decline trends
  4. upcoming holidays or events
  5. contextual signals such as weather.
  1. Ensure adjustments remain stable and realistic, avoiding overfitting to short-term anomalies.
  1. Output constraints:
  2. return adjusted forecast data only
  3. do not include explanations, reasoning, or methodology.
  1. Minimize database usage:
  2. prefer aggregated summaries
  3. avoid requesting more than 3 queries unless necessary.

Output Format

Return adjusted forecast values reflecting seasonality, trends, and special-event demand effects.

No explanations or narrative text should be included in output.