package com.prodhack.moscow2025.domain.usecase

import com.prodhack.moscow2025.data.data_providers.PhoneNumberPatternsProvider
import com.prodhack.moscow2025.domain.models.PhoneNumberPattern
import java.util.Locale
import org.koin.core.annotation.Single

@Single
class GetDefaultPhoneNumberPatternUseCase {
	fun execute(): PhoneNumberPattern? {
		val locale = Locale.getDefault()

		return PhoneNumberPatternsProvider.phoneNumberPatterns.find {
			it.countryCodeISO.equals(
				locale.country,
				ignoreCase = true
			)
		}
	}
}
