aboutsummaryrefslogtreecommitdiff
path: root/src/DevHive.Data/Interfaces
diff options
context:
space:
mode:
authorKamen Mladenov <kamen.d.mladenov@protonmail.com>2021-04-09 19:51:35 +0300
committerGitHub <noreply@github.com>2021-04-09 19:51:35 +0300
commit233f38915ba0079079233eff55434ef349c05c45 (patch)
tree6c5f69017865bcab87355e910c87339453da1406 /src/DevHive.Data/Interfaces
parentf4a70c6430db923af9fa9958a11c2d6612cb52cc (diff)
parenta992357efcf1bc1ece81b95ecee5e05a0b73bfdc (diff)
downloadDevHive-233f38915ba0079079233eff55434ef349c05c45.tar
DevHive-233f38915ba0079079233eff55434ef349c05c45.tar.gz
DevHive-233f38915ba0079079233eff55434ef349c05c45.zip
Merge pull request #28 from Team-Kaleidoscope/devHEADv0.2mainheroku/main
Second stage: Complete
Diffstat (limited to 'src/DevHive.Data/Interfaces')
-rw-r--r--src/DevHive.Data/Interfaces/Models/IComment.cs16
-rw-r--r--src/DevHive.Data/Interfaces/Models/ILanguage.cs11
-rw-r--r--src/DevHive.Data/Interfaces/Models/IModel.cs9
-rw-r--r--src/DevHive.Data/Interfaces/Models/IPost.cs22
-rw-r--r--src/DevHive.Data/Interfaces/Models/IProfilePicture.cs13
-rw-r--r--src/DevHive.Data/Interfaces/Models/IRating.cs14
-rw-r--r--src/DevHive.Data/Interfaces/Models/IRole.cs10
-rw-r--r--src/DevHive.Data/Interfaces/Models/ITechnology.cs11
-rw-r--r--src/DevHive.Data/Interfaces/Models/IUser.cs21
-rw-r--r--src/DevHive.Data/Interfaces/Repositories/ICommentRepository.cs16
-rw-r--r--src/DevHive.Data/Interfaces/Repositories/IFeedRepository.cs13
-rw-r--r--src/DevHive.Data/Interfaces/Repositories/ILanguageRepository.cs17
-rw-r--r--src/DevHive.Data/Interfaces/Repositories/IPostRepository.cs19
-rw-r--r--src/DevHive.Data/Interfaces/Repositories/IRatingRepository.cs13
-rw-r--r--src/DevHive.Data/Interfaces/Repositories/IRepository.cs21
-rw-r--r--src/DevHive.Data/Interfaces/Repositories/IRoleRepository.cs15
-rw-r--r--src/DevHive.Data/Interfaces/Repositories/ITechnologyRepository.cs17
-rw-r--r--src/DevHive.Data/Interfaces/Repositories/IUserRepository.cs22
18 files changed, 0 insertions, 280 deletions
diff --git a/src/DevHive.Data/Interfaces/Models/IComment.cs b/src/DevHive.Data/Interfaces/Models/IComment.cs
deleted file mode 100644
index 97c1578..0000000
--- a/src/DevHive.Data/Interfaces/Models/IComment.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-using System;
-using DevHive.Data.Models;
-
-namespace DevHive.Data.Interfaces.Models
-{
- public interface IComment : IModel
- {
- Post Post { get; set; }
-
- User Creator { get; set; }
-
- string Message { get; set; }
-
- DateTime TimeCreated { get; set; }
- }
-}
diff --git a/src/DevHive.Data/Interfaces/Models/ILanguage.cs b/src/DevHive.Data/Interfaces/Models/ILanguage.cs
deleted file mode 100644
index 9eed09d..0000000
--- a/src/DevHive.Data/Interfaces/Models/ILanguage.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-using System.Collections.Generic;
-using DevHive.Data.Models;
-
-namespace DevHive.Data.Interfaces.Models
-{
- public interface ILanguage : IModel
- {
- string Name { get; set; }
- HashSet<User> Users { get; set; }
- }
-}
diff --git a/src/DevHive.Data/Interfaces/Models/IModel.cs b/src/DevHive.Data/Interfaces/Models/IModel.cs
deleted file mode 100644
index f903af3..0000000
--- a/src/DevHive.Data/Interfaces/Models/IModel.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-using System;
-
-namespace DevHive.Data.Interfaces.Models
-{
- public interface IModel
- {
- Guid Id { get; set; }
- }
-}
diff --git a/src/DevHive.Data/Interfaces/Models/IPost.cs b/src/DevHive.Data/Interfaces/Models/IPost.cs
deleted file mode 100644
index 712d955..0000000
--- a/src/DevHive.Data/Interfaces/Models/IPost.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using System;
-using System.Collections.Generic;
-using DevHive.Data.Models;
-using DevHive.Data.RelationModels;
-
-namespace DevHive.Data.Interfaces.Models
-{
- public interface IPost : IModel
- {
- User Creator { get; set; }
-
- string Message { get; set; }
-
- DateTime TimeCreated { get; set; }
-
- List<Comment> Comments { get; set; }
-
- // Rating Rating { get; set; }
-
- List<PostAttachments> Attachments { get; set; }
- }
-}
diff --git a/src/DevHive.Data/Interfaces/Models/IProfilePicture.cs b/src/DevHive.Data/Interfaces/Models/IProfilePicture.cs
deleted file mode 100644
index c3fcbea..0000000
--- a/src/DevHive.Data/Interfaces/Models/IProfilePicture.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-using System;
-using DevHive.Data.Models;
-
-namespace DevHive.Data.Interfaces.Models
-{
- public interface IProfilePicture : IModel
- {
- Guid UserId { get; set; }
- User User { get; set; }
-
- string PictureURL { get; set; }
- }
-}
diff --git a/src/DevHive.Data/Interfaces/Models/IRating.cs b/src/DevHive.Data/Interfaces/Models/IRating.cs
deleted file mode 100644
index d1b968f..0000000
--- a/src/DevHive.Data/Interfaces/Models/IRating.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using System.Collections.Generic;
-using DevHive.Data.Models;
-
-namespace DevHive.Data.Interfaces.Models
-{
- public interface IRating : IModel
- {
- // Post Post { get; set; }
-
- int Rate { get; set; }
-
- // HashSet<User> UsersThatRated { get; set; }
- }
-}
diff --git a/src/DevHive.Data/Interfaces/Models/IRole.cs b/src/DevHive.Data/Interfaces/Models/IRole.cs
deleted file mode 100644
index c8b7068..0000000
--- a/src/DevHive.Data/Interfaces/Models/IRole.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-using System.Collections.Generic;
-using DevHive.Data.Models;
-
-namespace DevHive.Data.Interfaces.Models
-{
- public interface IRole
- {
- HashSet<User> Users { get; set; }
- }
-}
diff --git a/src/DevHive.Data/Interfaces/Models/ITechnology.cs b/src/DevHive.Data/Interfaces/Models/ITechnology.cs
deleted file mode 100644
index 153f75f..0000000
--- a/src/DevHive.Data/Interfaces/Models/ITechnology.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-using System.Collections.Generic;
-using DevHive.Data.Models;
-
-namespace DevHive.Data.Interfaces.Models
-{
- public interface ITechnology : IModel
- {
- string Name { get; set; }
- HashSet<User> Users { get; set; }
- }
-}
diff --git a/src/DevHive.Data/Interfaces/Models/IUser.cs b/src/DevHive.Data/Interfaces/Models/IUser.cs
deleted file mode 100644
index fcd741c..0000000
--- a/src/DevHive.Data/Interfaces/Models/IUser.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using System.Collections.Generic;
-using DevHive.Data.Models;
-using DevHive.Data.RelationModels;
-
-namespace DevHive.Data.Interfaces.Models
-{
- public interface IUser : IModel
- {
- string FirstName { get; set; }
-
- string LastName { get; set; }
-
- ProfilePicture ProfilePicture { get; set; }
-
- HashSet<Language> Languages { get; set; }
-
- HashSet<Technology> Technologies { get; set; }
-
- HashSet<Role> Roles { get; set; }
- }
-}
diff --git a/src/DevHive.Data/Interfaces/Repositories/ICommentRepository.cs b/src/DevHive.Data/Interfaces/Repositories/ICommentRepository.cs
deleted file mode 100644
index 267f251..0000000
--- a/src/DevHive.Data/Interfaces/Repositories/ICommentRepository.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Threading.Tasks;
-using DevHive.Data.Models;
-using DevHive.Data.Repositories.Interfaces;
-
-namespace DevHive.Data.Interfaces.Repositories
-{
- public interface ICommentRepository : IRepository<Comment>
- {
- Task<List<Comment>> GetPostComments(Guid postId);
-
- Task<bool> DoesCommentExist(Guid id);
- Task<Comment> GetCommentByIssuerAndTimeCreatedAsync(Guid issuerId, DateTime timeCreated);
- }
-}
diff --git a/src/DevHive.Data/Interfaces/Repositories/IFeedRepository.cs b/src/DevHive.Data/Interfaces/Repositories/IFeedRepository.cs
deleted file mode 100644
index 7262510..0000000
--- a/src/DevHive.Data/Interfaces/Repositories/IFeedRepository.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Threading.Tasks;
-using DevHive.Data.Models;
-
-namespace DevHive.Data.Interfaces.Repositories
-{
- public interface IFeedRepository
- {
- Task<List<Post>> GetFriendsPosts(List<User> friendsList, DateTime firstRequestIssued, int pageNumber, int pageSize);
- Task<List<Post>> GetUsersPosts(User user, DateTime firstRequestIssued, int pageNumber, int pageSize);
- }
-}
diff --git a/src/DevHive.Data/Interfaces/Repositories/ILanguageRepository.cs b/src/DevHive.Data/Interfaces/Repositories/ILanguageRepository.cs
deleted file mode 100644
index db2949a..0000000
--- a/src/DevHive.Data/Interfaces/Repositories/ILanguageRepository.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Threading.Tasks;
-using DevHive.Data.Models;
-using DevHive.Data.Repositories.Interfaces;
-
-namespace DevHive.Data.Interfaces.Repositories
-{
- public interface ILanguageRepository : IRepository<Language>
- {
- HashSet<Language> GetLanguages();
- Task<Language> GetByNameAsync(string name);
-
- Task<bool> DoesLanguageExistAsync(Guid id);
- Task<bool> DoesLanguageNameExistAsync(string languageName);
- }
-}
diff --git a/src/DevHive.Data/Interfaces/Repositories/IPostRepository.cs b/src/DevHive.Data/Interfaces/Repositories/IPostRepository.cs
deleted file mode 100644
index 9f7cf85..0000000
--- a/src/DevHive.Data/Interfaces/Repositories/IPostRepository.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Threading.Tasks;
-using DevHive.Data.Models;
-using DevHive.Data.Repositories.Interfaces;
-
-namespace DevHive.Data.Interfaces.Repositories
-{
- public interface IPostRepository : IRepository<Post>
- {
- Task<bool> AddNewPostToCreator(Guid userId, Post post);
-
- Task<Post> GetPostByCreatorAndTimeCreatedAsync(Guid issuerId, DateTime timeCreated);
- Task<List<string>> GetFileUrls(Guid postId);
-
- Task<bool> DoesPostExist(Guid postId);
- Task<bool> DoesPostHaveFiles(Guid postId);
- }
-}
diff --git a/src/DevHive.Data/Interfaces/Repositories/IRatingRepository.cs b/src/DevHive.Data/Interfaces/Repositories/IRatingRepository.cs
deleted file mode 100644
index f77f301..0000000
--- a/src/DevHive.Data/Interfaces/Repositories/IRatingRepository.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-using System;
-using System.Threading.Tasks;
-using DevHive.Data.Models;
-using DevHive.Data.Repositories.Interfaces;
-
-namespace DevHive.Data.Interfaces.Repositories
-{
- public interface IRatingRepository : IRepository<Rating>
- {
- Task<Rating> GetRatingByPostId(Guid postId);
- Task<bool> UserRatedPost(Guid userId, Guid postId);
- }
-}
diff --git a/src/DevHive.Data/Interfaces/Repositories/IRepository.cs b/src/DevHive.Data/Interfaces/Repositories/IRepository.cs
deleted file mode 100644
index 0d11cd3..0000000
--- a/src/DevHive.Data/Interfaces/Repositories/IRepository.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using System;
-using System.Threading.Tasks;
-
-namespace DevHive.Data.Repositories.Interfaces
-{
- public interface IRepository<TEntity>
- where TEntity : class
- {
- //Add Entity to database
- Task<bool> AddAsync(TEntity entity);
-
- //Find entity by id
- Task<TEntity> GetByIdAsync(Guid id);
-
- //Modify Entity from database
- Task<bool> EditAsync(Guid id, TEntity newEntity);
-
- //Delete Entity from database
- Task<bool> DeleteAsync(TEntity entity);
- }
-}
diff --git a/src/DevHive.Data/Interfaces/Repositories/IRoleRepository.cs b/src/DevHive.Data/Interfaces/Repositories/IRoleRepository.cs
deleted file mode 100644
index e834369..0000000
--- a/src/DevHive.Data/Interfaces/Repositories/IRoleRepository.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-using System;
-using System.Threading.Tasks;
-using DevHive.Data.Models;
-using DevHive.Data.Repositories.Interfaces;
-
-namespace DevHive.Data.Interfaces.Repositories
-{
- public interface IRoleRepository : IRepository<Role>
- {
- Task<Role> GetByNameAsync(string name);
-
- Task<bool> DoesNameExist(string name);
- Task<bool> DoesRoleExist(Guid id);
- }
-}
diff --git a/src/DevHive.Data/Interfaces/Repositories/ITechnologyRepository.cs b/src/DevHive.Data/Interfaces/Repositories/ITechnologyRepository.cs
deleted file mode 100644
index 9126bfc..0000000
--- a/src/DevHive.Data/Interfaces/Repositories/ITechnologyRepository.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Threading.Tasks;
-using DevHive.Data.Models;
-using DevHive.Data.Repositories.Interfaces;
-
-namespace DevHive.Data.Interfaces.Repositories
-{
- public interface ITechnologyRepository : IRepository<Technology>
- {
- Task<Technology> GetByNameAsync(string name);
- HashSet<Technology> GetTechnologies();
-
- Task<bool> DoesTechnologyExistAsync(Guid id);
- Task<bool> DoesTechnologyNameExistAsync(string technologyName);
- }
-}
diff --git a/src/DevHive.Data/Interfaces/Repositories/IUserRepository.cs b/src/DevHive.Data/Interfaces/Repositories/IUserRepository.cs
deleted file mode 100644
index 5ebe3d3..0000000
--- a/src/DevHive.Data/Interfaces/Repositories/IUserRepository.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Threading.Tasks;
-using DevHive.Data.Models;
-using DevHive.Data.Repositories.Interfaces;
-
-namespace DevHive.Data.Interfaces.Repositories
-{
- public interface IUserRepository : IRepository<User>
- {
- //Read
- Task<User> GetByUsernameAsync(string username);
- Task<bool> UpdateProfilePicture(Guid userId, string pictureUrl);
-
- //Validations
- Task<bool> ValidateFriendsCollectionAsync(List<string> usernames);
- Task<bool> DoesEmailExistAsync(string email);
- Task<bool> DoesUserExistAsync(Guid id);
- Task<bool> DoesUsernameExistAsync(string username);
- bool DoesUserHaveThisUsername(Guid id, string username);
- }
-}