{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/medianfi-com/json-schema/medianfi-com-save-private-tax-plan-scenario-input-schema.json",
  "title": "SavePrivateTaxPlanScenarioInput",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/medianfi-com-companies-api-openapi.yml#/components/schemas/SavePrivateTaxPlanScenarioInput",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "releaseHash",
    "expectedRevision",
    "state"
  ],
  "properties": {
    "releaseHash": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    },
    "expectedRevision": {
      "type": "integer",
      "minimum": 0,
      "maximum": 2147483646
    },
    "state": {
      "$ref": "#/$defs/PrivateTaxPlanScenario"
    }
  },
  "$defs": {
    "PrivateTaxPlanScenario": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "scenarioId",
        "inputs",
        "payments",
        "withholding"
      ],
      "properties": {
        "scenarioId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 150
        },
        "inputs": {
          "type": "object",
          "propertyNames": {
            "maxLength": 100
          },
          "additionalProperties": {
            "type": "number",
            "minimum": -1000000000,
            "maximum": 1000000000
          }
        },
        "health": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "year",
            "householdSize",
            "otherMagi",
            "months"
          ],
          "properties": {
            "year": {
              "type": "integer",
              "minimum": 2026,
              "maximum": 2027
            },
            "householdSize": {
              "type": "integer",
              "minimum": 1,
              "maximum": 12
            },
            "otherMagi": {
              "type": "number",
              "minimum": 0,
              "maximum": 1000000000
            },
            "months": {
              "type": "array",
              "minItems": 12,
              "maxItems": 12,
              "items": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "premium",
                  "benchmark",
                  "advance",
                  "eligible",
                  "deductible"
                ],
                "properties": {
                  "premium": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1000000
                  },
                  "benchmark": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1000000
                  },
                  "advance": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1000000
                  },
                  "eligible": {
                    "type": "boolean"
                  },
                  "deductible": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "debt": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "year",
            "discharged",
            "gross",
            "liabilities",
            "assets"
          ],
          "properties": {
            "year": {
              "type": "integer",
              "minimum": 2020,
              "maximum": 2100
            },
            "discharged": {
              "type": "boolean"
            },
            "gross": {
              "type": "number",
              "minimum": 0,
              "maximum": 1000000000
            },
            "liabilities": {
              "type": "number",
              "minimum": 0,
              "maximum": 1000000000
            },
            "assets": {
              "type": "number",
              "minimum": 0,
              "maximum": 1000000000
            }
          }
        },
        "funding": {
          "type": "array",
          "maxItems": 100,
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "year",
              "paidDate",
              "type",
              "amount"
            ],
            "properties": {
              "year": {
                "type": "integer",
                "minimum": 2020,
                "maximum": 2100
              },
              "paidDate": {
                "type": "string",
                "format": "date",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "type": {
                "type": "string",
                "enum": [
                  "employee",
                  "employer",
                  "rollover",
                  "unclassified"
                ]
              },
              "amount": {
                "type": "number",
                "minimum": 0,
                "maximum": 1000000000
              }
            }
          }
        },
        "payments": {
          "type": "array",
          "maxItems": 100,
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "agency",
              "year",
              "date",
              "amountCents",
              "status"
            ],
            "properties": {
              "agency": {
                "type": "string",
                "enum": [
                  "federal-personal",
                  "state-personal",
                  "nyc-ubt",
                  "nyc-gct",
                  "nys-ptet",
                  "nyc-ptet"
                ]
              },
              "year": {
                "type": "integer",
                "minimum": 2020,
                "maximum": 2100
              },
              "date": {
                "type": "string",
                "format": "date",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "amountCents": {
                "type": "integer",
                "minimum": 0,
                "maximum": 100000000000
              },
              "status": {
                "type": "string",
                "enum": [
                  "paid",
                  "planned"
                ]
              }
            }
          }
        },
        "withholding": {
          "type": "object",
          "propertyNames": {
            "pattern": "^20\\d{2}$"
          },
          "additionalProperties": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "mode",
              "federalCents",
              "stateCents",
              "wagesPaidCents",
              "federalPaidCents"
            ],
            "properties": {
              "mode": {
                "type": "string",
                "enum": [
                  "salary-estimate",
                  "entered-total",
                  "actual-and-remaining"
                ]
              },
              "federalCents": {
                "type": "integer",
                "minimum": 0,
                "maximum": 100000000000
              },
              "stateCents": {
                "type": "integer",
                "minimum": 0,
                "maximum": 100000000000
              },
              "wagesPaidCents": {
                "type": "integer",
                "minimum": 0,
                "maximum": 100000000000
              },
              "federalPaidCents": {
                "type": "integer",
                "minimum": 0,
                "maximum": 100000000000
              }
            }
          }
        }
      }
    }
  }
}