{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/zywave/json-schema/zywave-contribution-records-with-strategy-schema.json",
  "title": "ContributionRecordsWithStrategy",
  "description": "The contribution strategy and records for the policy.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/zywave-contributions-api-openapi.yml#/components/schemas/ContributionRecordsWithStrategy",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "contributionStrategy": {
      "description": "The contribution strategy.",
      "oneOf": [
        {
          "$ref": "#/$defs/ContributionStrategyInfo"
        }
      ]
    },
    "contributionRecords": {
      "type": "array",
      "description": "The contribution records.",
      "items": {
        "$ref": "#/$defs/ContributionRecord"
      }
    }
  },
  "$defs": {
    "ContributionCalculationStrategyOption": {
      "type": "string",
      "description": "",
      "x-enumNames": [
        "EmployerPercent",
        "EmployeePercent",
        "EmployerDollars",
        "EmployeeDollars"
      ],
      "enum": [
        "EmployerPercent",
        "EmployeePercent",
        "EmployerDollars",
        "EmployeeDollars"
      ]
    },
    "ContributionRecord": {
      "type": "object",
      "description": "The contribution record data returned to the caller.",
      "additionalProperties": false,
      "properties": {
        "contributionTier": {
          "description": "The contribution tier.",
          "default": "Employee",
          "oneOf": [
            {
              "$ref": "#/$defs/ContributionTierOption"
            }
          ]
        },
        "rateTotal": {
          "type": "number",
          "description": "The monthly total for rate tier (Employer $ + Employee $).",
          "format": "decimal",
          "pattern": "^\\d+\\.?\\d{0,2}$"
        },
        "strategyAmount": {
          "type": "number",
          "description": "The percent or dollar amount used in calculations. E.g. 30% (a percentage strategy) or $541.32 (a dollars strategy).",
          "format": "decimal",
          "pattern": "^\\d+\\.?\\d{0,2}$"
        },
        "employeeDollars": {
          "type": "number",
          "description": "Computed. The monthly dollar amount paid by the employee.",
          "format": "decimal",
          "pattern": "^\\d+\\.?\\d{0,2}$"
        },
        "employerDollars": {
          "type": "number",
          "description": "Computed. The monthly dollar amount paid by the employer.",
          "format": "decimal",
          "pattern": "^\\d+\\.?\\d{0,2}$"
        },
        "employeePercent": {
          "type": "number",
          "description": "Computed. The monthly percent contribution paid by the employee.",
          "format": "decimal",
          "pattern": "^\\d+\\.?\\d{0,2}$"
        },
        "employerPercent": {
          "type": "number",
          "description": "Computed. The monthly percent contribution paid by the employer.",
          "format": "decimal",
          "pattern": "^\\d+\\.?\\d{0,2}$"
        }
      }
    },
    "ContributionRoundingStrategyOption": {
      "type": "string",
      "description": "",
      "x-enumNames": [
        "RoundDownEmployer",
        "RoundDownEmployee"
      ],
      "enum": [
        "RoundDownEmployer",
        "RoundDownEmployee"
      ]
    },
    "ContributionStrategyInfo": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "calculationStrategy",
        "roundingStrategy"
      ],
      "properties": {
        "calculationStrategy": {
          "description": "The strategy used for calculating monthly contributions.",
          "default": "EmployerDollars",
          "oneOf": [
            {
              "$ref": "#/$defs/ContributionCalculationStrategyOption"
            }
          ]
        },
        "roundingStrategy": {
          "description": "The strategy used for rounding.",
          "default": "RoundDownEmployee",
          "oneOf": [
            {
              "$ref": "#/$defs/ContributionRoundingStrategyOption"
            }
          ]
        }
      }
    },
    "ContributionTierOption": {
      "type": "string",
      "description": "",
      "x-enumNames": [
        "Employee",
        "EmployeeSpouse",
        "EmployeeChildren",
        "EmployeeFamily",
        "EmployeeChild",
        "EmployeeSpouseChild",
        "EmployeeTwoChildren",
        "EmployeeThreeChildren"
      ],
      "enum": [
        "Employee",
        "EmployeeSpouse",
        "EmployeeChildren",
        "EmployeeFamily",
        "EmployeeChild",
        "EmployeeSpouseChild",
        "EmployeeTwoChildren",
        "EmployeeThreeChildren"
      ]
    }
  }
}