// config/ConfigValidator.kt package com.complycube.reactnative.config interface ConfigValidator { fun validate(config: Map): ValidationResult } class ComplyCubeConfigValidator : ConfigValidator { override fun validate(config: Map): ValidationResult { val clientId = config["clientID"] as? String if (clientId.isNullOrBlank()) { return ValidationResult.Error("Client ID is required", "clientID") } val clientToken = config["clientToken"] as? String if (clientToken.isNullOrBlank()) { return ValidationResult.Error("Client token is required", "clientToken") } val workflowId = config["workflowTemplateId"] as? String val stages = config["stages"] as? List<*> if (workflowId.isNullOrBlank() && (stages == null || stages.isEmpty())) { return ValidationResult.Error( "Either workflowTemplateId or stages must be provided", "workflowTemplateId|stages" ) } return ValidationResult.Success(Unit) } }