using ColaFlow.Modules.Identity.Domain.Aggregates.Tenants.Events;
using MediatR;
using Microsoft.Extensions.Logging;

namespace ColaFlow.Modules.Identity.Application.EventHandlers;

public sealed class TenantCreatedEventHandler(ILogger<TenantCreatedEventHandler> logger)
    : INotificationHandler<TenantCreatedEvent>
{
    public Task Handle(TenantCreatedEvent notification, CancellationToken cancellationToken)
    {
        logger.LogInformation(
            "Tenant {TenantId} created with slug '{Slug}'",
            notification.TenantId,
            notification.Slug);

        // Future: Send welcome email
        // Future: Initialize default settings
        // Future: Create audit log entry

        return Task.CompletedTask;
    }
}
