{
  "header" : {
    "id" : "permit-basic",
    "modelType" : "document",
    "modelVersion" : "28.4.0",
    "locales" : [ {
      "code" : "en_US"
    } ],
    "labels" : [ ],
    "annotations" : [ ],
    "modelReferences" : [ ]
  },
  "content" : {
    "modelInfo" : {
      "name" : "permit-basic",
      "variant" : "cockpit",
      "revision" : "Arbeitsversion",
      "immutable" : false
    },
    "modelConfig" : {
      "decimalSeparator" : ".",
      "timeZone" : "Europe/Berlin",
      "conditionLanguage" : {
        "code" : "en_US"
      },
      "fieldRefByShortNameAllowed" : true
    },
    "modelRoot" : {
      "rootGroups" : [ {
        "type" : "Group",
        "id" : "/Permit",
        "name" : "Permit",
        "Group" : {
          "repeatability" : 1,
          "elements" : [ {
            "type" : "Field",
            "id" : "/Permit/ApplicationNo",
            "name" : "ApplicationNo",
            "Field" : {
              "fieldType" : {
                "type" : "StringType",
                "StringType" : {
                  "maxLength" : 20
                }
              },
              "requirednessConfig" : {
                "mode" : "absoluteOrRelativeToNextRepAncestor"
              },
              "label" : [ {
                "locale" : "en_US",
                "text" : "Application number"
              } ]
            }
          }, {
            "type" : "Field",
            "id" : "/Permit/ApplicantName",
            "name" : "ApplicantName",
            "Field" : {
              "fieldType" : {
                "type" : "StringType",
                "StringType" : {
                  "maxLength" : 80
                }
              },
              "label" : [ {
                "locale" : "en_US",
                "text" : "Applicant"
              } ]
            }
          }, {
            "type" : "Field",
            "id" : "/Permit/PermitType",
            "name" : "PermitType",
            "Field" : {
              "fieldType" : {
                "type" : "EnumerationType",
                "EnumerationType" : {
                  "values" : [ {
                    "value" : "RESIDENTIAL",
                    "label" : [ {
                      "locale" : "en_US",
                      "text" : "Residential"
                    } ]
                  }, {
                    "value" : "COMMERCIAL",
                    "label" : [ {
                      "locale" : "en_US",
                      "text" : "Commercial"
                    } ]
                  }, {
                    "value" : "PUBLIC",
                    "label" : [ {
                      "locale" : "en_US",
                      "text" : "Public"
                    } ]
                  } ]
                }
              },
              "label" : [ {
                "locale" : "en_US",
                "text" : "Permit type"
              } ]
            }
          }, {
            "type" : "Field",
            "id" : "/Permit/SubmittedOn",
            "name" : "SubmittedOn",
            "Field" : {
              "fieldType" : {
                "type" : "DateType",
                "DateType" : {
                  "format" : "yyyy-MM-dd"
                }
              },
              "label" : [ {
                "locale" : "en_US",
                "text" : "Submitted on"
              } ]
            }
          }, {
            "type" : "Field",
            "id" : "/Permit/RequestedArea",
            "name" : "RequestedArea",
            "Field" : {
              "fieldType" : {
                "type" : "NumberType",
                "NumberType" : {
                  "maxFractionalDigits" : 0,
                  "minValue" : 1,
                  "maxValue" : 1000
                }
              },
              "requirednessConfig" : {
                "mode" : "absoluteOrRelativeToNextRepAncestor"
              },
              "label" : [ {
                "locale" : "en_US",
                "text" : "Requested area (m²)"
              } ]
            }
          }, {
            "type" : "Field",
            "id" : "/Permit/UnitFee",
            "name" : "UnitFee",
            "Field" : {
              "fieldType" : {
                "type" : "NumberType",
                "NumberType" : {
                  "maxFractionalDigits" : 2,
                  "minValue" : 0
                }
              },
              "label" : [ {
                "locale" : "en_US",
                "text" : "Fee per m²"
              } ]
            }
          }, {
            "type" : "Field",
            "id" : "/Permit/ReviewedArea",
            "name" : "ReviewedArea",
            "Field" : {
              "fieldType" : {
                "type" : "NumberType",
                "NumberType" : {
                  "maxFractionalDigits" : 0
                }
              }
            }
          }, {
            "type" : "Field",
            "id" : "/Permit/EstimatedFee",
            "name" : "EstimatedFee",
            "Field" : {
              "fieldType" : {
                "type" : "NumberType",
                "NumberType" : {
                  "maxFractionalDigits" : 2
                }
              },
              "label" : [ {
                "locale" : "en_US",
                "text" : "Estimated fee"
              } ]
            }
          }, {
            "type" : "Field",
            "id" : "/Permit/Note",
            "name" : "Note",
            "Field" : {
              "fieldType" : {
                "type" : "StringType"
              }
            }
          }, {
            "type" : "Field",
            "id" : "/Permit/Rate",
            "name" : "Rate",
            "Field" : {
              "fieldType" : {
                "type" : "NumberType",
                "NumberType" : {
                  "maxFractionalDigits" : 14,
                  "minFractionalDigits" : 0
                }
              }
            }
          }, {
            "type" : "Field",
            "id" : "/Permit/PatternProbe",
            "name" : "PatternProbe",
            "Field" : {
              "fieldType" : {
                "type" : "StringType"
              }
            }
          }, {
            "type" : "Field",
            "id" : "/Permit/GraphemeProbe",
            "name" : "GraphemeProbe",
            "Field" : {
              "fieldType" : {
                "type" : "StringType"
              }
            }
          }, {
            "type" : "Field",
            "id" : "/Permit/ReportedAt",
            "name" : "ReportedAt",
            "Field" : {
              "fieldType" : {
                "type" : "DateTimeType",
                "DateTimeType" : {
                  "format" : "yyyy-MM-dd'T'HH:mm:ss"
                }
              }
            }
          }, {
            "type" : "Field",
            "id" : "/Permit/SettledAt",
            "name" : "SettledAt",
            "Field" : {
              "fieldType" : {
                "type" : "DateTimeType",
                "DateTimeType" : {
                  "format" : "yyyy-MM-dd'T'HH:mm:ss"
                }
              }
            }
          }, {
            "type" : "Group",
            "id" : "/Permit/SiteSections",
            "name" : "SiteSections",
            "Group" : {
              "repeatability" : 20,
              "elements" : [ {
                "type" : "Field",
                "id" : "/Permit/SiteSections/SectionName",
                "name" : "SectionName",
                "Field" : {
                  "fieldType" : {
                    "type" : "StringType",
                    "StringType" : {
                      "maxLength" : 60
                    }
                  },
                  "requirednessConfig" : {
                    "mode" : "absoluteOrRelativeToNextRepAncestor"
                  },
                  "label" : [ {
                    "locale" : "en_US",
                    "text" : "Section name"
                  } ]
                }
              }, {
                "type" : "Field",
                "id" : "/Permit/SiteSections/Area",
                "name" : "Area",
                "Field" : {
                  "fieldType" : {
                    "type" : "NumberType",
                    "NumberType" : {
                      "maxFractionalDigits" : 0,
                      "minValue" : 1,
                      "maxValue" : 1000
                    }
                  },
                  "requirednessConfig" : {
                    "mode" : "absoluteOrRelativeToNextRepAncestor"
                  },
                  "label" : [ {
                    "locale" : "en_US",
                    "text" : "Section area (m²)"
                  } ]
                }
              }, {
                "type" : "Field",
                "id" : "/Permit/SiteSections/SurveyCharge",
                "name" : "SurveyCharge",
                "Field" : {
                  "fieldType" : {
                    "type" : "NumberType",
                    "NumberType" : {
                      "maxFractionalDigits" : 0
                    }
                  },
                  "label" : [ {
                    "locale" : "en_US",
                    "text" : "Section survey charge"
                  } ]
                }
              }, {
                "type" : "Computation",
                "id" : "/Permit/SiteSections/ChargeSectionSurvey",
                "name" : "ChargeSectionSurvey",
                "Computation" : {
                  "computedFieldRelPath" : "../SurveyCharge",
                  "computationAlternatives" : [ {
                    "precondition" : "FieldFilled(Area)",
                    "operation" : "[Area] * 25"
                  } ],
                  "errorMessage" : [ {
                    "locale" : "en_US",
                    "text" : "Each site section is surveyed at the statutory rate of 25 per m²."
                  } ]
                },
                "externalDescription" : [ {
                  "locale" : "en_US",
                  "text" : "Charges every site-section row its own survey fee at the statutory per-m² rate. Computes /Permit/SiteSections/SurveyCharge 1 alternative."
                } ]
              } ]
            }
          }, {
            "type" : "Rule",
            "id" : "/Permit/AreaNeedsNote",
            "name" : "AreaNeedsNote",
            "Rule" : {
              "errorEntityRelPath" : "../Note",
              "errorCode" : "AREA_NEEDS_NOTE",
              "errorCondition" : "FieldFilled(RequestedArea) And [RequestedArea] > 100 And FieldNotFilled(Note)",
              "severity" : "ERROR",
              "errorMessage" : [ {
                "locale" : "en_US",
                "text" : "A large requested area needs a note."
              } ]
            },
            "externalDescription" : [ {
              "locale" : "en_US",
              "text" : "Flags a permit when its requested area exceeds 100 m² and no review note is present. Uses And, FieldFilled, >, FieldNotFilled over /Permit/Note, /Permit/RequestedArea."
            } ]
          }, {
            "type" : "Computation",
            "id" : "/Permit/CopyRequestedArea",
            "name" : "CopyRequestedArea",
            "Computation" : {
              "computedFieldRelPath" : "../ReviewedArea",
              "computationAlternatives" : [ {
                "precondition" : "FieldFilled(ApplicationNo)",
                "operation" : "[RequestedArea]"
              } ],
              "errorMessage" : [ {
                "locale" : "en_US",
                "text" : "The reviewed area follows the request."
              } ]
            },
            "externalDescription" : [ {
              "locale" : "en_US",
              "text" : "Copies the requested area into the reviewed-area output. Computes /Permit/ReviewedArea 1 alternative."
            } ]
          }, {
            "type" : "Computation",
            "id" : "/Permit/CalculateEstimatedFee",
            "name" : "CalculateEstimatedFee",
            "Computation" : {
              "computedFieldRelPath" : "../EstimatedFee",
              "computationAlternatives" : [ {
                "precondition" : "FieldFilled(RequestedArea) And FieldFilled(UnitFee)",
                "operation" : "[RequestedArea] * [UnitFee]"
              } ],
              "errorMessage" : [ {
                "locale" : "en_US",
                "text" : "The estimated permit fee is area multiplied by the unit fee."
              } ]
            },
            "externalDescription" : [ {
              "locale" : "en_US",
              "text" : "Calculates the estimated permit fee as requested area multiplied by the fee per m². Computes /Permit/EstimatedFee 1 alternative."
            } ]
          }, {
            "type" : "Rule",
            "id" : "/Permit/DecimalPrecisionControl",
            "name" : "DecimalPrecisionControl",
            "Rule" : {
              "errorEntityRelPath" : "../Rate",
              "errorCode" : "DECIMAL_CONTROL",
              "errorCondition" : "FieldFilled(Rate) And [Rate] ^ -64 > 1000000",
              "severity" : "ERROR",
              "errorMessage" : [ {
                "locale" : "en_US",
                "text" : "The decimal control discriminator fires."
              } ]
            },
            "externalDescription" : [ {
              "locale" : "en_US",
              "text" : "Exercises the maintained high-precision arithmetic control used by the browser conformance gate. Uses And, FieldFilled, > over /Permit/Rate."
            } ]
          }, {
            "type" : "Rule",
            "id" : "/Permit/DecimalPrecisionSplit",
            "name" : "DecimalPrecisionSplit",
            "Rule" : {
              "errorEntityRelPath" : "../Rate",
              "errorCode" : "DECIMAL_SPLIT",
              "errorCondition" : "FieldFilled(Rate) And [Rate] ^ -64 > 2912324058756262786433368781182555.3552912554484015",
              "severity" : "ERROR",
              "errorMessage" : [ {
                "locale" : "en_US",
                "text" : "The decimal precision discriminator must stay silent."
              } ]
            },
            "externalDescription" : [ {
              "locale" : "en_US",
              "text" : "Guards the browser's high-precision arithmetic boundary and normally remains silent. Uses And, FieldFilled, > over /Permit/Rate."
            } ]
          }, {
            "type" : "Rule",
            "id" : "/Permit/PatternDialect",
            "name" : "PatternDialect",
            "Rule" : {
              "errorEntityRelPath" : "../PatternProbe",
              "errorCode" : "PATTERN_DIALECT",
              "errorCondition" : "[PatternProbe] PatternMatched \"\\d+\\h\\d+\"",
              "severity" : "ERROR",
              "errorMessage" : [ {
                "locale" : "en_US",
                "text" : "Java horizontal whitespace matched."
              } ]
            },
            "externalDescription" : [ {
              "locale" : "en_US",
              "text" : "Exercises Java-compatible horizontal-whitespace matching when PatternProbe is supplied. Uses PatternMatched over /Permit/PatternProbe."
            } ]
          }, {
            "type" : "Rule",
            "id" : "/Permit/GraphemeDialect",
            "name" : "GraphemeDialect",
            "Rule" : {
              "errorEntityRelPath" : "../GraphemeProbe",
              "errorCode" : "GRAPHEME_DIALECT",
              "errorCondition" : "[GraphemeProbe] PatternMatched \"\\X\"",
              "severity" : "ERROR",
              "errorMessage" : [ {
                "locale" : "en_US",
                "text" : "The extended grapheme matched."
              } ]
            },
            "externalDescription" : [ {
              "locale" : "en_US",
              "text" : "Exercises extended-grapheme matching when GraphemeProbe is supplied. Uses PatternMatched over /Permit/GraphemeProbe."
            } ]
          }, {
            "type" : "Rule",
            "id" : "/Permit/BerlinSpringHour",
            "name" : "BerlinSpringHour",
            "Rule" : {
              "errorEntityRelPath" : "../ReportedAt",
              "errorCode" : "BERLIN_SPRING_HOUR",
              "errorCondition" : "FieldFilled(ReportedAt) And DifferenceInHours(ReportedAt, SettledAt) == 1",
              "severity" : "ERROR",
              "errorMessage" : [ {
                "locale" : "en_US",
                "text" : "The Berlin spring-forward pair is one real hour apart."
              } ]
            },
            "externalDescription" : [ {
              "locale" : "en_US",
              "text" : "Recognizes a one-hour real-time interval across Berlin's spring daylight-saving transition. Uses And, FieldFilled, ==, DifferenceInHours over /Permit/ReportedAt, /Permit/SettledAt."
            } ]
          } ]
        }
      } ]
    }
  }
}