// config/ComplyCubeConfigurationFactory.kt package com.complycube.reactnative.config import com.complycube.reactnative.config.helper.AndroidColorConverter import com.complycube.reactnative.config.helper.ColorConverter import com.complycube.reactnative.config.helper.ColorSchemeParser import com.complycube.reactnative.config.helper.CustomerInfoFieldMapper import com.complycube.reactnative.config.helper.MetadataTemplateProcessor import com.complycube.reactnative.config.parser.AddressStageParser import com.complycube.reactnative.config.parser.CountryExtractor import com.complycube.reactnative.config.parser.CustomerInfoParser import com.complycube.reactnative.config.parser.CustomerInfoStageParser import com.complycube.reactnative.config.parser.DocumentStageParser import com.complycube.reactnative.config.parser.DocumentTypeParser import com.complycube.reactnative.config.parser.DesignTokensParser import com.complycube.reactnative.config.parser.FaceStageParser import com.complycube.reactnative.config.parser.LookAndFeelParser import com.complycube.reactnative.config.parser.MapStageParserFactory import com.complycube.reactnative.config.parser.ProofOfAddressStageParser import com.complycube.reactnative.config.parser.StageParserFactory import com.complycube.reactnative.config.parser.StringStageParser class ComplyCubeConfigurationFactory( private val colorConverter: ColorConverter = AndroidColorConverter() ) { fun createConfigBuilder(): ComplyCubeConfigBuilder { // Create utilities val countryExtractor = CountryExtractor() val fieldMapper = CustomerInfoFieldMapper() val templateProcessor = MetadataTemplateProcessor() // Create parsers val colorSchemeParser = ColorSchemeParser(colorConverter) val designTokensParser = DesignTokensParser() val lookAndFeelParser = LookAndFeelParser(colorConverter) val customerInfoParser = CustomerInfoParser(fieldMapper, templateProcessor) // Create stage parsers val documentTypeParser = DocumentTypeParser(countryExtractor) val documentStageParser = DocumentStageParser(documentTypeParser) val faceStageParser = FaceStageParser() val poaStageParser = ProofOfAddressStageParser(countryExtractor) val addressStageParser = AddressStageParser() val customerInfoStageParser = CustomerInfoStageParser(customerInfoParser) // Create stage parser factory val mapStageParserFactory = MapStageParserFactory( documentStageParser, faceStageParser, poaStageParser, addressStageParser, customerInfoStageParser ) val stringStageParser = StringStageParser() val stageParserFactory = StageParserFactory(stringStageParser, mapStageParserFactory) // Create validator val validator = ComplyCubeConfigValidator() return ComplyCubeConfigBuilder( validator, stageParserFactory, designTokensParser, lookAndFeelParser, colorSchemeParser, countryExtractor ) } }