
{
    "id": "legacy_traffic_report",
    "title": "Traffic Report",
    "description": "Generate a traffic citation report.",
    "icon": "Car",
    "is_html_output": false,
    "custom_button_text": "Open MDC Record",
    "custom_button_link": "https://mdc.gta.world/persons/{{defendant_name}}",
    "custom_button_replace_spaces": true,
    "output": "{{#each officers}}<strong>{{this.rank}} {{this.name}}</strong> (<strong>#{{this.badgeNumber}}</strong>), {{/each}} under the call sign <strong>{{general.callSign}}</strong> on the <strong>{{general.date}}</strong>, <strong>{{general.time}}</strong>.<br>Conducted a traffic stop on a <strong>{{vehicle_make_model}}</strong>, on <strong>{{location.street}}</strong>, <strong>{{location.district}}</strong>.<br>The vehicle was {{#if vehicle_registered}}<strong>registered</strong>{{else}}<strong>unregistered</strong>{{/if}} to <strong>{{#if vehicle_owner}}{{vehicle_owner}}{{else}}N/A{{/if}}</strong>, with the identification plate reading <strong>{{#if vehicle_plate}}{{vehicle_plate}}{{else}}N/A{{/if}}</strong>.<br>{{#if vehicle_insured}}The vehicle was insured at the time of the stop.{{else}}The vehicle was uninsured at the time of the conducted traffic stop, having expired on the <strong>{{insurance_expired_date}}</strong>.{{/if}}<br>The vehicle's window tint was <strong>{{vehicle_tint_level}}</strong>.<br>The driver was identified as <strong>{{defendant_name}}</strong>, possessing a <strong>{{defendant_license_status}} drivers license</strong>.<br>{{narrative}}<br><br>Following charge(s) were issued:<ul>{{#each charges}}<li><strong class=\"style-underline chargeCopy\"><span id=\"charge-{{this.chargeId}}\"><strong style=\"color: #27ae60!important;\">{{#with (lookup @root.penalCode this.chargeId)}}{{this.type}}{{../class}}. {{this.id}}. {{this.charge}}{{/with}}</strong></span></strong> - <strong style=\"color: green!important;\">${{../fine}}</strong> Citation</li>{{/each}}</ul><strong style=\"color: #9944dd!important;\">*</strong> {{dashcam}} <strong style=\"color: #9944dd!important;\">*</strong>",
    "form": [
        { "type": "hidden", "name": "generatorType", "value": "TrafficReport" },
        { "type": "section", "title": "General Section" },
        { "type": "general", "name": "general" },
        { "type": "section", "title": "Officer Section" },
        { "type": "officer", "name": "officers", "showBadgeNumber": true },
        { "type": "section", "title": "Defendant & Narrative" },
        { "type": "text", "name": "defendant_name", "label": "Defendant's Full Name", "placeholder": "Firstname Lastname", "required": true },
        { "type": "dropdown", "name": "defendant_license_status", "label": "Driver's License Status", "placeholder": "Select License Status", "options": ["Valid", "No License", "Expired", "Suspended", "Revoked"], "required": true },
        { "type": "textarea", "name": "narrative", "label": "Traffic Stop Narrative", "placeholder": "Witnessed the defendant to be...", "required": true },
        { "type": "textarea", "name": "dashcam", "label": "Dashboard Camera", "placeholder": "The dashboard camera captures audio and video footage showcasing...", "required": true },
        { "type": "section", "title": "Location Details" },
        { 
            "type": "location", 
            "name": "location", 
            "showDistrict": true 
        },
        { "type": "section", "title": "Vehicle Details" },
        { "type": "group", "fields": [
            { "type": "toggle", "name": "vehicle_registered", "label": "Registration Status", "dataOn": "Registered", "dataOff": "Unregistered", "defaultValue": true },
            { "type": "text", "name": "vehicle_owner", "label": "Registered Owner", "placeholder": "Firstname Lastname", "stipulation": {"field": "vehicle_registered", "value": true}},
            { "type": "text", "name": "vehicle_plate", "label": "Identification Plate", "placeholder": "###XXX", "stipulation": {"field": "vehicle_registered", "value": true}}
          ]
        },
        { "type": "group", "fields": [
            { "type": "toggle", "name": "vehicle_insured", "label": "Insurance Status", "dataOn": "Insured", "dataOff": "Uninsured", "defaultValue": true },
            { "type": "text", "name": "insurance_expired_date", "label": "Insurance Expired Date", "placeholder": "DD/MM/YYYY", "stipulation": {"field": "vehicle_insured", "value": false}}
          ]
        },
        { "type": "group", "fields": [
            { "type": "datalist", "name": "vehicle_make_model", "label": "Make & Model", "placeholder": "e.g. Benefactor Dubsta", "optionsSource": "vehicles", "required": true },
            {
                "type": "dropdown", 
                "name": "vehicle_tint_level", 
                "label": "Tint Level", 
                "placeholder": "Select Tint Level",
                "defaultValue": "Uninspected",
                "options": [
                    "Uninspected",
                    {
                        "label": "Legal",
                        "items": ["Level 0", "Level 3", "Level 4", "Level 5"]
                    },
                    {
                        "label": "Illegal",
                        "items": ["Level 1", "Level 2"]
                    }
                ], 
                "required": true 
            }
        ]},
        { "type": "section", "title": "Charges" },
        { 
            "type": "charge", 
            "name": "charges",
            "showClass": true,
            "allowedTypes": { "M": true, "I": true },
            "allowedIds": "401-429,435-442",
            "customFields": [
                {
                    "type": "text",
                    "name": "fine",
                    "label": "Fine",
                    "placeholder": "Fine Amount"
                }
            ],
            "previewFields": {
                "fine": true,
                "impound": true,
                "suspension": true
            },
            "copyable_charge": true
        }
    ],
    "countyCityStipulation": false
}
