{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/lassare-com/json-schema/lassare-com-project-settings-schema.json",
  "title": "ProjectSettings",
  "description": "Project-level configuration settings.\n\nAllows projects to override company-level defaults for:\n- Notification channels\n- Escalation policies\n- Timezone preferences",
  "x-generated": "2026-11-15",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/lassare-com-openapi.json#/components/schemas/ProjectSettings",
  "properties": {
    "projectId": {
      "type": "string",
      "title": "Projectid",
      "description": "Unique project identifier"
    },
    "companyId": {
      "type": "string",
      "title": "Companyid",
      "description": "Company that owns this project (for multi-tenancy)"
    },
    "notificationChannels": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Notificationchannels",
      "description": "Project-specific notification channels (overrides company defaults). Example: ['slack', 'email']"
    },
    "escalationPolicy": {
      "anyOf": [
        {
          "$ref": "#/$defs/EscalationPolicy"
        },
        {
          "type": "null"
        }
      ],
      "description": "Project-specific escalation policy (overrides company default). Includes secondary_approver and urgency_overrides (FR-012)"
    },
    "timezone": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Timezone",
      "description": "Project-specific IANA timezone (overrides company default). Example: 'Europe/Rome', 'America/New_York'"
    },
    "createdAt": {
      "type": "string",
      "title": "Createdat",
      "description": "ISO 8601 timestamp of settings creation"
    },
    "updatedAt": {
      "type": "string",
      "title": "Updatedat",
      "description": "ISO 8601 timestamp of last update"
    },
    "createdBy": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Createdby",
      "description": "User ID who created these settings"
    },
    "updatedBy": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Updatedby",
      "description": "User ID who last updated these settings"
    }
  },
  "type": "object",
  "required": [
    "projectId",
    "companyId",
    "createdAt",
    "updatedAt"
  ],
  "$defs": {
    "EscalationPolicy": {
      "properties": {
        "secondaryApprover": {
          "anyOf": [
            {
              "$ref": "#/$defs/SecondaryApprover"
            },
            {
              "type": "null"
            }
          ],
          "description": "Default secondary approver for escalations"
        },
        "urgencyOverrides": {
          "anyOf": [
            {
              "additionalProperties": {
                "$ref": "#/$defs/UrgencyTimingProfile"
              },
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Urgencyoverrides",
          "description": "Custom timing profiles for urgency levels (overrides system defaults)"
        }
      },
      "type": "object",
      "title": "EscalationPolicy",
      "description": "Escalation policy configuration.\n\nDefines:\n- secondary_approver: Who to escalate to when primary approvers don't respond\n- urgency_overrides: Custom timing profiles for urgency levels\n\nUsed in CompanySettings and ProjectSettings with precedence:\n1. Request-level fallback_approver (highest)\n2. ProjectSettings.escalation_policy\n3. CompanySettings.escalation_policy\n4. System defaults (lowest)"
    },
    "SecondaryApprover": {
      "properties": {
        "approverType": {
          "allOf": [
            {
              "$ref": "#/$defs/SecondaryApproverType"
            }
          ],
          "description": "Type of secondary approver"
        },
        "approverValue": {
          "type": "string",
          "title": "Approvervalue",
          "description": "Approver identifier (email, channel ID, or user ID)"
        }
      },
      "type": "object",
      "required": [
        "approverType",
        "approverValue"
      ],
      "title": "SecondaryApprover",
      "description": "Secondary approver configuration.\n\nFormat: type:value\n- email:admin@company.com\n- slack:C1234567890 (channel)\n- slack_user:U1234567890 (DM)"
    },
    "SecondaryApproverType": {
      "type": "string",
      "enum": [
        "email",
        "slack",
        "slack_user",
        "webhook"
      ],
      "title": "SecondaryApproverType",
      "description": "Secondary approver target types."
    },
    "UrgencyTimingProfile": {
      "properties": {
        "reminderMinutes": {
          "type": "integer",
          "title": "Reminderminutes",
          "description": "Minutes until reminder notification (from T=0)"
        },
        "escalationMinutes": {
          "type": "integer",
          "title": "Escalationminutes",
          "description": "Minutes until escalation to secondary approver (from T=0)"
        },
        "expiryMinutes": {
          "type": "integer",
          "title": "Expiryminutes",
          "description": "Minutes until request expires (from T=0)"
        }
      },
      "type": "object",
      "required": [
        "reminderMinutes",
        "escalationMinutes",
        "expiryMinutes"
      ],
      "title": "UrgencyTimingProfile",
      "description": "Timing configuration for a specific urgency level.\n\nDefines reminder_minutes, escalation_minutes, and expiry_minutes\nfrom initial notification time (T=0)."
    }
  }
}