feat: item to collection

This commit is contained in:
2026-09-28 02:37:11 +04:00
parent 5238bfd103
commit 50fe29f4f0
29 changed files with 732 additions and 156 deletions
@@ -25,10 +25,15 @@ public sealed class CollectionRepository : ICollectionRepository
return await _db.Collections
.Include(c => c.Members)
.Where(x => x.OwnerTelegramId == ownerTelegramId)
.OrderBy(x => x.Name)
.OrderBy(x => x.IsInbox ? 0 : 1) // Inbox всегда первым
.ThenBy(x => x.Name)
.ToListAsync(ct);
}
public Task<Collection?> GetInboxAsync(long ownerTelegramId, CancellationToken ct) =>
_db.Collections
.FirstOrDefaultAsync(x => x.OwnerTelegramId == ownerTelegramId && x.IsInbox, ct);
public async Task AddAsync(Collection collection, CancellationToken ct) =>
await _db.Collections.AddAsync(collection, ct);