{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "A multi-party trade chain.",
      "key": "tid",
      "record": {
        "properties": {
          "chainOrder": {
            "knownValues": [
              "clockwise",
              "anticlockwise"
            ],
            "type": "string"
          },
          "completedAt": {
            "format": "datetime",
            "type": "string"
          },
          "createdAt": {
            "format": "datetime",
            "type": "string"
          },
          "organiserDid": {
            "format": "did",
            "type": "string"
          },
          "organiserName": {
            "type": "string"
          },
          "participantDids": {
            "items": {
              "format": "did",
              "type": "string"
            },
            "type": "array"
          },
          "participantNames": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "receiptConfirmed": {
            "items": {
              "type": "boolean"
            },
            "type": "array"
          },
          "shippingConfirmed": {
            "items": {
              "type": "boolean"
            },
            "type": "array"
          },
          "shipstoDids": {
            "items": {
              "format": "did",
              "type": "string"
            },
            "type": "array"
          },
          "status": {
            "knownValues": [
              "proposed",
              "accepted",
              "in_transit",
              "completed",
              "cancelled"
            ],
            "type": "string"
          },
          "totalValue": {
            "type": "number"
          },
          "tradeListingUris": {
            "items": {
              "format": "at-uri",
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "participantDids",
          "chainOrder",
          "status",
          "totalValue",
          "createdAt"
        ],
        "type": "object"
      },
      "type": "record"
    }
  },
  "description": "A multi-party trade chain (3-5 participants shipping cards in sequence), mirrored to AT Protocol as a real org.swappulse.tradeChain record so chains are portable and verifiable across instances.",
  "id": "org.swappulse.tradeChain",
  "lexicon": 1,
  "revision": 1
}
