using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;

namespace ColaFlow.Shared.Kernel.Modules;

/// <summary>
/// Defines the contract for a modular component in ColaFlow.
/// Each module is responsible for registering its own services and configuring its middleware.
/// </summary>
public interface IModule
{
    /// <summary>
    /// Gets the unique name of the module.
    /// </summary>
    string Name { get; }

    /// <summary>
    /// Registers module-specific services with the dependency injection container.
    /// </summary>
    /// <param name="services">The service collection to register services with.</param>
    /// <param name="configuration">The application configuration.</param>
    void RegisterServices(IServiceCollection services, IConfiguration configuration);

    /// <summary>
    /// Configures module-specific middleware and application behaviors.
    /// </summary>
    /// <param name="app">The application builder.</param>
    void ConfigureApplication(IApplicationBuilder app);
}
