package de.effigenix.infrastructure.config;

import de.effigenix.application.masterdata.*;
import de.effigenix.domain.masterdata.ArticleRepository;
import de.effigenix.domain.masterdata.CustomerRepository;
import de.effigenix.domain.masterdata.ProductCategoryRepository;
import de.effigenix.domain.masterdata.SupplierRepository;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MasterDataUseCaseConfiguration {

    // ==================== Article Use Cases ====================

    @Bean
    public CreateArticle createArticle(ArticleRepository articleRepository) {
        return new CreateArticle(articleRepository);
    }

    @Bean
    public UpdateArticle updateArticle(ArticleRepository articleRepository) {
        return new UpdateArticle(articleRepository);
    }

    @Bean
    public GetArticle getArticle(ArticleRepository articleRepository) {
        return new GetArticle(articleRepository);
    }

    @Bean
    public ListArticles listArticles(ArticleRepository articleRepository) {
        return new ListArticles(articleRepository);
    }

    @Bean
    public ActivateArticle activateArticle(ArticleRepository articleRepository) {
        return new ActivateArticle(articleRepository);
    }

    @Bean
    public DeactivateArticle deactivateArticle(ArticleRepository articleRepository) {
        return new DeactivateArticle(articleRepository);
    }

    @Bean
    public AddSalesUnit addSalesUnit(ArticleRepository articleRepository) {
        return new AddSalesUnit(articleRepository);
    }

    @Bean
    public RemoveSalesUnit removeSalesUnit(ArticleRepository articleRepository) {
        return new RemoveSalesUnit(articleRepository);
    }

    @Bean
    public UpdateSalesUnitPrice updateSalesUnitPrice(ArticleRepository articleRepository) {
        return new UpdateSalesUnitPrice(articleRepository);
    }

    @Bean
    public AssignSupplier assignSupplier(ArticleRepository articleRepository) {
        return new AssignSupplier(articleRepository);
    }

    @Bean
    public RemoveSupplier removeSupplier(ArticleRepository articleRepository) {
        return new RemoveSupplier(articleRepository);
    }

    // ==================== ProductCategory Use Cases ====================

    @Bean
    public CreateProductCategory createProductCategory(ProductCategoryRepository categoryRepository) {
        return new CreateProductCategory(categoryRepository);
    }

    @Bean
    public UpdateProductCategory updateProductCategory(ProductCategoryRepository categoryRepository) {
        return new UpdateProductCategory(categoryRepository);
    }

    @Bean
    public ListProductCategories listProductCategories(ProductCategoryRepository categoryRepository) {
        return new ListProductCategories(categoryRepository);
    }

    @Bean
    public DeleteProductCategory deleteProductCategory(
            ProductCategoryRepository categoryRepository,
            ArticleRepository articleRepository
    ) {
        return new DeleteProductCategory(categoryRepository, articleRepository);
    }

    // ==================== Supplier Use Cases ====================

    @Bean
    public CreateSupplier createSupplier(SupplierRepository supplierRepository) {
        return new CreateSupplier(supplierRepository);
    }

    @Bean
    public UpdateSupplier updateSupplier(SupplierRepository supplierRepository) {
        return new UpdateSupplier(supplierRepository);
    }

    @Bean
    public GetSupplier getSupplier(SupplierRepository supplierRepository) {
        return new GetSupplier(supplierRepository);
    }

    @Bean
    public ListSuppliers listSuppliers(SupplierRepository supplierRepository) {
        return new ListSuppliers(supplierRepository);
    }

    @Bean
    public ActivateSupplier activateSupplier(SupplierRepository supplierRepository) {
        return new ActivateSupplier(supplierRepository);
    }

    @Bean
    public DeactivateSupplier deactivateSupplier(SupplierRepository supplierRepository) {
        return new DeactivateSupplier(supplierRepository);
    }

    @Bean
    public RateSupplier rateSupplier(SupplierRepository supplierRepository) {
        return new RateSupplier(supplierRepository);
    }

    @Bean
    public AddCertificate addCertificate(SupplierRepository supplierRepository) {
        return new AddCertificate(supplierRepository);
    }

    @Bean
    public RemoveCertificate removeCertificate(SupplierRepository supplierRepository) {
        return new RemoveCertificate(supplierRepository);
    }

    // ==================== Customer Use Cases ====================

    @Bean
    public CreateCustomer createCustomer(CustomerRepository customerRepository) {
        return new CreateCustomer(customerRepository);
    }

    @Bean
    public UpdateCustomer updateCustomer(CustomerRepository customerRepository) {
        return new UpdateCustomer(customerRepository);
    }

    @Bean
    public GetCustomer getCustomer(CustomerRepository customerRepository) {
        return new GetCustomer(customerRepository);
    }

    @Bean
    public ListCustomers listCustomers(CustomerRepository customerRepository) {
        return new ListCustomers(customerRepository);
    }

    @Bean
    public ActivateCustomer activateCustomer(CustomerRepository customerRepository) {
        return new ActivateCustomer(customerRepository);
    }

    @Bean
    public DeactivateCustomer deactivateCustomer(CustomerRepository customerRepository) {
        return new DeactivateCustomer(customerRepository);
    }

    @Bean
    public AddDeliveryAddress addDeliveryAddress(CustomerRepository customerRepository) {
        return new AddDeliveryAddress(customerRepository);
    }

    @Bean
    public RemoveDeliveryAddress removeDeliveryAddress(CustomerRepository customerRepository) {
        return new RemoveDeliveryAddress(customerRepository);
    }

    @Bean
    public SetFrameContract setFrameContract(CustomerRepository customerRepository) {
        return new SetFrameContract(customerRepository);
    }

    @Bean
    public RemoveFrameContract removeFrameContract(CustomerRepository customerRepository) {
        return new RemoveFrameContract(customerRepository);
    }

    @Bean
    public SetPreferences setPreferences(CustomerRepository customerRepository) {
        return new SetPreferences(customerRepository);
    }
}
