diff --git a/Dentizone.Application/AssemblyReference.cs b/Dentizone.Application/AssemblyReference.cs
index 9d5c46b..ec6ba79 100644
--- a/Dentizone.Application/AssemblyReference.cs
+++ b/Dentizone.Application/AssemblyReference.cs
@@ -1,6 +1,10 @@
namespace Dentizone.Application
{
- public static class AssemblyReference
+ ///
+ /// Marker interface for the Application assembly,
+ /// used by AutoMapper to locate and load its profiles.
+ ///
+ public interface IAssemblyReference
{
}
}
\ No newline at end of file
diff --git a/Dentizone.Application/AutoMapper/Carts/CartProfile.cs b/Dentizone.Application/AutoMapper/Carts/CartProfile.cs
index 08a640f..c9d57b1 100644
--- a/Dentizone.Application/AutoMapper/Carts/CartProfile.cs
+++ b/Dentizone.Application/AutoMapper/Carts/CartProfile.cs
@@ -12,23 +12,23 @@ public CartProfile()
.ForMember(dest => dest.Id, opt => opt.MapFrom(src => src.Id))
.ForMember(dest => dest.PostId, opt => opt.MapFrom(src => src.PostId))
.ForMember(dest => dest.Post, opt => opt.MapFrom(src => new Post
- {
- Title = src.Title,
- Price = src.Price,
- PostAssets = new List
- {
- new PostAsset
- {
- Asset = new Domain.Entity.Asset
- {
- Url = src.Url
- }
- }
- }
- }))
+ {
+ Title = src.Title,
+ Price = src.Price,
+ PostAssets = new List
+ {
+ new()
+ {
+ Asset = new Domain.Entity.Asset
+ {
+ Url = src.Url
+ }
+ }
+ }
+ }))
.ReverseMap()
.ForMember(dest => dest.Url, opt => opt.MapFrom(src =>
- src.Post.PostAssets.FirstOrDefault().Asset.Url))
+ src.Post.PostAssets.FirstOrDefault().Asset.Url))
.ForMember(dest => dest.Title, opt => opt.MapFrom(src => src.Post.Title))
.ForMember(dest => dest.Price, opt => opt.MapFrom(src => src.Post.Price));
diff --git a/Dentizone.Application/AutoMapper/CatalogProfile.cs b/Dentizone.Application/AutoMapper/CatalogProfile.cs
index b7b3879..8f7f64c 100644
--- a/Dentizone.Application/AutoMapper/CatalogProfile.cs
+++ b/Dentizone.Application/AutoMapper/CatalogProfile.cs
@@ -14,7 +14,7 @@ public CatalogProfile()
CreateMap().ReverseMap();
CreateMap().ReverseMap();
CreateMap().ReverseMap();
- CreateMap().ReverseMap();
+ CreateMap().ReverseMap();
}
}
}
\ No newline at end of file
diff --git a/Dentizone.Application/AutoMapper/Payments/PaymentProfile.cs b/Dentizone.Application/AutoMapper/Payments/PaymentProfile.cs
index 08d7348..c2940e8 100644
--- a/Dentizone.Application/AutoMapper/Payments/PaymentProfile.cs
+++ b/Dentizone.Application/AutoMapper/Payments/PaymentProfile.cs
@@ -1,5 +1,5 @@
using AutoMapper;
-using Dentizone.Application.Services.Payment;
+using Dentizone.Application.DTOs.Payment;
using Dentizone.Domain.Entity;
namespace Dentizone.Application.AutoMapper.Payments
diff --git a/Dentizone.Application/AutoMapper/Posts/PostProfile.cs b/Dentizone.Application/AutoMapper/Posts/PostProfile.cs
index fe0b02e..103061d 100644
--- a/Dentizone.Application/AutoMapper/Posts/PostProfile.cs
+++ b/Dentizone.Application/AutoMapper/Posts/PostProfile.cs
@@ -1,5 +1,5 @@
using AutoMapper;
-using Dentizone.Application.DTOs.PostDTO;
+using Dentizone.Application.DTOs.Post;
using Dentizone.Domain.Entity;
namespace Dentizone.Application.AutoMapper.Posts
@@ -12,7 +12,7 @@ public PostProfile()
.ReverseMap();
CreateMap().ReverseMap();
CreateMap()
- .ForMember(dest => dest.Id, opt => opt.MapFrom(src => src.AssetId)) // Map AssetId to Id
+ .ForMember(dest => dest.Id, opt => opt.MapFrom(src => src.AssetId)) // Map AssetId to Id
.ForMember(dest => dest.Url, opt => opt.MapFrom(src => src.Asset.Url)) // Map Asset.Url to Url
.ReverseMap();
CreateMap()
diff --git a/Dentizone.Application/AutoMapper/UserActivityProfile.cs b/Dentizone.Application/AutoMapper/UserActivityProfile.cs
index 18d795b..9d70ec2 100644
--- a/Dentizone.Application/AutoMapper/UserActivityProfile.cs
+++ b/Dentizone.Application/AutoMapper/UserActivityProfile.cs
@@ -1,5 +1,5 @@
using AutoMapper;
-using Dentizone.Application.DTOs.UserActivityDTO;
+using Dentizone.Application.DTOs.UserActivity;
using Dentizone.Domain.Entity;
namespace Dentizone.Application.AutoMapper
@@ -9,7 +9,7 @@ public class UserActivityProfile : Profile
public UserActivityProfile()
{
CreateMap().ReverseMap();
- CreateMap()
+ CreateMap()
.ReverseMap()
.ForMember(dest => dest.UserName, opt => opt.MapFrom(src => src.User.Username));
}
diff --git a/Dentizone.Application/AutoMapper/UserProfile.cs b/Dentizone.Application/AutoMapper/UserProfile.cs
index fc0b623..18bd0f9 100644
--- a/Dentizone.Application/AutoMapper/UserProfile.cs
+++ b/Dentizone.Application/AutoMapper/UserProfile.cs
@@ -18,13 +18,13 @@ public UserProfile()
CreateMap()
.ReverseMap();
- CreateMap().ReverseMap();
- CreateMap()
+ CreateMap().ReverseMap();
+ CreateMap()
.ForMember(dest => dest.Status, opt => opt.MapFrom(src => src.Status))
.ReverseMap()
.ForMember(dest => dest.Status, opt => opt.MapFrom(src => src.Status));
CreateMap()
- .ForPath(dest => dest.University.Name, opt => opt.MapFrom(src => src.UnversityName))
+ .ForPath(dest => dest.University.Name, opt => opt.MapFrom(src => src.UniversityName))
.ReverseMap();
CreateMap()
diff --git a/Dentizone.Application/DI/Services.cs b/Dentizone.Application/DI/Services.cs
index 0d4fff0..83a23f7 100644
--- a/Dentizone.Application/DI/Services.cs
+++ b/Dentizone.Application/DI/Services.cs
@@ -1,14 +1,4 @@
using Dentizone.Application.Interfaces;
-using Dentizone.Application.Interfaces.Analytics;
-using Dentizone.Application.Interfaces.Assets;
-using Dentizone.Application.Interfaces.Cart;
-using Dentizone.Application.Interfaces.Catalog;
-using Dentizone.Application.Interfaces.Cloudinary;
-using Dentizone.Application.Interfaces.Favorites;
-using Dentizone.Application.Interfaces.Order;
-using Dentizone.Application.Interfaces.Post;
-using Dentizone.Application.Interfaces.Review;
-using Dentizone.Application.Interfaces.User;
using Dentizone.Application.Services;
using Dentizone.Application.Services.Authentication;
using Dentizone.Application.Services.Payment;
@@ -45,7 +35,7 @@ public static IServiceCollection AddApplicationServices(this IServiceCollection
services.AddScoped();
services.AddScoped();
- services.AddScoped();
+ services.AddScoped();
return services;
}
}
diff --git a/Dentizone.Application/DTOs/Analytics/PostAnalyticsDTO.cs b/Dentizone.Application/DTOs/Analytics/PostAnalyticsDTO.cs
index 44d40d7..946f3a1 100644
--- a/Dentizone.Application/DTOs/Analytics/PostAnalyticsDTO.cs
+++ b/Dentizone.Application/DTOs/Analytics/PostAnalyticsDTO.cs
@@ -6,6 +6,6 @@ public class PostAnalyticsDto
public int PendingPosts { get; set; }
public decimal AveragePostPrice { get; set; }
- public Dictionary PostsByCategory { get; set; } = new Dictionary();
+ public Dictionary PostsByCategory { get; set; } = new();
}
}
\ No newline at end of file
diff --git a/Dentizone.Application/DTOs/Analytics/UserAnalyticsDTO.cs b/Dentizone.Application/DTOs/Analytics/UserAnalyticsDTO.cs
index dbc0906..c4628b3 100644
--- a/Dentizone.Application/DTOs/Analytics/UserAnalyticsDTO.cs
+++ b/Dentizone.Application/DTOs/Analytics/UserAnalyticsDTO.cs
@@ -6,6 +6,6 @@ public class UserAnalyticsDto
public int NewUsersLast7Days { get; set; }
public int NewUsersLast30Days { get; set; }
- public Dictionary UsersByUniversity { get; set; } = new Dictionary();
+ public Dictionary UsersByUniversity { get; set; } = new();
}
}
\ No newline at end of file
diff --git a/Dentizone.Application/DTOs/Auth/ConfirmEmailRequestDto.cs b/Dentizone.Application/DTOs/Auth/ConfirmEmailRequestDto.cs
index 0618ded..77c850c 100644
--- a/Dentizone.Application/DTOs/Auth/ConfirmEmailRequestDto.cs
+++ b/Dentizone.Application/DTOs/Auth/ConfirmEmailRequestDto.cs
@@ -2,6 +2,6 @@
public class ConfirmEmailRequestDto
{
- public string Token { get; set; }
- public string UserId { get; set; }
+ public required string Token { get; set; }
+ public required string UserId { get; set; }
}
\ No newline at end of file
diff --git a/Dentizone.Application/DTOs/Auth/RegisterRequestDto.cs b/Dentizone.Application/DTOs/Auth/RegisterRequestDto.cs
index 1131f3f..1ebebb3 100644
--- a/Dentizone.Application/DTOs/Auth/RegisterRequestDto.cs
+++ b/Dentizone.Application/DTOs/Auth/RegisterRequestDto.cs
@@ -4,12 +4,12 @@ namespace Dentizone.Application.DTOs.Auth;
public class RegisterRequestDto
{
- public string Email { get; set; }
- public string Password { get; set; }
- public string FullName { get; set; }
- public string Username { get; set; }
+ public required string Email { get; set; }
+ public required string Password { get; set; }
+ public required string FullName { get; set; }
+ public required string Username { get; set; }
public int AcademicYear { get; set; }
- public string UniversityId { get; set; }
+ public required string UniversityId { get; set; }
}
public class RegisterRequestDtoValidator : AbstractValidator
@@ -25,7 +25,7 @@ public RegisterRequestDtoValidator()
RuleFor(x => x.FullName).NotEmpty().WithMessage("Full name is required.");
RuleFor(x => x.Username).NotEmpty().WithMessage("Username is required.");
RuleFor(x => x.AcademicYear).GreaterThan(0).LessThanOrEqualTo(5)
- .WithMessage("Academic year must be greater than 0 and less than 6.");
+ .WithMessage("Academic year must be greater than 0 and less than 6.");
RuleFor(x => x.UniversityId).NotEmpty().WithMessage("University ID is required.");
}
}
\ No newline at end of file
diff --git a/Dentizone.Application/DTOs/Auth/ResetPasswordDto.cs b/Dentizone.Application/DTOs/Auth/ResetPasswordDto.cs
index 8908f59..f5e8ef9 100644
--- a/Dentizone.Application/DTOs/Auth/ResetPasswordDto.cs
+++ b/Dentizone.Application/DTOs/Auth/ResetPasswordDto.cs
@@ -2,8 +2,8 @@
{
public class ResetPasswordDto
{
- public string NewPassword { get; set; }
- public string Token { get; set; }
- public string Email { get; set; }
+ public required string NewPassword { get; set; }
+ public required string Token { get; set; }
+ public required string Email { get; set; }
}
}
\ No newline at end of file
diff --git a/Dentizone.Application/DTOs/Cart/CartItemDTO.cs b/Dentizone.Application/DTOs/Cart/CartItemDTO.cs
index b41c53e..ef3d6a1 100644
--- a/Dentizone.Application/DTOs/Cart/CartItemDTO.cs
+++ b/Dentizone.Application/DTOs/Cart/CartItemDTO.cs
@@ -2,10 +2,10 @@
{
public class CartItemDto
{
- public string Id { get; set; }
- public string PostId { get; set; }
- public string Title { get; set; }
+ public required string Id { get; set; }
+ public required string PostId { get; set; }
+ public required string Title { get; set; }
public decimal Price { get; set; }
- public string Url { get; set; }
+ public required string Url { get; set; }
}
}
\ No newline at end of file
diff --git a/Dentizone.Application/DTOs/Catalog/CategoryDTO.cs b/Dentizone.Application/DTOs/Catalog/CategoryDTO.cs
index 0cd3cbd..1e58da1 100644
--- a/Dentizone.Application/DTOs/Catalog/CategoryDTO.cs
+++ b/Dentizone.Application/DTOs/Catalog/CategoryDTO.cs
@@ -4,7 +4,7 @@ namespace Dentizone.Application.DTOs.Catalog
{
public class CategoryDto
{
- public string Name { get; set; }
+ public required string Name { get; set; }
public string IconUrl { get; set; } = string.Empty;
}
diff --git a/Dentizone.Application/DTOs/Catalog/CategoryView.cs b/Dentizone.Application/DTOs/Catalog/CategoryView.cs
index 3eb31e5..6f97dfe 100644
--- a/Dentizone.Application/DTOs/Catalog/CategoryView.cs
+++ b/Dentizone.Application/DTOs/Catalog/CategoryView.cs
@@ -4,13 +4,13 @@ namespace Dentizone.Application.DTOs.Catalog
{
public class CategoryView
{
- public string Id { get; set; }
- public string Name { get; set; }
+ public required string Id { get; set; }
+ public required string Name { get; set; }
}
- public class CreatedCategoryDTOValidator : AbstractValidator
+ public class CreatedCategoryDtoValidator : AbstractValidator
{
- public CreatedCategoryDTOValidator()
+ public CreatedCategoryDtoValidator()
{
RuleFor(x => x.Name)
.NotEmpty().WithMessage("Category name is required.")
diff --git a/Dentizone.Application/DTOs/Catalog/CreatedSubCategoryDTO.cs b/Dentizone.Application/DTOs/Catalog/CreatedSubCategoryDTO.cs
index d6f3938..05748d7 100644
--- a/Dentizone.Application/DTOs/Catalog/CreatedSubCategoryDTO.cs
+++ b/Dentizone.Application/DTOs/Catalog/CreatedSubCategoryDTO.cs
@@ -2,15 +2,15 @@
namespace Dentizone.Application.DTOs.Catalog
{
- public class CreatedSubCategoryDTO
+ public class CreatedSubCategoryDto
{
- public string Id { get; set; }
- public string Name { get; set; }
+ public required string Id { get; set; }
+ public required string Name { get; set; }
}
- public class CreatedSubCategoryDTOValidator : AbstractValidator
+ public class CreatedSubCategoryDtoValidator : AbstractValidator
{
- public CreatedSubCategoryDTOValidator()
+ public CreatedSubCategoryDtoValidator()
{
RuleFor(x => x.Name)
.NotEmpty().WithMessage("SubCategory name is required.")
diff --git a/Dentizone.Application/DTOs/Catalog/SubCategoryDTO.cs b/Dentizone.Application/DTOs/Catalog/SubCategoryDTO.cs
index b29e011..c95cced 100644
--- a/Dentizone.Application/DTOs/Catalog/SubCategoryDTO.cs
+++ b/Dentizone.Application/DTOs/Catalog/SubCategoryDTO.cs
@@ -4,13 +4,13 @@ namespace Dentizone.Application.DTOs.Catalog
{
public class SubCategoryDto
{
- public string Name { get; set; }
- public string CategoryId { get; set; }
+ public required string Name { get; set; }
+ public required string CategoryId { get; set; }
}
- public class SubCategoryDTOValidator : AbstractValidator
+ public class SubCategoryDtoValidator : AbstractValidator
{
- public SubCategoryDTOValidator()
+ public SubCategoryDtoValidator()
{
RuleFor(x => x.Name)
.NotEmpty().WithMessage("SubCategory name is required.")
diff --git a/Dentizone.Application/DTOs/Catalog/SubCategoryView.cs b/Dentizone.Application/DTOs/Catalog/SubCategoryView.cs
index 77b520a..abf2a66 100644
--- a/Dentizone.Application/DTOs/Catalog/SubCategoryView.cs
+++ b/Dentizone.Application/DTOs/Catalog/SubCategoryView.cs
@@ -2,7 +2,7 @@
public class SubCategoryView
{
- public string Name { get; set; }
- public string Id { get; set; }
- public CategoryView Category { get; set; }
+ public required string Name { get; set; }
+ public required string Id { get; set; }
+ public required CategoryView Category { get; set; }
}
\ No newline at end of file
diff --git a/Dentizone.Application/DTOs/ErrorResponse.cs b/Dentizone.Application/DTOs/ErrorResponse.cs
index bb0b9f2..1199c98 100644
--- a/Dentizone.Application/DTOs/ErrorResponse.cs
+++ b/Dentizone.Application/DTOs/ErrorResponse.cs
@@ -2,7 +2,7 @@ namespace Dentizone.Application.DTOs;
public class ErrorResponse
{
- public string Message { get; set; }
+ public required string Message { get; set; }
public string? Details { get; set; }
public int StatusCode { get; set; }
}
\ No newline at end of file
diff --git a/Dentizone.Application/DTOs/Favorites/FavoriteViewDto.cs b/Dentizone.Application/DTOs/Favorites/FavoriteViewDto.cs
index 3820aa0..b2e784b 100644
--- a/Dentizone.Application/DTOs/Favorites/FavoriteViewDto.cs
+++ b/Dentizone.Application/DTOs/Favorites/FavoriteViewDto.cs
@@ -1,10 +1,10 @@
-using Dentizone.Application.DTOs.PostDTO;
+using Dentizone.Application.DTOs.Post;
namespace Dentizone.Application.DTOs.Favorites
{
public class FavoriteViewDto
{
- public string Id { get; set; }
- public PostViewDto Post { get; set; } = new PostViewDto();
+ public string Id { get; set; } = string.Empty;
+ public PostViewDto Post { get; set; } = new();
}
}
\ No newline at end of file
diff --git a/Dentizone.Application/DTOs/Order/CreateOrderDTO.cs b/Dentizone.Application/DTOs/Order/CreateOrderDTO.cs
index b7d935f..95fd8ff 100644
--- a/Dentizone.Application/DTOs/Order/CreateOrderDTO.cs
+++ b/Dentizone.Application/DTOs/Order/CreateOrderDTO.cs
@@ -4,8 +4,8 @@ namespace Dentizone.Application.DTOs.Order
{
public class CreateOrderDto
{
- public List PostIds { get; set; } = new List();
- public ShipInfoDto ShipInfo { get; set; } = new ShipInfoDto();
+ public List PostIds { get; set; } = new();
+ public ShipInfoDto ShipInfo { get; set; } = new();
}
public class ShipInfoDtoValidation : AbstractValidator
diff --git a/Dentizone.Application/DTOs/Order/OrderItemDto.cs b/Dentizone.Application/DTOs/Order/OrderItemDto.cs
index b5c0773..db74c6f 100644
--- a/Dentizone.Application/DTOs/Order/OrderItemDto.cs
+++ b/Dentizone.Application/DTOs/Order/OrderItemDto.cs
@@ -2,9 +2,9 @@
public class OrderItemDto
{
- public string Id { get; set; }
- public string PostId { get; set; }
- public string PostTitle { get; set; }
+ public required string Id { get; set; }
+ public required string PostId { get; set; }
+ public required string PostTitle { get; set; }
public decimal Price { get; set; }
public DateTime CreatedAt { get; set; }
diff --git a/Dentizone.Application/DTOs/Order/OrderShipInfoDto.cs b/Dentizone.Application/DTOs/Order/OrderShipInfoDto.cs
index 5f5ed03..fdb3eff 100644
--- a/Dentizone.Application/DTOs/Order/OrderShipInfoDto.cs
+++ b/Dentizone.Application/DTOs/Order/OrderShipInfoDto.cs
@@ -2,6 +2,6 @@
public class OrderShipInfoDto
{
- public string Street { get; set; }
- public string City { get; set; }
+ public string Street { get; set; } = string.Empty;
+ public string City { get; set; } = string.Empty;
}
\ No newline at end of file
diff --git a/Dentizone.Application/DTOs/Order/OrderStatusTimeline.cs b/Dentizone.Application/DTOs/Order/OrderStatusTimeline.cs
index 91172f7..6a480f3 100644
--- a/Dentizone.Application/DTOs/Order/OrderStatusTimeline.cs
+++ b/Dentizone.Application/DTOs/Order/OrderStatusTimeline.cs
@@ -2,6 +2,6 @@
public class OrderStatusTimeline
{
- public string Status { get; set; }
+ public required string Status { get; set; }
public DateTime Timestamp { get; set; }
}
\ No newline at end of file
diff --git a/Dentizone.Application/DTOs/Order/OrderViewDTO.cs b/Dentizone.Application/DTOs/Order/OrderViewDTO.cs
index d264110..bed2cbb 100644
--- a/Dentizone.Application/DTOs/Order/OrderViewDTO.cs
+++ b/Dentizone.Application/DTOs/Order/OrderViewDTO.cs
@@ -2,14 +2,14 @@
{
public class OrderViewDto
{
- public string Id { get; set; }
- public string BuyerName { get; set; }
+ public string Id { get; set; } = string.Empty;
+ public string BuyerName { get; set; } = string.Empty;
public int TotalAmount { get; set; }
- public OrderShipInfoDto OrderShipmentAddress { get; set; } = new OrderShipInfoDto();
+ public OrderShipInfoDto OrderShipmentAddress { get; set; } = new();
public DateTime CreatedAt { get; set; }
public IReadOnlyCollection StatusTimeline { get; set; } = new List();
- public List OrderItems { get; set; } = new List();
+ public List OrderItems { get; set; } = new();
}
}
\ No newline at end of file
diff --git a/Dentizone.Application/DTOs/Order/ShipInfoDto.cs b/Dentizone.Application/DTOs/Order/ShipInfoDto.cs
index 4322d29..11dfd11 100644
--- a/Dentizone.Application/DTOs/Order/ShipInfoDto.cs
+++ b/Dentizone.Application/DTOs/Order/ShipInfoDto.cs
@@ -2,6 +2,6 @@
public class ShipInfoDto
{
- public string Address { get; set; }
- public string City { get; set; }
+ public string Address { get; set; } = string.Empty;
+ public string City { get; set; } = string.Empty;
}
\ No newline at end of file
diff --git a/Dentizone.Application/DTOs/Payment/PaymentDto.cs b/Dentizone.Application/DTOs/Payment/PaymentDto.cs
new file mode 100644
index 0000000..35c3785
--- /dev/null
+++ b/Dentizone.Application/DTOs/Payment/PaymentDto.cs
@@ -0,0 +1,11 @@
+using Dentizone.Domain.Enums;
+
+namespace Dentizone.Application.DTOs.Payment;
+
+public class PaymentDto
+{
+ public required string OrderId { get; set; }
+ public required string BuyerId { get; set; }
+ public decimal Amount { get; set; }
+ public PaymentMethod PaymentMethod { get; set; }
+}
\ No newline at end of file
diff --git a/Dentizone.Application/DTOs/Payment/PaymentView.cs b/Dentizone.Application/DTOs/Payment/PaymentView.cs
new file mode 100644
index 0000000..07cc556
--- /dev/null
+++ b/Dentizone.Application/DTOs/Payment/PaymentView.cs
@@ -0,0 +1,15 @@
+using Dentizone.Domain.Enums;
+
+namespace Dentizone.Application.DTOs.Payment;
+
+public class PaymentView
+{
+ public required string Id { get; set; }
+ public required string OrderId { get; set; }
+ public required string BuyerId { get; set; }
+ public required string BuyerName { get; set; }
+ public decimal Amount { get; set; }
+ public PaymentMethod Method { get; set; }
+ public DateTime CreatedAt { get; set; }
+ public DateTime UpdatedAt { get; set; }
+}
\ No newline at end of file
diff --git a/Dentizone.Application/DTOs/PostDTO/CreatePostDTO.cs b/Dentizone.Application/DTOs/Post/CreatePostDTO.cs
similarity index 78%
rename from Dentizone.Application/DTOs/PostDTO/CreatePostDTO.cs
rename to Dentizone.Application/DTOs/Post/CreatePostDTO.cs
index 9299601..1ab7dc9 100644
--- a/Dentizone.Application/DTOs/PostDTO/CreatePostDTO.cs
+++ b/Dentizone.Application/DTOs/Post/CreatePostDTO.cs
@@ -1,21 +1,21 @@
using Dentizone.Domain.Enums;
using FluentValidation;
-namespace Dentizone.Application.DTOs.PostDTO
+namespace Dentizone.Application.DTOs.Post
{
public class CreatePostDto
{
- public string Title { get; set; }
- public string Description { get; set; }
+ public required string Title { get; set; }
+ public required string Description { get; set; }
public decimal Price { get; set; }
public PostItemCondition Condition { get; set; }
- public string Street { get; set; }
- public string City { get; set; }
- public string CategoryId { get; set; }
- public string SubCategoryId { get; set; }
+ public required string Street { get; set; }
+ public required string City { get; set; }
+ public required string CategoryId { get; set; }
+ public required string SubCategoryId { get; set; }
public DateTime? ExpireDate { get; set; }
- public List AssetIds { get; set; }
+ public required List AssetIds { get; set; }
}
public class CreatePostDtoValidator : AbstractValidator
diff --git a/Dentizone.Application/DTOs/Post/PostAssetView.cs b/Dentizone.Application/DTOs/Post/PostAssetView.cs
new file mode 100644
index 0000000..d765beb
--- /dev/null
+++ b/Dentizone.Application/DTOs/Post/PostAssetView.cs
@@ -0,0 +1,8 @@
+namespace Dentizone.Application.DTOs.Post
+{
+ public class PostAssetView
+ {
+ public required string Id { get; set; }
+ public required string Url { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/Dentizone.Application/DTOs/Post/PostFilterDto/CategoryFilterDTO.cs b/Dentizone.Application/DTOs/Post/PostFilterDto/CategoryFilterDTO.cs
new file mode 100644
index 0000000..bb12e0d
--- /dev/null
+++ b/Dentizone.Application/DTOs/Post/PostFilterDto/CategoryFilterDTO.cs
@@ -0,0 +1,9 @@
+namespace Dentizone.Application.DTOs.Post.PostFilterDto
+{
+ public class CategoryFilterDto
+ {
+ public required string Id { get; set; }
+ public required string CategoryName { get; set; }
+ public List Subcategories { get; set; } = new();
+ }
+}
\ No newline at end of file
diff --git a/Dentizone.Application/DTOs/PostFilterDTO/SidebarFilterDTO.cs b/Dentizone.Application/DTOs/Post/PostFilterDto/SidebarFilterDTO.cs
similarity index 56%
rename from Dentizone.Application/DTOs/PostFilterDTO/SidebarFilterDTO.cs
rename to Dentizone.Application/DTOs/Post/PostFilterDto/SidebarFilterDTO.cs
index 94fe064..5387ea7 100644
--- a/Dentizone.Application/DTOs/PostFilterDTO/SidebarFilterDTO.cs
+++ b/Dentizone.Application/DTOs/Post/PostFilterDto/SidebarFilterDTO.cs
@@ -1,9 +1,9 @@
-namespace Dentizone.Application.DTOs.PostFilterDTO
+namespace Dentizone.Application.DTOs.Post.PostFilterDto
{
public class SidebarFilterDto
{
- public List Cities { get; set; } = new List();
- public List Categories { get; set; } = new List();
+ public List Cities { get; set; } = new();
+ public List Categories { get; set; } = new();
public decimal MinPrice { get; set; }
public decimal MaxPrice { get; set; }
}
diff --git a/Dentizone.Application/DTOs/PostFilterDTO/UserPreferenceDTO.cs b/Dentizone.Application/DTOs/Post/PostFilterDto/UserPreferenceDTO.cs
similarity index 94%
rename from Dentizone.Application/DTOs/PostFilterDTO/UserPreferenceDTO.cs
rename to Dentizone.Application/DTOs/Post/PostFilterDto/UserPreferenceDTO.cs
index 2dc97dc..339ab18 100644
--- a/Dentizone.Application/DTOs/PostFilterDTO/UserPreferenceDTO.cs
+++ b/Dentizone.Application/DTOs/Post/PostFilterDto/UserPreferenceDTO.cs
@@ -1,7 +1,7 @@
using Dentizone.Domain.Enums;
using FluentValidation;
-namespace Dentizone.Application.DTOs.PostFilterDTO
+namespace Dentizone.Application.DTOs.Post.PostFilterDto
{
public class UserPreferenceDto
{
diff --git a/Dentizone.Application/DTOs/Post/PostViewDTO.cs b/Dentizone.Application/DTOs/Post/PostViewDTO.cs
new file mode 100644
index 0000000..7635878
--- /dev/null
+++ b/Dentizone.Application/DTOs/Post/PostViewDTO.cs
@@ -0,0 +1,21 @@
+using Dentizone.Application.DTOs.User;
+
+namespace Dentizone.Application.DTOs.Post
+{
+ public class PostViewDto
+ {
+ public string Id { get; set; } = string.Empty;
+ public string Title { get; set; } = string.Empty;
+ public string Description { get; set; } = string.Empty;
+ public decimal Price { get; set; } = 0;
+ public DateTime? ExpireDate { get; set; } = null;
+ public string Condition { get; set; } = string.Empty;
+ public string Category { get; set; } = string.Empty;
+ public string SubCatgory { get; set; } = string.Empty;
+ public string Status { get; set; } = string.Empty;
+ public UserView Seller { get; set; } = new();
+ public List Assets { get; set; }
+ public DateTime CreatedAt { get; set; }
+ public DateTime UpdatedAt { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/Dentizone.Application/DTOs/PostDTO/UpdatePostDTO.cs b/Dentizone.Application/DTOs/Post/UpdatePostDTO.cs
similarity index 57%
rename from Dentizone.Application/DTOs/PostDTO/UpdatePostDTO.cs
rename to Dentizone.Application/DTOs/Post/UpdatePostDTO.cs
index 4fc56ca..5494fed 100644
--- a/Dentizone.Application/DTOs/PostDTO/UpdatePostDTO.cs
+++ b/Dentizone.Application/DTOs/Post/UpdatePostDTO.cs
@@ -1,15 +1,15 @@
using Dentizone.Domain.Enums;
-namespace Dentizone.Application.DTOs.PostDTO
+namespace Dentizone.Application.DTOs.Post
{
public class UpdatePostDto
{
- public string Title { get; set; }
- public string Description { get; set; }
+ public required string Title { get; set; }
+ public required string Description { get; set; }
public decimal Price { get; set; }
public PostItemCondition Condition { get; set; }
- public string Street { get; set; }
- public string City { get; set; }
+ public required string Street { get; set; }
+ public required string City { get; set; }
public PostStatus Status { get; set; }
public List AssetIds { get; set; } = new();
diff --git a/Dentizone.Application/DTOs/PostDTO/PostAssetView.cs b/Dentizone.Application/DTOs/PostDTO/PostAssetView.cs
deleted file mode 100644
index da869b0..0000000
--- a/Dentizone.Application/DTOs/PostDTO/PostAssetView.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-namespace Dentizone.Application.DTOs.PostDTO
-{
- public class PostAssetView
- {
- public string Id { get; set; }
- public string Url { get; set; }
- }
-}
\ No newline at end of file
diff --git a/Dentizone.Application/DTOs/PostDTO/PostViewDTO.cs b/Dentizone.Application/DTOs/PostDTO/PostViewDTO.cs
deleted file mode 100644
index 1522155..0000000
--- a/Dentizone.Application/DTOs/PostDTO/PostViewDTO.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using Dentizone.Application.DTOs.User;
-
-namespace Dentizone.Application.DTOs.PostDTO
-{
- public class PostViewDto
- {
- public string Id { get; set; }
- public string Title { get; set; }
- public string Description { get; set; }
- public decimal Price { get; set; }
- public DateTime? ExpireDate { get; set; }
- public string Condition { get; set; }
- public string Category { get; set; }
- public string SubCatgory { get; set; }
- public string Status { get; set; }
- public UserView Seller { get; set; }
- public List Assets { get; set; }
- public DateTime CreatedAt { get; set; }
- public DateTime UpdatedAt { get; set; }
- }
-}
\ No newline at end of file
diff --git a/Dentizone.Application/DTOs/PostFilterDTO/CategoryFilterDTO.cs b/Dentizone.Application/DTOs/PostFilterDTO/CategoryFilterDTO.cs
deleted file mode 100644
index afae69b..0000000
--- a/Dentizone.Application/DTOs/PostFilterDTO/CategoryFilterDTO.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-namespace Dentizone.Application.DTOs.PostFilterDTO
-{
- public class CategoryFilterDto
- {
- public string Id { get; set; }
- public string CategoryName { get; set; }
- public List Subcategories { get; set; } = new List();
- }
-}
\ No newline at end of file
diff --git a/Dentizone.Application/DTOs/Q&A/AnswerDTO/AnswerViewDto.cs b/Dentizone.Application/DTOs/Q&A/AnswerDTO/AnswerViewDto.cs
index 4ca4fa4..fa45ec2 100644
--- a/Dentizone.Application/DTOs/Q&A/AnswerDTO/AnswerViewDto.cs
+++ b/Dentizone.Application/DTOs/Q&A/AnswerDTO/AnswerViewDto.cs
@@ -4,9 +4,9 @@ namespace Dentizone.Application.DTOs.Q_A.AnswerDTO
{
public class AnswerViewDto
{
- public string Id { get; set; }
- public string ResponderName { get; set; }
- public string Text { get; set; }
+ public required string Id { get; set; }
+ public required string ResponderName { get; set; }
+ public required string Text { get; set; }
public DateTime CreatedAt { get; set; }
}
diff --git a/Dentizone.Application/DTOs/Q&A/AnswerDTO/CreateAnswerDto.cs b/Dentizone.Application/DTOs/Q&A/AnswerDTO/CreateAnswerDto.cs
index c07f497..2236700 100644
--- a/Dentizone.Application/DTOs/Q&A/AnswerDTO/CreateAnswerDto.cs
+++ b/Dentizone.Application/DTOs/Q&A/AnswerDTO/CreateAnswerDto.cs
@@ -4,7 +4,7 @@ namespace Dentizone.Application.DTOs.Q_A.AnswerDTO
{
public class CreateAnswerDto
{
- public string Text { get; set; }
+ public required string Text { get; set; }
}
public class CreateAnswerDtoValidator : AbstractValidator
diff --git a/Dentizone.Application/DTOs/Q&A/AnswerDTO/UpdateAnswerDto.cs b/Dentizone.Application/DTOs/Q&A/AnswerDTO/UpdateAnswerDto.cs
index e1fb393..0986040 100644
--- a/Dentizone.Application/DTOs/Q&A/AnswerDTO/UpdateAnswerDto.cs
+++ b/Dentizone.Application/DTOs/Q&A/AnswerDTO/UpdateAnswerDto.cs
@@ -4,7 +4,7 @@ namespace Dentizone.Application.DTOs.Q_A.AnswerDTO
{
public class UpdateAnswerDto
{
- public string Text { get; set; }
+ public required string Text { get; set; }
}
public class UpdateAnswerDtoValidator : AbstractValidator
diff --git a/Dentizone.Application/DTOs/Q&A/QuestionDTO/CreateQuestionDto.cs b/Dentizone.Application/DTOs/Q&A/QuestionDTO/CreateQuestionDto.cs
index 4685c38..b74425c 100644
--- a/Dentizone.Application/DTOs/Q&A/QuestionDTO/CreateQuestionDto.cs
+++ b/Dentizone.Application/DTOs/Q&A/QuestionDTO/CreateQuestionDto.cs
@@ -6,7 +6,7 @@ namespace Dentizone.Application.DTOs.Q_A.QuestionDTO
#nullable enable
public class CreateQuestionDto
{
- public string PostId { get; set; }
+ public required string PostId { get; set; }
public string? Text { get; set; }
}
diff --git a/Dentizone.Application/DTOs/Q&A/QuestionDTO/QuestionViewDto.cs b/Dentizone.Application/DTOs/Q&A/QuestionDTO/QuestionViewDto.cs
index b25559a..951fd84 100644
--- a/Dentizone.Application/DTOs/Q&A/QuestionDTO/QuestionViewDto.cs
+++ b/Dentizone.Application/DTOs/Q&A/QuestionDTO/QuestionViewDto.cs
@@ -5,9 +5,9 @@ namespace Dentizone.Application.DTOs.Q_A.QuestionDTO
{
public class QuestionViewDto
{
- public string Id { get; set; }
- public string AskerName { get; set; }
- public string Text { get; set; }
+ public required string Id { get; set; }
+ public required string AskerName { get; set; }
+ public required string Text { get; set; }
public AnswerViewDto? Answer { get; set; }
public DateTime CreatedAt { get; set; }
}
diff --git a/Dentizone.Application/DTOs/Review/CreateReviewDTO.cs b/Dentizone.Application/DTOs/Review/CreateReviewDTO.cs
index 93e3234..405e9a6 100644
--- a/Dentizone.Application/DTOs/Review/CreateReviewDTO.cs
+++ b/Dentizone.Application/DTOs/Review/CreateReviewDTO.cs
@@ -4,9 +4,9 @@ namespace Dentizone.Application.DTOs.Review
{
public class CreateReviewDto
{
- public string OrderId { get; set; }
+ public required string OrderId { get; set; }
public int Stars { get; set; }
- public string Comment { get; set; }
+ public required string Comment { get; set; }
}
public class CreateReviewDtoValidation : AbstractValidator
diff --git a/Dentizone.Application/DTOs/Review/ReviewDTO.cs b/Dentizone.Application/DTOs/Review/ReviewDTO.cs
index f8030ff..a8b406c 100644
--- a/Dentizone.Application/DTOs/Review/ReviewDTO.cs
+++ b/Dentizone.Application/DTOs/Review/ReviewDTO.cs
@@ -4,7 +4,7 @@ namespace Dentizone.Application.DTOs.Review
{
public class ReviewDto
{
- public string Comment { get; set; }
+ public required string Comment { get; set; }
public int Stars { get; set; }
}
diff --git a/Dentizone.Application/DTOs/University/SupportedUniversitiesDTO.cs b/Dentizone.Application/DTOs/University/SupportedUniversitiesDTO.cs
index bccc1d9..22fa707 100644
--- a/Dentizone.Application/DTOs/University/SupportedUniversitiesDTO.cs
+++ b/Dentizone.Application/DTOs/University/SupportedUniversitiesDTO.cs
@@ -2,6 +2,5 @@
{
public class SupportedUniversitiesDto : UniversityDto
{
- public string Id { get; set; }
}
}
\ No newline at end of file
diff --git a/Dentizone.Application/DTOs/University/University.cs b/Dentizone.Application/DTOs/University/University.cs
index 8931a78..d113c1b 100644
--- a/Dentizone.Application/DTOs/University/University.cs
+++ b/Dentizone.Application/DTOs/University/University.cs
@@ -2,8 +2,8 @@
public class UniversityDto
{
- public string Id { get; set; }
- public string Name { get; set; }
- public string Domain { get; set; }
+ public required string Id { get; set; }
+ public required string Name { get; set; }
+ public required string Domain { get; set; }
public bool IsSupported { get; set; }
}
\ No newline at end of file
diff --git a/Dentizone.Application/DTOs/University/UniversityView.cs b/Dentizone.Application/DTOs/University/UniversityView.cs
index feda1bb..5025a89 100644
--- a/Dentizone.Application/DTOs/University/UniversityView.cs
+++ b/Dentizone.Application/DTOs/University/UniversityView.cs
@@ -2,9 +2,9 @@
{
public class UniversityView
{
- public string Id { get; set; }
- public string Name { get; set; }
+ public required string Id { get; set; }
+ public required string Name { get; set; }
public bool IsSupported { get; set; }
- public string Domain { get; set; }
+ public required string Domain { get; set; }
}
}
\ No newline at end of file
diff --git a/Dentizone.Application/DTOs/User/CreateAppUser.cs b/Dentizone.Application/DTOs/User/CreateAppUser.cs
index 03c6898..ec80acd 100644
--- a/Dentizone.Application/DTOs/User/CreateAppUser.cs
+++ b/Dentizone.Application/DTOs/User/CreateAppUser.cs
@@ -4,13 +4,13 @@ namespace Dentizone.Application.DTOs.User
{
public class CreateAppUser
{
- public string
+ public required string
Id { get; set; }
- public string FullName { get; set; }
- public string Email { get; set; }
- public string Username { get; set; }
- public string UniversityId { get; set; }
+ public required string FullName { get; set; }
+ public required string Email { get; set; }
+ public required string Username { get; set; }
+ public required string UniversityId { get; set; }
public int AcademicYear { get; set; }
public KycStatus KycStatus { get; set; }
diff --git a/Dentizone.Application/DTOs/User/DomainUser.cs b/Dentizone.Application/DTOs/User/DomainUser.cs
index b116f22..16e911c 100644
--- a/Dentizone.Application/DTOs/User/DomainUser.cs
+++ b/Dentizone.Application/DTOs/User/DomainUser.cs
@@ -3,11 +3,11 @@
public class DomainUserView
{
public string Id { get; set; } = string.Empty;
- public string FullName { get; set; }
+ public required string FullName { get; set; }
public int AcademicYear { get; set; }
public long? NationalId { get; set; }
- public string KycStatus { get; set; }
- public string Status { get; set; }
- public string UnversityName { get; set; }
+ public required string KycStatus { get; set; }
+ public required string Status { get; set; }
+ public required string UnversityName { get; set; }
public string Username { get; set; } = string.Empty;
}
\ No newline at end of file
diff --git a/Dentizone.Application/DTOs/User/KycStatusDTO.cs b/Dentizone.Application/DTOs/User/KycStatusDTO.cs
index 70aa7bd..faac2c5 100644
--- a/Dentizone.Application/DTOs/User/KycStatusDTO.cs
+++ b/Dentizone.Application/DTOs/User/KycStatusDTO.cs
@@ -3,14 +3,14 @@
namespace Dentizone.Application.DTOs.User
{
- public class KycStatusDTO
+ public class KycStatusDto
{
public KycStatus KycStatus { get; set; }
}
- public class KycStatusDTOValidator : AbstractValidator
+ public class KycStatusDtoValidator : AbstractValidator
{
- public KycStatusDTOValidator()
+ public KycStatusDtoValidator()
{
RuleFor(x => x.KycStatus)
.IsInEnum()
diff --git a/Dentizone.Application/DTOs/User/LoggedInUser.cs b/Dentizone.Application/DTOs/User/LoggedInUser.cs
index b20ca36..b755352 100644
--- a/Dentizone.Application/DTOs/User/LoggedInUser.cs
+++ b/Dentizone.Application/DTOs/User/LoggedInUser.cs
@@ -5,6 +5,6 @@ namespace Dentizone.Application.DTOs.User;
public class LoggedInUser
{
- public ApplicationUser User { get; set; }
- public UserRoles role { get; set; }
+ public required ApplicationUser User { get; set; }
+ public UserRoles Role { get; set; }
}
\ No newline at end of file
diff --git a/Dentizone.Application/DTOs/User/UserDTO.cs b/Dentizone.Application/DTOs/User/UserDTO.cs
index 333d674..29ca58b 100644
--- a/Dentizone.Application/DTOs/User/UserDTO.cs
+++ b/Dentizone.Application/DTOs/User/UserDTO.cs
@@ -4,16 +4,15 @@ namespace Dentizone.Application.DTOs.User
{
public class UserDto
{
- public string
- Id
- { get; set; } // YES, we're accepting string IDs for user because it's coming from IdentityServer
+ public required string
+ Id { get; set; } // YES, we're accepting string IDs for user because it's coming from IdentityServer
- public string FullName { get; set; }
- public string Username { get; set; }
+ public required string FullName { get; set; }
+ public required string Username { get; set; }
public int AcademicYear { get; set; }
public long? NationalId { get; set; }
public KycStatus KycStatus { get; set; }
public UserState Status { get; set; }
- public string UniversityName { get; set; }
+ public required string UniversityName { get; set; }
}
}
\ No newline at end of file
diff --git a/Dentizone.Application/DTOs/User/UserStateDTO.cs b/Dentizone.Application/DTOs/User/UserStateDTO.cs
index 21fa51a..6764733 100644
--- a/Dentizone.Application/DTOs/User/UserStateDTO.cs
+++ b/Dentizone.Application/DTOs/User/UserStateDTO.cs
@@ -3,14 +3,14 @@
namespace Dentizone.Application.DTOs.User
{
- public class UserStateDTO
+ public class UserStateDto
{
public UserState Status { get; set; }
}
- public class UserStateDTOValidator : AbstractValidator
+ public class UserStateDtoValidator : AbstractValidator
{
- public UserStateDTOValidator()
+ public UserStateDtoValidator()
{
RuleFor(x => x.Status)
.IsInEnum()
diff --git a/Dentizone.Application/DTOs/User/UserView.cs b/Dentizone.Application/DTOs/User/UserView.cs
index 0edcf99..9c2b65d 100644
--- a/Dentizone.Application/DTOs/User/UserView.cs
+++ b/Dentizone.Application/DTOs/User/UserView.cs
@@ -2,9 +2,9 @@
{
public class UserView
{
- public string Id { get; set; }
- public string Username { get; set; }
+ public string Id { get; set; } = string.Empty;
+ public string Username { get; set; } = string.Empty;
public int AcademicYear { get; set; }
- public string UnversityName { get; set; }
+ public string UniversityName { get; set; } = string.Empty;
}
}
\ No newline at end of file
diff --git a/Dentizone.Application/DTOs/UserActivityDTO/CreatedUserActivityDTO.cs b/Dentizone.Application/DTOs/UserActivity/CreatedUserActivityDTO.cs
similarity index 74%
rename from Dentizone.Application/DTOs/UserActivityDTO/CreatedUserActivityDTO.cs
rename to Dentizone.Application/DTOs/UserActivity/CreatedUserActivityDTO.cs
index 173d89c..de81ce5 100644
--- a/Dentizone.Application/DTOs/UserActivityDTO/CreatedUserActivityDTO.cs
+++ b/Dentizone.Application/DTOs/UserActivity/CreatedUserActivityDTO.cs
@@ -1,7 +1,7 @@
using Dentizone.Domain.Enums;
using FluentValidation;
-namespace Dentizone.Application.DTOs.UserActivityDTO
+namespace Dentizone.Application.DTOs.UserActivity
{
public class CreatedUserActivityDto
{
@@ -9,9 +9,9 @@ public class CreatedUserActivityDto
public UserActivities ActivityType { get; set; }
}
- public class CreatedUserActivityDTOValidator : AbstractValidator
+ public class CreatedUserActivityDtoValidator : AbstractValidator
{
- public CreatedUserActivityDTOValidator()
+ public CreatedUserActivityDtoValidator()
{
RuleFor(x => x.DetectedAt).NotEmpty().WithMessage("DetectedAt is required.");
RuleFor(x => x.ActivityType).IsInEnum().WithMessage("ActivityType must be a valid enum value.");
diff --git a/Dentizone.Application/DTOs/UserActivity/UniversitiesByUserDto.cs b/Dentizone.Application/DTOs/UserActivity/UniversitiesByUserDto.cs
new file mode 100644
index 0000000..704f299
--- /dev/null
+++ b/Dentizone.Application/DTOs/UserActivity/UniversitiesByUserDto.cs
@@ -0,0 +1,8 @@
+namespace Dentizone.Application.DTOs.UserActivity
+{
+ public class UniversitiesByUserDto
+ {
+ public required string UniversityName { get; set; }
+ public int StudentCount { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/Dentizone.Application/DTOs/UserActivityDTO/UserActivityDTO.cs b/Dentizone.Application/DTOs/UserActivity/UserActivityDTO.cs
similarity index 63%
rename from Dentizone.Application/DTOs/UserActivityDTO/UserActivityDTO.cs
rename to Dentizone.Application/DTOs/UserActivity/UserActivityDTO.cs
index b171982..878b1c2 100644
--- a/Dentizone.Application/DTOs/UserActivityDTO/UserActivityDTO.cs
+++ b/Dentizone.Application/DTOs/UserActivity/UserActivityDTO.cs
@@ -1,24 +1,24 @@
using Dentizone.Domain.Enums;
using FluentValidation;
-namespace Dentizone.Application.DTOs.UserActivityDTO
+namespace Dentizone.Application.DTOs.UserActivity
{
- public class UserActivityDTO
+ public class UserActivityDto
{
- public string Id { get; set; }
- public string UserName { get; set; }
- public string UserId { get; set; }
- public string FingerprintToken { get; set; }
- public string Device { get; set; }
- public string UserAgent { get; set; }
+ public required string Id { get; set; }
+ public required string UserName { get; set; }
+ public required string UserId { get; set; }
+ public required string FingerprintToken { get; set; }
+ public required string Device { get; set; }
+ public required string UserAgent { get; set; }
public DateTime DetectedAt { get; set; }
- public string IpAddress { get; set; }
+ public required string IpAddress { get; set; }
public UserActivities ActivityType { get; set; }
}
- public class UserActivityDTOValidator : AbstractValidator
+ public class UserActivityDtoValidator : AbstractValidator
{
- public UserActivityDTOValidator()
+ public UserActivityDtoValidator()
{
RuleFor(x => x.Id).NotEmpty().WithMessage("Id is required.");
RuleFor(x => x.UserId).NotEmpty().WithMessage("UserId is required.");
diff --git a/Dentizone.Application/DTOs/UserActivityDTO/UniversitiesByUserDto.cs b/Dentizone.Application/DTOs/UserActivityDTO/UniversitiesByUserDto.cs
deleted file mode 100644
index 8e6f65e..0000000
--- a/Dentizone.Application/DTOs/UserActivityDTO/UniversitiesByUserDto.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-namespace Dentizone.Application.DTOs.UserActivityDTO
-{
- public class UniversitiesByUserDto
- {
- public string UniversityName { get; set; }
- public int StudentCount { get; set; }
- }
-}
\ No newline at end of file
diff --git a/Dentizone.Application/DTOs/Withdrawal/ApproveWithdrawalDto.cs b/Dentizone.Application/DTOs/Withdrawal/ApproveWithdrawalDto.cs
index 8e91bda..9207cce 100644
--- a/Dentizone.Application/DTOs/Withdrawal/ApproveWithdrawalDto.cs
+++ b/Dentizone.Application/DTOs/Withdrawal/ApproveWithdrawalDto.cs
@@ -2,6 +2,6 @@
{
public class ApproveWithdrawalDto
{
- public string AdminNote { get; set; }
+ public required string AdminNote { get; set; }
}
}
\ No newline at end of file
diff --git a/Dentizone.Application/DTOs/Withdrawal/WithdrawalRequestDto.cs b/Dentizone.Application/DTOs/Withdrawal/WithdrawalRequestDto.cs
index b051717..bc41ad6 100644
--- a/Dentizone.Application/DTOs/Withdrawal/WithdrawalRequestDto.cs
+++ b/Dentizone.Application/DTOs/Withdrawal/WithdrawalRequestDto.cs
@@ -5,7 +5,7 @@ namespace Dentizone.Application.DTOs.Withdrawal
public class WithdrawalRequestDto
{
public decimal Amount { get; set; }
- public string WalletId { get; set; }
+ public required string WalletId { get; set; }
}
public class WithdrawalRequestDtoValidator : AbstractValidator
diff --git a/Dentizone.Application/DTOs/Withdrawal/WithdrawalRequestView.cs b/Dentizone.Application/DTOs/Withdrawal/WithdrawalRequestView.cs
index 3baa43a..77b86bc 100644
--- a/Dentizone.Application/DTOs/Withdrawal/WithdrawalRequestView.cs
+++ b/Dentizone.Application/DTOs/Withdrawal/WithdrawalRequestView.cs
@@ -2,12 +2,12 @@
{
public class WithdrawalRequestView
{
- public string Id { get; set; }
+ public required string Id { get; set; }
public decimal Amount { get; set; }
- public string WalletId { get; set; }
- public string Status { get; set; }
- public string UserId { get; set; }
+ public required string WalletId { get; set; }
+ public required string Status { get; set; }
+ public required string UserId { get; set; }
- public string AdminNotes { get; set; }
+ public required string AdminNotes { get; set; }
}
}
\ No newline at end of file
diff --git a/Dentizone.Application/Interfaces/Analytics/IAnalyticsService.cs b/Dentizone.Application/Interfaces/IAnalyticsService.cs
similarity index 87%
rename from Dentizone.Application/Interfaces/Analytics/IAnalyticsService.cs
rename to Dentizone.Application/Interfaces/IAnalyticsService.cs
index e554133..5d785e9 100644
--- a/Dentizone.Application/Interfaces/Analytics/IAnalyticsService.cs
+++ b/Dentizone.Application/Interfaces/IAnalyticsService.cs
@@ -1,6 +1,6 @@
using Dentizone.Application.DTOs.Analytics;
-namespace Dentizone.Application.Interfaces.Analytics
+namespace Dentizone.Application.Interfaces
{
public interface IAnalyticsService
{
diff --git a/Dentizone.Application/Interfaces/Assets/IAssetService.cs b/Dentizone.Application/Interfaces/IAssetService.cs
similarity index 85%
rename from Dentizone.Application/Interfaces/Assets/IAssetService.cs
rename to Dentizone.Application/Interfaces/IAssetService.cs
index 545b3e7..16fcd22 100644
--- a/Dentizone.Application/Interfaces/Assets/IAssetService.cs
+++ b/Dentizone.Application/Interfaces/IAssetService.cs
@@ -1,6 +1,6 @@
using Dentizone.Application.DTOs.Assets;
-namespace Dentizone.Application.Interfaces.Assets;
+namespace Dentizone.Application.Interfaces;
public interface IAssetService
{
diff --git a/Dentizone.Application/Interfaces/Cart/ICartService.cs b/Dentizone.Application/Interfaces/ICartService.cs
similarity index 88%
rename from Dentizone.Application/Interfaces/Cart/ICartService.cs
rename to Dentizone.Application/Interfaces/ICartService.cs
index ffa68ed..e8d2b49 100644
--- a/Dentizone.Application/Interfaces/Cart/ICartService.cs
+++ b/Dentizone.Application/Interfaces/ICartService.cs
@@ -1,6 +1,6 @@
using Dentizone.Application.DTOs.Cart;
-namespace Dentizone.Application.Interfaces.Cart
+namespace Dentizone.Application.Interfaces
{
public interface ICartService
{
diff --git a/Dentizone.Application/Interfaces/Catalog/ICatalogService.cs b/Dentizone.Application/Interfaces/ICatalogService.cs
similarity index 86%
rename from Dentizone.Application/Interfaces/Catalog/ICatalogService.cs
rename to Dentizone.Application/Interfaces/ICatalogService.cs
index 9fd3508..d1c48ed 100644
--- a/Dentizone.Application/Interfaces/Catalog/ICatalogService.cs
+++ b/Dentizone.Application/Interfaces/ICatalogService.cs
@@ -1,6 +1,6 @@
using Dentizone.Application.DTOs.Catalog;
-namespace Dentizone.Application.Interfaces.Catalog;
+namespace Dentizone.Application.Interfaces;
public interface ICatalogService
{
@@ -10,7 +10,7 @@ public interface ICatalogService
Task UpdateCategory(string userId, CategoryDto updatedCategoryDto);
Task> GetAllCategories();
Task> GetSubCategoriesByCategoryId(string id);
- Task CreateSubCategory(SubCategoryDto createdSubCategoryDto);
+ Task CreateSubCategory(SubCategoryDto createdSubCategoryDto);
Task GetSubCategoryById(string id);
Task DeleteSubCategory(string id);
Task UpdateSubCategory(SubCategoryDto updatedSubCategoryDto);
diff --git a/Dentizone.Application/Interfaces/Cloudinary/ICloudinaryService.cs b/Dentizone.Application/Interfaces/ICloudinaryService.cs
similarity index 62%
rename from Dentizone.Application/Interfaces/Cloudinary/ICloudinaryService.cs
rename to Dentizone.Application/Interfaces/ICloudinaryService.cs
index 1a098eb..f99b1b1 100644
--- a/Dentizone.Application/Interfaces/Cloudinary/ICloudinaryService.cs
+++ b/Dentizone.Application/Interfaces/ICloudinaryService.cs
@@ -1,4 +1,4 @@
-namespace Dentizone.Application.Interfaces.Cloudinary;
+namespace Dentizone.Application.Interfaces;
public interface ICloudinaryService
{
diff --git a/Dentizone.Application/Interfaces/Favorites/IFavoritesService.cs b/Dentizone.Application/Interfaces/IFavoritesService.cs
similarity index 86%
rename from Dentizone.Application/Interfaces/Favorites/IFavoritesService.cs
rename to Dentizone.Application/Interfaces/IFavoritesService.cs
index bd2d9fc..b23f779 100644
--- a/Dentizone.Application/Interfaces/Favorites/IFavoritesService.cs
+++ b/Dentizone.Application/Interfaces/IFavoritesService.cs
@@ -1,6 +1,6 @@
using Dentizone.Application.DTOs.Favorites;
-namespace Dentizone.Application.Interfaces.Favorites
+namespace Dentizone.Application.Interfaces
{
public interface IFavoritesService
{
diff --git a/Dentizone.Application/Interfaces/Order/IOrderService.cs b/Dentizone.Application/Interfaces/IOrderService.cs
similarity index 92%
rename from Dentizone.Application/Interfaces/Order/IOrderService.cs
rename to Dentizone.Application/Interfaces/IOrderService.cs
index 8d45836..d4b22ef 100644
--- a/Dentizone.Application/Interfaces/Order/IOrderService.cs
+++ b/Dentizone.Application/Interfaces/IOrderService.cs
@@ -1,7 +1,7 @@
using Dentizone.Application.DTOs;
using Dentizone.Application.DTOs.Order;
-namespace Dentizone.Application.Interfaces.Order
+namespace Dentizone.Application.Interfaces
{
public interface IOrderService
{
diff --git a/Dentizone.Application/Interfaces/IPaymentService.cs b/Dentizone.Application/Interfaces/IPaymentService.cs
new file mode 100644
index 0000000..34c022a
--- /dev/null
+++ b/Dentizone.Application/Interfaces/IPaymentService.cs
@@ -0,0 +1,14 @@
+using Dentizone.Application.DTOs.Payment;
+
+namespace Dentizone.Application.Interfaces;
+
+public interface IPaymentService
+{
+ Task CreatePaymentAsync(PaymentDto payment);
+ Task GetPaymentByIdAsync(string paymentId);
+ Task CreateSaleTransaction(string paymentId, string walletId, decimal amount);
+
+ Task ConfirmPaymentAsync(string orderId);
+
+ Task CancelPaymentByOrderId(string orderId);
+}
\ No newline at end of file
diff --git a/Dentizone.Application/Interfaces/Post/IPostService.cs b/Dentizone.Application/Interfaces/IPostService.cs
similarity index 84%
rename from Dentizone.Application/Interfaces/Post/IPostService.cs
rename to Dentizone.Application/Interfaces/IPostService.cs
index bf61cd1..55422e5 100644
--- a/Dentizone.Application/Interfaces/Post/IPostService.cs
+++ b/Dentizone.Application/Interfaces/IPostService.cs
@@ -1,8 +1,8 @@
-using Dentizone.Application.DTOs.PostDTO;
-using Dentizone.Application.DTOs.PostFilterDTO;
+using Dentizone.Application.DTOs.Post;
+using Dentizone.Application.DTOs.Post.PostFilterDto;
using Dentizone.Domain.Enums;
-namespace Dentizone.Application.Interfaces.Post
+namespace Dentizone.Application.Interfaces
{
public interface IPostService
{
diff --git a/Dentizone.Application/Interfaces/IQAService.cs b/Dentizone.Application/Interfaces/IQAService.cs
index d1f743a..472e7be 100644
--- a/Dentizone.Application/Interfaces/IQAService.cs
+++ b/Dentizone.Application/Interfaces/IQAService.cs
@@ -3,7 +3,7 @@
namespace Dentizone.Application.Interfaces
{
- public interface IQAService
+ public interface IQaService
{
Task AskQuestionAsync(CreateQuestionDto dto, string askerId);
Task> GetQuestionsForPostAsync(string postId);
diff --git a/Dentizone.Application/Interfaces/Review/IReviewService.cs b/Dentizone.Application/Interfaces/IReviewService.cs
similarity index 90%
rename from Dentizone.Application/Interfaces/Review/IReviewService.cs
rename to Dentizone.Application/Interfaces/IReviewService.cs
index 429bf3c..888d81c 100644
--- a/Dentizone.Application/Interfaces/Review/IReviewService.cs
+++ b/Dentizone.Application/Interfaces/IReviewService.cs
@@ -1,6 +1,6 @@
using Dentizone.Application.DTOs.Review;
-namespace Dentizone.Application.Interfaces.Review
+namespace Dentizone.Application.Interfaces
{
public interface IReviewService
{
diff --git a/Dentizone.Application/Interfaces/Order/IShippingService.cs b/Dentizone.Application/Interfaces/IShippingService.cs
similarity index 81%
rename from Dentizone.Application/Interfaces/Order/IShippingService.cs
rename to Dentizone.Application/Interfaces/IShippingService.cs
index d92b031..a71bb68 100644
--- a/Dentizone.Application/Interfaces/Order/IShippingService.cs
+++ b/Dentizone.Application/Interfaces/IShippingService.cs
@@ -1,6 +1,6 @@
using Dentizone.Domain.Enums;
-namespace Dentizone.Application.Interfaces.Order
+namespace Dentizone.Application.Interfaces
{
public interface IShippingService
{
diff --git a/Dentizone.Application/Interfaces/IUserActivityService.cs b/Dentizone.Application/Interfaces/IUserActivityService.cs
index 5bf8522..826e6eb 100644
--- a/Dentizone.Application/Interfaces/IUserActivityService.cs
+++ b/Dentizone.Application/Interfaces/IUserActivityService.cs
@@ -1,4 +1,4 @@
-using Dentizone.Application.DTOs.UserActivityDTO;
+using Dentizone.Application.DTOs.UserActivity;
using Dentizone.Domain.Enums;
namespace Dentizone.Application.Interfaces;
@@ -6,10 +6,10 @@ namespace Dentizone.Application.Interfaces;
public interface IUserActivityService
{
Task CreateAsync(UserActivities activity,
- DateTime? detectedAt = null, string? userId = null);
+ DateTime? detectedAt = null, string? userId = null);
- Task GetByIdAsync(string id);
+ Task GetByIdAsync(string id);
- Task> GetAllByActivityTypeAndUserIdAsync(
+ Task> GetAllByActivityTypeAndUserIdAsync(
int page, string userId, UserActivities activityType);
}
\ No newline at end of file
diff --git a/Dentizone.Application/Interfaces/User/IUserService.cs b/Dentizone.Application/Interfaces/IUserService.cs
similarity index 72%
rename from Dentizone.Application/Interfaces/User/IUserService.cs
rename to Dentizone.Application/Interfaces/IUserService.cs
index 86743b0..876b58d 100644
--- a/Dentizone.Application/Interfaces/User/IUserService.cs
+++ b/Dentizone.Application/Interfaces/IUserService.cs
@@ -3,7 +3,7 @@
using Dentizone.Domain.Enums;
using System.Linq.Expressions;
-namespace Dentizone.Application.Interfaces.User
+namespace Dentizone.Application.Interfaces
{
public interface IUserService
{
@@ -11,11 +11,11 @@ public interface IUserService
Task GetByIdAsync(string id);
Task> GetAllAsync(int page, string? searchByName = null,
- Expression>? filterExpression = null);
+ Expression>? filterExpression = null);
Task DeleteAsync(string id);
Task SetKycStatusAsync(string userId, KycStatus status);
- Task SetUserStateAsync(string userId, UserStateDTO userStateDto);
+ Task SetUserStateAsync(string userId, UserStateDto userStateDto);
Task SetNationalId(string userId, string nationalId);
}
}
\ No newline at end of file
diff --git a/Dentizone.Application/Interfaces/IWithdrawalService.cs b/Dentizone.Application/Interfaces/IWithdrawalService.cs
index 9124433..144ec23 100644
--- a/Dentizone.Application/Interfaces/IWithdrawalService.cs
+++ b/Dentizone.Application/Interfaces/IWithdrawalService.cs
@@ -7,7 +7,7 @@ public interface IWithdrawalService
Task CreateWithdrawalRequestAsync(string userId,
WithdrawalRequestDto withdrawalRequestDto);
- Task> GetWithdrawalHistoryAsync(string userId, int page);
+ Task> GetWithdrawalHistoryAsync(string userId);
Task ApproveWithdrawalAsync(string id, string adminNote);
Task RejectWithdrawalAsync(string id, string adminNote);
}
diff --git a/Dentizone.Application/Services/AnalyticsService.cs b/Dentizone.Application/Services/AnalyticsService.cs
index 2b44b0e..2b7505f 100644
--- a/Dentizone.Application/Services/AnalyticsService.cs
+++ b/Dentizone.Application/Services/AnalyticsService.cs
@@ -1,5 +1,5 @@
using Dentizone.Application.DTOs.Analytics;
-using Dentizone.Application.Interfaces.Analytics;
+using Dentizone.Application.Interfaces;
using Dentizone.Domain.Interfaces;
using Dentizone.Domain.Interfaces.Repositories;
using Dentizone.Infrastructure.Cache;
diff --git a/Dentizone.Application/Services/AssetService.cs b/Dentizone.Application/Services/AssetService.cs
index 1bb1785..f7a6f1a 100644
--- a/Dentizone.Application/Services/AssetService.cs
+++ b/Dentizone.Application/Services/AssetService.cs
@@ -1,6 +1,6 @@
using AutoMapper;
using Dentizone.Application.DTOs.Assets;
-using Dentizone.Application.Interfaces.Assets;
+using Dentizone.Application.Interfaces;
using Dentizone.Domain.Entity;
using Dentizone.Domain.Exceptions;
using Dentizone.Domain.Interfaces.Repositories;
diff --git a/Dentizone.Application/Services/Authentication/AuthService.cs b/Dentizone.Application/Services/Authentication/AuthService.cs
index cae13a5..92482c5 100644
--- a/Dentizone.Application/Services/Authentication/AuthService.cs
+++ b/Dentizone.Application/Services/Authentication/AuthService.cs
@@ -34,7 +34,7 @@ public async Task GetUserRoleAsync(string userId)
throw new NotFoundException("User does not have any roles assigned");
}
- return Enum.Parse(currentRoles.FirstOrDefault() ?? UserRoles.GHOST.ToString());
+ return Enum.Parse(currentRoles.FirstOrDefault() ?? UserRoles.Ghost.ToString());
}
public async Task AlternateUserRoleAsync(UserRoles newRole, string userId)
@@ -69,7 +69,7 @@ public async Task LoginWithEmailAndPassword(string email, string p
if (isLockedOut)
{
- await userActivityService.CreateAsync(UserActivities.LOCKDOUT, DateTime.Now, user.Id);
+ await userActivityService.CreateAsync(UserActivities.Lockdout, DateTime.Now, user.Id);
throw new
UserLockedOutException(
"User is locked out due to too many failed login attempts. Please try again later.");
@@ -97,7 +97,7 @@ public async Task LoginWithEmailAndPassword(string email, string p
// 4. Check if user is in role
- if (roles.Contains(UserRoles.BLACKLISTED.ToString()))
+ if (roles.Contains(UserRoles.Blacklisted.ToString()))
{
throw new BadActionException("You're banned from using our platform.");
}
@@ -105,11 +105,11 @@ public async Task LoginWithEmailAndPassword(string email, string p
// 5. Generate token
await userManager.ResetAccessFailedCountAsync(user);
- await userActivityService.CreateAsync(UserActivities.LOGIN, DateTime.Now, user.Id);
+ await userActivityService.CreateAsync(UserActivities.Login, DateTime.Now, user.Id);
return new LoggedInUser()
{
User = user,
- role = Enum.Parse(roles.FirstOrDefault())
+ Role = Enum.Parse(roles.FirstOrDefault())
};
}
@@ -137,7 +137,7 @@ public async Task RegisterWithEmailAndPassword(RegisterRequestDto
// 3. Assign default role
- await userManager.AddToRoleAsync(user, UserRoles.GHOST.ToString());
+ await userManager.AddToRoleAsync(user, UserRoles.Ghost.ToString());
// 4. Send Verification Email
@@ -146,7 +146,7 @@ public async Task RegisterWithEmailAndPassword(RegisterRequestDto
return new LoggedInUser()
{
User = user,
- role = UserRoles.GHOST
+ Role = UserRoles.Ghost
};
}
@@ -174,10 +174,10 @@ public async Task ConfirmEmail(string token, string userId)
}
// 4. Assign verified role
- await AlternateUserRoleAsync(UserRoles.PARTILY_VERIFIED, user);
- await userActivityService.CreateAsync(UserActivities.EMAIL_CONFIRMED, DateTime.Now, user.Id);
+ await AlternateUserRoleAsync(UserRoles.PartilyVerified, user);
+ await userActivityService.CreateAsync(UserActivities.EmailConfirmed, DateTime.Now, user.Id);
// 4. Generate token
- return GenerateToken(user.Id, user.Email, UserRoles.PARTILY_VERIFIED.ToString());
+ return GenerateToken(user.Id, user.Email, UserRoles.PartilyVerified.ToString());
}
public async Task SendVerificationEmail(string email)
@@ -248,7 +248,7 @@ public async Task ResetPassword(string email, string token, string newPa
throw new NotFoundException("User does not have any roles assigned");
}
- await userActivityService.CreateAsync(UserActivities.PASSWORD_RESET);
+ await userActivityService.CreateAsync(UserActivities.PasswordReset);
// 3. Generate token
return GenerateToken(user.Id, user.Email, roles.FirstOrDefault());
}
diff --git a/Dentizone.Application/Services/Authentication/VerificationService.cs b/Dentizone.Application/Services/Authentication/VerificationService.cs
index 1ad8a9e..89da368 100644
--- a/Dentizone.Application/Services/Authentication/VerificationService.cs
+++ b/Dentizone.Application/Services/Authentication/VerificationService.cs
@@ -1,6 +1,5 @@
using Dentizone.Application.DTOs.User;
using Dentizone.Application.Interfaces;
-using Dentizone.Application.Interfaces.User;
using Dentizone.Domain.Enums;
using Dentizone.Domain.Interfaces.Mail;
using Dentizone.Domain.Interfaces.Secret;
@@ -11,8 +10,8 @@ namespace Dentizone.Application.Services.Authentication
{
public class Metadata
{
- public string Email { get; set; }
- public string UserId { get; set; }
+ public required string Email { get; set; }
+ public required string UserId { get; set; }
}
@@ -28,15 +27,15 @@ public class VerificationService : IVerificationService
private static Dictionary MapVerificationStatusToEnum()
{
return new Dictionary
- {
- { "approved", KycStatus.APPROVED },
- { "declined", KycStatus.REJECTED },
- { "pending", KycStatus.PENDING }
- };
+ {
+ { "approved", KycStatus.Approved },
+ { "declined", KycStatus.Rejected },
+ { "pending", KycStatus.Pending }
+ };
}
public VerificationService(IDiditApi diditApi, ISecretService secretService, IAuthService authService,
- IUserService userService)
+ IUserService userService)
{
_diditApi = diditApi;
_secretService = secretService;
@@ -69,12 +68,12 @@ public async Task StartSessionAsync(string userId)
};
var session = await _diditApi.CreateSessionAsync(request, _secretService.GetSecret("DiditApi"));
- await _userService.SetKycStatusAsync(userId, KycStatus.NOT_SUBMITTED);
+ await _userService.SetKycStatusAsync(userId, KycStatus.NotSubmitted);
await _mailService.Send(user.Email, "Dentizone: Verification Started",
- "Thank you for starting the email verification process." +
- " You can use this url to verify your identity" +
- $" Verify Now"
- );
+ "Thank you for starting the email verification process." +
+ " You can use this url to verify your identity" +
+ $" Verify Now"
+ );
return session;
}
diff --git a/Dentizone.Application/Services/BaseService.cs b/Dentizone.Application/Services/BaseService.cs
index bcf00d4..aa9d502 100644
--- a/Dentizone.Application/Services/BaseService.cs
+++ b/Dentizone.Application/Services/BaseService.cs
@@ -22,7 +22,7 @@ protected BaseService(IHttpContextAccessor httpContextAccessor)
protected bool IsAdmin()
{
var userRole = _httpContextAccessor.HttpContext?.User.FindFirstValue(ClaimTypes.Role);
- return Enum.TryParse(userRole, out var role) && role == UserRoles.ADMIN;
+ return Enum.TryParse(userRole, out var role) && role == UserRoles.Admin;
}
///
diff --git a/Dentizone.Application/Services/CartService.cs b/Dentizone.Application/Services/CartService.cs
index 20824c7..8e333ed 100644
--- a/Dentizone.Application/Services/CartService.cs
+++ b/Dentizone.Application/Services/CartService.cs
@@ -1,6 +1,6 @@
using AutoMapper;
using Dentizone.Application.DTOs.Cart;
-using Dentizone.Application.Interfaces.Cart;
+using Dentizone.Application.Interfaces;
using Dentizone.Domain.Entity;
using Dentizone.Domain.Enums;
using Dentizone.Domain.Exceptions;
diff --git a/Dentizone.Application/Services/CatalogService.cs b/Dentizone.Application/Services/CatalogService.cs
index dc4a32e..0cac5a1 100644
--- a/Dentizone.Application/Services/CatalogService.cs
+++ b/Dentizone.Application/Services/CatalogService.cs
@@ -1,6 +1,6 @@
using AutoMapper;
using Dentizone.Application.DTOs.Catalog;
-using Dentizone.Application.Interfaces.Catalog;
+using Dentizone.Application.Interfaces;
using Dentizone.Domain.Entity;
using Dentizone.Domain.Exceptions;
using Dentizone.Domain.Interfaces.Repositories;
@@ -72,7 +72,7 @@ public async Task> GetSubCategoriesByCategoryId(str
return relatedSubCategories.Select(mapper.Map);
}
- public async Task CreateSubCategory(SubCategoryDto createdSubCategoryDto)
+ public async Task CreateSubCategory(SubCategoryDto createdSubCategoryDto)
{
var category = await categoryRepository.GetByIdAsync(createdSubCategoryDto.CategoryId);
if (category == null)
@@ -80,7 +80,7 @@ public async Task CreateSubCategory(SubCategoryDto create
var subCategory = mapper.Map(createdSubCategoryDto);
var createdSubCategory = await subCategoryRepository.CreateAsync(subCategory);
- return mapper.Map(createdSubCategory);
+ return mapper.Map(createdSubCategory);
}
public async Task GetSubCategoryById(string id)
diff --git a/Dentizone.Application/Services/CloudinaryService.cs b/Dentizone.Application/Services/CloudinaryService.cs
index 60cd470..d122b32 100644
--- a/Dentizone.Application/Services/CloudinaryService.cs
+++ b/Dentizone.Application/Services/CloudinaryService.cs
@@ -1,6 +1,6 @@
using CloudinaryDotNet;
using CloudinaryDotNet.Actions;
-using Dentizone.Application.Interfaces.Cloudinary;
+using Dentizone.Application.Interfaces;
using Dentizone.Domain.Exceptions;
using Dentizone.Domain.Interfaces.Secret;
@@ -23,7 +23,8 @@ public string Upload(Stream fileStream, string fileName)
throw new CloudinaryUploadException($"Error uploading image: {uploadResult.Error.Message}");
}
- return uploadResult.SecureUri.ToString();
+
+ return uploadResult.SecureUrl.ToString();
}
}
}
\ No newline at end of file
diff --git a/Dentizone.Application/Services/FavoriteService.cs b/Dentizone.Application/Services/FavoriteService.cs
index 7c77039..a024d20 100644
--- a/Dentizone.Application/Services/FavoriteService.cs
+++ b/Dentizone.Application/Services/FavoriteService.cs
@@ -1,6 +1,6 @@
using AutoMapper;
using Dentizone.Application.DTOs.Favorites;
-using Dentizone.Application.Interfaces.Favorites;
+using Dentizone.Application.Interfaces;
using Dentizone.Domain.Entity;
using Dentizone.Domain.Exceptions;
using Dentizone.Domain.Interfaces.Repositories;
diff --git a/Dentizone.Application/Services/MailService.cs b/Dentizone.Application/Services/MailService.cs
index 53da6c3..f91eccb 100644
--- a/Dentizone.Application/Services/MailService.cs
+++ b/Dentizone.Application/Services/MailService.cs
@@ -4,22 +4,22 @@
namespace Dentizone.Application.Services
{
- internal class MailService(ITruboSMTP smtpApi, ISecretService secretService) : IMailService
+ internal class MailService(ITruboSmtp smtpApi, ISecretService secretService) : IMailService
{
public async Task