namespace ChatService.Domain.AggregatesModel.UserAggregate; using ChatService.Domain.SeedWork; /// /// EN: Repository interface for ChatUser aggregate. /// VI: Interface repository cho ChatUser aggregate. /// public interface IChatUserRepository : IRepository { /// /// EN: Get user by their IAM Service identity ID. /// VI: Lấy user theo IAM Service identity ID. /// Task GetByIdentityUserIdAsync(string identityUserId, CancellationToken cancellationToken = default); /// /// EN: Get user by their chat user ID. /// VI: Lấy user theo chat user ID. /// Task GetByIdAsync(Guid id, CancellationToken cancellationToken = default); /// /// EN: Get user with their key bundle and one-time pre-keys. /// VI: Lấy user với key bundle và one-time pre-keys. /// Task GetWithKeysAsync(Guid id, CancellationToken cancellationToken = default); /// /// EN: Get multiple users by their IDs. /// VI: Lấy nhiều users theo danh sách ID. /// Task> GetByIdsAsync(IEnumerable ids, CancellationToken cancellationToken = default); /// /// EN: Check if user exists by identity ID. /// VI: Kiểm tra user tồn tại theo identity ID. /// Task ExistsByIdentityUserIdAsync(string identityUserId, CancellationToken cancellationToken = default); /// /// EN: Add a new chat user. /// VI: Thêm một chat user mới. /// ChatUser Add(ChatUser user); /// /// EN: Update an existing chat user. /// VI: Cập nhật một chat user. /// void Update(ChatUser user); /// /// EN: Get key bundle for X3DH key exchange and consume one-time pre-key. /// VI: Lấy key bundle cho X3DH key exchange và consume one-time pre-key. /// Task<(string? IdentityPublicKey, string? SignedPreKey, string? SignedPreKeySignature, OneTimePreKey? OneTimePreKey)> GetKeyBundleAsync(Guid userId, CancellationToken cancellationToken = default); /// /// EN: Get count of available one-time pre-keys. /// VI: Lấy số lượng one-time pre-keys còn khả dụng. /// Task GetAvailablePreKeyCountAsync(Guid userId, CancellationToken cancellationToken = default); }