using TakeoutSaaS.Domain.Membership.Entities;
namespace TakeoutSaaS.Domain.Membership.Repositories;
///
/// 会员聚合仓储契约。
///
public interface IMemberRepository
{
///
/// 查询租户下会员档案。
///
Task> GetProfilesAsync(long tenantId, CancellationToken cancellationToken = default);
///
/// 按手机号集合查询会员档案。
///
Task> GetProfilesByMobilesAsync(
long tenantId,
IReadOnlyCollection mobiles,
CancellationToken cancellationToken = default);
///
/// 按标识查询会员档案。
///
Task FindProfileByIdAsync(long tenantId, long memberId, CancellationToken cancellationToken = default);
///
/// 新增会员档案集合。
///
Task AddProfilesAsync(IEnumerable profiles, CancellationToken cancellationToken = default);
///
/// 更新会员档案。
///
Task UpdateProfileAsync(MemberProfile profile, CancellationToken cancellationToken = default);
///
/// 查询租户下会员等级。
///
Task> GetTiersAsync(long tenantId, CancellationToken cancellationToken = default);
///
/// 按标识查询会员等级。
///
Task FindTierByIdAsync(long tenantId, long tierId, CancellationToken cancellationToken = default);
///
/// 新增会员等级。
///
Task AddTierAsync(MemberTier tier, CancellationToken cancellationToken = default);
///
/// 更新会员等级。
///
Task UpdateTierAsync(MemberTier tier, CancellationToken cancellationToken = default);
///
/// 删除会员等级。
///
Task DeleteTierAsync(MemberTier tier, CancellationToken cancellationToken = default);
///
/// 查询租户会员日配置。
///
Task GetMemberDaySettingAsync(long tenantId, CancellationToken cancellationToken = default);
///
/// 新增会员日配置。
///
Task AddMemberDaySettingAsync(MemberDaySetting setting, CancellationToken cancellationToken = default);
///
/// 更新会员日配置。
///
Task UpdateMemberDaySettingAsync(MemberDaySetting setting, CancellationToken cancellationToken = default);
///
/// 查询会员标签集合。
///
Task> GetProfileTagsAsync(
long tenantId,
long memberProfileId,
CancellationToken cancellationToken = default);
///
/// 按会员集合批量查询标签。
///
Task> GetProfileTagsByMemberIdsAsync(
long tenantId,
IReadOnlyCollection memberProfileIds,
CancellationToken cancellationToken = default);
///
/// 替换会员标签集合。
///
Task ReplaceProfileTagsAsync(
long tenantId,
long memberProfileId,
IReadOnlyCollection tags,
CancellationToken cancellationToken = default);
///
/// 持久化变更。
///
Task SaveChangesAsync(CancellationToken cancellationToken = default);
}