from logging_config import setup_logging
from config import Config
from db.oracle_connector import OracleConnector
from db.db import OracleDB
from repository.repository import Repository
from api.api_client import FetchQueueClient
from processor.processor import Processor
from scheduler.scheduler import Scheduler

def main():
    setup_logging()

    config = Config()
    config.validate()

    connector = OracleConnector(config)
    db = OracleDB(connector)
    repo = Repository(db)
    api = FetchQueueClient(config)

    processor = Processor(config, repo, api)
    scheduler = Scheduler(processor, config)

    scheduler.run()

if __name__ == "__main__":
    main()