added some service interfaces

This commit is contained in:
Вячеслав 2025-04-01 16:52:02 +05:00
parent cac3cd5ea4
commit 74b650dd8e
4 changed files with 48 additions and 0 deletions

View file

@ -0,0 +1,12 @@
using SurveyLib.Core.Models;
namespace SurveyLib.Core.Services;
public interface IAnswerService
{
Task<bool> AddAnswerAsync(Answer answer);
Task<bool> UpdateAnswerAsync(Answer answer);
Task<bool> DeleteAnswerAsync(int id);
Task<IEnumerable<Answer>> GetAnswersByCompletionIdAsync(int completionId);
Task<IEnumerable<Answer>> GetAnswersByQuestionIdAsync(int questionId);
}

View file

@ -0,0 +1,11 @@
using SurveyLib.Core.Models;
namespace SurveyLib.Core.Services;
public interface ICompletionService
{
Task<bool> AddCompletionAsync(Completion completion);
Task<bool> UpdateCompletionAsync(Completion completion);
Task<bool> DeleteCompletionAsync(int id);
Task<IEnumerable<Completion>> GetCompletionsBySurveyIdAsync(int surveyId);
}

View file

@ -0,0 +1,11 @@
using SurveyLib.Core.Models;
namespace SurveyLib.Core.Services;
public interface IQuestionService
{
Task<bool> AddQuestionAsync(QuestionBase question);
Task<bool> UpdateQuestionAsync(QuestionBase question);
Task<bool> DeleteQuestionAsync(int id);
Task<IEnumerable<QuestionBase>> GetQuestionsBySurveyIdAsync(int surveyId);
}

View file

@ -0,0 +1,14 @@
using SurveyLib.Core.Models;
namespace SurveyLib.Core.Services;
public interface ISurveyService
{
Task<bool> AddSurveyAsync(Survey survey);
Task<bool> UpdateSurveyAsync(Survey survey);
Task<bool> DeleteSurveyAsync(int id);
Task<IEnumerable<Survey>> GetSurveysAsync();
Task<Survey> GetSurveyByIdAsync(int id);
Task<Survey> GetSurveyWithQuestionsByIdAsync(int id);
Task<Survey> GetSurveyWithAnswersByIdAsync(int id);
}