feat : refactor , version 0.27.31.52 , fix issues
add torob search , add webite controller , refacor unused namespaces , fix job scheduler , fix nav menu management pagerelease
parent
e024b4d977
commit
f62ee59f24
|
@ -63,7 +63,9 @@ public class BlogCategoryController : ICarterModule
|
|||
// POST:Create Entity
|
||||
public async Task<IResult> Post([FromBody] BlogCategorySDto dto, IRepositoryWrapper repositoryWrapper, CancellationToken cancellationToken)
|
||||
{
|
||||
var ent = BlogCategory.Create(dto.Name,dto.Description);
|
||||
var ent = BlogCategory.Create(dto.Name,dto.Description,dto.IsMain);
|
||||
if (dto.ParentId != default)
|
||||
ent.SetParent(dto.ParentId);
|
||||
repositoryWrapper.SetRepository<BlogCategory>().Add(ent);
|
||||
await repositoryWrapper.SaveChangesAsync(cancellationToken);
|
||||
return TypedResults.Ok();
|
||||
|
@ -76,7 +78,9 @@ public class BlogCategoryController : ICarterModule
|
|||
.FirstOrDefaultAsync(b => b.Id == dto.Id, cancellationToken);
|
||||
if (ent == null)
|
||||
throw new AppException("Blog not found");
|
||||
var newEnt = BlogCategory.Create(dto.Name, dto.Description);
|
||||
var newEnt = BlogCategory.Create(dto.Name, dto.Description,dto.IsMain);
|
||||
if (dto.ParentId != default)
|
||||
ent.SetParent(dto.ParentId);
|
||||
newEnt.Id = ent.Id;
|
||||
repositoryWrapper.SetRepository<BlogCategory>().Update(newEnt);
|
||||
await repositoryWrapper.SaveChangesAsync(cancellationToken);
|
||||
|
|
|
@ -17,6 +17,10 @@ public class SearchController : ICarterModule
|
|||
group.MapGet("zarehbin", ZarehbinAsync)
|
||||
.WithDisplayName("Search Async")
|
||||
.HasApiVersion(1.0);
|
||||
|
||||
group.MapGet("torob", TorobAsync)
|
||||
.WithDisplayName("Get Torob Product Async")
|
||||
.HasApiVersion(1.0);
|
||||
}
|
||||
|
||||
private async Task<IResult> SearchThumbAsync([FromQuery] string name, [FromServices] ISearchService searchService, CancellationToken cancellationToken)
|
||||
|
@ -38,4 +42,7 @@ public class SearchController : ICarterModule
|
|||
else
|
||||
return TypedResults.Ok(await searchService.ZarehbinAsync(Guid.Parse(product_id), cancellationToken));
|
||||
}
|
||||
|
||||
private async Task<IResult> TorobAsync([FromQuery] int page, [FromServices] IMediator mediator, CancellationToken cancellationToken)
|
||||
=> TypedResults.Ok(await mediator.Send(new GetTorobProductsQuery(page),cancellationToken));
|
||||
}
|
|
@ -164,13 +164,13 @@ public class SeedController : ICarterModule
|
|||
throw new AppException("Key is not valid", ApiResultStatusCode.UnAuthorized);
|
||||
|
||||
Dictionary<int, Guid> categories = new Dictionary<int, Guid>();
|
||||
var baseCategory = BlogCategory.Create("دسته بندی نشده","دسته بندی برای بلاگ های دسته بندی نشده");
|
||||
var baseCategory = BlogCategory.Create("دسته بندی نشده","دسته بندی برای بلاگ های دسته بندی نشده",true);
|
||||
repositoryWrapper.SetRepository<BlogCategory>().Add(baseCategory);
|
||||
await repositoryWrapper.SaveChangesAsync(cancellationToken);
|
||||
categories.Add(0, baseCategory.Id);
|
||||
foreach (var requestDto in request)
|
||||
{
|
||||
var ent = BlogCategory.Create(requestDto.Name,requestDto.Slug, requestDto.Description);
|
||||
var ent = BlogCategory.Create(requestDto.Name,requestDto.Slug, requestDto.Description,false);
|
||||
repositoryWrapper.SetRepository<BlogCategory>().Add(ent);
|
||||
await repositoryWrapper.SaveChangesAsync(cancellationToken);
|
||||
categories.Add(requestDto.BaseCategoryId, ent.Id);
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
using Netina.Domain.MartenEntities.Settings;
|
||||
|
||||
namespace Netina.Api.Controllers;
|
||||
namespace Netina.Api.Controllers;
|
||||
|
||||
public class WebSiteController:ICarterModule
|
||||
{
|
||||
|
@ -13,16 +11,6 @@ public class WebSiteController:ICarterModule
|
|||
.HasApiVersion(1.0);
|
||||
}
|
||||
|
||||
private async Task<IResult> GetNavBarItemsAsync([FromServices]ISettingService settingService,CancellationToken cancellationToken)
|
||||
{
|
||||
var navBarSetting = await settingService.GetSettingAsync(nameof(NavMenuSetting), cancellationToken) as NavMenuSetting;
|
||||
if (navBarSetting == null)
|
||||
return TypedResults.Ok();
|
||||
navBarSetting.NavMenuItems.ForEach(n =>
|
||||
{
|
||||
n.Children = navBarSetting.NavMenuItems.Where(ni => ni.ParentId == n.Id).ToList();
|
||||
});
|
||||
navBarSetting.NavMenuItems.Where(n=>n.ParentId != default).ToList().ForEach(ni=>navBarSetting.NavMenuItems.Remove(ni));
|
||||
return TypedResults.Ok(navBarSetting.NavMenuItems);
|
||||
}
|
||||
private async Task<IResult> GetNavBarItemsAsync([FromServices] IMediator mediator, CancellationToken cancellationToken)
|
||||
=> TypedResults.Ok(await mediator.Send(new GetWebSiteNavBarCommand(),cancellationToken));
|
||||
}
|
|
@ -6,8 +6,8 @@
|
|||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<InvariantGlobalization>true</InvariantGlobalization>
|
||||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
||||
<AssemblyVersion>0.26.30.51</AssemblyVersion>
|
||||
<FileVersion>0.26.30.51</FileVersion>
|
||||
<AssemblyVersion>0.27.31.52</AssemblyVersion>
|
||||
<FileVersion>0.27.31.52</FileVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -76,6 +76,7 @@
|
|||
<Using Include="Netina.Core.Abstracts" />
|
||||
<Using Include="Netina.Core.BaseServices.Abstracts" />
|
||||
<Using Include="Netina.Core.CoreServices.Abstracts" />
|
||||
<Using Include="Netina.Core.CoreServices.CommandQueries.Commands" />
|
||||
<Using Include="Netina.Core.Models.Api" />
|
||||
<Using Include="Netina.Core.Utilities" />
|
||||
<Using Include="Netina.Domain" />
|
||||
|
|
|
@ -8,7 +8,7 @@ string env = builder.Environment.IsDevelopment() == true ? "Development" : "Prod
|
|||
builder.Host.UseContentRoot(Directory.GetCurrentDirectory());
|
||||
if (builder.Environment.IsDevelopment())
|
||||
{
|
||||
string projectName = "Vesmeh";
|
||||
string projectName = "Hamyan";
|
||||
builder.Configuration.AddJsonFile($"AppSettings/appsettings.json").AddJsonFile($"AppSettings/appsettings.{env}{projectName}.json");
|
||||
}
|
||||
|
||||
|
|
|
@ -3,13 +3,15 @@
|
|||
public enum FileUploadType
|
||||
{
|
||||
[Display(Name = "Images")]
|
||||
Image,
|
||||
Image = 0,
|
||||
[Display(Name = "Handouts")]
|
||||
Handout,
|
||||
Handout = 1,
|
||||
[Display(Name = "Videos")]
|
||||
Video,
|
||||
Video = 2,
|
||||
[Display(Name = "site-maps")]
|
||||
SiteMap
|
||||
SiteMap = 3,
|
||||
[Display(Name = "Logo")]
|
||||
Logo = 4,
|
||||
}
|
||||
public class FileUploadRequest
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<!--<PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
|
@ -12,9 +12,9 @@
|
|||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
|
||||
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="7.5.1" />
|
||||
</ItemGroup>-->
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<!--<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<LangVersion>10</LangVersion>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
|
@ -25,7 +25,7 @@
|
|||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
|
||||
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="7.3.1" />
|
||||
</ItemGroup>
|
||||
</ItemGroup>-->
|
||||
|
||||
<ItemGroup>
|
||||
<Using Include="MD.PersianDateTime.Standard" />
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
using System.IO.Compression;
|
||||
using System.Web;
|
||||
using System.Xml;
|
||||
using Netina.Core.Models;
|
||||
using Netina.Domain.Entities.Blogs;
|
||||
using Netina.Domain.Entities.Brands;
|
||||
using Netina.Domain.Entities.ProductCategories;
|
||||
using Netina.Domain.Entities.Products;
|
||||
|
||||
namespace Netina.Core.BaseServices;
|
||||
|
||||
|
|
|
@ -8,4 +8,5 @@ public interface ISearchService : IScopedDependency
|
|||
public Task<SearchResponseDto> ThumbSearchAsync(string name,CancellationToken cancellationToken = default);
|
||||
public Task<ZarehbinPagedResponseDto> ZarehbinAsync(int page,CancellationToken cancellationToken = default);
|
||||
public Task<ZarehbinProductResponseDto> ZarehbinAsync(Guid productId,CancellationToken cancellationToken = default);
|
||||
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
namespace Netina.Core.CoreServices.CommandQueries.Commands;
|
||||
|
||||
public sealed record GetWebSiteNavBarCommand() : IRequest<List<NavMenuItem>>;
|
|
@ -1,4 +1,5 @@
|
|||
using Netina.Domain.Dtos.ResponseDtos.Zarehbin;
|
||||
using Netina.Domain.Dtos.ResponseDtos.Torob;
|
||||
using Netina.Domain.Dtos.ResponseDtos.Zarehbin;
|
||||
using Netina.Domain.Entities.ProductCategories;
|
||||
|
||||
namespace Netina.Core.CoreServices;
|
||||
|
@ -63,4 +64,5 @@ public class SearchService : ISearchService
|
|||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
using Netina.Domain.Dtos.ResponseDtos.Torob;
|
||||
|
||||
namespace Netina.Core.CoreServices.SearchServices;
|
||||
|
||||
public class GetTorobProductsQueryHandler : IRequestHandler<GetTorobProductsQuery, List<TorobProductResponseDto>>
|
||||
{
|
||||
private readonly IRepositoryWrapper _repositoryWrapper;
|
||||
private readonly SiteSettings _siteSetting;
|
||||
|
||||
public GetTorobProductsQueryHandler(IRepositoryWrapper repositoryWrapper , IOptionsSnapshot<SiteSettings> optionsSnapshot)
|
||||
{
|
||||
_repositoryWrapper = repositoryWrapper;
|
||||
_siteSetting = optionsSnapshot.Value;
|
||||
}
|
||||
public async Task<List<TorobProductResponseDto>> Handle(GetTorobProductsQuery request, CancellationToken cancellationToken)
|
||||
{
|
||||
var products = await _repositoryWrapper.SetRepository<Product>()
|
||||
.TableNoTracking
|
||||
.OrderByDescending(p => p.ModifiedAt == DateTime.MinValue ? p.CreatedAt : p.ModifiedAt)
|
||||
.Select(ProductMapper.ProjectToTorobResponseDto)
|
||||
.Skip(request.Page * 100)
|
||||
.Take(100)
|
||||
.ToListAsync(cancellationToken);
|
||||
|
||||
products.ForEach(p =>
|
||||
{
|
||||
p.page_url = $"{_siteSetting.WebSiteUrl}/products/{p.product_id}";
|
||||
});
|
||||
|
||||
return products;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,81 @@
|
|||
using Netina.Domain.Entities.Blogs;
|
||||
using Netina.Domain.Entities.ProductCategories;
|
||||
|
||||
namespace Netina.Core.CoreServices.WebSiteServices;
|
||||
|
||||
public class GetWebSiteNavBarCommandHandler : IRequestHandler<GetWebSiteNavBarCommand , List<NavMenuItem>>
|
||||
{
|
||||
private readonly IRepositoryWrapper _repositoryWrapper;
|
||||
private readonly ISettingService _settingService;
|
||||
private readonly SiteSettings _siteSetting;
|
||||
|
||||
public GetWebSiteNavBarCommandHandler(IRepositoryWrapper repositoryWrapper , ISettingService settingService,IOptionsSnapshot<SiteSettings> optionsSnapshot)
|
||||
{
|
||||
_repositoryWrapper = repositoryWrapper;
|
||||
_settingService = settingService;
|
||||
_siteSetting = optionsSnapshot.Value;
|
||||
}
|
||||
|
||||
public async Task<List<NavMenuItem>> Handle(GetWebSiteNavBarCommand request, CancellationToken cancellationToken)
|
||||
{
|
||||
var navBarSetting = await _settingService.GetSettingAsync(nameof(NavMenuSetting), cancellationToken) as NavMenuSetting;
|
||||
var navBarItems = new List<NavMenuItem>();
|
||||
if (navBarSetting == null)
|
||||
return new List<NavMenuItem>();
|
||||
|
||||
navBarSetting.NavMenuItems.ForEach(n =>
|
||||
{
|
||||
n.Children = navBarSetting.NavMenuItems.Where(ni => ni.ParentId == n.Id).ToList();
|
||||
});
|
||||
navBarSetting.NavMenuItems.Where(n => n.ParentId != default).ToList().ForEach(ni => navBarSetting.NavMenuItems.Remove(ni));
|
||||
if (navBarSetting.ShowBlogCategories)
|
||||
{
|
||||
|
||||
var baseCategories = await _repositoryWrapper.SetRepository<BlogCategory>()
|
||||
.TableNoTracking
|
||||
.OrderByDescending(c => c.CreatedAt)
|
||||
.Select(BlogCategoryMapper.ProjectToSDto)
|
||||
.ToListAsync(cancellationToken);
|
||||
|
||||
return baseCategories.Where(c=>c.IsMain).Select(b => new NavMenuItem
|
||||
{
|
||||
Title = b.Name,
|
||||
Url = $"{_siteSetting.WebSiteUrl}/categories/{b.Id}/{b.Slug}",
|
||||
Id = b.Id,
|
||||
ParentId = b.ParentId,
|
||||
Children = baseCategories.Where(c=>c.ParentId == b.Id).Select(c=>new NavMenuItem
|
||||
{
|
||||
|
||||
Title = c.Name,
|
||||
Url = $"{_siteSetting.WebSiteUrl}/categories/{c.Id}/{c.Slug}",
|
||||
Id = c.Id,
|
||||
}).ToList()
|
||||
}).ToList();
|
||||
|
||||
}
|
||||
else if (navBarSetting.ShowProductCategories)
|
||||
{
|
||||
var baseCategories = await _repositoryWrapper.SetRepository<ProductCategory>()
|
||||
.TableNoTracking
|
||||
.OrderByDescending(c => c.CreatedAt)
|
||||
.Select(ProductCategoryMapper.ProjectToSDto)
|
||||
.ToListAsync(cancellationToken);
|
||||
|
||||
return baseCategories.Where(c => c.IsMain).Select(b => new NavMenuItem
|
||||
{
|
||||
Title = b.Name,
|
||||
Url = $"{_siteSetting.WebSiteUrl}/categories/{b.Id}/{b.Slug}",
|
||||
Id = b.Id,
|
||||
ParentId = b.ParentId,
|
||||
Children = baseCategories.Where(c => c.ParentId == b.Id).Select(c => new NavMenuItem
|
||||
{
|
||||
|
||||
Title = c.Name,
|
||||
Url = $"{_siteSetting.WebSiteUrl}/categories/{c.Id}/{c.Slug}",
|
||||
Id = c.Id,
|
||||
}).ToList()
|
||||
}).ToList();
|
||||
}
|
||||
return navBarSetting.NavMenuItems;
|
||||
}
|
||||
}
|
|
@ -24,6 +24,8 @@
|
|||
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="CoreServices\WebSiteServices\" />
|
||||
<Folder Include="CoreServices\SearchServices\" />
|
||||
<Folder Include="EntityServices\ProductHandlers\" />
|
||||
<Folder Include="EntityServices\ReviewHandlers\" />
|
||||
<Folder Include="Models\Api\" />
|
||||
|
@ -47,6 +49,7 @@
|
|||
<Using Include="Netina.Core.Abstracts" />
|
||||
<Using Include="Netina.Core.BaseServices.Abstracts" />
|
||||
<Using Include="Netina.Core.CoreServices.Abstracts" />
|
||||
<Using Include="Netina.Core.CoreServices.CommandQueries.Commands" />
|
||||
<Using Include="Netina.Core.EntityServices.Abstracts" />
|
||||
<Using Include="Netina.Domain" />
|
||||
<Using Include="Netina.Domain.CommandQueries.Commands" />
|
||||
|
|
|
@ -23,7 +23,7 @@ public class JobScheduler
|
|||
.Build();
|
||||
ITrigger trigger = TriggerBuilder.Create()
|
||||
.WithIdentity("SiteMapJobTrigger", "admin")
|
||||
.WithSchedule(CronScheduleBuilder.AtHourAndMinuteOnGivenDaysOfWeek(3, 30,
|
||||
.WithSchedule(CronScheduleBuilder.AtHourAndMinuteOnGivenDaysOfWeek(1, 10,
|
||||
DayOfWeek.Saturday,
|
||||
DayOfWeek.Sunday,
|
||||
DayOfWeek.Monday,
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
using Netina.Domain.Dtos.ResponseDtos.Torob;
|
||||
|
||||
namespace Netina.Domain.CommandQueries.Queries;
|
||||
|
||||
public sealed record GetTorobProductsQuery(int Page = 0) : IRequest<List<TorobProductResponseDto>>;
|
|
@ -8,3 +8,11 @@ public class BaseFilterDto
|
|||
public QueryFilterType QueryType { get; set; }
|
||||
public List<FilterOptionDto> Options { get; set; } = new List<FilterOptionDto>();
|
||||
}
|
||||
public class BaseFilterDto<TOptionValue>
|
||||
{
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public string Type { get; set; } = string.Empty;
|
||||
public string QueryName { get; set; } = string.Empty;
|
||||
public QueryFilterType QueryType { get; set; }
|
||||
public List<FilterOptionDto<TOptionValue>> Options { get; set; } = new List<FilterOptionDto<TOptionValue>>();
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
namespace Netina.Domain.Dtos.FilterDtos;
|
||||
|
||||
public class ExpressDeliveryFilter : BaseFilterDto
|
||||
public class ExpressDeliveryFilter : BaseFilterDto<bool>
|
||||
{
|
||||
public ExpressDeliveryFilter()
|
||||
{
|
||||
|
@ -8,6 +8,6 @@ public class ExpressDeliveryFilter : BaseFilterDto
|
|||
QueryName = "expressDelivery";
|
||||
Type = "checkbox";
|
||||
QueryType = QueryFilterType.Bool;
|
||||
Options.Add(new FilterOptionDto{Id = 0,Title = "فقط ارسال سریع"});
|
||||
Options.Add(new FilterOptionDto<bool>{Id = 0,Title = "فقط ارسال سریع",Value = true});
|
||||
}
|
||||
}
|
|
@ -5,3 +5,9 @@ public class FilterOptionDto
|
|||
public int Id { get; set; }
|
||||
public string Title { get; set; } = string.Empty;
|
||||
}
|
||||
public class FilterOptionDto<TValue>
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Title { get; set; } = string.Empty;
|
||||
public TValue? Value { get; set; }
|
||||
}
|
|
@ -23,6 +23,7 @@ public class ProductLDto : BaseDto<ProductLDto,Product>
|
|||
public string BrandName { get; set; } = string.Empty;
|
||||
public Guid CategoryId { get; set; }
|
||||
public string CategoryName { get; set; } = string.Empty;
|
||||
public string MainImage { get; set; } = string.Empty;
|
||||
public bool IsSpecialOffer { get; set; }
|
||||
|
||||
public List<SpecificationSDto> Specifications { get; set; } = new();
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
namespace Netina.Domain.Dtos.ResponseDtos.Torob;
|
||||
public class TorobPagedResponseDto
|
||||
{
|
||||
public List<TorobProductResponseDto> Products { get; set; } = new();
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
namespace Netina.Domain.Dtos.ResponseDtos.Torob;
|
||||
|
||||
public class TorobProductResponseDto
|
||||
{
|
||||
public string product_id { get; set; } = string.Empty;
|
||||
public string page_url { get; set; } = string.Empty;
|
||||
public double price { get; set; }
|
||||
public bool availibility { get; set; }
|
||||
public double old_price { get; set; }
|
||||
}
|
|
@ -6,21 +6,3 @@ public class ZarehbinPagedResponseDto
|
|||
public int total_pages_count { get; set; }
|
||||
public List<ZarehbinProductResponseDto> products { get; set; } = new();
|
||||
}
|
||||
|
||||
public class ZarehbinProductResponseDto
|
||||
{
|
||||
public string title { get; set; } = string.Empty;
|
||||
public string subtitle { get; set; } = string.Empty;
|
||||
public string id { get; set; } = string.Empty;
|
||||
public string current_price { get; set; } = string.Empty;
|
||||
public string old_price { get; set; } = string.Empty;
|
||||
public string availability { get; set; } = string.Empty;
|
||||
public List<string> categories { get; set; } = new();
|
||||
public string image_link { get; set; } = string.Empty;
|
||||
public List<string> image_links { get; set; } = new();
|
||||
public string page_url { get; set; } = string.Empty;
|
||||
public string short_desc { get; set; } = string.Empty;
|
||||
public List<Tuple<string, string>> spec { get; set; } = new();
|
||||
public string registry { get; set; } = string.Empty;
|
||||
public string guarantee { get; set; } = string.Empty;
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
namespace Netina.Domain.Dtos.ResponseDtos.Zarehbin;
|
||||
|
||||
public class ZarehbinProductResponseDto
|
||||
{
|
||||
public string title { get; set; } = string.Empty;
|
||||
public string subtitle { get; set; } = string.Empty;
|
||||
public string id { get; set; } = string.Empty;
|
||||
public string current_price { get; set; } = string.Empty;
|
||||
public string old_price { get; set; } = string.Empty;
|
||||
public string availability { get; set; } = string.Empty;
|
||||
public List<string> categories { get; set; } = new();
|
||||
public string image_link { get; set; } = string.Empty;
|
||||
public List<string> image_links { get; set; } = new();
|
||||
public string page_url { get; set; } = string.Empty;
|
||||
public string short_desc { get; set; } = string.Empty;
|
||||
public List<Tuple<string, string>> spec { get; set; } = new();
|
||||
public string registry { get; set; } = string.Empty;
|
||||
public string guarantee { get; set; } = string.Empty;
|
||||
}
|
|
@ -6,4 +6,6 @@ public class BlogCategorySDto : BaseDto<BlogCategorySDto , BlogCategory>
|
|||
public int BlogCount { get; set; }
|
||||
public string Description { get; set; } = string.Empty;
|
||||
public string Slug { get; set; } = string.Empty;
|
||||
public bool IsMain { get; set; }
|
||||
public Guid ParentId { get; set; }
|
||||
}
|
|
@ -34,15 +34,20 @@ public partial class BlogStorageFile
|
|||
|
||||
public partial class BlogCategory
|
||||
{
|
||||
public static BlogCategory Create(string name, string description)
|
||||
public static BlogCategory Create(string name, string description, bool isMain)
|
||||
{
|
||||
var slug = StringExtensions.GetSlug(name);
|
||||
return new BlogCategory(name, slug, description);
|
||||
return new BlogCategory(name, slug, description, isMain);
|
||||
}
|
||||
public static BlogCategory Create(string name, string slug, string description)
|
||||
public static BlogCategory Create(string name, string slug, string description,bool isMain)
|
||||
{
|
||||
if (slug.IsNullOrEmpty())
|
||||
slug = StringExtensions.GetSlug(name);
|
||||
return new BlogCategory(name, slug, description);
|
||||
return new BlogCategory(name, slug, description, isMain);
|
||||
}
|
||||
|
||||
public void SetParent(Guid parentId)
|
||||
{
|
||||
ParentId = parentId;
|
||||
}
|
||||
}
|
|
@ -10,14 +10,18 @@ public partial class BlogCategory : ApiEntity
|
|||
|
||||
}
|
||||
|
||||
public BlogCategory(string name,string slug, string description)
|
||||
public BlogCategory(string name,string slug, string description,bool isMain)
|
||||
{
|
||||
Name = name;
|
||||
Slug = slug;
|
||||
Description = description;
|
||||
IsMain = isMain;
|
||||
}
|
||||
public string Name { get; internal set; } = string.Empty;
|
||||
public string Slug { get; internal set; } = string.Empty;
|
||||
public string Description { get; internal set; } = string.Empty;
|
||||
public bool IsMain { get; set; }
|
||||
public Guid? ParentId { get; set; }
|
||||
public BlogCategory? Parent { get; set; }
|
||||
public List<Blog> Blogs { get; internal set; } = new();
|
||||
}
|
|
@ -3,6 +3,7 @@
|
|||
[AdaptTwoWays("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
||||
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget )]
|
||||
[AdaptTo("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Projection)]
|
||||
[AdaptTo("TorobProductResponseDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Projection)]
|
||||
//[AdaptTo("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Projection)]
|
||||
[GenerateMapper]
|
||||
public partial class Product : ApiEntity
|
||||
|
|
|
@ -4,6 +4,7 @@ using System.Linq;
|
|||
using System.Linq.Expressions;
|
||||
using Mapster.Models;
|
||||
using Netina.Domain.Dtos.LargDtos;
|
||||
using Netina.Domain.Dtos.ResponseDtos.Torob;
|
||||
using Netina.Domain.Dtos.SmallDtos;
|
||||
using Netina.Domain.Entities.Brands;
|
||||
using Netina.Domain.Entities.ProductCategories;
|
||||
|
@ -342,7 +343,6 @@ namespace Netina.Domain.Mappers
|
|||
MainImage = p44.Files.FirstOrDefault<ProductStorageFile>(funcMain17) != null ? p44.Files.FirstOrDefault<ProductStorageFile>(funcMain18).FileLocation : (p44.Files.Count > 0 ? p44.Files.FirstOrDefault<ProductStorageFile>().FileLocation : string.Empty),
|
||||
CategoryId = p44.CategoryId,
|
||||
BrandId = p44.BrandId,
|
||||
BrandName = p44.Brand == null ? null : p44.Brand.PersianName,
|
||||
CategoryName = p44.Category == null ? null : p44.Category.Name,
|
||||
ModifiedAt = p44.ModifiedAt,
|
||||
Id = p44.Id,
|
||||
|
@ -376,7 +376,6 @@ namespace Netina.Domain.Mappers
|
|||
result.MainImage = p45.Files.FirstOrDefault<ProductStorageFile>(funcMain17) != null ? p45.Files.FirstOrDefault<ProductStorageFile>(funcMain18).FileLocation : (p45.Files.Count > 0 ? p45.Files.FirstOrDefault<ProductStorageFile>().FileLocation : string.Empty);
|
||||
result.CategoryId = p45.CategoryId;
|
||||
result.BrandId = p45.BrandId;
|
||||
result.BrandName = p45.Brand == null ? null : p45.Brand.PersianName;
|
||||
result.CategoryName = p45.Category == null ? null : p45.Category.Name;
|
||||
result.ModifiedAt = p45.ModifiedAt;
|
||||
result.Id = p45.Id;
|
||||
|
@ -405,12 +404,17 @@ namespace Netina.Domain.Mappers
|
|||
MainImage = p47.Files.FirstOrDefault<ProductStorageFile>(f => f.IsPrimary) != null ? p47.Files.FirstOrDefault<ProductStorageFile>(f => f.IsPrimary).FileLocation : (p47.Files.Count > 0 ? p47.Files.FirstOrDefault<ProductStorageFile>().FileLocation : string.Empty),
|
||||
CategoryId = p47.CategoryId,
|
||||
BrandId = p47.BrandId,
|
||||
BrandName = p47.Brand == null ? null : p47.Brand.PersianName,
|
||||
CategoryName = p47.Category == null ? null : p47.Category.Name,
|
||||
CategoryName = p47.Category.Name,
|
||||
ModifiedAt = p47.ModifiedAt,
|
||||
Id = p47.Id,
|
||||
CreatedAt = p47.CreatedAt
|
||||
};
|
||||
public static Expression<Func<Product, TorobProductResponseDto>> ProjectToTorobResponseDto => p48 => new TorobProductResponseDto()
|
||||
{
|
||||
product_id = p48.Id.ToString(),
|
||||
price = p48.Cost,
|
||||
availibility = p48.IsEnable
|
||||
};
|
||||
|
||||
private static List<Specification> funcMain1(List<SpecificationSDto> p2)
|
||||
{
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using Netina.Domain.Entities.Accounting;
|
||||
using Netina.Domain.Dtos.ResponseDtos.Torob;
|
||||
using Netina.Domain.Entities.Accounting;
|
||||
|
||||
namespace Netina.Domain;
|
||||
|
||||
|
@ -56,6 +57,16 @@ public class MapsterRegister : IRegister
|
|||
.Map("BrandName", o => o.Brand == null ? null : o.Brand.PersianName)
|
||||
.IgnoreNullValues(false)
|
||||
.TwoWays();
|
||||
config.NewConfig<Product, ProductSDto>()
|
||||
.Map("MainImage", o => o.Files.FirstOrDefault(f => f.IsPrimary) != null ? o.Files.FirstOrDefault(f => f.IsPrimary).FileLocation : o.Files.Count > 0 ? o.Files.FirstOrDefault().FileLocation : string.Empty)
|
||||
.IgnoreNullValues(false)
|
||||
.TwoWays();
|
||||
config.NewConfig<Product, TorobProductResponseDto>()
|
||||
.Map(s=>s.availibility,o=>o.IsEnable)
|
||||
.Map(s=>s.price , o=>o.Cost)
|
||||
.Map(s=>s.product_id,o=>o.Id.ToString())
|
||||
.IgnoreNullValues(false)
|
||||
.TwoWays();
|
||||
|
||||
ConfigOrderMappers(config);
|
||||
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
namespace Netina.Domain.MartenEntities.Settings;
|
||||
public class NetinaSetting
|
||||
{
|
||||
public int WebSiteType { get; set; }
|
||||
}
|
||||
|
|
@ -17,4 +17,5 @@ public class ShopSetting
|
|||
public double TaxesFee { get; set; }
|
||||
public double ServiceFee { get; set; }
|
||||
public bool ServiceIsPercent { get; set; }
|
||||
public string LogoUrl { get; set; } = string.Empty;
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<!--<PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
|
@ -14,9 +14,9 @@
|
|||
<PackageReference Include="MediatR" Version="12.2.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Identity.Stores" Version="8.0.4" />
|
||||
<PackageReference Include="PropertyChanged.Fody" Version="4.1.0" />
|
||||
</ItemGroup>-->
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<!--<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<LangVersion>10</LangVersion>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
|
@ -32,7 +32,7 @@
|
|||
<PackageReference Include="Microsoft.Extensions.Identity.Stores" Version="5.0.0" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.0" />
|
||||
<PackageReference Include="PropertyChanged.Fody" Version="4.1.0" />
|
||||
</ItemGroup>
|
||||
</ItemGroup>-->
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -8,10 +8,13 @@ namespace Netina.Infrastructure.Services;
|
|||
public class UploadFileService : IUploadFileService
|
||||
{
|
||||
private readonly IStorageService _storageService;
|
||||
private readonly SiteSettings _siteSetting;
|
||||
|
||||
public UploadFileService(IStorageService storageService)
|
||||
public UploadFileService(IStorageService storageService,IOptionsSnapshot<SiteSettings> optionsSnapshot)
|
||||
{
|
||||
_storageService = storageService;
|
||||
_siteSetting = optionsSnapshot.Value;
|
||||
|
||||
}
|
||||
public async Task<FileUploadResponse> UploadImageAsync(FileUploadRequest uploadRequest)
|
||||
{
|
||||
|
@ -23,13 +26,24 @@ public class UploadFileService : IUploadFileService
|
|||
|
||||
await uploadRequest.ImageResize(originalMedFileStream, mediumFileStream, 1280);
|
||||
await uploadRequest.ImageResize(originalThumbFileStream, thumbnailFileStream, 200);
|
||||
var medFileName = await _storageService.UploadObjectFromFileAsync(uploadRequest.FileName, $"{uploadRequest.FileUploadType.ToDisplay()}/Med", uploadRequest.ContentType, mediumFileStream);
|
||||
await _storageService.UploadObjectFromFileAsync(medFileName, $"{uploadRequest.FileUploadType.ToDisplay()}/Thumb", uploadRequest.ContentType, thumbnailFileStream, false);
|
||||
string medFileName;
|
||||
if (uploadRequest.FileUploadType == FileUploadType.Logo)
|
||||
{
|
||||
uploadRequest.FileName = $"Main.{uploadRequest.FileName.Split('.').Last()}";
|
||||
medFileName = await _storageService.UploadObjectFromFileAsync(uploadRequest.FileName, $"{uploadRequest.FileUploadType.ToDisplay()}/Med", uploadRequest.ContentType, mediumFileStream,false);
|
||||
await _storageService.UploadObjectFromFileAsync(medFileName, $"{uploadRequest.FileUploadType.ToDisplay()}/Thumb", uploadRequest.ContentType, thumbnailFileStream, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
medFileName = await _storageService.UploadObjectFromFileAsync(uploadRequest.FileName, $"{uploadRequest.FileUploadType.ToDisplay()}/Med", uploadRequest.ContentType, mediumFileStream);
|
||||
await _storageService.UploadObjectFromFileAsync(medFileName, $"{uploadRequest.FileUploadType.ToDisplay()}/Thumb", uploadRequest.ContentType, thumbnailFileStream, false);
|
||||
}
|
||||
|
||||
var response = new FileUploadResponse
|
||||
{
|
||||
FileName = medFileName,
|
||||
FileLocation = $"{uploadRequest.FileUploadType.ToDisplay()}/Med/{medFileName}",
|
||||
FileUrl = $"https://storage.vesmook.com/{uploadRequest.FileUploadType.ToDisplay()}/Med/{medFileName}"
|
||||
FileUrl = $"{_siteSetting.StorageBaseUrl}/{uploadRequest.FileUploadType.ToDisplay()}/Med/{medFileName}"
|
||||
};
|
||||
return response;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using System.IdentityModel.Tokens.Jwt;
|
||||
using Netina.Common.Models;
|
||||
|
||||
namespace Netina.Repository.Abstracts;
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using FluentValidation;
|
||||
using Netina.Common.Models.Exception;
|
||||
using ValidationException = Netina.Common.Models.Exception.ValidationException;
|
||||
|
||||
namespace Netina.Repository.Behaviors;
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using Netina.Common.Models.Entity;
|
||||
using Netina.Repository.Models;
|
||||
|
||||
namespace Netina.Repository.Extensions;
|
||||
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using Netina.Common.Models.Api;
|
||||
using Netina.Common.Models.Exception;
|
||||
using Netina.Domain.CommandQueries.Commands;
|
||||
using Netina.Domain.Entities.Accounting;
|
||||
using Netina.Repository.Repositories.Base.Contracts;
|
||||
|
||||
namespace Netina.Repository.Handlers.Accounting;
|
||||
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using Netina.Common.Models.Api;
|
||||
using Netina.Common.Models.Exception;
|
||||
using Netina.Domain.CommandQueries.Queries;
|
||||
using Netina.Domain.Dtos.SmallDtos;
|
||||
using Netina.Domain.Entities.Accounting;
|
||||
using Netina.Repository.Repositories.Base.Contracts;
|
||||
|
||||
namespace Netina.Repository.Handlers.Accounting;
|
||||
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using Netina.Domain.CommandQueries.Queries;
|
||||
using Netina.Domain.Dtos.SmallDtos;
|
||||
using Netina.Domain.Entities.Accounting;
|
||||
using Netina.Repository.Repositories.Base.Contracts;
|
||||
|
||||
namespace Netina.Repository.Handlers.Accounting;
|
||||
|
||||
|
|
|
@ -1,11 +1,4 @@
|
|||
using Netina.Common.Models.Api;
|
||||
using Netina.Common.Models.Exception;
|
||||
using Netina.Domain.CommandQueries.Commands;
|
||||
using Netina.Domain.Entities.Users;
|
||||
using Netina.Repository.Abstracts;
|
||||
using Netina.Repository.Repositories.Base.Contracts;
|
||||
|
||||
namespace Netina.Repository.Handlers.Addresses;
|
||||
namespace Netina.Repository.Handlers.Addresses;
|
||||
|
||||
public class CreateAddressCommandHandler : IRequestHandler<CreateAddressCommand,bool>
|
||||
{
|
||||
|
|
|
@ -1,9 +1,4 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using Netina.Common.Models.Api;
|
||||
using Netina.Common.Models.Exception;
|
||||
using Netina.Domain.CommandQueries.Commands;
|
||||
using Netina.Domain.Entities.Users;
|
||||
using Netina.Repository.Repositories.Base.Contracts;
|
||||
|
||||
namespace Netina.Repository.Handlers.Addresses;
|
||||
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using Netina.Common.Models.Exception;
|
||||
using Netina.Domain.CommandQueries.Commands;
|
||||
using Netina.Domain.Entities.Brands;
|
||||
using Netina.Repository.Repositories.Base.Contracts;
|
||||
|
||||
namespace Netina.Repository.Handlers.Brands;
|
||||
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using Netina.Domain.CommandQueries.Queries;
|
||||
using Netina.Domain.Dtos.SmallDtos;
|
||||
using Netina.Domain.Entities.Brands;
|
||||
using Netina.Domain.Entities.Products;
|
||||
using Netina.Repository.Repositories.Base.Contracts;
|
||||
|
||||
namespace Netina.Repository.Handlers.Brands;
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using FluentValidation;
|
||||
using Netina.Domain.CommandQueries.Commands;
|
||||
|
||||
namespace Netina.Repository.Handlers.Brands.Validators;
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using FluentValidation;
|
||||
using Netina.Domain.CommandQueries.Commands;
|
||||
|
||||
namespace Netina.Repository.Handlers.Brands.Validators;
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using Netina.Domain.CommandQueries.Commands;
|
||||
using Netina.Domain.DocumentEntities.Complexes;
|
||||
using Netina.Domain.DocumentEntities.Complexes;
|
||||
|
||||
namespace Netina.Repository.Handlers.Complexes;
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using FluentValidation;
|
||||
using Netina.Domain.CommandQueries.Commands;
|
||||
|
||||
namespace Netina.Repository.Handlers.Complexes.Validators;
|
||||
|
||||
|
|
|
@ -1,10 +1,4 @@
|
|||
using Netina.Domain.CommandQueries.Commands;
|
||||
using Netina.Domain.Dtos.LargDtos;
|
||||
using Netina.Domain.Entities.Discounts;
|
||||
using Netina.Domain.Enums;
|
||||
using Netina.Repository.Repositories.Base.Contracts;
|
||||
|
||||
namespace Netina.Repository.Handlers.Discounts;
|
||||
namespace Netina.Repository.Handlers.Discounts;
|
||||
|
||||
public class CreateDiscountCommandHandler : IRequestHandler<CreateDiscountCommand , DiscountLDto>
|
||||
{
|
||||
|
|
|
@ -1,9 +1,4 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using Netina.Common.Models.Api;
|
||||
using Netina.Common.Models.Exception;
|
||||
using Netina.Domain.CommandQueries.Commands;
|
||||
using Netina.Domain.Entities.Discounts;
|
||||
using Netina.Repository.Repositories.Base.Contracts;
|
||||
|
||||
namespace Netina.Repository.Handlers.Discounts;
|
||||
|
||||
|
|
|
@ -1,10 +1,4 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using Netina.Common.Models.Api;
|
||||
using Netina.Common.Models.Exception;
|
||||
using Netina.Domain.CommandQueries.Queries;
|
||||
using Netina.Domain.Dtos.LargDtos;
|
||||
using Netina.Domain.Entities.Discounts;
|
||||
using Netina.Repository.Repositories.Base.Contracts;
|
||||
|
||||
namespace Netina.Repository.Handlers.Discounts;
|
||||
|
||||
|
|
|
@ -1,8 +1,4 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using Netina.Domain.CommandQueries.Queries;
|
||||
using Netina.Domain.Dtos.SmallDtos;
|
||||
using Netina.Domain.Entities.Discounts;
|
||||
using Netina.Repository.Repositories.Base.Contracts;
|
||||
|
||||
namespace Netina.Repository.Handlers.Discounts;
|
||||
|
||||
|
|
|
@ -1,10 +1,4 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using Netina.Common.Models.Api;
|
||||
using Netina.Common.Models.Exception;
|
||||
using Netina.Domain.CommandQueries.Commands;
|
||||
using Netina.Domain.Entities.Discounts;
|
||||
using Netina.Domain.Enums;
|
||||
using Netina.Repository.Repositories.Base.Contracts;
|
||||
|
||||
namespace Netina.Repository.Handlers.Discounts;
|
||||
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
using FluentValidation;
|
||||
using Netina.Domain.CommandQueries.Commands;
|
||||
using Netina.Domain.Enums;
|
||||
|
||||
namespace Netina.Repository.Handlers.Discounts.Validators;
|
||||
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
using Netina.Common.Models.Exception;
|
||||
using Netina.Domain.CommandQueries.Commands;
|
||||
using Netina.Domain.Entities.Users;
|
||||
using Netina.Repository.Repositories.Base.Contracts;
|
||||
|
||||
namespace Netina.Repository.Handlers.Newsletters;
|
||||
|
||||
|
|
|
@ -1,8 +1,4 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using Netina.Domain.CommandQueries.Queries;
|
||||
using Netina.Domain.Dtos.SmallDtos;
|
||||
using Netina.Domain.Entities.Users;
|
||||
using Netina.Repository.Repositories.Base.Contracts;
|
||||
|
||||
namespace Netina.Repository.Handlers.Newsletters;
|
||||
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
using FluentValidation;
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
using Netina.Common.Extensions;
|
||||
using Netina.Domain.CommandQueries.Commands;
|
||||
|
||||
namespace Netina.Repository.Handlers.Newsletters.Validators;
|
||||
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using Netina.Common.Models.Exception;
|
||||
using Netina.Domain.CommandQueries.Commands;
|
||||
using Netina.Domain.Entities.Orders;
|
||||
using Netina.Domain.Entities.Users;
|
||||
using Netina.Repository.Repositories.Base.Contracts;
|
||||
|
||||
namespace Netina.Repository.Handlers.Orders;
|
||||
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using Netina.Common.Models.Api;
|
||||
using Netina.Common.Models.Exception;
|
||||
using Netina.Domain.CommandQueries.Commands;
|
||||
using Netina.Domain.Entities.Orders;
|
||||
using Netina.Repository.Repositories.Base.Contracts;
|
||||
|
||||
namespace Netina.Repository.Handlers.Orders;
|
||||
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using Netina.Common.Models.Api;
|
||||
using Netina.Common.Models.Exception;
|
||||
using Netina.Domain.CommandQueries.Queries;
|
||||
using Netina.Domain.Dtos.LargDtos;
|
||||
using Netina.Domain.Entities.Orders;
|
||||
using Netina.Repository.Repositories.Base.Contracts;
|
||||
|
||||
namespace Netina.Repository.Handlers.Orders;
|
||||
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using Netina.Common.Models.Api;
|
||||
using Netina.Common.Models.Exception;
|
||||
using Netina.Domain.CommandQueries.Queries;
|
||||
using Netina.Domain.Entities.Orders;
|
||||
using Netina.Repository.Repositories.Base.Contracts;
|
||||
|
||||
namespace Netina.Repository.Handlers.Orders;
|
||||
|
||||
|
|
|
@ -1,12 +1,5 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using Netina.Common.Extensions;
|
||||
using Netina.Common.Models.Api;
|
||||
using Netina.Common.Models.Exception;
|
||||
using Netina.Domain.CommandQueries.Queries;
|
||||
using Netina.Domain.Dtos.SmallDtos;
|
||||
using Netina.Domain.Entities.Orders;
|
||||
using Netina.Domain.Enums;
|
||||
using Netina.Repository.Repositories.Base.Contracts;
|
||||
|
||||
namespace Netina.Repository.Handlers.Orders;
|
||||
|
||||
|
|
|
@ -1,12 +1,5 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using Netina.Common.Models.Api;
|
||||
using Netina.Common.Models.Exception;
|
||||
using Netina.Domain.CommandQueries.Queries;
|
||||
using Netina.Domain.Dtos.SmallDtos;
|
||||
using Netina.Domain.Entities.Orders;
|
||||
using Netina.Domain.Entities.Users;
|
||||
using Netina.Repository.Abstracts;
|
||||
using Netina.Repository.Repositories.Base.Contracts;
|
||||
|
||||
namespace Netina.Repository.Handlers.Orders;
|
||||
|
||||
|
|
|
@ -1,9 +1,4 @@
|
|||
using Netina.Domain.CommandQueries.Commands;
|
||||
using Netina.Domain.Dtos.LargDtos;
|
||||
using Netina.Domain.Entities.ProductCategories;
|
||||
using Netina.Repository.Repositories.Base.Contracts;
|
||||
|
||||
namespace Netina.Repository.Handlers.ProductCategories;
|
||||
namespace Netina.Repository.Handlers.ProductCategories;
|
||||
|
||||
public class CreateProductCategoryCommandHandler : IRequestHandler<CreateProductCategoryCommand,ProductCategoryLDto>
|
||||
{
|
||||
|
|
|
@ -1,9 +1,4 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using Netina.Common.Models.Api;
|
||||
using Netina.Common.Models.Exception;
|
||||
using Netina.Domain.CommandQueries.Commands;
|
||||
using Netina.Domain.Entities.ProductCategories;
|
||||
using Netina.Repository.Repositories.Base.Contracts;
|
||||
|
||||
namespace Netina.Repository.Handlers.ProductCategories;
|
||||
|
||||
|
|
|
@ -1,8 +1,4 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using Netina.Domain.CommandQueries.Queries;
|
||||
using Netina.Domain.Dtos.SmallDtos;
|
||||
using Netina.Domain.Entities.ProductCategories;
|
||||
using Netina.Repository.Repositories.Base.Contracts;
|
||||
|
||||
namespace Netina.Repository.Handlers.ProductCategories;
|
||||
|
||||
|
|
|
@ -1,8 +1,4 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using Netina.Common.Models.Exception;
|
||||
using Netina.Domain.CommandQueries.Queries;
|
||||
using Netina.Domain.Entities.ProductCategories;
|
||||
using Netina.Repository.Repositories.Base.Contracts;
|
||||
|
||||
namespace Netina.Repository.Handlers.ProductCategories;
|
||||
|
||||
|
|
|
@ -1,10 +1,4 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using Netina.Common.Models.Api;
|
||||
using Netina.Common.Models.Exception;
|
||||
using Netina.Domain.CommandQueries.Queries;
|
||||
using Netina.Domain.Dtos.LargDtos;
|
||||
using Netina.Domain.Entities.ProductCategories;
|
||||
using Netina.Repository.Repositories.Base.Contracts;
|
||||
|
||||
namespace Netina.Repository.Handlers.ProductCategories;
|
||||
|
||||
|
|
|
@ -1,9 +1,4 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using Netina.Common.Models.Api;
|
||||
using Netina.Common.Models.Exception;
|
||||
using Netina.Domain.CommandQueries.Commands;
|
||||
using Netina.Domain.Entities.ProductCategories;
|
||||
using Netina.Repository.Repositories.Base.Contracts;
|
||||
|
||||
namespace Netina.Repository.Handlers.ProductCategories;
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using FluentValidation;
|
||||
using Netina.Domain.CommandQueries.Commands;
|
||||
|
||||
namespace Netina.Repository.Handlers.ProductCategories.Validators;
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using FluentValidation;
|
||||
using Netina.Domain.CommandQueries.Commands;
|
||||
|
||||
namespace Netina.Repository.Handlers.ProductCategories.Validators;
|
||||
|
||||
|
|
|
@ -1,8 +1,4 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using Netina.Common.Models.Exception;
|
||||
using Netina.Domain.CommandQueries.Commands;
|
||||
using Netina.Domain.Entities.Products;
|
||||
using Netina.Repository.Repositories.Base.Contracts;
|
||||
|
||||
namespace Netina.Repository.Handlers.Products;
|
||||
|
||||
|
|
|
@ -1,10 +1,4 @@
|
|||
using Netina.Domain.CommandQueries.Commands;
|
||||
using Netina.Domain.Dtos.LargDtos;
|
||||
using Netina.Domain.Entities.Products;
|
||||
using Netina.Domain.Enums;
|
||||
using Netina.Repository.Repositories.Base.Contracts;
|
||||
|
||||
namespace Netina.Repository.Handlers.Products;
|
||||
namespace Netina.Repository.Handlers.Products;
|
||||
|
||||
public class CreateProductCommandHandler : IRequestHandler<CreateProductCommand, ProductLDto>
|
||||
{
|
||||
|
|
|
@ -1,9 +1,4 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using Netina.Common.Models.Api;
|
||||
using Netina.Common.Models.Exception;
|
||||
using Netina.Domain.CommandQueries.Commands;
|
||||
using Netina.Domain.Entities.Products;
|
||||
using Netina.Repository.Repositories.Base.Contracts;
|
||||
|
||||
namespace Netina.Repository.Handlers.Products;
|
||||
|
||||
|
|
|
@ -1,13 +1,4 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using Netina.Domain.CommandQueries.Commands;
|
||||
using Netina.Domain.CommandQueries.Queries;
|
||||
using Netina.Domain.Dtos.ResponseDtos;
|
||||
using Netina.Domain.Dtos.SmallDtos;
|
||||
using Netina.Domain.Entities.Discounts;
|
||||
using Netina.Domain.Entities.Products;
|
||||
using Netina.Domain.Enums;
|
||||
using Netina.Repository.Abstracts;
|
||||
using Netina.Repository.Repositories.Base.Contracts;
|
||||
|
||||
namespace Netina.Repository.Handlers.Products;
|
||||
|
||||
|
|
|
@ -1,11 +1,4 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using Netina.Common.Models.Api;
|
||||
using Netina.Common.Models.Exception;
|
||||
using Netina.Domain.CommandQueries.Commands;
|
||||
using Netina.Domain.Dtos.LargDtos;
|
||||
using Netina.Domain.Entities.Products;
|
||||
using Netina.Domain.Enums;
|
||||
using Netina.Repository.Repositories.Base.Contracts;
|
||||
|
||||
namespace Netina.Repository.Handlers.Products;
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using FluentValidation;
|
||||
using Netina.Domain.CommandQueries.Commands;
|
||||
|
||||
namespace Netina.Repository.Handlers.Products.Validators;
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using FluentValidation;
|
||||
using Netina.Domain.CommandQueries.Commands;
|
||||
|
||||
namespace Netina.Repository.Handlers.Products.Validators;
|
||||
|
||||
|
|
|
@ -1,9 +1,4 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using Netina.Common.Models.Api;
|
||||
using Netina.Domain.CommandQueries.Commands;
|
||||
using Netina.Domain.Dtos.SmallDtos;
|
||||
using Netina.Domain.Entities.Products;
|
||||
using Netina.Repository.Repositories.Base.Contracts;
|
||||
using AppException = Netina.Common.Models.Exception.AppException;
|
||||
|
||||
namespace Netina.Repository.Handlers.Reviews;
|
||||
|
|
|
@ -1,9 +1,4 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using Netina.Common.Models.Api;
|
||||
using Netina.Common.Models.Exception;
|
||||
using Netina.Domain.CommandQueries.Commands;
|
||||
using Netina.Domain.Entities.Products;
|
||||
using Netina.Repository.Repositories.Base.Contracts;
|
||||
|
||||
namespace Netina.Repository.Handlers.Reviews;
|
||||
|
||||
|
|
|
@ -1,10 +1,4 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using Netina.Common.Models.Api;
|
||||
using Netina.Common.Models.Exception;
|
||||
using Netina.Domain.CommandQueries.Queries;
|
||||
using Netina.Domain.Dtos.LargDtos;
|
||||
using Netina.Domain.Entities.Products;
|
||||
using Netina.Repository.Repositories.Base.Contracts;
|
||||
|
||||
namespace Netina.Repository.Handlers.Reviews;
|
||||
|
||||
|
|
|
@ -1,8 +1,4 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using Netina.Domain.CommandQueries.Queries;
|
||||
using Netina.Domain.Dtos.SmallDtos;
|
||||
using Netina.Domain.Entities.Products;
|
||||
using Netina.Repository.Repositories.Base.Contracts;
|
||||
|
||||
namespace Netina.Repository.Handlers.Reviews;
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using FluentValidation;
|
||||
using Netina.Domain.CommandQueries.Commands;
|
||||
|
||||
namespace Netina.Repository.Handlers.Reviews.Validators;
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using FluentValidation;
|
||||
using Netina.Domain.CommandQueries.Commands;
|
||||
|
||||
namespace Netina.Repository.Handlers.Reviews.Validators;
|
||||
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
using Netina.Domain.CommandQueries.Commands;
|
||||
using Netina.Domain.Dtos.SmallDtos;
|
||||
using Netina.Domain.Entities.Warehouses;
|
||||
using Netina.Repository.Repositories.Base.Contracts;
|
||||
using Netina.Domain.Entities.Warehouses;
|
||||
|
||||
namespace Netina.Repository.Handlers.Warehouses;
|
||||
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using Netina.Common.Models.Api;
|
||||
using Netina.Common.Models.Exception;
|
||||
using Netina.Domain.CommandQueries.Commands;
|
||||
using Netina.Domain.Entities.Warehouses;
|
||||
using Netina.Repository.Repositories.Base.Contracts;
|
||||
|
||||
namespace Netina.Repository.Handlers.Warehouses;
|
||||
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using Netina.Common.Models.Api;
|
||||
using Netina.Common.Models.Exception;
|
||||
using Netina.Domain.CommandQueries.Queries;
|
||||
using Netina.Domain.Dtos.SmallDtos;
|
||||
using Netina.Domain.Entities.Warehouses;
|
||||
using Netina.Repository.Repositories.Base.Contracts;
|
||||
|
||||
namespace Netina.Repository.Handlers.Warehouses;
|
||||
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using Netina.Domain.CommandQueries.Queries;
|
||||
using Netina.Domain.Dtos.SmallDtos;
|
||||
using Netina.Domain.Entities.Warehouses;
|
||||
using Netina.Repository.Repositories.Base.Contracts;
|
||||
|
||||
namespace Netina.Repository.Handlers.Warehouses;
|
||||
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using Netina.Common.Models.Api;
|
||||
using Netina.Common.Models.Exception;
|
||||
using Netina.Domain.CommandQueries.Commands;
|
||||
using Netina.Domain.Entities.Warehouses;
|
||||
using Netina.Repository.Repositories.Base.Contracts;
|
||||
|
||||
namespace Netina.Repository.Handlers.Warehouses;
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using FluentValidation;
|
||||
using Netina.Domain.CommandQueries.Commands;
|
||||
|
||||
namespace Netina.Repository.Handlers.Warehouses.Validators;
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using FluentValidation;
|
||||
using Netina.Domain.CommandQueries.Commands;
|
||||
|
||||
namespace Netina.Repository.Handlers.Warehouses.Validators;
|
||||
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Netina.Common.Models.Entity;
|
||||
using Netina.Domain.Entities.Users;
|
||||
using Netina.Repository.Extensions;
|
||||
|
||||
namespace Netina.Repository.Models;
|
||||
|
||||
|
|
|
@ -1,12 +1,4 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using Netina.Common.Extensions;
|
||||
using Netina.Common.Models.Api;
|
||||
using Netina.Common.Models.Entity;
|
||||
using Netina.Common.Models.Exception;
|
||||
using Netina.Domain.Entities.Products;
|
||||
using Netina.Repository.Abstracts;
|
||||
using Netina.Repository.Models;
|
||||
using Netina.Repository.Repositories.Base.Contracts;
|
||||
|
||||
namespace Netina.Repository.Repositories.Base
|
||||
{
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
using Netina.Common.Models.Entity;
|
||||
|
||||
namespace Netina.Repository.Repositories.Base.Contracts
|
||||
namespace Netina.Repository.Repositories.Base.Contracts
|
||||
{
|
||||
public interface IBaseRepository<T> : IDisposable, IReadRepository<T>, IWriteRepository<T> where T : class, IApiEntity
|
||||
{
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using Netina.Common.Models.Entity;
|
||||
|
||||
namespace Netina.Repository.Repositories.Base.Contracts
|
||||
{
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using Netina.Common.Models.Entity;
|
||||
|
||||
namespace Netina.Repository.Repositories.Base.Contracts
|
||||
{
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
using Netina.Common.Models.Entity;
|
||||
|
||||
namespace Netina.Repository.Repositories.Base.Contracts
|
||||
namespace Netina.Repository.Repositories.Base.Contracts
|
||||
{
|
||||
public interface IWriteRepository<T> where T : class, IApiEntity
|
||||
{
|
||||
|
|
|
@ -1,9 +1,4 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using Netina.Common.Extensions;
|
||||
using Netina.Common.Models.Entity;
|
||||
using Netina.Common.Models.Exception;
|
||||
using Netina.Repository.Models;
|
||||
using Netina.Repository.Repositories.Base.Contracts;
|
||||
|
||||
namespace Netina.Repository.Repositories.Base
|
||||
{
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue