{
  "format": "pricekit-template",
  "schemaVersion": "1.0",
  "engineVersion": "1",
  "createdWithVersion": "1.0.0",
  "template": {
    "templateId": "0fd1ea73-a30b-4a0e-829d-abd6e9a9dafa",
    "templateVersion": "1.0"
  },
  "calculator": {
    "name": "دهان وديكور",
    "description": "سعر الدهان حسب المساحة ونوع الدهان، مع المعالجة والجبس.",
    "currency": "USD",
    "calculatorVersion": 1,
    "moneyDecimals": 2,
    "allowNegativeTotal": false,
    "fields": [
      {
        "key": "area",
        "label": "مساحة الجدران والأسقف",
        "type": "number",
        "required": true,
        "defaultValue": {
          "type": "number",
          "value": 100
        },
        "constraints": {
          "min": 10,
          "max": 5000
        },
        "unit": "م²",
        "visibleByDefault": true,
        "enabledByDefault": true,
        "customerVisible": true
      },
      {
        "key": "paint",
        "label": "نوع الدهان",
        "description": "السعر لكل متر مربع.",
        "type": "singleChoice",
        "required": true,
        "options": [
          {
            "key": "option_1",
            "label": "دهان عادي"
          },
          {
            "key": "option_2",
            "label": "دهان قابل للغسل عالي الجودة"
          },
          {
            "key": "option_3",
            "label": "دهان ديكوري بتأثيرات"
          }
        ],
        "visibleByDefault": true,
        "enabledByDefault": true,
        "customerVisible": true
      },
      {
        "key": "preparation",
        "label": "معالجة الجدران بالمعجون والصنفرة",
        "type": "boolean",
        "required": false,
        "defaultValue": {
          "type": "boolean",
          "value": false
        },
        "visibleByDefault": true,
        "enabledByDefault": true,
        "customerVisible": true
      },
      {
        "key": "gypsum",
        "label": "أسقف جبس بورد",
        "type": "number",
        "required": true,
        "defaultValue": {
          "type": "number",
          "value": 0
        },
        "constraints": {
          "min": 0,
          "max": 1000
        },
        "unit": "م²",
        "visibleByDefault": true,
        "enabledByDefault": true,
        "customerVisible": true
      },
      {
        "key": "furniture",
        "label": "تغطية ونقل الأثاث",
        "type": "boolean",
        "required": false,
        "defaultValue": {
          "type": "boolean",
          "value": false
        },
        "visibleByDefault": true,
        "enabledByDefault": true,
        "customerVisible": true
      }
    ],
    "rules": [
      {
        "key": "when_paint_option_1",
        "name": "نوع الدهان: دهان عادي",
        "enabled": true,
        "when": {
          "mode": "all",
          "items": [
            {
              "type": "condition",
              "subject": {
                "kind": "field",
                "key": "paint"
              },
              "operator": "equals",
              "operand": {
                "type": "choice",
                "option": "option_1"
              }
            }
          ]
        },
        "then": [
          {
            "action": "activateComponent",
            "target": "paint_option_1"
          }
        ]
      },
      {
        "key": "when_paint_option_2",
        "name": "نوع الدهان: دهان قابل للغسل عالي الجودة",
        "enabled": true,
        "when": {
          "mode": "all",
          "items": [
            {
              "type": "condition",
              "subject": {
                "kind": "field",
                "key": "paint"
              },
              "operator": "equals",
              "operand": {
                "type": "choice",
                "option": "option_2"
              }
            }
          ]
        },
        "then": [
          {
            "action": "activateComponent",
            "target": "paint_option_2"
          }
        ]
      },
      {
        "key": "when_paint_option_3",
        "name": "نوع الدهان: دهان ديكوري بتأثيرات",
        "enabled": true,
        "when": {
          "mode": "all",
          "items": [
            {
              "type": "condition",
              "subject": {
                "kind": "field",
                "key": "paint"
              },
              "operator": "equals",
              "operand": {
                "type": "choice",
                "option": "option_3"
              }
            }
          ]
        },
        "then": [
          {
            "action": "activateComponent",
            "target": "paint_option_3"
          }
        ]
      },
      {
        "key": "when_preparation",
        "name": "معالجة الجدران بالمعجون والصنفرة",
        "enabled": true,
        "when": {
          "mode": "all",
          "items": [
            {
              "type": "condition",
              "subject": {
                "kind": "field",
                "key": "preparation"
              },
              "operator": "equals",
              "operand": {
                "type": "boolean",
                "value": true
              }
            }
          ]
        },
        "then": [
          {
            "action": "activateComponent",
            "target": "preparation_price"
          }
        ]
      },
      {
        "key": "when_furniture",
        "name": "تغطية ونقل الأثاث",
        "enabled": true,
        "when": {
          "mode": "all",
          "items": [
            {
              "type": "condition",
              "subject": {
                "kind": "field",
                "key": "furniture"
              },
              "operator": "equals",
              "operand": {
                "type": "boolean",
                "value": true
              }
            }
          ]
        },
        "then": [
          {
            "action": "activateComponent",
            "target": "furniture_price"
          }
        ]
      }
    ],
    "components": [
      {
        "key": "paint_option_1",
        "label": "نوع الدهان: دهان عادي",
        "stage": "base",
        "pricing": {
          "type": "unitRate",
          "quantity": {
            "kind": "field",
            "key": "area"
          },
          "rate": 4
        },
        "activeByDefault": false,
        "customerVisible": true
      },
      {
        "key": "paint_option_2",
        "label": "نوع الدهان: دهان قابل للغسل عالي الجودة",
        "stage": "base",
        "pricing": {
          "type": "unitRate",
          "quantity": {
            "kind": "field",
            "key": "area"
          },
          "rate": 6
        },
        "activeByDefault": false,
        "customerVisible": true
      },
      {
        "key": "paint_option_3",
        "label": "نوع الدهان: دهان ديكوري بتأثيرات",
        "stage": "base",
        "pricing": {
          "type": "unitRate",
          "quantity": {
            "kind": "field",
            "key": "area"
          },
          "rate": 12
        },
        "activeByDefault": false,
        "customerVisible": true
      },
      {
        "key": "preparation_price",
        "label": "معالجة الجدران بالمعجون والصنفرة",
        "stage": "base",
        "pricing": {
          "type": "unitRate",
          "quantity": {
            "kind": "field",
            "key": "area"
          },
          "rate": 1.5
        },
        "activeByDefault": false,
        "customerVisible": true
      },
      {
        "key": "gypsum_price",
        "label": "أسقف جبس بورد",
        "stage": "base",
        "pricing": {
          "type": "unitRate",
          "quantity": {
            "kind": "field",
            "key": "gypsum"
          },
          "rate": 25
        },
        "activeByDefault": true,
        "customerVisible": true
      },
      {
        "key": "furniture_price",
        "label": "تغطية ونقل الأثاث",
        "stage": "base",
        "pricing": {
          "type": "fixedAmount",
          "amount": 40
        },
        "activeByDefault": false,
        "customerVisible": true
      },
      {
        "key": "minimum_order",
        "label": "الحد الأدنى للعمل",
        "stage": "adjustment",
        "pricing": {
          "type": "minimumCharge",
          "minimum": 140,
          "basis": "beforeTax"
        },
        "activeByDefault": true,
        "customerVisible": true
      }
    ],
    "derivedValues": [],
    "outputs": []
  }
}