title: Dashboard Overview
type: object
x-tags:
  - Models
description: Comparison-ready recorded capture/void activity, purchasing-customer continuity, selected outlets and merchant-wide loyalty programs.
required:
  - currency_code
  - timezone
  - current_period
  - comparison_period
  - has_order_history
  - summary
  - customer_activity
  - daily_order_activity
  - comparison_daily_order_activity
  - outlets
  - loyalty_programs
  - generated_at
  - latest_order_updated_at
properties:
  currency_code:
    type: string
    minLength: 3
    maxLength: 3
    description: The merchant's ISO 4217 alpha-3 currency code.
    example: SGD
  timezone:
    type: string
    minLength: 1
    maxLength: 255
    description: The IANA timezone used to form calendar-day buckets.
    example: Asia/Singapore
  current_period:
    $ref: ./AnalyticsPeriod.yaml
  comparison_period:
    $ref: ./AnalyticsPeriod.yaml
  has_order_history:
    type: boolean
    description: Whether any captured purchase exists for the selected outlets, including purchases outside the requested periods and purchases later voided.
  summary:
    type: object
    required: [current, comparison]
    properties:
      current:
        $ref: ./DashboardOrderSummary.yaml
      comparison:
        $ref: ./DashboardOrderSummary.yaml
  customer_activity:
    type: object
    required:
      - active_identified_customers
      - active_in_both_periods
      - newly_active_customers
      - tier_upgrades
    properties:
      active_identified_customers:
        type: integer
        minimum: 0
        description: Distinct retained customers with captures in the current period, including purchases later voided.
      active_in_both_periods:
        type: integer
        minimum: 0
        description: Retained customers with at least one capture in each requested period.
      newly_active_customers:
        type: integer
        minimum: 0
        description: Current-period purchasing customers without a capture in the comparison period. This is not a first-ever-purchase count.
      tier_upgrades:
        type: integer
        minimum: 0
        description: Automatic tier achievements recorded in the current period from selected-outlet purchases. Full voids do not revoke attained tiers or their benefits.
  daily_order_activity:
    type: array
    description: Zero-filled merchant-local calendar buckets for the current period, using recorded capture/void times. Returned UTC boundaries are half-open and can differ in duration across daylight-saving transitions.
    items:
      type: object
      required: [from, to, summary]
      properties:
        from:
          type: string
          format: date-time
        to:
          type: string
          format: date-time
        summary:
          $ref: ./DashboardOrderSummary.yaml
  comparison_daily_order_activity:
    type: array
    description: Zero-filled merchant-local calendar buckets for the comparison period, with the same recorded-action semantics as the current period.
    items:
      type: object
      required: [from, to, summary]
      properties:
        from:
          type: string
          format: date-time
        to:
          type: string
          format: date-time
        summary:
          $ref: ./DashboardOrderSummary.yaml
  outlets:
    type: array
    description: Selected outlets, including those with zero activity, ordered by descending current net captured amount, then outlet name and UUID.
    items:
      type: object
      required: [outlet_uuid, outlet_name, current, comparison]
      properties:
        outlet_uuid:
          type: string
          format: uuid
        outlet_name:
          type: string
        current:
          $ref: ./DashboardOrderSummary.yaml
        comparison:
          $ref: ./DashboardOrderSummary.yaml
  loyalty_programs:
    type: array
    description: Merchant-wide loyalty-program activity and current outstanding balances. Outlet selection does not allocate or filter these figures.
    items:
      $ref: ./DashboardLoyaltyProgramSummary.yaml
  generated_at:
    type: string
    format: date-time
    description: When this report was generated.
  latest_order_updated_at:
    type: [string, 'null']
    format: date-time
    description: Latest purchase capture/void update for the selected outlets, or null when there is no purchase history.
