from functools import cached_property

from django.apps import AppConfig


class SoileConfig(AppConfig):
    default_auto_field = "django.db.models.BigAutoField"
    name = "soile"
    verbose_name = "Soile"

    @cached_property
    def soil_moisture_service(self):
        from .services import SoilMoistureHeatmapService

        return SoilMoistureHeatmapService()

    def get_soil_moisture_service(self):
        return self.soil_moisture_service

    @cached_property
    def soil_health_service(self):
        from .services import SoilHealthService

        return SoilHealthService()

    def get_soil_health_service(self):
        return self.soil_health_service

    @cached_property
    def soil_anomaly_service(self):
        from .services import SoilAnomalyDetectionService

        return SoilAnomalyDetectionService()

    def get_soil_anomaly_service(self):
        return self.soil_anomaly_service
