Sa-14 added RefreshTokensRepository

This commit is contained in:
shchoholiev-opflo 2023-10-14 19:55:13 +00:00
parent 5679b2837d
commit 4102312fe9
4 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,8 @@
using ShoppingAssistantApi.Domain.Entities;
namespace ShoppingAssistantApi.Application.IRepositories;
public interface IRefreshTokensRepository : IBaseRepository<RefreshToken>
{
}

View File

@ -0,0 +1,10 @@
using ShoppingAssistantApi.Domain.Common;
namespace ShoppingAssistantApi.Domain.Entities;
public class RefreshToken : EntityBase
{
public string Token { get; set; }
public DateTime ExpiryDateUTC { get; set; }
}

View File

@ -13,6 +13,7 @@ public static class RepositoriesExtention
services.AddScoped<IRolesRepository, RolesRepository>();
services.AddScoped<IUsersRepository, UsersRepository>();
services.AddScoped<IRefreshTokensRepository, RefreshTokensRepository>();
services.AddScoped<IWishlistsRepository, WishlistsRepository>();
services.AddScoped<IMessagesRepository, MessagesRepository>();

View File

@ -0,0 +1,10 @@
using ShoppingAssistantApi.Application.IRepositories;
using ShoppingAssistantApi.Domain.Entities;
using ShoppingAssistantApi.Persistance.Database;
namespace ShoppingAssistantApi.Persistance.Repositories;
public class RefreshTokensRepository : BaseRepository<RefreshToken>, IRefreshTokensRepository
{
public RefreshTokensRepository(MongoDbContext db) : base(db, "RefreshTokens") { }
}