{
  "format": "pricekit-template",
  "schemaVersion": "1.0",
  "engineVersion": "1",
  "createdWithVersion": "1.0.0",
  "template": {
    "templateId": "45a58c30-9c66-4955-adaf-c83531842fa4",
    "templateVersion": "1.0"
  },
  "calculator": {
    "name": "تصميم موقع إلكتروني أو متجر",
    "description": "سعر موقعك حسب نوعه وعدد صفحاته ومنتجاته واللغات والإضافات.",
    "currency": "USD",
    "calculatorVersion": 1,
    "moneyDecimals": 2,
    "allowNegativeTotal": false,
    "fields": [
      {
        "key": "site_type",
        "label": "نوع الموقع",
        "type": "singleChoice",
        "required": true,
        "options": [
          {
            "key": "option_1",
            "label": "صفحة هبوط"
          },
          {
            "key": "option_2",
            "label": "موقع تعريفي"
          },
          {
            "key": "option_3",
            "label": "متجر إلكتروني"
          }
        ],
        "visibleByDefault": true,
        "enabledByDefault": true,
        "customerVisible": true
      },
      {
        "key": "pages",
        "label": "عدد الصفحات",
        "description": "أول 5 صفحات مشمولة في السعر.",
        "type": "number",
        "required": true,
        "defaultValue": {
          "type": "number",
          "value": 5
        },
        "constraints": {
          "min": 1,
          "max": 100
        },
        "unit": "صفحة",
        "visibleByDefault": true,
        "enabledByDefault": true,
        "customerVisible": true
      },
      {
        "key": "products",
        "label": "عدد المنتجات المطلوب إدخالها",
        "type": "number",
        "required": true,
        "defaultValue": {
          "type": "number",
          "value": 50
        },
        "constraints": {
          "min": 0,
          "max": 5000
        },
        "unit": "منتج",
        "visibleByDefault": false,
        "enabledByDefault": true,
        "customerVisible": true
      },
      {
        "key": "payments",
        "label": "وسائل الدفع",
        "type": "multipleChoice",
        "required": false,
        "options": [
          {
            "key": "option_1",
            "label": "بطاقات الائتمان"
          },
          {
            "key": "option_2",
            "label": "محافظ إلكترونية"
          },
          {
            "key": "option_3",
            "label": "الدفع عند الاستلام"
          }
        ],
        "visibleByDefault": false,
        "enabledByDefault": true,
        "customerVisible": true
      },
      {
        "key": "design",
        "label": "التصميم",
        "type": "singleChoice",
        "required": true,
        "options": [
          {
            "key": "option_1",
            "label": "قالب جاهز معدّل"
          },
          {
            "key": "option_2",
            "label": "تصميم خاص بالكامل"
          }
        ],
        "visibleByDefault": true,
        "enabledByDefault": true,
        "customerVisible": true
      },
      {
        "key": "languages",
        "label": "لغات الموقع",
        "type": "singleChoice",
        "required": true,
        "options": [
          {
            "key": "option_1",
            "label": "لغة واحدة"
          },
          {
            "key": "option_2",
            "label": "لغتان"
          },
          {
            "key": "option_3",
            "label": "ثلاث لغات"
          }
        ],
        "visibleByDefault": true,
        "enabledByDefault": true,
        "customerVisible": true
      },
      {
        "key": "extras",
        "label": "إضافات",
        "type": "multipleChoice",
        "required": false,
        "options": [
          {
            "key": "option_1",
            "label": "تهيئة أساسية لمحركات البحث"
          },
          {
            "key": "option_2",
            "label": "ربط أدوات التحليلات"
          },
          {
            "key": "option_3",
            "label": "مدونة"
          },
          {
            "key": "option_4",
            "label": "نموذج حجز مواعيد"
          }
        ],
        "visibleByDefault": true,
        "enabledByDefault": true,
        "customerVisible": true
      },
      {
        "key": "hosting",
        "label": "استضافة ونطاق للسنة الأولى",
        "type": "boolean",
        "required": false,
        "defaultValue": {
          "type": "boolean",
          "value": false
        },
        "visibleByDefault": true,
        "enabledByDefault": true,
        "customerVisible": true
      },
      {
        "key": "support_months",
        "label": "أشهر الدعم والصيانة",
        "type": "number",
        "required": true,
        "defaultValue": {
          "type": "number",
          "value": 3
        },
        "constraints": {
          "min": 0,
          "max": 24
        },
        "unit": "شهر",
        "visibleByDefault": true,
        "enabledByDefault": true,
        "customerVisible": true
      }
    ],
    "rules": [
      {
        "key": "show_products",
        "name": "عدد المنتجات المطلوب إدخالها",
        "enabled": true,
        "when": {
          "mode": "any",
          "items": [
            {
              "type": "condition",
              "subject": {
                "kind": "field",
                "key": "site_type"
              },
              "operator": "equals",
              "operand": {
                "type": "choice",
                "option": "option_3"
              }
            }
          ]
        },
        "then": [
          {
            "action": "showField",
            "target": "products"
          }
        ]
      },
      {
        "key": "show_payments",
        "name": "وسائل الدفع",
        "enabled": true,
        "when": {
          "mode": "any",
          "items": [
            {
              "type": "condition",
              "subject": {
                "kind": "field",
                "key": "site_type"
              },
              "operator": "equals",
              "operand": {
                "type": "choice",
                "option": "option_3"
              }
            }
          ]
        },
        "then": [
          {
            "action": "showField",
            "target": "payments"
          }
        ]
      },
      {
        "key": "when_hosting",
        "name": "استضافة ونطاق للسنة الأولى",
        "enabled": true,
        "when": {
          "mode": "all",
          "items": [
            {
              "type": "condition",
              "subject": {
                "kind": "field",
                "key": "hosting"
              },
              "operator": "equals",
              "operand": {
                "type": "boolean",
                "value": true
              }
            }
          ]
        },
        "then": [
          {
            "action": "activateComponent",
            "target": "hosting_price"
          }
        ]
      },
      {
        "key": "rule_3",
        "name": "pages",
        "enabled": true,
        "when": {
          "mode": "all",
          "items": [
            {
              "type": "condition",
              "subject": {
                "kind": "field",
                "key": "site_type"
              },
              "operator": "equals",
              "operand": {
                "type": "choice",
                "option": "option_1"
              }
            }
          ]
        },
        "then": [
          {
            "action": "hideField",
            "target": "pages"
          }
        ]
      }
    ],
    "components": [
      {
        "key": "site_type_price",
        "label": "نوع الموقع",
        "stage": "base",
        "pricing": {
          "type": "singleChoice",
          "field": "site_type",
          "options": [
            {
              "option": "option_1",
              "amount": 350
            },
            {
              "option": "option_2",
              "amount": 700
            },
            {
              "option": "option_3",
              "amount": 1700
            }
          ]
        },
        "activeByDefault": true,
        "customerVisible": true
      },
      {
        "key": "pages_price",
        "label": "عدد الصفحات",
        "stage": "base",
        "pricing": {
          "type": "tiers",
          "mode": "progressive",
          "quantity": {
            "kind": "field",
            "key": "pages"
          },
          "allowGaps": false,
          "tiers": [
            {
              "from": 0,
              "to": 5,
              "amount": 0
            },
            {
              "from": 5,
              "to": 15,
              "amount": 50
            },
            {
              "from": 15,
              "amount": 40
            }
          ]
        },
        "activeByDefault": true,
        "customerVisible": true
      },
      {
        "key": "products_price",
        "label": "عدد المنتجات المطلوب إدخالها",
        "stage": "base",
        "pricing": {
          "type": "unitRate",
          "quantity": {
            "kind": "field",
            "key": "products"
          },
          "rate": 2
        },
        "activeByDefault": true,
        "customerVisible": true
      },
      {
        "key": "payments_price",
        "label": "وسائل الدفع",
        "stage": "base",
        "pricing": {
          "type": "multipleChoice",
          "field": "payments",
          "options": [
            {
              "option": "option_1",
              "amount": 120
            },
            {
              "option": "option_2",
              "amount": 70
            },
            {
              "option": "option_3",
              "amount": 0
            }
          ]
        },
        "activeByDefault": true,
        "customerVisible": true
      },
      {
        "key": "design_price",
        "label": "التصميم",
        "stage": "base",
        "pricing": {
          "type": "singleChoice",
          "field": "design",
          "options": [
            {
              "option": "option_1",
              "amount": 0
            },
            {
              "option": "option_2",
              "amount": 600
            }
          ]
        },
        "activeByDefault": true,
        "customerVisible": true
      },
      {
        "key": "languages_percent",
        "label": "لغات الموقع",
        "stage": "adjustment",
        "pricing": {
          "type": "percentage",
          "direction": "surcharge",
          "percent": {
            "type": "choice",
            "field": "languages",
            "options": [
              {
                "option": "option_1",
                "percent": 0
              },
              {
                "option": "option_2",
                "percent": 25
              },
              {
                "option": "option_3",
                "percent": 45
              }
            ]
          },
          "base": {
            "type": "subtotal",
            "subtotal": "baseSubtotal"
          }
        },
        "activeByDefault": true,
        "customerVisible": true
      },
      {
        "key": "extras_price",
        "label": "إضافات",
        "stage": "base",
        "pricing": {
          "type": "multipleChoice",
          "field": "extras",
          "options": [
            {
              "option": "option_1",
              "amount": 150
            },
            {
              "option": "option_2",
              "amount": 40
            },
            {
              "option": "option_3",
              "amount": 120
            },
            {
              "option": "option_4",
              "amount": 150
            }
          ]
        },
        "activeByDefault": true,
        "customerVisible": true
      },
      {
        "key": "hosting_price",
        "label": "استضافة ونطاق للسنة الأولى",
        "stage": "base",
        "pricing": {
          "type": "fixedAmount",
          "amount": 120
        },
        "activeByDefault": false,
        "customerVisible": true
      },
      {
        "key": "support_months_price",
        "label": "أشهر الدعم والصيانة",
        "stage": "base",
        "pricing": {
          "type": "unitRate",
          "quantity": {
            "kind": "field",
            "key": "support_months"
          },
          "rate": 40
        },
        "activeByDefault": true,
        "customerVisible": true
      },
      {
        "key": "minimum_order",
        "label": "الحد الأدنى للمشروع",
        "stage": "adjustment",
        "pricing": {
          "type": "minimumCharge",
          "minimum": 350,
          "basis": "beforeTax"
        },
        "activeByDefault": true,
        "customerVisible": true
      }
    ],
    "derivedValues": [],
    "outputs": []
  }
}