{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "http://cowhills.nl/RosPriceInfo-1-0/TreazurePromoInfo.schema.json",
  "title": "TreazurePromoInfo",
  "type": "object",
  "properties": {
    "ConditionalPromotions": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "ActivePeriod": {
            "type": "object",
            "properties": {
              "value": { "type": "string" },
              "Days": { "type": "string" },
              "StartTime": { "type": "string" },
              "EndTime": { "type": "string" }
            },
            "required": ["Days", "StartTime", "EndTime"]
          },
          "Description": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "Value": { "type": "string" },
                "LanCode": { "type": "string" }
              },
              "required": ["Value", "LanCode"]
            }
          },
          "TreazureInfo": {
            "type": "object",
            "properties": {
              "Sticker": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "StickerTitle": { "type": "string" },
                    "StickerText": { "type": "string" },
                    "LanCode": { "type": "string" }
                  },
                  "required": ["StickerTitle", "StickerText"]
                }
              },
              "LongTerm": { "type": "boolean" }
            }
          },
          "FilterGroups": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "Article": {
                  "type": "array",
                  "items": { "$ref": "#/$defs/FilterAttributes" }
                },
                "Group": {
                  "type": "array",
                  "items": { "$ref": "#/$defs/FilterAttributes" }
                },
                "CouponDefinition": {
                  "type": "array",
                  "items": { "$ref": "#/$defs/FilterAttributesCoupon" }
                },
                "TransactionAttribute": {
                  "type": "array",
                  "items": {
                    "$ref": "#/$defs/FilterAttributesTransactionAttribute"
                  }
                },
                "Id": { "type": "string" }
              },
              "required": ["Id"]
            }
          },
          "AssignedStores": {
            "type": "object",
            "properties": {
              "Store": {
                "type": "array",
                "items": { "$ref": "#/$defs/StoreAttributes" }
              }
            }
          },
          "LayerInfo": { "$ref": "#/$defs/LayerInfo" },
          "Code": { "type": "string" },
          "Type": {
            "type": "string",
            "enum": [
              "FinancialPromotion",
              "ShippingCosts",
              "TypeValue",
              "IssueCoupon",
              "Loyalty",
              "DiscountVoucher",
              "Notification"
            ]
          },
          "From": { "type": "string", "format": "date-time" },
          "To": { "type": "string", "format": "date-time" },
          "CardHolder": { "type": "boolean" }
        },
        "required": [
          "Code",
          "Type",
          "From",
          "To",
          "Description",
          "FilterGroups"
        ]
      }
    },
    "ReferenceDate": { "type": "string", "format": "date-time" },
    "ChainId": { "type": "string" }
  },
  "required": ["ConditionalPromotions"],
  "$defs": {
    "FilterAttributes": {
      "type": "object",
      "properties": {
        "Attribute": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "Type": { "type": "string" },
              "Value": { "type": "string" }
            },
            "required": ["Type", "Value"]
          }
        },
        "Id": { "type": "string" },
        "ColorId": { "type": "string" },
        "SizeId": { "type": "string" },
        "PluRule": {
          "type": "string",
          "enum": ["Required", "NotAllowed"]
        },
        "Exclude": { "type": "boolean" }
      },
      "required": ["Id"]
    },
    "FilterAttributesCoupon": {
      "type": "object",
      "properties": {
        "Attribute": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "Type": { "type": "string" },
              "Value": { "type": "string" }
            },
            "required": ["Type", "Value"]
          }
        },
        "Id": { "type": "string" },
        "Type": {
          "type": "string",
          "enum": ["Generic", "Unique"]
        }
      },
      "required": ["Id"]
    },
    "FilterAttributesTransactionAttribute": {
      "type": "object",
      "properties": {
        "Attribute": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "Type": { "type": "string" },
              "Value": { "type": "string" }
            },
            "required": ["Type", "Value"]
          }
        },
        "Id": { "type": "string" }
      },
      "required": ["Id"]
    },
    "StoreAttributes": {
      "type": "object",
      "properties": {
        "Attribute": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "Type": { "type": "string" },
              "Value": { "type": "string" }
            },
            "required": ["Type", "Value"]
          }
        },
        "Id": { "type": "string" }
      },
      "required": ["Id"]
    },
    "LayerInfo": {
      "type": "object",
      "properties": {
        "Name": { "type": "string" },
        "Description": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "Value": { "type": "string" },
              "LanCode": { "type": "string" }
            },
            "required": ["Value", "LanCode"]
          }
        },
        "Order": { "type": "integer" }
      },
      "required": ["Name", "Description", "Order"]
    }
  }
}
