Browse Source

Adjust to new PolzyFrontend-Functions

bernhardbuhl 3 years ago
parent
commit
23811272b5
5 changed files with 56 additions and 56 deletions
  1. 5 5
      AntragDrucken.py
  2. 2 2
      antrag.py
  3. 5 5
      pms/__init__.py
  4. 10 10
      pms/data/antrag_activities.json
  5. 34 34
      pms/data/antrags.json

+ 5 - 5
AntragDrucken.py

@@ -8,7 +8,7 @@ from dataclasses import dataclass
 @dataclass
 class Field:
     name: str
-    fieldType: int
+    fieldVisibilityType: int
     isGroupField: bool
     group: str
     valueOutput: object
@@ -26,12 +26,12 @@ class AntragDrucken:
         # Build field-list for printout
         for fieldGroup in self.antrag.instance["field_groups"]:
             self.activityFields.append(Field(name=fieldGroup["name"],
-                                             fieldType=fieldGroup["fieldType"],
+                                             fieldVisibilityType=fieldGroup["fieldVisibilityType"],
                                              isGroupField=True, group="", valueOutput=None,
                                              kurzbeschreibung=fieldGroup["brief"]))
             for field in self.antrag.instance[fieldGroup["name"]]:
                 self.activityFields.append(Field(name=field["name"],
-                                                 fieldType=field["fieldType"],
+                                                 fieldVisibilityType=field["fieldVisibilityType"],
                                                  isGroupField=False, group=fieldGroup["name"],
                                                  valueOutput=field["value"],
                                                  kurzbeschreibung=field["brief"]))
@@ -87,7 +87,7 @@ Based on the given parameters we are happy to provide a premium indication as fo
             for field in [x for x in self.activityFields if not x.isGroupField and x.group == groupField.name]:
                 if isinstance(field.valueOutput, datetime):
                     field.valueOutput = field.valueOutput.strftime("%Y-%M-%D")
-                if field.fieldType == 3:  # Don' print hidden fields!
+                if field.fieldVisibilityType == 3:  # Don' print hidden fields!
                     continue
                 template = f"""<tr><font face="arial" size="8"><b>
                     <td align="right">{str(field.kurzbeschreibung)}</td></b></font>
@@ -99,7 +99,7 @@ Based on the given parameters we are happy to provide a premium indication as fo
         for field in [x for x in self.activityFields if not x.isGroupField and not x.group]:
             if isinstance(field.valueOutput, datetime):
                 field.valueOutput = field.valueOutput.strftime("%Y-%M-%D")
-            if field.fieldType == 3:  # Don' print hidden fields!
+            if field.fieldVisibilityType == 3:  # Don' print hidden fields!
                 continue
             if field.name == "premium":
                 template = f"""<tr><font face="arial" size="9"><b>

+ 2 - 2
antrag.py

@@ -164,7 +164,7 @@ class SampleAntrag(Antrag):
         # create field if not exist
         if documents is None:
             documents = {
-                "fieldType": 2,
+                "fieldVisibilityType": 2,
                 "name": "Documents",
                 "brief": "Documents",
                 "tooltip": "Here you can manage the documents",
@@ -199,7 +199,7 @@ class SampleAntrag(Antrag):
 
         for key, value in data['values'].items():
             field = self.get_field_by_name(key)
-            if field and (field['fieldType'] == 1):
+            if field and (field['fieldVisibilityType'] == 1):
                 field['value'] = booleans.get(value) or value
                 if field.get("fieldDataType") == "FlagWithOptions" and field.get("relatedFields"):
                     for sub_field in field['relatedFields']:

+ 5 - 5
pms/__init__.py

@@ -20,7 +20,7 @@ activities = {
             {
                 "name": "Re-activation Date",
                 "brief": "Re-activation Date",
-                "fieldType": 1,
+                "fieldVisibilityType": 1,
                 "tooltip": "On what date should the re-activation be made?",
                 "type": "Datum",
                 "inputRange": [
@@ -41,7 +41,7 @@ activities = {
             {
                 "name": "Cancellation Reason",
                 "brief": "Cancellation Reason",
-                "fieldType": 1,
+                "fieldVisibilityType": 1,
                 "tooltip": "Please select a reason for cancellation from the list of possible reasons for cancellation. After selecting the reason for cancellation, further input fields may appear",
                 "type": "Text",
                 "inputRange": [
@@ -56,7 +56,7 @@ activities = {
             {
                 "name": "Cancellation Date",
                 "brief": "Cancellation Date",
-                "fieldType": 1,
+                "fieldVisibilityType": 1,
                 "tooltip": "On what date should the cancellation be made?",
                 "type": "Datum",
                 "inputRange": [
@@ -77,7 +77,7 @@ activities = {
             {
                 "name": "Suspension Reason",
                 "brief": "Suspension Reason",
-                "fieldType": 1,
+                "fieldVisibilityType": 1,
                 "tooltip": "Please select a reason for suspension from the list of possible reasons.",
                 "type": "Text",
                 "inputRange": [
@@ -93,7 +93,7 @@ activities = {
             {
                 "name": "Cancellation Date",
                 "brief": "Cancellation Date",
-                "fieldType": 1,
+                "fieldVisibilityType": 1,
                 "tooltip": "Date of the policy suspension",
                 "type": "Datum",
                 "inputRange": [

+ 10 - 10
pms/data/antrag_activities.json

@@ -27,7 +27,7 @@
       "icon": "downUploadDocuments.svg",
       "fields": [
         {
-          "fieldType": 2,
+          "fieldVisibilityType": 2,
           "name": "Attachments",
           "brief": "Attachments",
           "tooltip": "Here you can manage the attached documents",
@@ -52,7 +52,7 @@
       "icon": "iconQuestions.svg",
       "fields": [
         {
-          "fieldType": 1,
+          "fieldVisibilityType": 1,
           "name": "PreviousCancelation",
           "brief": "Did the policeholder <strong>cancel</strong> policies before?",
           "tooltip": "Please give the detailes on the previously canceled policies if any",
@@ -62,7 +62,7 @@
           "isMandatory": true,
           "relatedFields": [
             {
-              "fieldType": 1,
+              "fieldVisibilityType": 1,
               "name": "PreviouaseCancelDate",
               "brief": "Date of the Cancelation",
               "tooltip": "Please select the cancelation date of the last policy",
@@ -70,7 +70,7 @@
               "isMandatory": true
             },
             {
-              "fieldType": 1,
+              "fieldVisibilityType": 1,
               "name": "PreviousCancelationCompany",
               "brief": "Insurance Company",
               "tooltip": "Please type the name of the insurance company where the last polisy was cancel",
@@ -79,7 +79,7 @@
               "isMandatory": true
             },
             {
-              "fieldType": 1,
+              "fieldVisibilityType": 1,
               "name": "PreviousCancelationReason",
               "brief": "Cancelation Reason",
               "tooltip": "Please type the reason for the policy cancelation",
@@ -90,7 +90,7 @@
           ]
         },
         {
-          "fieldType": 2,
+          "fieldVisibilityType": 2,
           "name": "multiLineText",
           "brief": "Multiline Text",
           "tooltip": "This text is contains several lines",
@@ -110,7 +110,7 @@
       ],
       "field_groups": [
         {
-          "fieldType": 3,
+          "fieldVisibilityType": 3,
           "name": "NumericFields",
           "brief": "Numeric Data",
           "tooltip": "Examples of Numeric Data",
@@ -120,7 +120,7 @@
       ],
       "NumericFields": [
         {
-          "fieldType": 1,
+          "fieldVisibilityType": 1,
           "name": "regular",
           "brief": "Regular",
           "tooltip": "Please enter a number",
@@ -135,7 +135,7 @@
           "isMandatory": true
         },
         {
-          "fieldType": 1,
+          "fieldVisibilityType": 1,
           "name": "slider",
           "brief": "Slider",
           "tooltip": "Please select a number",
@@ -150,7 +150,7 @@
           "isMandatory": true
         },
         {
-          "fieldType": 1,
+          "fieldVisibilityType": 1,
           "name": "stepSlider",
           "brief": "Slider with Step",
           "tooltip": "Please select a number",

+ 34 - 34
pms/data/antrags.json

@@ -2,7 +2,7 @@
   "Automobile": {  
     "fields": [
       {
-        "fieldType": 2,
+        "fieldVisibilityType": 2,
         "name": "premium",
         "brief": "Premium",
         "tooltip": "Indicative premium based on the inputs",
@@ -21,7 +21,7 @@
     ],
     "field_groups": [
       {
-        "fieldType": 3,
+        "fieldVisibilityType": 3,
         "name": "Standard",
         "brief": "General Data",
         "tooltip": "General Data",
@@ -36,7 +36,7 @@
         "endpoint": ""
       },
       {
-        "fieldType": 3,
+        "fieldVisibilityType": 3,
         "name": "VehicleData",
         "brief": "Vehicle Data",
         "tooltip": "Vehicle Data",
@@ -51,7 +51,7 @@
         "endpoint": ""
       },
       {
-        "fieldType": 1,
+        "fieldVisibilityType": 1,
         "name": "Kasko",
         "brief": "Hull",
         "tooltip": "Hull Insurance",
@@ -66,7 +66,7 @@
         "endpoint": ""
       },
       {
-        "fieldType": 1,
+        "fieldVisibilityType": 1,
         "name": "Accident",
         "brief": "Accident Insurance",
         "tooltip": "Accident Insurance",
@@ -83,7 +83,7 @@
     ],
     "Standard": [
       {
-        "fieldType": 3,
+        "fieldVisibilityType": 3,
         "name": "InsuranceStart",
         "brief": "Start of insurance",
         "tooltip": "Please select the date of start of the insurance",
@@ -98,7 +98,7 @@
         "endpoint": ""
       },
       {
-        "fieldType": 1,
+        "fieldVisibilityType": 1,
         "name": "PreviousCancelation",
         "brief": "Did the policeholder cancel policies before?",
         "tooltip": "Please give the detailes on the previously canceled policies if any",
@@ -108,7 +108,7 @@
         "isMandatory": true,
         "relatedFields": [
           {
-            "fieldType": 1,
+            "fieldVisibilityType": 1,
             "name": "PreviouaseCancelDate",
             "brief": "Date of the Cancelation",
             "tooltip": "Please select the cancelation date of the last policy",
@@ -116,7 +116,7 @@
             "isMandatory": true
           },
           {
-            "fieldType": 1,
+            "fieldVisibilityType": 1,
             "name": "PreviousCancelationCompany",
             "brief": "Insurance Company",
             "tooltip": "Please type the name of the insurance company where the last polisy was cancel",
@@ -125,7 +125,7 @@
             "isMandatory": true
           },
           {
-            "fieldType": 1,
+            "fieldVisibilityType": 1,
             "name": "PreviousCancelationReason",
             "brief": "Cancelation Reason",
             "tooltip": "Please type the reason for the policy cancelation",
@@ -136,7 +136,7 @@
         ]
       },
       {
-        "fieldType": 1,
+        "fieldVisibilityType": 1,
         "name": "VehicleType",
         "brief": "Vehicle Type",
         "tooltip": "Please select the type of vehicle",
@@ -158,7 +158,7 @@
         "endpoint": ""
       },
       {
-        "fieldType": 1,
+        "fieldVisibilityType": 1,
         "name": "Brand",
         "brief": "Brand",
         "tooltip": "Please select the manufacturer of the vehicle",
@@ -172,7 +172,7 @@
         "endpoint": ""
       },
       {
-        "fieldType": 1,
+        "fieldVisibilityType": 1,
         "name": "OwnerAge",
         "brief": "Owner's Age",
         "tooltip": "Please enter the age of the license holder",
@@ -191,7 +191,7 @@
         "endpoint": ""
       },
       {
-        "fieldType": 3,
+        "fieldVisibilityType": 3,
         "name": "DriverUnder23",
         "brief": "Driver Under 23",
         "tooltip": "Do drivers under the age of 23 also drive this vehicle?",
@@ -206,7 +206,7 @@
         "endpoint": ""
       },
       {
-        "fieldType": 1,
+        "fieldVisibilityType": 1,
         "name": "OwnerPostcode",
         "brief": "Owner's Postcode",
         "tooltip": "Post code of the registration address of the license holder",
@@ -225,7 +225,7 @@
         "endpoint": ""
       },
       {
-        "fieldType": 1,
+        "fieldVisibilityType": 1,
         "name": "BonusLevel",
         "brief": "Bonus Level",
         "tooltip": "Please enter the bonus level for calculation",
@@ -244,7 +244,7 @@
         "endpoint": ""
       },
       {
-        "fieldType": 1,
+        "fieldVisibilityType": 1,
         "name": "IntendedUse",
         "brief": "Intended Use",
         "tooltip": "",
@@ -264,7 +264,7 @@
         "endpoint": ""
       },
       {
-        "fieldType": 1,
+        "fieldVisibilityType": 1,
         "name": "Discount",
         "brief": "Discount",
         "tooltip": "Please select the discount level",
@@ -283,7 +283,7 @@
         "endpoint": ""
       },
       {
-        "fieldType": 1,
+        "fieldVisibilityType": 1,
         "name": "PaymentFrequency",
         "brief": "Payment Frequency",
         "tooltip": "Select the payment frequency from the list",
@@ -304,7 +304,7 @@
     ],
     "VehicleData": [
       {
-        "fieldType": 1,
+        "fieldVisibilityType": 1,
         "name": "VehicleAge",
         "brief": "Vehicle Age",
         "tooltip": "Please enter the age of the vehicle",
@@ -333,7 +333,7 @@
         "endpoint": ""
       },
       {
-        "fieldType": 1,
+        "fieldVisibilityType": 1,
         "name": "EngineType",
         "brief": "Engine Type",
         "tooltip": "Please select the type of the engine",
@@ -358,7 +358,7 @@
         "endpoint": ""
       },
       {
-        "fieldType": 1,
+        "fieldVisibilityType": 1,
         "name": "CO2",
         "brief": "CO2 Value",
         "tooltip": "Please enter the CO2 value of the vehicle",
@@ -377,7 +377,7 @@
         "endpoint": ""
       },
       {
-        "fieldType": 1,
+        "fieldVisibilityType": 1,
         "name": "KW",
         "brief": "Kilowatt",
         "tooltip": "Please enter the KW value of the vehicle",
@@ -396,7 +396,7 @@
         "endpoint": ""
       },
       {
-        "fieldType": 3,
+        "fieldVisibilityType": 3,
         "name": "EngineSize",
         "brief": "Engine Size",
         "tooltip": "Please enter the engine size of the vehicle",
@@ -417,7 +417,7 @@
     ],
     "Kasko": [
       {
-        "fieldType": 1,
+        "fieldVisibilityType": 1,
         "name": "ListPrice",
         "brief": "List Price",
         "tooltip": "Indication of the new list price including NOVA and VAT",
@@ -436,7 +436,7 @@
         "endpoint": ""
       },
       {
-        "fieldType": 1,
+        "fieldVisibilityType": 1,
         "name": "SpecialEquipment",
         "brief": "Special Equipment",
         "tooltip": "Specification of the special equipment including VAT. (if applicable)",
@@ -451,7 +451,7 @@
         "endpoint": ""
       },
       {
-        "fieldType": 1,
+        "fieldVisibilityType": 1,
         "name": "KaskoVariant",
         "brief": "Hull Variant",
         "tooltip": "Select a hull insurance variant",
@@ -473,7 +473,7 @@
         "endpoint": ""
       },
       {
-        "fieldType": 1,
+        "fieldVisibilityType": 1,
         "name": "KaskoSBH",
         "brief": "Deductible Hull",
         "tooltip": "Select which waiver amount should be apply",
@@ -494,7 +494,7 @@
     ],
     "Accident": [
       {
-        "fieldType": 1,
+        "fieldVisibilityType": 1,
         "name": "AccidentVariants",
         "brief": "Accident Variants",
         "tooltip": "Select whether you want cover only the driver or driver and passenger in case of an accident",
@@ -512,7 +512,7 @@
         "endpoint": ""
       },
       {
-        "fieldType": 1,
+        "fieldVisibilityType": 1,
         "name": "AccidentIban",
         "brief": "IBAN",
         "tooltip": "Type some description here",
@@ -521,7 +521,7 @@
         "isMandatory": false
       },
       {
-        "fieldType": 2,
+        "fieldVisibilityType": 2,
         "name": "AccidentDeath",
         "brief": "Death",
         "tooltip": "Sum insured in the event of death",
@@ -536,7 +536,7 @@
         "endpoint": ""
       },
       {
-        "fieldType": 2,
+        "fieldVisibilityType": 2,
         "name": "AccidentDisability",
         "brief": "Permanent Disability",
         "tooltip": "Sum insured in the event of permanent disability",
@@ -553,7 +553,7 @@
         "endpoint": ""
       },
       {
-        "fieldType": 2,
+        "fieldVisibilityType": 2,
         "name": "AccidentDisability",
         "brief": "Disability Benefit",
         "tooltip": "Move mouse over the image to see details",
@@ -612,7 +612,7 @@
         "endpoint": ""
       },
       {
-        "fieldType": 2,
+        "fieldVisibilityType": 2,
         "name": "Chart",
         "brief": "Chart Demo",
         "tooltip": "Time series example",