{
  "template": {
    "ir": "0.1.0",
    "meta": {
      "name": "rental-contract",
      "version": "1.0.0"
    },
    "page": {
      "size": "A4",
      "margins": "18mm",
      "direction": "rtl"
    },
    "styles": {
      "body": {
        "font": "Noto Naskh Arabic",
        "size": "11.5pt",
        "lineHeight": 2,
        "align": "justify"
      },
      "title": {
        "font": "Cairo",
        "weight": 700,
        "size": "16pt",
        "align": "center",
        "color": "#1A3C6E"
      },
      "sec": {
        "font": "Cairo",
        "weight": 700,
        "size": "12pt",
        "color": "#8A1538"
      },
      "b": {
        "font": "Noto Naskh Arabic",
        "weight": 700,
        "size": "11.5pt"
      },
      "th": {
        "font": "Cairo",
        "weight": 700,
        "size": "9.5pt",
        "align": "center",
        "background": "#EEF2F7"
      },
      "td": {
        "font": "Cairo",
        "size": "9.5pt",
        "align": "center"
      }
    },
    "body": [
      {
        "type": "heading",
        "text": "عقد إيجار",
        "level": 1,
        "style": "title"
      },
      {
        "type": "spacer",
        "height": "4mm"
      },
      {
        "type": "text",
        "runs": [
          {
            "text": "إنه في يوم "
          },
          {
            "bind": "$.contract.date",
            "format": {
              "dateStyle": "full"
            }
          },
          {
            "text": "، تم الاتفاق بين كلٍ من:"
          }
        ]
      },
      {
        "type": "text",
        "runs": [
          {
            "text": "الطرف الأول (المؤجر): "
          },
          {
            "bind": "$.landlord.name",
            "style": "b"
          },
          {
            "text": "، هوية رقم "
          },
          {
            "bind": "$.landlord.id"
          },
          {
            "text": "."
          }
        ]
      },
      {
        "type": "text",
        "runs": [
          {
            "text": "الطرف الثاني (المستأجر): "
          },
          {
            "bind": "$.tenant.name",
            "style": "b"
          },
          {
            "text": "، هوية رقم "
          },
          {
            "bind": "$.tenant.id"
          },
          {
            "text": "."
          }
        ]
      },
      {
        "type": "spacer",
        "height": "3mm"
      },
      {
        "type": "heading",
        "text": "البند الأول — العين المؤجرة",
        "level": 3,
        "style": "sec"
      },
      {
        "type": "text",
        "bind": "$.property.description"
      },
      {
        "type": "heading",
        "text": "البند الثاني — المدة والأجرة",
        "level": 3,
        "style": "sec"
      },
      {
        "type": "text",
        "runs": [
          {
            "text": "مدة هذا العقد "
          },
          {
            "bind": "$.contract.term",
            "style": "b"
          },
          {
            "text": " تبدأ من "
          },
          {
            "bind": "$.contract.from",
            "format": {
              "dateStyle": "long"
            }
          },
          {
            "text": "، بأجرة سنوية قدرها "
          },
          {
            "bind": "$.contract.rentWords",
            "style": "b"
          },
          {
            "text": " تُدفع وفق الجدول التالي:"
          }
        ]
      },
      {
        "type": "table",
        "bind": "$.payments",
        "headerStyle": "th",
        "cellStyle": "td",
        "columns": [
          {
            "header": "الدفعة",
            "cell": {
              "bind": "item.name"
            }
          },
          {
            "header": "تاريخ الاستحقاق",
            "cell": {
              "bind": "item.due",
              "format": {
                "dateStyle": "medium"
              }
            }
          },
          {
            "header": "المبلغ",
            "cell": {
              "bind": "item.amount",
              "format": {
                "currency": "SAR",
                "kind": "currency"
              }
            }
          }
        ]
      },
      {
        "type": "heading",
        "text": "البند الثالث — التزامات عامة",
        "level": 3,
        "style": "sec"
      },
      {
        "type": "text",
        "text": "يلتزم المستأجر بالمحافظة على العين المؤجرة واستخدامها فيما أُجرت له، ولا يحق له التأجير من الباطن إلا بموافقة خطية من المؤجر. تُعالج أي نزاعات ودياً وإلا فعبر الجهات المختصة."
      },
      {
        "type": "spacer",
        "height": "10mm"
      },
      {
        "type": "row",
        "align": "space-between",
        "children": [
          {
            "type": "signature",
            "field": "landlord",
            "label": "الطرف الأول — المؤجر",
            "bind": "$.landlord.name"
          },
          {
            "type": "signature",
            "field": "tenant",
            "label": "الطرف الثاني — المستأجر",
            "bind": "$.tenant.name"
          }
        ]
      }
    ]
  },
  "data": {
    "contract": {
      "date": "2026-08-14",
      "term": "سنة واحدة",
      "from": "2026-09-01",
      "rentWords": "ستون ألف ريال سعودي"
    },
    "landlord": {
      "name": "صالح محمد العنزي",
      "id": "1055555555"
    },
    "tenant": {
      "name": "شركة المدار للاستشارات",
      "id": "7001234567"
    },
    "property": {
      "description": "مكتب رقم ٣٠٢ بالدور الثالث من برج الياسمين، حي العليا، الرياض — بمساحة ١٤٠ متراً مربعاً، مع موقفين للسيارات."
    },
    "payments": [
      {
        "name": "الدفعة الأولى",
        "due": "2026-09-01",
        "amount": 30000
      },
      {
        "name": "الدفعة الثانية",
        "due": "2027-03-01",
        "amount": 30000
      }
    ]
  }
}