{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "FOMO canonical public profile v1",
  "description": "Public projection only. No private identity, email, payment IDs or verification evidence. canonicalPath is relative to the approved deployment origin.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schemaVersion",
    "id",
    "displayName",
    "kind",
    "crew",
    "category",
    "summary",
    "offer",
    "links",
    "logo",
    "canonicalPath",
    "machinePath",
    "listingStatus",
    "publicationConsent",
    "paymentStatus",
    "socialStatus",
    "agentVerification",
    "sponsorPlacement"
  ],
  "properties": {
    "schemaVersion": {
      "const": "1.0"
    },
    "id": {
      "type": "string",
      "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
    },
    "displayName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80
    },
    "kind": {
      "enum": [
        "human",
        "agent",
        "organization"
      ]
    },
    "crew": {
      "enum": [
        "paid",
        "social",
        "agents",
        "none"
      ]
    },
    "category": {
      "type": "string"
    },
    "summary": {
      "type": "string",
      "maxLength": 500
    },
    "offer": {
      "type": "string",
      "maxLength": 500
    },
    "links": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uri",
        "pattern": "^https://"
      }
    },
    "logo": {
      "type": [
        "string",
        "null"
      ]
    },
    "canonicalPath": {
      "type": "string",
      "pattern": "^directory/profiles/[a-z0-9-]+\\.html$"
    },
    "machinePath": {
      "type": "string",
      "pattern": "^api/v1/profiles/[a-z0-9-]+\\.json$"
    },
    "listingStatus": {
      "enum": [
        "demo",
        "draft",
        "published",
        "withdrawn"
      ]
    },
    "publicationConsent": {
      "type": "boolean"
    },
    "paymentStatus": {
      "enum": [
        "none",
        "pending",
        "confirmed",
        "refunded"
      ]
    },
    "socialStatus": {
      "enum": [
        "unverified",
        "verified",
        "revoked"
      ]
    },
    "agentVerification": {
      "enum": [
        "unverified",
        "verified",
        "revoked"
      ]
    },
    "sponsorPlacement": {
      "type": "boolean"
    },
    "demoPeriod": {
      "enum": [
        "recent",
        "older"
      ]
    }
  },
  "allOf": [
    {
      "if": {
        "properties": {
          "listingStatus": {
            "const": "demo"
          }
        }
      },
      "then": {
        "properties": {
          "paymentStatus": {
            "const": "none"
          },
          "socialStatus": {
            "const": "unverified"
          },
          "agentVerification": {
            "const": "unverified"
          },
          "publicationConsent": {
            "const": false
          },
          "sponsorPlacement": {
            "const": false
          }
        }
      }
    },
    {
      "if": {
        "properties": {
          "listingStatus": {
            "const": "published"
          }
        }
      },
      "then": {
        "properties": {
          "publicationConsent": {
            "const": true
          }
        }
      }
    }
  ]
}
