{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/advisorppc-com/json-schema/advisorppc-com-daily-business-impact-out-schema.json",
  "title": "DailyBusinessImpactOut",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/advisorppc-com-commerce-api-openapi.yml#/components/schemas/DailyBusinessImpactOut",
  "properties": {
    "day": {
      "type": "string",
      "format": "date",
      "title": "Day"
    },
    "generated_at": {
      "type": "string",
      "format": "date-time",
      "title": "Generated At"
    },
    "state": {
      "type": "string",
      "enum": [
        "available",
        "partial",
        "unavailable"
      ],
      "title": "State"
    },
    "impacts": {
      "items": {
        "$ref": "#/$defs/DailyCurrencyImpactOut"
      },
      "type": "array",
      "title": "Impacts"
    },
    "connector_action": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "connect",
            "reconnect"
          ]
        },
        {
          "type": "null"
        }
      ],
      "title": "Connector Action"
    },
    "connectors_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Connectors Url"
    }
  },
  "type": "object",
  "required": [
    "day",
    "generated_at",
    "state",
    "impacts"
  ],
  "$defs": {
    "AdBudgetBurnImpactOut": {
      "properties": {
        "state": {
          "type": "string",
          "enum": [
            "available",
            "unavailable"
          ],
          "title": "State"
        },
        "selection_state": {
          "type": "string",
          "enum": [
            "bound",
            "unavailable"
          ],
          "title": "Selection State"
        },
        "aggregation_grain": {
          "type": "string",
          "enum": [
            "selected_provider_account_portfolio_utc_day",
            "unavailable"
          ],
          "title": "Aggregation Grain"
        },
        "additivity_state": {
          "type": "string",
          "enum": [
            "proven",
            "unavailable"
          ],
          "title": "Additivity State"
        },
        "additivity_proof": {
          "anyOf": [
            {
              "type": "string",
              "const": "distinct_selected_provider_accounts"
            },
            {
              "type": "null"
            }
          ],
          "title": "Additivity Proof"
        },
        "coverage_state": {
          "type": "string",
          "enum": [
            "complete",
            "incomplete",
            "ambiguous",
            "unavailable"
          ],
          "title": "Coverage State"
        },
        "expected_selection_count": {
          "anyOf": [
            {
              "type": "integer",
              "maximum": 9007199254740991.0,
              "minimum": 0.0
            },
            {
              "type": "null"
            }
          ],
          "title": "Expected Selection Count"
        },
        "observed_selection_count": {
          "anyOf": [
            {
              "type": "integer",
              "maximum": 9007199254740991.0,
              "minimum": 0.0
            },
            {
              "type": "null"
            }
          ],
          "title": "Observed Selection Count"
        },
        "headline_eligible": {
          "type": "boolean",
          "title": "Headline Eligible"
        },
        "spent_minor": {
          "anyOf": [
            {
              "type": "integer",
              "maximum": 9007199254740991.0,
              "minimum": 0.0
            },
            {
              "type": "null"
            }
          ],
          "title": "Spent Minor"
        },
        "planned_budget_minor": {
          "anyOf": [
            {
              "type": "integer",
              "maximum": 9007199254740991.0,
              "minimum": 0.0
            },
            {
              "type": "null"
            }
          ],
          "title": "Planned Budget Minor"
        },
        "utilization_bps": {
          "anyOf": [
            {
              "type": "integer",
              "maximum": 9007199254740991.0,
              "minimum": 0.0
            },
            {
              "type": "null"
            }
          ],
          "title": "Utilization Bps"
        },
        "comparability_state": {
          "type": "string",
          "enum": [
            "proven",
            "unavailable"
          ],
          "title": "Comparability State"
        },
        "comparability_proof": {
          "anyOf": [
            {
              "type": "string",
              "const": "same_tenant_provider_account_scope_utc_day_currency_exponent_planned_period"
            },
            {
              "type": "null"
            }
          ],
          "title": "Comparability Proof"
        },
        "confidence": {
          "type": "string",
          "enum": [
            "high",
            "medium",
            "low",
            "unavailable"
          ],
          "title": "Confidence"
        },
        "basis": {
          "type": "string",
          "const": "actual_ad_spend_observed",
          "title": "Basis",
          "default": "actual_ad_spend_observed"
        },
        "formula": {
          "type": "string",
          "const": "sum(spent_minor); utilization_bps = round_half_up(spent_minor * 10000 / planned_budget_minor)",
          "title": "Formula",
          "default": "sum(spent_minor); utilization_bps = round_half_up(spent_minor * 10000 / planned_budget_minor)"
        },
        "exclusions": {
          "items": {
            "type": "string",
            "enum": [
              "missing_budgets",
              "incompatible_scope_or_period",
              "different_currencies",
              "forecast_spend"
            ]
          },
          "type": "array",
          "title": "Exclusions"
        },
        "provenance": {
          "items": {
            "$ref": "#/$defs/ImpactProvenanceOut"
          },
          "type": "array",
          "title": "Provenance"
        },
        "freshness": {
          "$ref": "#/$defs/ImpactFreshnessOut"
        }
      },
      "type": "object",
      "required": [
        "state",
        "selection_state",
        "aggregation_grain",
        "additivity_state",
        "additivity_proof",
        "coverage_state",
        "headline_eligible",
        "spent_minor",
        "planned_budget_minor",
        "utilization_bps",
        "comparability_state",
        "comparability_proof",
        "confidence",
        "provenance",
        "freshness"
      ],
      "title": "AdBudgetBurnImpactOut"
    },
    "AttributedRevenueImpactOut": {
      "properties": {
        "state": {
          "type": "string",
          "enum": [
            "available",
            "unavailable"
          ],
          "title": "State"
        },
        "selection_state": {
          "type": "string",
          "enum": [
            "bound",
            "unavailable"
          ],
          "title": "Selection State"
        },
        "aggregation_grain": {
          "type": "string",
          "enum": [
            "selected_store_portfolio_utc_day",
            "unavailable"
          ],
          "title": "Aggregation Grain"
        },
        "additivity_state": {
          "type": "string",
          "enum": [
            "proven",
            "unavailable"
          ],
          "title": "Additivity State"
        },
        "additivity_proof": {
          "anyOf": [
            {
              "type": "string",
              "const": "single_selected_store"
            },
            {
              "type": "null"
            }
          ],
          "title": "Additivity Proof"
        },
        "coverage_state": {
          "type": "string",
          "enum": [
            "complete",
            "incomplete",
            "ambiguous",
            "unavailable"
          ],
          "title": "Coverage State"
        },
        "expected_selection_count": {
          "anyOf": [
            {
              "type": "integer",
              "maximum": 9007199254740991.0,
              "minimum": 0.0
            },
            {
              "type": "null"
            }
          ],
          "title": "Expected Selection Count"
        },
        "observed_selection_count": {
          "anyOf": [
            {
              "type": "integer",
              "maximum": 9007199254740991.0,
              "minimum": 0.0
            },
            {
              "type": "null"
            }
          ],
          "title": "Observed Selection Count"
        },
        "headline_eligible": {
          "type": "boolean",
          "title": "Headline Eligible"
        },
        "amount_minor": {
          "anyOf": [
            {
              "type": "integer",
              "maximum": 9007199254740991.0,
              "minimum": 0.0
            },
            {
              "type": "null"
            }
          ],
          "title": "Amount Minor"
        },
        "confidence": {
          "type": "string",
          "enum": [
            "high",
            "medium",
            "low",
            "unavailable"
          ],
          "title": "Confidence"
        },
        "basis": {
          "type": "string",
          "const": "gross_order_value_attributed",
          "title": "Basis",
          "default": "gross_order_value_attributed"
        },
        "formula": {
          "type": "string",
          "const": "sum(attributed_revenue_minor)",
          "title": "Formula",
          "default": "sum(attributed_revenue_minor)"
        },
        "exclusions": {
          "items": {
            "type": "string",
            "enum": [
              "refunds",
              "cost_of_goods",
              "payment_and_platform_fees",
              "ad_spend",
              "operating_expenses"
            ]
          },
          "type": "array",
          "title": "Exclusions"
        },
        "provenance": {
          "items": {
            "$ref": "#/$defs/ImpactProvenanceOut"
          },
          "type": "array",
          "title": "Provenance"
        },
        "freshness": {
          "$ref": "#/$defs/ImpactFreshnessOut"
        }
      },
      "type": "object",
      "required": [
        "state",
        "selection_state",
        "aggregation_grain",
        "additivity_state",
        "additivity_proof",
        "coverage_state",
        "headline_eligible",
        "amount_minor",
        "confidence",
        "provenance",
        "freshness"
      ],
      "title": "AttributedRevenueImpactOut"
    },
    "DailyCurrencyImpactOut": {
      "properties": {
        "currency": {
          "type": "string",
          "pattern": "^[A-Z]{3}$",
          "title": "Currency"
        },
        "currency_exponent": {
          "type": "integer",
          "maximum": 3.0,
          "minimum": 0.0,
          "title": "Currency Exponent"
        },
        "attributed_revenue": {
          "$ref": "#/$defs/AttributedRevenueImpactOut"
        },
        "verified_ad_savings": {
          "$ref": "#/$defs/VerifiedAdSavingsImpactOut"
        },
        "ad_budget_burn": {
          "$ref": "#/$defs/AdBudgetBurnImpactOut"
        }
      },
      "type": "object",
      "required": [
        "currency",
        "currency_exponent",
        "attributed_revenue",
        "verified_ad_savings",
        "ad_budget_burn"
      ],
      "title": "DailyCurrencyImpactOut"
    },
    "ImpactFreshnessOut": {
      "properties": {
        "state": {
          "type": "string",
          "enum": [
            "fresh",
            "stale",
            "unavailable"
          ],
          "title": "State"
        },
        "as_of": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "As Of"
        },
        "max_age_seconds": {
          "type": "integer",
          "const": 86400,
          "title": "Max Age Seconds",
          "default": 86400
        }
      },
      "type": "object",
      "required": [
        "state",
        "as_of"
      ],
      "title": "ImpactFreshnessOut"
    },
    "ImpactProvenanceOut": {
      "properties": {
        "source_system": {
          "type": "string",
          "minLength": 1,
          "pattern": ".*\\S.*",
          "title": "Source System"
        },
        "record_count": {
          "type": "integer",
          "maximum": 9007199254740991.0,
          "minimum": 1.0,
          "title": "Record Count"
        },
        "latest_source_observed_at": {
          "type": "string",
          "format": "date-time",
          "title": "Latest Source Observed At"
        },
        "latest_ingested_at": {
          "type": "string",
          "format": "date-time",
          "title": "Latest Ingested At"
        }
      },
      "type": "object",
      "required": [
        "source_system",
        "record_count",
        "latest_source_observed_at",
        "latest_ingested_at"
      ],
      "title": "ImpactProvenanceOut"
    },
    "VerifiedAdSavingsImpactOut": {
      "properties": {
        "state": {
          "type": "string",
          "enum": [
            "verified",
            "estimated",
            "unavailable"
          ],
          "title": "State"
        },
        "selection_state": {
          "type": "string",
          "enum": [
            "bound",
            "unavailable"
          ],
          "title": "Selection State"
        },
        "aggregation_grain": {
          "type": "string",
          "enum": [
            "observed_verified_savings_partition_utc_day",
            "observed_estimated_savings_scope_utc_day",
            "unavailable"
          ],
          "title": "Aggregation Grain"
        },
        "additivity_state": {
          "type": "string",
          "enum": [
            "proven",
            "unavailable"
          ],
          "title": "Additivity State"
        },
        "additivity_proof": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "single_observed_verified_partition",
                "single_observed_estimated_scope"
              ]
            },
            {
              "type": "null"
            }
          ],
          "title": "Additivity Proof"
        },
        "coverage_state": {
          "type": "string",
          "enum": [
            "complete",
            "unknown",
            "unavailable"
          ],
          "title": "Coverage State"
        },
        "coverage_scope": {
          "type": "string",
          "enum": [
            "selected_portfolio",
            "observed_subset",
            "unavailable"
          ],
          "title": "Coverage Scope"
        },
        "headline_eligible": {
          "type": "boolean",
          "title": "Headline Eligible"
        },
        "direction": {
          "type": "string",
          "enum": [
            "savings",
            "loss",
            "neutral",
            "unavailable"
          ],
          "title": "Direction"
        },
        "amount_minor": {
          "anyOf": [
            {
              "type": "integer",
              "maximum": 9007199254740991.0,
              "minimum": -9007199254740991.0
            },
            {
              "type": "null"
            }
          ],
          "title": "Amount Minor"
        },
        "estimated_amount_minor": {
          "anyOf": [
            {
              "type": "integer",
              "maximum": 9007199254740991.0,
              "minimum": -9007199254740991.0
            },
            {
              "type": "null"
            }
          ],
          "title": "Estimated Amount Minor"
        },
        "confidence": {
          "type": "string",
          "enum": [
            "high",
            "medium",
            "low",
            "unavailable"
          ],
          "title": "Confidence"
        },
        "basis": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "approved_applied_optimization_counterfactual",
                "connector_estimate"
              ]
            },
            {
              "type": "null"
            }
          ],
          "title": "Basis"
        },
        "formula": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "counterfactual_spend_minor - observed_spend_minor",
                "source_supplied_estimated_savings_minor"
              ]
            },
            {
              "type": "null"
            }
          ],
          "title": "Formula"
        },
        "exclusions": {
          "items": {
            "type": "string",
            "enum": [
              "estimated_measurements",
              "unapproved_optimizations",
              "unapplied_or_rolled_back_actions"
            ]
          },
          "type": "array",
          "title": "Exclusions"
        },
        "provenance": {
          "items": {
            "$ref": "#/$defs/ImpactProvenanceOut"
          },
          "type": "array",
          "title": "Provenance"
        },
        "freshness": {
          "$ref": "#/$defs/ImpactFreshnessOut"
        },
        "estimated_confidence": {
          "type": "string",
          "enum": [
            "high",
            "medium",
            "low",
            "unavailable"
          ],
          "title": "Estimated Confidence"
        },
        "estimated_provenance": {
          "items": {
            "$ref": "#/$defs/ImpactProvenanceOut"
          },
          "type": "array",
          "title": "Estimated Provenance"
        },
        "estimated_freshness": {
          "$ref": "#/$defs/ImpactFreshnessOut"
        }
      },
      "type": "object",
      "required": [
        "state",
        "selection_state",
        "aggregation_grain",
        "additivity_state",
        "additivity_proof",
        "coverage_state",
        "coverage_scope",
        "headline_eligible",
        "direction",
        "amount_minor",
        "estimated_amount_minor",
        "confidence",
        "basis",
        "formula",
        "provenance",
        "freshness",
        "estimated_confidence",
        "estimated_provenance",
        "estimated_freshness"
      ],
      "title": "VerifiedAdSavingsImpactOut"
    }
  }
}