# settings.py
import os
from dotenv import load_dotenv
from datetime import timedelta
import platform

#load_dotenv()
#env = os.getenv('ENVIRONMENT', 'testing')
#dotenv_path = f'.env.{env}'
#load_dotenv(dotenv_path=dotenv_path)

os.environ['FLASK_ENV'] = 'testing'
from pathlib import Path
base_dir = Path(__file__).resolve().parent
env_file = base_dir / ('.env.testing' if os.getenv('FLASK_ENV') == 'testing' else '.env')
#env_file = '.env.testing' if os.getenv('FLASK_ENV') == 'testing' else '.env'
load_dotenv(dotenv_path=env_file)


DB_URL = os.getenv("DB_URL")
JWT_SECRET_KEY = os.getenv("JWT_SECRET_KEY")

#JWT
ACCESS_EXPIRES = timedelta(hours=12)
JWT_REFRESH_EXPIRES = timedelta(days=30)

# Email
EMAIL_FROM = os.getenv("EMAIL_FROM")
EMAIL_CODE = os.getenv("EMAIL_CODE")

# Logger path
#Check OS
log_path = '/var/www/api/v1/logs_app/'
if platform.system() == "Windows":
    log_path = "./logs_app/"

# Customer type
user_type={
    1:"admin",
    2:"customer",
    3:"provider",
    4:"test_customer",
    5:"test_provider"
}

# Service type
service_type ={
    1:"Savjetovanje",
    2:"Čišćenje"
}

# City list
city_list = [
    {"Zagreb",'HR'},
    {"Split",'HR'}
]

# Price
currency = {
    "HR": 'EUR',
    "US": 'USD'
}

# VAT (%)
vat = {
    "HR": 25
}

# Service steps
service_step ={
    1:"Plaćeno",
    2:"Izvršeno",
    3:"Ocjenjeno"
}

# CONTANTS
DISTANCE_MAX = 99999.9
DELAY_DAYS = 2
TOTAL_DAYS = 15