package ru.soune.nocopy.configuration;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import ru.soune.nocopy.handler.*;

import java.util.HashMap;
import java.util.Map;

@Configuration
public class HandlerConfig {

    @Bean
    public Map<Integer, RequestHandler> handlers(
            RegRequestHandler reg,
            LoginRequestHandler login,
            FileUploadHandler upload,
            FileEntityHandler file,
            LogoutRequestHandler logoutHandler,
            ImageFoundRequestHandler imageFoundRequestHandler,
            VerifyRegisterUserHandler verifyRegisterUser,
            AuthRequestHandler authRequestHandler,
            CompanyHandler companyHandler,
            TariffHandler tariffHandler,
            TariffInfoHandler tariffInfoHandler,
            ReferralHandler referralHandler,
            DaDataHandler daDataHandler
    ) {
        Map<Integer, RequestHandler> map = new HashMap<>();
        map.put(20001, login);
        map.put(20002, reg);
        map.put(20004, upload);
        map.put(20005, file);
        map.put(20006, logoutHandler);
        map.put(20007, imageFoundRequestHandler);
        map.put(20008, authRequestHandler);
        map.put(20009, verifyRegisterUser);
        map.put(30000, companyHandler);
        map.put(30001, tariffHandler);
        map.put(30002, tariffInfoHandler);
        map.put(30003, referralHandler);
        map.put(30004, daDataHandler);

        return map;
    }
}
