{
  "format": "pricekit-template",
  "schemaVersion": "1.0",
  "engineVersion": "1",
  "createdWithVersion": "1.0.0",
  "template": {
    "templateId": "6dc2cd43-7d63-4c5e-a822-af0258b7eac6",
    "templateVersion": "1.0"
  },
  "calculator": {
    "name": "صيانة منزلية وتكييف",
    "description": "سعر الخدمة حسب نوعها وعدد الأجهزة وموعد الزيارة.",
    "currency": "USD",
    "calculatorVersion": 1,
    "moneyDecimals": 2,
    "allowNegativeTotal": false,
    "fields": [
      {
        "key": "service",
        "label": "الخدمة المطلوبة",
        "type": "singleChoice",
        "required": true,
        "options": [
          {
            "key": "option_1",
            "label": "صيانة مكيف"
          },
          {
            "key": "option_2",
            "label": "تركيب مكيف جديد"
          },
          {
            "key": "option_3",
            "label": "فك ونقل مكيف"
          },
          {
            "key": "option_4",
            "label": "صيانة كهرباء"
          },
          {
            "key": "option_5",
            "label": "صيانة سباكة"
          }
        ],
        "visibleByDefault": true,
        "enabledByDefault": true,
        "customerVisible": true
      },
      {
        "key": "units",
        "label": "عدد الأجهزة أو النقاط",
        "type": "number",
        "required": true,
        "defaultValue": {
          "type": "number",
          "value": 1
        },
        "constraints": {
          "min": 1,
          "max": 20
        },
        "unit": "جهاز",
        "visibleByDefault": true,
        "enabledByDefault": true,
        "customerVisible": true
      },
      {
        "key": "gas",
        "label": "تعبئة غاز للمكيف",
        "type": "boolean",
        "required": false,
        "defaultValue": {
          "type": "boolean",
          "value": false
        },
        "visibleByDefault": false,
        "enabledByDefault": true,
        "customerVisible": true
      },
      {
        "key": "copper",
        "label": "تمديدات نحاس إضافية",
        "type": "number",
        "required": true,
        "defaultValue": {
          "type": "number",
          "value": 0
        },
        "constraints": {
          "min": 0,
          "max": 50
        },
        "unit": "متر",
        "visibleByDefault": false,
        "enabledByDefault": true,
        "customerVisible": true
      },
      {
        "key": "visit",
        "label": "موعد الزيارة",
        "type": "singleChoice",
        "required": true,
        "options": [
          {
            "key": "option_1",
            "label": "خلال أيام العمل"
          },
          {
            "key": "option_2",
            "label": "مساءً أو في العطلة"
          },
          {
            "key": "option_3",
            "label": "طارئ خلال ساعتين"
          }
        ],
        "visibleByDefault": true,
        "enabledByDefault": true,
        "customerVisible": true
      }
    ],
    "rules": [
      {
        "key": "when_service_option_1",
        "name": "الخدمة المطلوبة: صيانة مكيف",
        "enabled": true,
        "when": {
          "mode": "all",
          "items": [
            {
              "type": "condition",
              "subject": {
                "kind": "field",
                "key": "service"
              },
              "operator": "equals",
              "operand": {
                "type": "choice",
                "option": "option_1"
              }
            }
          ]
        },
        "then": [
          {
            "action": "activateComponent",
            "target": "service_option_1"
          }
        ]
      },
      {
        "key": "when_service_option_2",
        "name": "الخدمة المطلوبة: تركيب مكيف جديد",
        "enabled": true,
        "when": {
          "mode": "all",
          "items": [
            {
              "type": "condition",
              "subject": {
                "kind": "field",
                "key": "service"
              },
              "operator": "equals",
              "operand": {
                "type": "choice",
                "option": "option_2"
              }
            }
          ]
        },
        "then": [
          {
            "action": "activateComponent",
            "target": "service_option_2"
          }
        ]
      },
      {
        "key": "when_service_option_3",
        "name": "الخدمة المطلوبة: فك ونقل مكيف",
        "enabled": true,
        "when": {
          "mode": "all",
          "items": [
            {
              "type": "condition",
              "subject": {
                "kind": "field",
                "key": "service"
              },
              "operator": "equals",
              "operand": {
                "type": "choice",
                "option": "option_3"
              }
            }
          ]
        },
        "then": [
          {
            "action": "activateComponent",
            "target": "service_option_3"
          }
        ]
      },
      {
        "key": "when_service_option_4",
        "name": "الخدمة المطلوبة: صيانة كهرباء",
        "enabled": true,
        "when": {
          "mode": "all",
          "items": [
            {
              "type": "condition",
              "subject": {
                "kind": "field",
                "key": "service"
              },
              "operator": "equals",
              "operand": {
                "type": "choice",
                "option": "option_4"
              }
            }
          ]
        },
        "then": [
          {
            "action": "activateComponent",
            "target": "service_option_4"
          }
        ]
      },
      {
        "key": "when_service_option_5",
        "name": "الخدمة المطلوبة: صيانة سباكة",
        "enabled": true,
        "when": {
          "mode": "all",
          "items": [
            {
              "type": "condition",
              "subject": {
                "kind": "field",
                "key": "service"
              },
              "operator": "equals",
              "operand": {
                "type": "choice",
                "option": "option_5"
              }
            }
          ]
        },
        "then": [
          {
            "action": "activateComponent",
            "target": "service_option_5"
          }
        ]
      },
      {
        "key": "show_gas",
        "name": "تعبئة غاز للمكيف",
        "enabled": true,
        "when": {
          "mode": "any",
          "items": [
            {
              "type": "condition",
              "subject": {
                "kind": "field",
                "key": "service"
              },
              "operator": "equals",
              "operand": {
                "type": "choice",
                "option": "option_1"
              }
            }
          ]
        },
        "then": [
          {
            "action": "showField",
            "target": "gas"
          }
        ]
      },
      {
        "key": "when_gas",
        "name": "تعبئة غاز للمكيف",
        "enabled": true,
        "when": {
          "mode": "all",
          "items": [
            {
              "type": "condition",
              "subject": {
                "kind": "field",
                "key": "gas"
              },
              "operator": "equals",
              "operand": {
                "type": "boolean",
                "value": true
              }
            }
          ]
        },
        "then": [
          {
            "action": "activateComponent",
            "target": "gas_price"
          }
        ]
      },
      {
        "key": "show_copper",
        "name": "تمديدات نحاس إضافية",
        "enabled": true,
        "when": {
          "mode": "any",
          "items": [
            {
              "type": "condition",
              "subject": {
                "kind": "field",
                "key": "service"
              },
              "operator": "equals",
              "operand": {
                "type": "choice",
                "option": "option_2"
              }
            },
            {
              "type": "condition",
              "subject": {
                "kind": "field",
                "key": "service"
              },
              "operator": "equals",
              "operand": {
                "type": "choice",
                "option": "option_3"
              }
            }
          ]
        },
        "then": [
          {
            "action": "showField",
            "target": "copper"
          }
        ]
      }
    ],
    "components": [
      {
        "key": "service_option_1",
        "label": "الخدمة المطلوبة: صيانة مكيف",
        "stage": "base",
        "pricing": {
          "type": "unitRate",
          "quantity": {
            "kind": "field",
            "key": "units"
          },
          "rate": 40
        },
        "activeByDefault": false,
        "customerVisible": true
      },
      {
        "key": "service_option_2",
        "label": "الخدمة المطلوبة: تركيب مكيف جديد",
        "stage": "base",
        "pricing": {
          "type": "unitRate",
          "quantity": {
            "kind": "field",
            "key": "units"
          },
          "rate": 100
        },
        "activeByDefault": false,
        "customerVisible": true
      },
      {
        "key": "service_option_3",
        "label": "الخدمة المطلوبة: فك ونقل مكيف",
        "stage": "base",
        "pricing": {
          "type": "unitRate",
          "quantity": {
            "kind": "field",
            "key": "units"
          },
          "rate": 70
        },
        "activeByDefault": false,
        "customerVisible": true
      },
      {
        "key": "service_option_4",
        "label": "الخدمة المطلوبة: صيانة كهرباء",
        "stage": "base",
        "pricing": {
          "type": "unitRate",
          "quantity": {
            "kind": "field",
            "key": "units"
          },
          "rate": 35
        },
        "activeByDefault": false,
        "customerVisible": true
      },
      {
        "key": "service_option_5",
        "label": "الخدمة المطلوبة: صيانة سباكة",
        "stage": "base",
        "pricing": {
          "type": "unitRate",
          "quantity": {
            "kind": "field",
            "key": "units"
          },
          "rate": 35
        },
        "activeByDefault": false,
        "customerVisible": true
      },
      {
        "key": "gas_price",
        "label": "تعبئة غاز للمكيف",
        "stage": "base",
        "pricing": {
          "type": "unitRate",
          "quantity": {
            "kind": "field",
            "key": "units"
          },
          "rate": 50
        },
        "activeByDefault": false,
        "customerVisible": true
      },
      {
        "key": "copper_price",
        "label": "تمديدات نحاس إضافية",
        "stage": "base",
        "pricing": {
          "type": "unitRate",
          "quantity": {
            "kind": "field",
            "key": "copper"
          },
          "rate": 15
        },
        "activeByDefault": true,
        "customerVisible": true
      },
      {
        "key": "visit_price",
        "label": "موعد الزيارة",
        "stage": "base",
        "pricing": {
          "type": "singleChoice",
          "field": "visit",
          "options": [
            {
              "option": "option_1",
              "amount": 0
            },
            {
              "option": "option_2",
              "amount": 20
            },
            {
              "option": "option_3",
              "amount": 40
            }
          ]
        },
        "activeByDefault": true,
        "customerVisible": true
      },
      {
        "key": "minimum_order",
        "label": "الحد الأدنى للزيارة",
        "stage": "adjustment",
        "pricing": {
          "type": "minimumCharge",
          "minimum": 40,
          "basis": "beforeTax"
        },
        "activeByDefault": true,
        "customerVisible": true
      }
    ],
    "derivedValues": [],
    "outputs": []
  }
}