Files
Wino-Mail/Wino.Core.Domain/Interfaces/IContactService.cs
T

42 lines
1.9 KiB
C#
Raw Normal View History

2026-03-01 21:07:10 +01:00
using System;
using System.Collections.Generic;
2025-10-29 19:35:04 +01:00
using System.Linq;
using System.Threading.Tasks;
using MimeKit;
using Wino.Core.Domain.Entities.Shared;
using Wino.Core.Domain.Models.Contacts;
2025-02-16 11:54:23 +01:00
namespace Wino.Core.Domain.Interfaces;
public interface IContactService
{
2025-02-16 11:54:23 +01:00
Task<List<AccountContact>> GetAddressInformationAsync(string queryText);
Task<AccountContact> GetAddressInformationByAddressAsync(string address);
Task<List<AccountContact>> GetContactsByAddressesAsync(IEnumerable<string> addresses);
2025-02-16 11:54:23 +01:00
Task SaveAddressInformationAsync(MimeMessage message);
Task SaveAddressInformationAsync(IEnumerable<AccountContact> contacts);
2025-02-16 11:54:23 +01:00
Task<AccountContact> CreateNewContactAsync(string address, string displayName);
2025-10-29 19:35:04 +01:00
2026-03-01 21:07:10 +01:00
// Paged contact queries for ContactsPage
2025-10-29 19:35:04 +01:00
Task<List<AccountContact>> GetAllContactsAsync();
Task<List<AccountContact>> SearchContactsAsync(string searchQuery);
Task<PagedContactsResult> GetContactsPageAsync(int offset, int pageSize, string searchQuery = null, bool excludeRootContacts = false);
2025-10-29 19:35:04 +01:00
Task<AccountContact> UpdateContactAsync(AccountContact contact);
Task DeleteContactAsync(string address);
Task DeleteContactsAsync(IEnumerable<string> addresses);
2026-03-01 21:07:10 +01:00
// Group / distribution list support
Task<List<ContactGroup>> GetGroupsAsync();
Task<ContactGroup> CreateGroupAsync(string name, string description = null);
Task DeleteGroupAsync(Guid groupId);
Task<List<AccountContact>> GetGroupMembersAsync(Guid groupId);
Task AddGroupMemberAsync(Guid groupId, string memberAddress);
Task RemoveGroupMemberAsync(Guid groupId, string memberAddress);
/// <summary>
/// Expands a contact group to the individual <see cref="AccountContact"/> entries of its members.
/// Returns an empty list if the group does not exist or has no members.
/// </summary>
Task<List<AccountContact>> ExpandGroupAsync(Guid groupId);
}