{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://schemas.neurondigitaltrading.com/select/us/cyber/broker/final/submission/v1/validations",
    "title": "Neuron Cyber Submission Schema (Submitted State)",
    "description": "Strict validation schema for Submissions in SUBMITTED state.",
    "type": "object",
    "additionalProperties": true,
    "properties": {
		"$schema": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2048
        },
        "submissionId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
        },
        "status": {
            "type": "string",
            "enum": [
                "DRAFT"
            ]
        },
        "processStatus": {
            "type": "string",
            "enum": [
                "SUBMITTED_TO_BROKER"
            ]
        },
        "submissionCreatedAt": {
            "type": "string",
            "format": "date-time"
        },
        "submissionUpdatedAt": {
            "type": "string",
            "format": "date-time"
        },
        "submissionSubmittedAt": {
            "type": "string",
            "format": "date-time"
        },
        "brokerId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
        },
        "carrierIds": {
            "type": "array",
            "minItems": 1,
            "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
            }
        },
        "carrierNames": {
            "type": "array",
            "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
            }
        },
        "quoteDueDate": {
            "type": "string",
            "format": "date"
        },
        "isIncumbent": {
            "type": "boolean"
        },
        "expiringPolicy": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
        },
        "sanctionsClear": {
            "type": "boolean",
            "const": true
        },
        "comments": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4000
        },
        "type": {
            "type": "string",
            "enum": [
                "LOW-COMPLEXITY"
            ]
        },
        "documents": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "name": {
                        "type": "string"
                    },
                    "url": {
                        "type": "string"
                    },
                    "contentType": {
                        "type": "string"
                    }
                }
            }
        },
        "contacts": {
            "type": "object",
            "additionalProperties": false,
            "required": [
                "broker",
                "insured",
                "cybersecurity"
            ],
            "properties": {
                "broker": {
                    "type": "object",
                    "required": [
                        "name",
                        "email"
                    ],
                    "properties": {
                        "name": {
                            "type": "string",
                            "maxLength": 100
                        },
                        "email": {
                            "type": "string",
                            "maxLength": 100
                        },
                        "phone": {
                            "type": "string",
                            "maxLength": 20
                        },
                        "role": {
                            "type": "string",
                            "maxLength": 100
                        }
                    }
                },
                "insured": {
                    "type": "object",
                    "required": [
                        "name",
                        "email",
                        "role"
                    ],
                    "properties": {
                        "name": {
                            "type": "string",
                            "maxLength": 100
                        },
                        "email": {
                            "type": "string",
                            "maxLength": 100
                        },
                        "role": {
                            "type": "string",
                            "maxLength": 100
                        }
                    }
                },
                "cybersecurity": {
                    "type": "object",
                    "required": [
                        "name",
                        "email",
                        "phone",
                        "role"
                    ],
                    "properties": {
                        "name": {
                            "type": "string",
                            "maxLength": 100
                        },
                        "email": {
                            "type": "string",
                            "maxLength": 100
                        },
                        "phone": {
                            "type": "string",
                            "maxLength": 20
                        },
                        "role": {
                            "type": "string",
                            "maxLength": 100
                        }
                    }
                }
            }
        },
        "brokerageOffices": {
            "type": "object",
            "required": [
                "name",
                "address"
            ],
            "properties": {
                "name": {
                    "type": "string",
                    "maxLength": 200
                },
                "address": {
                    "$ref": "#/$defs/addressBlock"
                }
            }
        },
        "insured": {
            "type": "object",
            "additionalProperties": false,
            "required": [
                "GCID",
                "name",
                "address",
                "industryClassificationSystem",
                "websiteAddress",
                "businessDescription",
                "revenueGeneratingOperationsOutsideDomiciledCountry",
                "numberOfEmployees",
                "revenue",
                "highRiskOrRegulatedActivitiesEngagement",
                "mergersAcquisitions"
            ],
            "properties": {
                "GCID": {
                    "type": "integer"
                },
                "name": {
                    "type": "string",
                    "maxLength": 200
                },
                "address": {
                    "$ref": "#/$defs/addressBlock"
                },
                "industryClassificationSystem": {
                    "type": "string",
                    "enum": [
                        "NAICS",
                        "SIC"
                    ]
                },
                "predominantIndustryNAICS": {
                    "type": "string"
                },
                "NAICS": {
                    "type": "string"
                },
                "predominantIndustrySIC": {
                    "type": "string"
                },
                "SIC": {
                    "type": "string"
                },
                "websiteAddress": {
                    "type": "string",
                    "maxLength": 500
                },
                "businessDescription": {
                    "type": "string",
                    "maxLength": 500
                },
                "revenueGeneratingOperationsOutsideDomiciledCountry": {
                    "type": "boolean"
                },
                "revenueGeneratingOperationsOutsideDomiciledCountryPrcnt": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 100
                },
                "numberOfEmployees": {
                    "type": "integer",
                    "maximum": 999999999999
                },
                "revenue": {
                    "type": "object",
                    "required": [
                        "recentYear",
                        "currentYear"
                    ],
                    "properties": {
                        "recentYear": {
                            "$ref": "#/$defs/moneyBlock"
                        },
                        "currentYear": {
                            "$ref": "#/$defs/moneyBlock"
                        }
                    }
                },
                "highRiskOrRegulatedActivitiesEngagement": {
                    "type": "boolean"
                },
                "mergersAcquisitions": {
                    "type": "boolean"
                }
            },
            "allOf": [
                {
                    "if": {
                        "properties": {
                            "industryClassificationSystem": {
                                "const": "NAICS"
                            }
                        }
                    },
                    "then": {
                        "required": [
                            "predominantIndustryNAICS",
                            "NAICS"
                        ]
                    }
                },
                {
                    "if": {
                        "properties": {
                            "industryClassificationSystem": {
                                "const": "SIC"
                            }
                        }
                    },
                    "then": {
                        "required": [
                            "predominantIndustrySIC",
                            "SIC"
                        ]
                    }
                },
                {
                    "if": {
                        "properties": {
                            "revenueGeneratingOperationsOutsideDomiciledCountry": {
                                "const": true
                            }
                        }
                    },
                    "then": {
                        "required": [
                            "revenueGeneratingOperationsOutsideDomiciledCountryPrcnt"
                        ]
                    }
                }
            ]
        },
        "policyHolder": {
            "type": "object",
            "additionalProperties": false,
            "required": [
                "name",
                "address"
            ],
            "properties": {
                "name": {
                    "type": "string",
                    "maxLength": 200
                },
                "address": {
                    "$ref": "#/$defs/addressBlock"
                }
            }
        },
        "options": {
            "type": "array",
            "minItems": 1,
            "items": {
                "type": "object",
                "additionalProperties": true,
                "required": [
                    "optionId",
                    "description",
                    "includedRiskIds",
                    "inceptionDate",
                    "expiryDate",
                    "policyLimit",
                    "deductible",
                    "risks"
                ],
                "properties": {
                    "optionId": {
                        "type": "string",
                        "maxLength": 200
                    },
                    "description": {
                        "type": "string",
                        "maxLength": 200
                    },
                    "includedRiskIds": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "inceptionDate": {
                        "type": "string",
                        "format": "date"
                    },
                    "expiryDate": {
                        "type": "string",
                        "format": "date"
                    },
                    "brokeragePercentage": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 99.99
                    },
                    "currency": {
                        "type": "string",
                        "minLength": 3,
                        "maxLength": 3
                    },
                    "annualPremium": {
                        "$ref": "#/$defs/moneyBlock"
                    },
                    "policyLimit": {
                        "$ref": "#/$defs/moneyBlock"
                    },
                    "deductible": {
                        "$ref": "#/$defs/moneyBlock"
                    },
                    "limitBasis": {
                        "type": "string",
                        "enum": [
                            "Aggregate",
                            "All claims",
                            "Each claim"
                        ]
                    },
                    "retroactiveDate": {
                        "type": "string",
                        "description": "Can be a specific date (YYYY-MM-DD) or a standard term.",
                        "oneOf": [
                            {
                                "format": "date",
                                "description": "RFC 3339 date format"
                            },
                            {
                                "enum": [
                                    "Full prior acts",
                                    "N/A",
                                    "Unlimited"
                                ],
                                "description": "Standard business terms"
                            }
                        ]
                    },
                    "waitingPeriodHours": {
                        "type": "integer",
                        "maximum": 99999
                    },
                    "risks": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "additionalProperties": false,
                            "required": [
                                "optionRiskId",
                                "riskId",
                                "lineOfBusiness",
                                "coverageNames"
                            ],
                            "properties": {
                                "optionRiskId": {
                                    "type": "string",
                                    "maxLength": 500
                                },
                                "riskId": {
                                    "type": "string",
                                    "maxLength": 200
                                },
                                "lineOfBusiness": {
                                    "type": "string",
                                    "const": "Cyber"
                                },
                                "coverageNames": {
                                    "type": "array",
                                    "items": {
                                        "type": "string"
                                    }
                                },
                                "coverages": {
                                    "type": "object",
                                    "additionalProperties": false,
                                    "properties": {
                                        "dataNetworkSecurityLiability": {
                                            "$ref": "#/$defs/coverageDetail"
                                        },
                                        "regulatoryDefense": {
                                            "$ref": "#/$defs/coverageDetail"
                                        },
                                        "pciDssLiability": {
                                            "$ref": "#/$defs/coverageDetail"
                                        },
                                        "mediaLiability": {
                                            "$ref": "#/$defs/coverageDetail"
                                        },
                                        "contingentBodilyInjury": {
                                            "$ref": "#/$defs/coverageDetail"
                                        },
                                        "incidentResponseCost": {
                                            "$ref": "#/$defs/coverageDetail"
                                        },
                                        "nonPanelResponseProvider": {
                                            "$ref": "#/$defs/coverageDetail"
                                        },
                                        "publicRelationsAndCrisisManagement": {
                                            "$ref": "#/$defs/coverageDetail"
                                        },
                                        "extortionLoss": {
                                            "$ref": "#/$defs/coverageDetail"
                                        },
                                        "businessInterruptionLoss": {
                                            "$ref": "#/$defs/coverageDetailWithWaitingPeriod"
                                        },
                                        "contingentBusinessInterruptionLoss": {
                                            "$ref": "#/$defs/coverageDetailWithWaitingPeriod"
                                        },
                                        "digitalDataRecovery": {
                                            "$ref": "#/$defs/coverageDetail"
                                        },
                                        "reputationLoss": {
                                            "$ref": "#/$defs/coverageDetail"
                                        },
                                        "computerReplacementAndBricking": {
                                            "$ref": "#/$defs/coverageDetail"
                                        },
                                        "criminalReward": {
                                            "$ref": "#/$defs/coverageDetail"
                                        },
                                        "fundsTransferFraud": {
                                            "$ref": "#/$defs/coverageDetail"
                                        },
                                        "fraudulentInstruction": {
                                            "$ref": "#/$defs/coverageDetail"
                                        },
                                        "invoiceManipulation": {
                                            "$ref": "#/$defs/coverageDetail"
                                        },
                                        "socialEngineeringFraud": {
                                            "$ref": "#/$defs/coverageDetail"
                                        },
                                        "telecommunicationsTheftLoss": {
                                            "$ref": "#/$defs/coverageDetail"
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "riskAttributes": {
            "type": "object",
            "additionalProperties": false,
            "required": [
                "lineOfBusinesses",
                "mfaForRemoteAccessToTheNetwork",
                "mfaForAccessToWebBasedEmail",
                "emailSecurityControls",
                "frequencyOfInteractiveSocialEngineeringTraining",
                "frequencyOfBusinessCriticalDataBackup",
                "companyDevicesProtectionSoftwareUsage",
                "installedCriticalPatchesAcrossInternetFacingSystems",
                "microsoft365DefenderUsage",
                "defaultMacrosOfficeSetting",
                "eppToPreventOrDetectMaliciousActivity",
                "edrToPreventOrDetectMaliciousActivity",
                "mdrToPreventOrDetectMaliciousActivity",
                "hardenedBaselineConfigurationUsage",
                "cloudBasedBackupService",
                "incidentResponsePlan",
                "reviewProcessForScreeningMediaMaterial",
                "attorneyReviewsOfMediaMaterial",
                "contentRemovalPolicy",
                "employeesAntiFraudTraining",
                "vendorAccountChangeVerification"
            ],
            "properties": {
                "lineOfBusinesses": {
                    "type": "array",
                    "items": {
                        "type": "string",
                        "const": "Cyber"
                    }
                },
                "mfaForRemoteAccessToTheNetwork": {
                    "type": "string",
                    "enum": [
                        "Yes",
                        "No",
                        "Remote access not permitted"
                    ]
                },
                "mfaForAccessToWebBasedEmail": {
                    "type": "string",
                    "enum": [
                        "Yes",
                        "No",
                        "Access not permitted/no web-based email"
                    ]
                },
                "emailSecurityControls": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "frequencyOfInteractiveSocialEngineeringTraining": {
                    "type": "string",
                    "enum": [
                        "Never",
                        "Annually",
                        ">=2x per year"
                    ]
                },
                "frequencyOfBusinessCriticalDataBackup": {
                    "type": "string",
                    "enum": [
                        "No",
                        "Monthly",
                        "Weekly",
                        "Daily"
                    ]
                },
                "companyDevicesProtectionSoftwareUsage": {
                    "type": "boolean"
                },
                "installedCriticalPatchesAcrossInternetFacingSystems": {
                    "type": "boolean"
                },
                "microsoft365DefenderUsage": {
                    "type": "boolean"
                },
                "defaultMacrosOfficeSetting": {
                    "type": "boolean"
                },
                "eppToPreventOrDetectMaliciousActivity": {
                    "type": "string"
                },
                "edrToPreventOrDetectMaliciousActivity": {
                    "type": "string"
                },
                "mdrToPreventOrDetectMaliciousActivity": {
                    "type": "string"
                },
                "hardenedBaselineConfigurationUsage": {
                    "type": "boolean"
                },
                "cloudBasedBackupService": {
                    "type": "string"
                },
                "incidentResponsePlan": {
                    "type": "boolean"
                },
                "reviewProcessForScreeningMediaMaterial": {
                    "type": "boolean"
                },
                "attorneyReviewsOfMediaMaterial": {
                    "type": "boolean"
                },
                "contentRemovalPolicy": {
                    "type": "boolean"
                },
                "employeesAntiFraudTraining": {
                    "type": "boolean"
                },
                "vendorAccountChangeVerification": {
                    "type": "boolean"
                }
            }
        },
        "claims": {
            "type": "object",
            "additionalProperties": false,
            "required": [
                "claims5YearsAvailable",
                "potentialClaimNotification",
                "occurredCyberClaimComplaintInTheLast5Years",
                "privacyInvestigation5YearsHistory",
                "dataBreachIncidentsDuringTheLast5Years",
                "actualOrAttemptedExtortionDemandToComputerSystems",
                "3OrMoreOccurredClaimsActionsEvents"
            ],
            "properties": {
                "claims5YearsAvailable": {
                    "type": "boolean"
                },
                "potentialClaimNotification": {
                    "type": "boolean"
                },
                "occurredCyberClaimComplaintInTheLast5Years": {
                    "type": "boolean"
                },
                "history": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "amountOfClaim": {
                                "type": "number"
                            },
                            "claimAmountCurrency": {
                                "type": "string"
                            }
                        }
                    }
                },
                "privacyInvestigation5YearsHistory": {
                    "type": "boolean"
                },
                "dataBreachIncidentsDuringTheLast5Years": {
                    "type": "boolean"
                },
                "actualOrAttemptedExtortionDemandToComputerSystems": {
                    "type": "boolean"
                },
                "3OrMoreOccurredClaimsActionsEvents": {
                    "type": "boolean"
                },
                "disclosuresAndClarifications": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                }
            },
            "allOf": [
                {
                    "if": {
                        "properties": {
                            "claims5YearsAvailable": {
                                "const": true
                            }
                        }
                    },
                    "then": {
                        "properties": {
                            "history": {
                                "items": {
                                    "required": [
                                        "amountOfClaim",
                                        "claimAmountCurrency"
                                    ]
                                }
                            }
                        }
                    }
                }
            ]
        }
    },
    "required": [
        "$schema",
		"submissionId",
        "quoteDueDate",
        "brokerId",
        "carrierIds",
        "type",
        "contacts",
        "brokerageOffices",
        "insured",
        "policyHolder",
        "options",
        "riskAttributes"
    ],
    "$defs": {
        "addressBlock": {
            "type": "object",
            "required": [
                "addressLine1",
                "city",
                "postCodeZip",
                "country"
            ],
            "properties": {
                "addressLine1": {
                    "type": "string",
                    "maxLength": 200
                },
                "addressLine2": {
                    "type": "string",
                    "maxLength": 200
                },
                "addressLine3": {
                    "type": "string",
                    "maxLength": 200
                },
                "addressLine4": {
                    "type": "string",
                    "maxLength": 200
                },
                "city": {
                    "type": "string",
                    "maxLength": 58
                },
                "postCodeZip": {
                    "type": "string",
                    "maxLength": 20
                },
                "country": {
                    "type": "string",
                    "enum": [
                        "US"
                    ]
                },
                "state": {
                    "type": "string"
                }
            },
            "allOf": [
                {
                    "if": {
                        "properties": {
                            "country": {
                                "const": "US"
                            }
                        }
                    },
                    "then": {
                        "required": [
                            "state"
                        ]
                    }
                }
            ]
        },
        "moneyBlock": {
            "type": "object",
            "required": [
                "amount",
                "currency"
            ],
            "properties": {
                "amount": {
                    "type": "number",
                    "minimum": 1
                },
                "currency": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 3
                }
            }
        },
        "coverageDetail": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
                "limitAmount": {
                    "type": "number",
                    "minimum": 1
                },
                "limitCurrency": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 3
                },
                "limitBasis": {
                    "type": "string",
                    "enum": [
                        "Aggregate",
                        "All claims",
                        "Each claim"
                    ]
                },
                "deductibleAmount": {
                    "type": "number",
                    "minimum": 1
                },
                "deductibleCurrency": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 3
                },
                "retentionAmount": {
                    "type": "number",
                    "minimum": 1
                },
                "retentionCurrency": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 3
                }
            }
        },
        "coverageDetailWithWaitingPeriod": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
                "limitAmount": {
                    "type": "number",
                    "minimum": 1
                },
                "limitCurrency": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 3
                },
                "limitBasis": {
                    "type": "string",
                    "enum": [
                        "Aggregate",
                        "All claims",
                        "Each claim"
                    ]
                },
                "deductibleAmount": {
                    "type": "number",
                    "minimum": 1
                },
                "deductibleCurrency": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 3
                },
                "retentionAmount": {
                    "type": "number",
                    "minimum": 1
                },
                "retentionCurrency": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 3
                },
                "waitingPeriodHours": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 99999
                }
            }
        }
    }
}