{
  "format": "pricekit-template",
  "schemaVersion": "1.0",
  "engineVersion": "1",
  "createdWithVersion": "1.0.0",
  "template": {
    "templateId": "4ae3e58c-ffe1-4df8-9c8e-fcc36f5a7238",
    "templateVersion": "1.0"
  },
  "calculator": {
    "name": "طباعة ولوحات إعلانية",
    "description": "سعر المطبوعات حسب النوع والكمية، مع خيار التصميم.",
    "currency": "USD",
    "calculatorVersion": 1,
    "moneyDecimals": 2,
    "allowNegativeTotal": false,
    "fields": [
      {
        "key": "product",
        "label": "نوع المطبوعة",
        "type": "singleChoice",
        "required": true,
        "options": [
          {
            "key": "option_1",
            "label": "بطاقة أعمال"
          },
          {
            "key": "a5",
            "label": "فلاير A5"
          },
          {
            "key": "a4",
            "label": "فلاير A4"
          },
          {
            "key": "option_4",
            "label": "ستيكر"
          },
          {
            "key": "option_5",
            "label": "رول أب (ستاند إعلاني)"
          },
          {
            "key": "option_6",
            "label": "لوحة فليكس للمتر المربع"
          }
        ],
        "visibleByDefault": true,
        "enabledByDefault": true,
        "customerVisible": true
      },
      {
        "key": "quantity",
        "label": "الكمية",
        "type": "number",
        "required": true,
        "defaultValue": {
          "type": "number",
          "value": 500
        },
        "constraints": {
          "min": 1,
          "max": 100000
        },
        "unit": "قطعة",
        "visibleByDefault": true,
        "enabledByDefault": true,
        "customerVisible": true
      },
      {
        "key": "both_sides",
        "label": "طباعة على الوجهين",
        "type": "boolean",
        "required": false,
        "defaultValue": {
          "type": "boolean",
          "value": false
        },
        "visibleByDefault": true,
        "enabledByDefault": true,
        "customerVisible": true
      },
      {
        "key": "design",
        "label": "تصميم المطبوعة",
        "type": "boolean",
        "required": false,
        "defaultValue": {
          "type": "boolean",
          "value": false
        },
        "visibleByDefault": true,
        "enabledByDefault": true,
        "customerVisible": true
      }
    ],
    "rules": [
      {
        "key": "when_product_option_1",
        "name": "نوع المطبوعة: بطاقة أعمال",
        "enabled": true,
        "when": {
          "mode": "all",
          "items": [
            {
              "type": "condition",
              "subject": {
                "kind": "field",
                "key": "product"
              },
              "operator": "equals",
              "operand": {
                "type": "choice",
                "option": "option_1"
              }
            }
          ]
        },
        "then": [
          {
            "action": "activateComponent",
            "target": "product_option_1"
          }
        ]
      },
      {
        "key": "when_product_a5",
        "name": "نوع المطبوعة: فلاير A5",
        "enabled": true,
        "when": {
          "mode": "all",
          "items": [
            {
              "type": "condition",
              "subject": {
                "kind": "field",
                "key": "product"
              },
              "operator": "equals",
              "operand": {
                "type": "choice",
                "option": "a5"
              }
            }
          ]
        },
        "then": [
          {
            "action": "activateComponent",
            "target": "product_a5"
          }
        ]
      },
      {
        "key": "when_product_a4",
        "name": "نوع المطبوعة: فلاير A4",
        "enabled": true,
        "when": {
          "mode": "all",
          "items": [
            {
              "type": "condition",
              "subject": {
                "kind": "field",
                "key": "product"
              },
              "operator": "equals",
              "operand": {
                "type": "choice",
                "option": "a4"
              }
            }
          ]
        },
        "then": [
          {
            "action": "activateComponent",
            "target": "product_a4"
          }
        ]
      },
      {
        "key": "when_product_option_4",
        "name": "نوع المطبوعة: ستيكر",
        "enabled": true,
        "when": {
          "mode": "all",
          "items": [
            {
              "type": "condition",
              "subject": {
                "kind": "field",
                "key": "product"
              },
              "operator": "equals",
              "operand": {
                "type": "choice",
                "option": "option_4"
              }
            }
          ]
        },
        "then": [
          {
            "action": "activateComponent",
            "target": "product_option_4"
          }
        ]
      },
      {
        "key": "when_product_option_5",
        "name": "نوع المطبوعة: رول أب (ستاند إعلاني)",
        "enabled": true,
        "when": {
          "mode": "all",
          "items": [
            {
              "type": "condition",
              "subject": {
                "kind": "field",
                "key": "product"
              },
              "operator": "equals",
              "operand": {
                "type": "choice",
                "option": "option_5"
              }
            }
          ]
        },
        "then": [
          {
            "action": "activateComponent",
            "target": "product_option_5"
          }
        ]
      },
      {
        "key": "when_product_option_6",
        "name": "نوع المطبوعة: لوحة فليكس للمتر المربع",
        "enabled": true,
        "when": {
          "mode": "all",
          "items": [
            {
              "type": "condition",
              "subject": {
                "kind": "field",
                "key": "product"
              },
              "operator": "equals",
              "operand": {
                "type": "choice",
                "option": "option_6"
              }
            }
          ]
        },
        "then": [
          {
            "action": "activateComponent",
            "target": "product_option_6"
          }
        ]
      },
      {
        "key": "when_both_sides",
        "name": "طباعة على الوجهين",
        "enabled": true,
        "when": {
          "mode": "all",
          "items": [
            {
              "type": "condition",
              "subject": {
                "kind": "field",
                "key": "both_sides"
              },
              "operator": "equals",
              "operand": {
                "type": "boolean",
                "value": true
              }
            }
          ]
        },
        "then": [
          {
            "action": "activateComponent",
            "target": "both_sides_percent"
          }
        ]
      },
      {
        "key": "when_design",
        "name": "تصميم المطبوعة",
        "enabled": true,
        "when": {
          "mode": "all",
          "items": [
            {
              "type": "condition",
              "subject": {
                "kind": "field",
                "key": "design"
              },
              "operator": "equals",
              "operand": {
                "type": "boolean",
                "value": true
              }
            }
          ]
        },
        "then": [
          {
            "action": "activateComponent",
            "target": "design_price"
          }
        ]
      }
    ],
    "components": [
      {
        "key": "product_option_1",
        "label": "نوع المطبوعة: بطاقة أعمال",
        "stage": "base",
        "pricing": {
          "type": "unitRate",
          "quantity": {
            "kind": "field",
            "key": "quantity"
          },
          "rate": 0.1
        },
        "activeByDefault": false,
        "customerVisible": true
      },
      {
        "key": "product_a5",
        "label": "نوع المطبوعة: فلاير A5",
        "stage": "base",
        "pricing": {
          "type": "unitRate",
          "quantity": {
            "kind": "field",
            "key": "quantity"
          },
          "rate": 0.15
        },
        "activeByDefault": false,
        "customerVisible": true
      },
      {
        "key": "product_a4",
        "label": "نوع المطبوعة: فلاير A4",
        "stage": "base",
        "pricing": {
          "type": "unitRate",
          "quantity": {
            "kind": "field",
            "key": "quantity"
          },
          "rate": 0.25
        },
        "activeByDefault": false,
        "customerVisible": true
      },
      {
        "key": "product_option_4",
        "label": "نوع المطبوعة: ستيكر",
        "stage": "base",
        "pricing": {
          "type": "unitRate",
          "quantity": {
            "kind": "field",
            "key": "quantity"
          },
          "rate": 0.2
        },
        "activeByDefault": false,
        "customerVisible": true
      },
      {
        "key": "product_option_5",
        "label": "نوع المطبوعة: رول أب (ستاند إعلاني)",
        "stage": "base",
        "pricing": {
          "type": "unitRate",
          "quantity": {
            "kind": "field",
            "key": "quantity"
          },
          "rate": 40
        },
        "activeByDefault": false,
        "customerVisible": true
      },
      {
        "key": "product_option_6",
        "label": "نوع المطبوعة: لوحة فليكس للمتر المربع",
        "stage": "base",
        "pricing": {
          "type": "unitRate",
          "quantity": {
            "kind": "field",
            "key": "quantity"
          },
          "rate": 20
        },
        "activeByDefault": false,
        "customerVisible": true
      },
      {
        "key": "both_sides_percent",
        "label": "طباعة على الوجهين",
        "stage": "adjustment",
        "pricing": {
          "type": "percentage",
          "direction": "surcharge",
          "percent": {
            "type": "fixed",
            "percent": 30
          },
          "base": {
            "type": "subtotal",
            "subtotal": "baseSubtotal"
          }
        },
        "activeByDefault": false,
        "customerVisible": true
      },
      {
        "key": "design_price",
        "label": "تصميم المطبوعة",
        "stage": "base",
        "pricing": {
          "type": "fixedAmount",
          "amount": 30
        },
        "activeByDefault": false,
        "customerVisible": true
      },
      {
        "key": "minimum_order",
        "label": "الحد الأدنى للطلب",
        "stage": "adjustment",
        "pricing": {
          "type": "minimumCharge",
          "minimum": 15,
          "basis": "beforeTax"
        },
        "activeByDefault": true,
        "customerVisible": true
      }
    ],
    "derivedValues": [],
    "outputs": []
  }
}