using CommunityToolkit.Mvvm.Messaging;
using salesbook.Shared.Core.Dto;

namespace salesbook.Shared.Core.Messages.Contact;

public class NewContactService
{
    public event Action<CRMCreateContactResponseDTO>? OnContactCreated;

    public NewContactService(IMessenger messenger)
    {
        messenger.Register<NewContactMessage>(this, (_, o) =>
        {
            OnContactCreated?.Invoke(o.Value);
        });
    }
}