{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://developers.youareaccountable.com/schemas/plan_details.created.json",
  "title": "PlanDetailsCreated",
  "description": "A member is enrolled and their plan details are set. Sends the full list.",
  "type": "object",
  "required": [
    "event_type",
    "data"
  ],
  "properties": {
    "event_type": {
      "const": "plan_details.created"
    },
    "data": {
      "type": "object",
      "required": [
        "medical_record_number",
        "plan_details",
        "updated_at"
      ],
      "properties": {
        "medical_record_number": {
          "type": "string",
          "format": "uuid",
          "description": "The member's medical record number. Always a UUID. Use it to match the event to your own record."
        },
        "plan_name": {
          "type": [
            "string",
            "null"
          ],
          "description": "The member's Accountable plan. Can be null or left out."
        },
        "plan_details": {
          "type": "array",
          "description": "Every service on the member's plan. Empty when the plan has none. New values can be added.",
          "items": {
            "type": "string"
          }
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "description": "When this request was built. A retry has a new value."
        }
      }
    }
  }
}
