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

def main():
    setup_logging()

    config = Config()
    config.validate()

    db = OracleDB(config)
    db.connect()

    repo = Repository(db)
    api = FetchQueueClient(config)

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

    scheduler.run()

if __name__ == "__main__":
    main()