2023-09-03 04:11:53 +00:00
|
|
|
using BotSharp.Abstraction.Routing.Models;
|
2023-09-07 22:04:34 +00:00
|
|
|
using BotSharp.Abstraction.Users.Models;
|
2023-08-26 04:41:01 +00:00
|
|
|
|
|
|
|
|
namespace BotSharp.Abstraction.Repositories;
|
2023-08-10 04:53:22 +00:00
|
|
|
|
|
|
|
|
public interface IBotSharpRepository
|
|
|
|
|
{
|
2023-09-07 22:04:34 +00:00
|
|
|
IQueryable<User> Users { get; }
|
|
|
|
|
IQueryable<Agent> Agents { get; }
|
|
|
|
|
IQueryable<UserAgent> UserAgents { get; }
|
|
|
|
|
IQueryable<Conversation> Conversations { get; }
|
|
|
|
|
IQueryable<RoutingItem> RoutingItems { get; }
|
|
|
|
|
IQueryable<RoutingProfile> RoutingProfiles { get; }
|
2023-09-02 22:41:58 +00:00
|
|
|
|
2023-08-10 04:53:22 +00:00
|
|
|
int Transaction<TTableInterface>(Action action);
|
|
|
|
|
void Add<TTableInterface>(object entity);
|
2023-09-02 05:10:46 +00:00
|
|
|
|
2023-09-07 22:04:34 +00:00
|
|
|
User GetUserByEmail(string email);
|
|
|
|
|
void CreateUser(User user);
|
|
|
|
|
void UpdateAgent(Agent agent);
|
2023-09-03 04:11:53 +00:00
|
|
|
|
2023-09-07 22:04:34 +00:00
|
|
|
List<RoutingItem> CreateRoutingItems(List<RoutingItem> routingItems);
|
|
|
|
|
List<RoutingProfile> CreateRoutingProfiles(List<RoutingProfile> profiles);
|
2023-09-03 04:11:53 +00:00
|
|
|
void DeleteRoutingItems();
|
|
|
|
|
void DeleteRoutingProfiles();
|
2023-09-03 04:54:22 +00:00
|
|
|
|
2023-09-07 22:04:34 +00:00
|
|
|
Agent GetAgent(string agentId);
|
2023-09-09 20:13:19 +00:00
|
|
|
List<string> GetAgentResponses(string agentId, string prefix, string intent);
|
2023-09-03 22:43:50 +00:00
|
|
|
|
2023-09-07 22:04:34 +00:00
|
|
|
void CreateNewConversation(Conversation conversation);
|
2023-09-03 22:43:50 +00:00
|
|
|
string GetConversationDialog(string conversationId);
|
|
|
|
|
void UpdateConversationDialog(string conversationId, string dialogs);
|
|
|
|
|
|
2023-09-09 21:44:25 +00:00
|
|
|
List<StateKeyValue> GetConversationStates(string conversationId);
|
|
|
|
|
void UpdateConversationStates(string conversationId, List<StateKeyValue> states);
|
2023-09-03 22:43:50 +00:00
|
|
|
|
2023-09-07 22:04:34 +00:00
|
|
|
Conversation GetConversation(string conversationId);
|
|
|
|
|
List<Conversation> GetConversations(string userId);
|
2023-09-12 22:08:58 +00:00
|
|
|
|
|
|
|
|
string GetAgentTemplate(string agentId, string templateName);
|
2023-08-10 04:53:22 +00:00
|
|
|
}
|