{
  "rules": [
    {
      "name": "no-extra-ace-armless-when-chaise-connected",
      "menuId": "19753",
      "conditions": {
        "all": [
          {
            "fact": "connectedTo",
            "operator": "equal",
            "value": true,
            "params": {
              "productId": "RAY_Ace_LAF_Pwr_Chaise_SB",
              "toProductId": "RAY_Ace_Armless_Chair_SB",
              "connectionType": "sibling"
            }
          }
        ]
      },
      "event": {
        "type": "block",
        "params": {
          "productId": "RAY_Ace_Armless_Chair_SB",
          "i18nKey": "rule.noExtraAceArmless",
          "i18nNamespace": "custom",
          "message": "Cannot add another Ace Armless Chair when LAF Power Chaise is already connected to one"
        }
      }
    },
    {
      "name": "ottoman-in-scene-warning",
      "conditions": {
        "all": [
          {
            "fact": "inScene",
            "operator": "equal",
            "value": true,
            "params": { "productId": "RAY_Carter_Cocktail_Ottoman_SB" }
          }
        ]
      },
      "event": {
        "type": "warn",
        "params": {
          "i18nKey": "rule.ottomanInScene",
          "i18nNamespace": "custom",
          "message": "Cocktail Ottoman is in the scene — verify placement clearance"
        }
      }
    },
    {
      "name": "max-one-corner",
      "conditions": {
        "all": [
          {
            "fact": "productQty",
            "operator": "greaterThanInclusive",
            "value": 1,
            "params": { "productId": "RAY_Artemis_II_Corner_SB" }
          }
        ]
      },
      "event": {
        "type": "block",
        "params": {
          "productId": "RAY_Artemis_II_Corner_SB",
          "i18nKey": "rule.maxOneCorner",
          "i18nNamespace": "custom",
          "message": "Only one Corner piece is allowed per configuration"
        }
      }
    },
    {
      "name": "no-laf-with-raf-by-sku",
      "conditions": {
        "all": [
          {
            "fact": "hasSku",
            "operator": "equal",
            "value": true,
            "params": { "sku": "219095494" }
          }
        ]
      },
      "event": {
        "type": "block",
        "params": {
          "productId": "RAY_Ace_LAF_Pwr_Chaise_SB",
          "i18nKey": "rule.noLafWithRaf",
          "i18nNamespace": "custom",
          "message": "Cannot add LAF Power Chaise when RAF Chaise (SKU 219095494) is in scene"
        }
      }
    },
    {
      "name": "gypsy-vintage-corner-blocks-alston",
      "conditions": {
        "all": [
          {
            "fact": "hasOption",
            "operator": "equal",
            "value": true,
            "params": {
              "productId": "RAY_Artemis_II_Corner_SB",
              "stepId": "b0ca8e9b-af95-4420-aa9a-edb938b31a4e",
              "optionId": "RAY_ARTEMIS_UPH_GYPSYVINTAGE"
            }
          }
        ]
      },
      "event": {
        "type": "block",
        "params": {
          "productId": "RAY_Alston_Armless_Loveseat_SB",
          "i18nKey": "rule.gypsyVintageBlocksAlston",
          "i18nNamespace": "custom",
          "message": "Alston Armless Loveseat is not available when Artemis Corner is in Gypsy Vintage"
        }
      }
    },
    {
      "name": "large-config-with-raf-warning",
      "conditions": {
        "all": [
          {
            "fact": "inScene",
            "operator": "equal",
            "value": true,
            "params": { "productId": "RAY_Bayside_RAF_Chaise_SB" }
          },
          {
            "fact": "productQty",
            "operator": "greaterThanInclusive",
            "value": 1,
            "params": { "productId": "RAY_Artemis_II_Armless_Chair_SB" }
          }
        ]
      },
      "event": {
        "type": "warn",
        "params": {
          "i18nKey": "rule.largeConfigWithRaf",
          "i18nNamespace": "custom",
          "message": "Large configuration with RAF Chaise — verify overall dimensions"
        }
      }
    },
    {
      "name": "no-alston-with-any-armless",
      "conditions": {
        "any": [
          {
            "fact": "inScene",
            "operator": "equal",
            "value": true,
            "params": { "productId": "RAY_Ace_Armless_Chair_SB" }
          },
          {
            "fact": "inScene",
            "operator": "equal",
            "value": true,
            "params": { "productId": "RAY_Artemis_II_Armless_Chair_SB" }
          }
        ]
      },
      "event": {
        "type": "block",
        "params": {
          "productId": "RAY_Alston_Armless_Loveseat_SB",
          "i18nKey": "rule.noAlstonWithArmless",
          "i18nNamespace": "custom",
          "message": "Alston Loveseat cannot be added when an armless chair is already in the scene"
        }
      }
    },
    {
      "name": "artemis-armless-requires-corner",
      "menuId": "22632",
      "conditions": {
        "not": {
          "fact": "inScene",
          "operator": "equal",
          "value": true,
          "params": { "productId": "RAY_Artemis_II_Corner_SB" }
        }
      },
      "event": {
        "type": "block",
        "params": {
          "productId": "RAY_Artemis_II_Armless_Chair_SB",
          "i18nKey": "rule.artemisRequiresCorner",
          "i18nNamespace": "custom",
          "message": "Artemis Armless Chair requires a Corner piece in the scene"
        }
      }
    },
    {
      "name": "max-chain-length-right",
      "conditions": {
        "all": [
          {
            "fact": "productQty",
            "operator": "greaterThanInclusive",
            "value": 1,
            "params": { "productId": "RAY_Ace_Armless_Chair_SB" }
          },
          {
            "fact": "productQty",
            "operator": "greaterThanInclusive",
            "value": 1,
            "params": { "productId": "RAY_Bayside_RAF_Chaise_SB" }
          }
        ]
      },
      "event": {
        "type": "block",
        "params": {
          "connectorType": "sectional.middle.right",
          "i18nKey": "rule.maxChainRight",
          "i18nNamespace": "custom",
          "message": "Cannot extend the right side of the chain further"
        }
      }
    },
    {
      "name": "ottoman-blocks-alston-sku",
      "conditions": {
        "all": [
          {
            "fact": "inScene",
            "operator": "equal",
            "value": true,
            "params": { "productId": "RAY_Carter_Cocktail_Ottoman_SB" }
          }
        ]
      },
      "event": {
        "type": "block",
        "params": {
          "sku": "223046221",
          "i18nKey": "rule.ottomanBlocksAlston",
          "i18nNamespace": "custom",
          "message": "Alston Loveseat (SKU 223046221) not available when Ottoman is in scene"
        }
      }
    }
  ]
}
