{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/craaft-io/json-schema/craaft-io-invitation-schema.json",
  "title": "Invitation",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/craaft-io-invitations-api-openapi.yml#/components/schemas/Invitation",
  "type": "object",
  "required": [
    "id",
    "email",
    "role",
    "invitedBy",
    "invitedByName",
    "createdAt",
    "expiresAt",
    "boardGrants"
  ],
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "email": {
      "type": "string",
      "format": "email"
    },
    "role": {
      "type": "string",
      "enum": [
        "admin",
        "member"
      ]
    },
    "invitedBy": {
      "type": "string",
      "format": "uuid"
    },
    "invitedByName": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "expiresAt": {
      "type": "string",
      "format": "date-time"
    },
    "boardGrants": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/InvitationGrant"
      }
    }
  },
  "$defs": {
    "InvitationGrant": {
      "type": "object",
      "required": [
        "projectId",
        "name",
        "role"
      ],
      "properties": {
        "projectId": {
          "type": "string",
          "format": "uuid"
        },
        "name": {
          "type": "string",
          "maxLength": 200
        },
        "role": {
          "type": "string",
          "enum": [
            "admin",
            "contributor"
          ]
        }
      }
    }
  }
}