diff --git a/.version b/.version
index c972caa..5f51ce6 100644
--- a/.version
+++ b/.version
@@ -1 +1 @@
-1.4.12.17
\ No newline at end of file
+1.4.14.19
\ No newline at end of file
diff --git a/Netina.Api/Controllers/ProductReviewController.cs b/Netina.Api/Controllers/ProductReviewController.cs
index cd17875..9bc9202 100644
--- a/Netina.Api/Controllers/ProductReviewController.cs
+++ b/Netina.Api/Controllers/ProductReviewController.cs
@@ -5,7 +5,7 @@ public class ProductReviewController : ICarterModule
public void AddRoutes(IEndpointRouteBuilder app)
{
var group = app.NewVersionedApi("ProductReview")
- .MapGroup("product/review");
+ .MapGroup("api/product/review");
group.MapGet("{id}", GetAsync)
.WithDisplayName("Get Product Review")
diff --git a/Netina.Api/Netina.Api.csproj b/Netina.Api/Netina.Api.csproj
index 3099c36..5d04b19 100644
--- a/Netina.Api/Netina.Api.csproj
+++ b/Netina.Api/Netina.Api.csproj
@@ -6,8 +6,8 @@
enable
true
Linux
- 1.4.12.17
- 1.4.12.17do
+ 1.4.14.19
+ 1.4.14.19
diff --git a/Netina.Domain/CommandQueries/Commands/ReviewCommands.cs b/Netina.Domain/CommandQueries/Commands/ReviewCommands.cs
index 453b72b..1bed074 100644
--- a/Netina.Domain/CommandQueries/Commands/ReviewCommands.cs
+++ b/Netina.Domain/CommandQueries/Commands/ReviewCommands.cs
@@ -1,6 +1,6 @@
namespace Netina.Domain.CommandQueries.Commands;
-public sealed record CreateReviewCommand(string Title, string Comment, float Rate, bool IsBuyer, Guid ProductId, Guid UserId) : IRequest;
-public sealed record UpdateReviewCommand(Guid Id,string Title, string Comment, float Rate, bool IsBuyer, Guid ProductId, Guid UserId): IRequest;
+public sealed record CreateReviewCommand(string Title, string Comment, float Rate, bool IsBuyer,bool IsAdmin, Guid ProductId, Guid UserId) : IRequest;
+public sealed record UpdateReviewCommand(Guid Id,string Title, string Comment, float Rate, bool IsBuyer, bool IsAdmin, Guid ProductId, Guid UserId): IRequest;
public sealed record ConfirmReviewCommand(Guid Id) : IRequest;
public sealed record DeleteReviewCommand(Guid Id) : IRequest;
\ No newline at end of file
diff --git a/Netina.Domain/Dtos/SmallDtos/ReviewSDto.cs b/Netina.Domain/Dtos/SmallDtos/ReviewSDto.cs
index 2c4fcda..21394d0 100644
--- a/Netina.Domain/Dtos/SmallDtos/ReviewSDto.cs
+++ b/Netina.Domain/Dtos/SmallDtos/ReviewSDto.cs
@@ -8,6 +8,7 @@ public class ReviewSDto : BaseDto
public string Comment { get; set; } = string.Empty;
public float Rate { get; set; }
public bool IsBuyer { get; set; }
+ public bool IsAdmin { get; set; }
public Guid ProductId { get; set; }
public Guid UserId { get; set; }
}
\ No newline at end of file
diff --git a/Netina.Domain/Entities/Reviews/Review.Aggregate.cs b/Netina.Domain/Entities/Reviews/Review.Aggregate.cs
index 286b14f..6b39c80 100644
--- a/Netina.Domain/Entities/Reviews/Review.Aggregate.cs
+++ b/Netina.Domain/Entities/Reviews/Review.Aggregate.cs
@@ -2,9 +2,9 @@
public partial class Review
{
- public static Reviews.Review Create(string title, string comment, float rate, bool isBuyer, Guid productId, Guid userId)
+ public static Reviews.Review Create(string title, string comment, float rate, bool isBuyer,bool isAdmin, Guid productId, Guid userId)
{
- return new Reviews.Review(title, comment, rate, isBuyer, productId, userId);
+ return new Reviews.Review(title, comment, rate, isBuyer,isAdmin, productId, userId);
}
public void ConfirmReview()
diff --git a/Netina.Domain/Entities/Reviews/Review.cs b/Netina.Domain/Entities/Reviews/Review.cs
index cbec549..f1db25b 100644
--- a/Netina.Domain/Entities/Reviews/Review.cs
+++ b/Netina.Domain/Entities/Reviews/Review.cs
@@ -10,12 +10,13 @@ public partial class Review : ApiEntity
}
- public Review(string title, string comment, float rate, bool isBuyer, Guid productId, Guid userId)
+ public Review(string title, string comment, float rate, bool isBuyer,bool isAdmin, Guid productId, Guid userId)
{
Title = title;
Comment = comment;
Rate = rate;
IsBuyer = isBuyer;
+ IsAdmin = isAdmin;
ProductId = productId;
UserId = userId;
}
@@ -24,6 +25,7 @@ public partial class Review : ApiEntity
public float Rate { get; internal set; }
public bool IsBuyer { get; internal set; }
public bool IsConfirmed { get; internal set; }
+ public bool IsAdmin { get; internal set; }
public Guid ProductId { get; internal set; }
public Product? Product { get; internal set; }
diff --git a/Netina.Domain/Mappers/ProductMapper.g.cs b/Netina.Domain/Mappers/ProductMapper.g.cs
index 807434d..e413248 100644
--- a/Netina.Domain/Mappers/ProductMapper.g.cs
+++ b/Netina.Domain/Mappers/ProductMapper.g.cs
@@ -127,6 +127,7 @@ namespace Netina.Domain.Mappers
Comment = p21.Comment,
Rate = p21.Rate,
IsBuyer = p21.IsBuyer,
+ IsAdmin = p21.IsAdmin,
ProductId = p21.ProductId,
UserId = p21.UserId,
Id = p21.Id,
@@ -247,6 +248,7 @@ namespace Netina.Domain.Mappers
Comment = p37.Comment,
Rate = p37.Rate,
IsBuyer = p37.IsBuyer,
+ IsAdmin = p37.IsAdmin,
ProductId = p37.ProductId,
UserId = p37.UserId,
Id = p37.Id,
@@ -494,6 +496,7 @@ namespace Netina.Domain.Mappers
Comment = item.Comment,
Rate = item.Rate,
IsBuyer = item.IsBuyer,
+ IsAdmin = item.IsAdmin,
ProductId = item.ProductId,
UserId = item.UserId,
Id = item.Id,
@@ -615,6 +618,7 @@ namespace Netina.Domain.Mappers
Comment = item.Comment,
Rate = item.Rate,
IsBuyer = item.IsBuyer,
+ IsAdmin = item.IsAdmin,
ProductId = item.ProductId,
UserId = item.UserId,
Id = item.Id,
@@ -708,6 +712,7 @@ namespace Netina.Domain.Mappers
Comment = item.Comment,
Rate = item.Rate,
IsBuyer = item.IsBuyer,
+ IsAdmin = item.IsAdmin,
ProductId = item.ProductId,
UserId = item.UserId,
Id = item.Id,
@@ -800,6 +805,7 @@ namespace Netina.Domain.Mappers
Comment = item.Comment,
Rate = item.Rate,
IsBuyer = item.IsBuyer,
+ IsAdmin = item.IsAdmin,
ProductId = item.ProductId,
UserId = item.UserId,
Id = item.Id,
diff --git a/Netina.Domain/Mappers/ReviewMapper.g.cs b/Netina.Domain/Mappers/ReviewMapper.g.cs
index b924018..a8a0cb2 100644
--- a/Netina.Domain/Mappers/ReviewMapper.g.cs
+++ b/Netina.Domain/Mappers/ReviewMapper.g.cs
@@ -110,6 +110,7 @@ namespace Netina.Domain.Mappers
Comment = p9.Comment,
Rate = p9.Rate,
IsBuyer = p9.IsBuyer,
+ IsAdmin = p9.IsAdmin,
ProductId = p9.ProductId,
UserId = p9.UserId,
Id = p9.Id,
@@ -128,6 +129,7 @@ namespace Netina.Domain.Mappers
result.Comment = p10.Comment;
result.Rate = p10.Rate;
result.IsBuyer = p10.IsBuyer;
+ result.IsAdmin = p10.IsAdmin;
result.ProductId = p10.ProductId;
result.UserId = p10.UserId;
result.Id = p10.Id;
@@ -143,6 +145,7 @@ namespace Netina.Domain.Mappers
Comment = p12.Comment,
Rate = p12.Rate,
IsBuyer = p12.IsBuyer,
+ IsAdmin = p12.IsAdmin,
ProductId = p12.ProductId,
UserId = p12.UserId,
Id = p12.Id,
@@ -161,6 +164,7 @@ namespace Netina.Domain.Mappers
result.Comment = p13.Comment;
result.Rate = p13.Rate;
result.IsBuyer = p13.IsBuyer;
+ result.IsAdmin = p13.IsAdmin;
result.ProductId = p13.ProductId;
result.UserId = p13.UserId;
result.Id = p13.Id;
@@ -174,6 +178,7 @@ namespace Netina.Domain.Mappers
Comment = p15.Comment,
Rate = p15.Rate,
IsBuyer = p15.IsBuyer,
+ IsAdmin = p15.IsAdmin,
ProductId = p15.ProductId,
UserId = p15.UserId,
Id = p15.Id,
diff --git a/Netina.Repository/Handlers/Reviews/CreateReviewCommandHandler.cs b/Netina.Repository/Handlers/Reviews/CreateReviewCommandHandler.cs
index c601fdb..5f8aa44 100644
--- a/Netina.Repository/Handlers/Reviews/CreateReviewCommandHandler.cs
+++ b/Netina.Repository/Handlers/Reviews/CreateReviewCommandHandler.cs
@@ -2,7 +2,7 @@
namespace Netina.Repository.Handlers.Reviews;
-public class CreateReviewCommandHandler(IRepositoryWrapper repositoryWrapper,ICurrentUserService currentUserService)
+public class CreateReviewCommandHandler(IRepositoryWrapper repositoryWrapper, ICurrentUserService currentUserService)
: IRequestHandler
{
public async Task Handle(CreateReviewCommand request, CancellationToken cancellationToken)
@@ -13,13 +13,13 @@ public class CreateReviewCommandHandler(IRepositoryWrapper repositoryWrapper,ICu
if (!Guid.TryParse(currentUserService.UserId, out userId))
throw new AppException("User id is wrong", ApiResultStatusCode.BadRequest);
}
- var review = Review.Create(request.Title, request.Comment, request.Rate, request.IsBuyer, request.ProductId,
+ var review = Review.Create(request.Title, request.Comment, request.Rate, request.IsBuyer, request.IsAdmin, request.ProductId,
userId);
var product = await repositoryWrapper.SetRepository()
.TableNoTracking
.FirstOrDefaultAsync(p => p.Id == request.ProductId, cancellationToken);
if (product == null)
- throw new AppException("Product not found",ApiResultStatusCode.NotFound);
+ throw new AppException("Product not found", ApiResultStatusCode.NotFound);
product.AddRate(request.Rate);
diff --git a/Netina.Repository/Migrations/20240911192322_AddIsAdminReview.Designer.cs b/Netina.Repository/Migrations/20240911192322_AddIsAdminReview.Designer.cs
new file mode 100644
index 0000000..55b1730
--- /dev/null
+++ b/Netina.Repository/Migrations/20240911192322_AddIsAdminReview.Designer.cs
@@ -0,0 +1,2059 @@
+//
+using System;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using Netina.Repository.Models;
+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
+
+#nullable disable
+
+namespace NetinaShop.Repository.Migrations
+{
+ [DbContext(typeof(ApplicationContext))]
+ [Migration("20240911192322_AddIsAdminReview")]
+ partial class AddIsAdminReview
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasDefaultSchema("public")
+ .HasAnnotation("ProductVersion", "8.0.7")
+ .HasAnnotation("Relational:MaxIdentifierLength", 63);
+
+ NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "fuzzystrmatch");
+ NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "pg_trgm");
+ NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("ClaimType")
+ .HasColumnType("text");
+
+ b.Property("ClaimValue")
+ .HasColumnType("text");
+
+ b.Property("RoleId")
+ .HasColumnType("uuid");
+
+ b.HasKey("Id");
+
+ b.HasIndex("RoleId");
+
+ b.ToTable("RoleClaims", "public");
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("ClaimType")
+ .HasColumnType("text");
+
+ b.Property("ClaimValue")
+ .HasColumnType("text");
+
+ b.Property("UserId")
+ .HasColumnType("uuid");
+
+ b.HasKey("Id");
+
+ b.HasIndex("UserId");
+
+ b.ToTable("Claims", "public");
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b =>
+ {
+ b.Property("LoginProvider")
+ .HasColumnType("text");
+
+ b.Property("ProviderKey")
+ .HasColumnType("text");
+
+ b.Property("ProviderDisplayName")
+ .HasColumnType("text");
+
+ b.Property("UserId")
+ .HasColumnType("uuid");
+
+ b.HasKey("LoginProvider", "ProviderKey");
+
+ b.HasIndex("UserId");
+
+ b.ToTable("Logins", "public");
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b =>
+ {
+ b.Property("UserId")
+ .HasColumnType("uuid");
+
+ b.Property("RoleId")
+ .HasColumnType("uuid");
+
+ b.HasKey("UserId", "RoleId");
+
+ b.HasIndex("RoleId");
+
+ b.ToTable("UserRoles", "public");
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b =>
+ {
+ b.Property("UserId")
+ .HasColumnType("uuid");
+
+ b.Property("LoginProvider")
+ .HasColumnType("text");
+
+ b.Property("Name")
+ .HasColumnType("text");
+
+ b.Property("Value")
+ .HasColumnType("text");
+
+ b.HasKey("UserId", "LoginProvider", "Name");
+
+ b.ToTable("Tokens", "public");
+ });
+
+ modelBuilder.Entity("Netina.Domain.Entities.Accounting.Payment", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("Amount")
+ .HasColumnType("double precision");
+
+ b.Property("Authority")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("CardPan")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp without time zone");
+
+ b.Property("CreatedBy")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("CustomerId")
+ .HasColumnType("uuid");
+
+ b.Property("Description")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("FactorNumber")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("IsRemoved")
+ .HasColumnType("boolean");
+
+ b.Property("ModifiedAt")
+ .HasColumnType("timestamp without time zone");
+
+ b.Property("ModifiedBy")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("OrderId")
+ .HasColumnType("uuid");
+
+ b.Property("RemovedAt")
+ .HasColumnType("timestamp without time zone");
+
+ b.Property("RemovedBy")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Status")
+ .HasColumnType("integer");
+
+ b.Property("TransactionCode")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Type")
+ .HasColumnType("integer");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CustomerId");
+
+ b.HasIndex("OrderId");
+
+ b.ToTable("Payments", "public");
+ });
+
+ modelBuilder.Entity("Netina.Domain.Entities.Blogs.Blog", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("AuthorId")
+ .HasColumnType("uuid");
+
+ b.Property("CategoryId")
+ .HasColumnType("uuid");
+
+ b.Property("Content")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp without time zone");
+
+ b.Property("CreatedBy")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("IsRemoved")
+ .HasColumnType("boolean");
+
+ b.Property("IsSuggested")
+ .HasColumnType("boolean");
+
+ b.Property("ModifiedAt")
+ .HasColumnType("timestamp without time zone");
+
+ b.Property("ModifiedBy")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("ReadingTime")
+ .HasColumnType("integer");
+
+ b.Property("RemovedAt")
+ .HasColumnType("timestamp without time zone");
+
+ b.Property("RemovedBy")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Slug")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Summery")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Tags")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Title")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.HasIndex("AuthorId");
+
+ b.HasIndex("CategoryId");
+
+ b.ToTable("Blogs", "public");
+ });
+
+ modelBuilder.Entity("Netina.Domain.Entities.Blogs.BlogCategory", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp without time zone");
+
+ b.Property("CreatedBy")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Description")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("IsMain")
+ .HasColumnType("boolean");
+
+ b.Property("IsRemoved")
+ .HasColumnType("boolean");
+
+ b.Property("ModifiedAt")
+ .HasColumnType("timestamp without time zone");
+
+ b.Property("ModifiedBy")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("ParentId")
+ .HasColumnType("uuid");
+
+ b.Property("RemovedAt")
+ .HasColumnType("timestamp without time zone");
+
+ b.Property("RemovedBy")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Slug")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ParentId");
+
+ b.ToTable("BlogCategories", "public");
+ });
+
+ modelBuilder.Entity("Netina.Domain.Entities.Brands.Brand", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp without time zone");
+
+ b.Property("CreatedBy")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Description")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("EnglishName")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("HasSpecialPage")
+ .HasColumnType("boolean");
+
+ b.Property("IsRemoved")
+ .HasColumnType("boolean");
+
+ b.Property("ModifiedAt")
+ .HasColumnType("timestamp without time zone");
+
+ b.Property("ModifiedBy")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("PageUrl")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("PersianName")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("RemovedAt")
+ .HasColumnType("timestamp without time zone");
+
+ b.Property("RemovedBy")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Slug")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.ToTable("Brands", "public");
+ });
+
+ modelBuilder.Entity("Netina.Domain.Entities.Discounts.Discount", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("AmountType")
+ .HasColumnType("integer");
+
+ b.Property("Code")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Count")
+ .HasColumnType("integer");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp without time zone");
+
+ b.Property("CreatedBy")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Description")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("DiscountAmount")
+ .HasColumnType("bigint");
+
+ b.Property("DiscountPercent")
+ .HasColumnType("integer");
+
+ b.Property("Discriminator")
+ .IsRequired()
+ .HasMaxLength(21)
+ .HasColumnType("character varying(21)");
+
+ b.Property("ExpireDate")
+ .HasColumnType("timestamp without time zone");
+
+ b.Property("HasCode")
+ .HasColumnType("boolean");
+
+ b.Property("HasPriceCeiling")
+ .HasColumnType("boolean");
+
+ b.Property("HasPriceFloor")
+ .HasColumnType("boolean");
+
+ b.Property("Immortal")
+ .HasColumnType("boolean");
+
+ b.Property("IsForFirstPurchase")
+ .HasColumnType("boolean");
+
+ b.Property("IsForInvitation")
+ .HasColumnType("boolean");
+
+ b.Property("IsForSaleCooperation")
+ .HasColumnType("boolean");
+
+ b.Property("IsInfinity")
+ .HasColumnType("boolean");
+
+ b.Property("IsRemoved")
+ .HasColumnType("boolean");
+
+ b.Property("IsSpecialOffer")
+ .HasColumnType("boolean");
+
+ b.Property("MarketerId")
+ .HasColumnType("uuid");
+
+ b.Property("ModifiedAt")
+ .HasColumnType("timestamp without time zone");
+
+ b.Property("ModifiedBy")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("PriceCeiling")
+ .HasColumnType("bigint");
+
+ b.Property("PriceFloor")
+ .HasColumnType("bigint");
+
+ b.Property("RemovedAt")
+ .HasColumnType("timestamp without time zone");
+
+ b.Property("RemovedBy")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("StartDate")
+ .HasColumnType("timestamp without time zone");
+
+ b.Property("Type")
+ .HasColumnType("integer");
+
+ b.Property("UseCount")
+ .HasColumnType("bigint");
+
+ b.HasKey("Id");
+
+ b.HasIndex("MarketerId")
+ .IsUnique();
+
+ b.ToTable("Discounts", "public");
+
+ b.HasDiscriminator().HasValue("Discount");
+
+ b.UseTphMappingStrategy();
+ });
+
+ modelBuilder.Entity("Netina.Domain.Entities.Orders.Order", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp without time zone");
+
+ b.Property("CreatedBy")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("CustomerId")
+ .HasColumnType("uuid");
+
+ b.Property("DeliveredAt")
+ .HasColumnType("timestamp without time zone");
+
+ b.Property("DeliveryPrice")
+ .HasColumnType("double precision");
+
+ b.Property("DiscountCode")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("DiscountCodePrice")
+ .HasColumnType("double precision");
+
+ b.Property("DiscountId")
+ .HasColumnType("uuid");
+
+ b.Property("DiscountPrice")
+ .HasColumnType("double precision");
+
+ b.Property("DoneAt")
+ .HasColumnType("timestamp without time zone");
+
+ b.Property("FactorCode")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("IsPayed")
+ .HasColumnType("boolean");
+
+ b.Property("IsRemoved")
+ .HasColumnType("boolean");
+
+ b.Property("ModifiedAt")
+ .HasColumnType("timestamp without time zone");
+
+ b.Property("ModifiedBy")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("OrderAt")
+ .HasColumnType("timestamp without time zone");
+
+ b.Property("OrderStatus")
+ .HasColumnType("integer");
+
+ b.Property("PackingPrice")
+ .HasColumnType("double precision");
+
+ b.Property("PayedAt")
+ .HasColumnType("timestamp without time zone");
+
+ b.Property("PaymentMethod")
+ .HasColumnType("integer");
+
+ b.Property("PreparingMinute")
+ .HasColumnType("integer");
+
+ b.Property("ProductDiscountPrice")
+ .HasColumnType("double precision");
+
+ b.Property("RemovedAt")
+ .HasColumnType("timestamp without time zone");
+
+ b.Property("RemovedBy")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("ServicePrice")
+ .HasColumnType("double precision");
+
+ b.Property("TaxesPrice")
+ .HasColumnType("double precision");
+
+ b.Property("TotalPrice")
+ .HasColumnType("double precision");
+
+ b.Property("TotalProductsPrice")
+ .HasColumnType("double precision");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CustomerId");
+
+ b.HasIndex("DiscountId");
+
+ b.ToTable("Orders", "public");
+ });
+
+ modelBuilder.Entity("Netina.Domain.Entities.Orders.OrderDelivery", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("AddressId")
+ .HasColumnType("uuid");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp without time zone");
+
+ b.Property("CreatedBy")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("DeliveryCost")
+ .HasColumnType("double precision");
+
+ b.Property("IsRemoved")
+ .HasColumnType("boolean");
+
+ b.Property("ModifiedAt")
+ .HasColumnType("timestamp without time zone");
+
+ b.Property("ModifiedBy")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("OrderId")
+ .HasColumnType("uuid");
+
+ b.Property("RemovedAt")
+ .HasColumnType("timestamp without time zone");
+
+ b.Property("RemovedBy")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("ShippingId")
+ .HasColumnType("uuid");
+
+ b.Property("TrackingCode")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.HasIndex("AddressId");
+
+ b.HasIndex("OrderId")
+ .IsUnique();
+
+ b.HasIndex("ShippingId");
+
+ b.ToTable("OrderDeliveries", "public");
+ });
+
+ modelBuilder.Entity("Netina.Domain.Entities.Orders.OrderProduct", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("Count")
+ .HasColumnType("integer");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp without time zone");
+
+ b.Property("CreatedBy")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("HasDiscount")
+ .HasColumnType("boolean");
+
+ b.Property("IsRemoved")
+ .HasColumnType("boolean");
+
+ b.Property("ModifiedAt")
+ .HasColumnType("timestamp without time zone");
+
+ b.Property("ModifiedBy")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("OrderId")
+ .HasColumnType("uuid");
+
+ b.Property("OrderProductStatus")
+ .HasColumnType("integer");
+
+ b.Property("PackingCost")
+ .HasColumnType("double precision");
+
+ b.Property("PackingFee")
+ .HasColumnType("double precision");
+
+ b.Property("ProductCategoryId")
+ .HasColumnType("uuid");
+
+ b.Property("ProductCost")
+ .HasColumnType("double precision");
+
+ b.Property("ProductFee")
+ .HasColumnType("double precision");
+
+ b.Property("ProductFeeWithDiscount")
+ .HasColumnType("double precision");
+
+ b.Property("ProductId")
+ .HasColumnType("uuid");
+
+ b.Property("RemovedAt")
+ .HasColumnType("timestamp without time zone");
+
+ b.Property("RemovedBy")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.HasIndex("OrderId");
+
+ b.HasIndex("ProductId");
+
+ b.ToTable("OrderProducts", "public");
+ });
+
+ modelBuilder.Entity("Netina.Domain.Entities.ProductCategories.ProductCategory", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp without time zone");
+
+ b.Property("CreatedBy")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Description")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("IsMain")
+ .HasColumnType("boolean");
+
+ b.Property("IsRemoved")
+ .HasColumnType("boolean");
+
+ b.Property("ModifiedAt")
+ .HasColumnType("timestamp without time zone");
+
+ b.Property("ModifiedBy")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("ParentId")
+ .HasColumnType("uuid");
+
+ b.Property("RemovedAt")
+ .HasColumnType("timestamp without time zone");
+
+ b.Property("RemovedBy")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Slug")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ParentId");
+
+ b.ToTable("ProductCategories", "public");
+ });
+
+ modelBuilder.Entity("Netina.Domain.Entities.Products.Product", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("AuthorId")
+ .HasColumnType("uuid");
+
+ b.Property("BeDisplayed")
+ .HasColumnType("boolean");
+
+ b.Property("BrandId")
+ .HasColumnType("uuid");
+
+ b.Property("CategoryId")
+ .HasColumnType("uuid");
+
+ b.Property("Cost")
+ .HasColumnType("double precision");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp without time zone");
+
+ b.Property("CreatedBy")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("EnglishName")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("ExpertCheck")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("HasExpressDelivery")
+ .HasColumnType("boolean");
+
+ b.Property("IsEnable")
+ .HasColumnType("boolean");
+
+ b.Property("IsRemoved")
+ .HasColumnType("boolean");
+
+ b.Property("MaxOrderCount")
+ .HasColumnType("integer");
+
+ b.Property("ModifiedAt")
+ .HasColumnType("timestamp without time zone");
+
+ b.Property("ModifiedBy")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("PackingCost")
+ .HasColumnType("double precision");
+
+ b.Property("PersianName")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Rate")
+ .HasColumnType("real");
+
+ b.Property("RemovedAt")
+ .HasColumnType("timestamp without time zone");
+
+ b.Property("RemovedBy")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("ReviewCount")
+ .HasColumnType("integer");
+
+ b.Property("Slug")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Stock")
+ .HasColumnType("integer");
+
+ b.Property("Summery")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Tags")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Viewed")
+ .HasColumnType("integer");
+
+ b.Property("Warranty")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.HasIndex("AuthorId");
+
+ b.HasIndex("BrandId");
+
+ b.HasIndex("CategoryId");
+
+ b.ToTable("Products", "public");
+ });
+
+ modelBuilder.Entity("Netina.Domain.Entities.Products.Specification", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp without time zone");
+
+ b.Property("CreatedBy")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Detail")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("IsFeature")
+ .HasColumnType("boolean");
+
+ b.Property("IsRemoved")
+ .HasColumnType("boolean");
+
+ b.Property("ModifiedAt")
+ .HasColumnType("timestamp without time zone");
+
+ b.Property("ModifiedBy")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("ParentId")
+ .HasColumnType("uuid");
+
+ b.Property("ProductId")
+ .HasColumnType("uuid");
+
+ b.Property("RemovedAt")
+ .HasColumnType("timestamp without time zone");
+
+ b.Property("RemovedBy")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Title")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Value")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ParentId");
+
+ b.HasIndex("ProductId");
+
+ b.ToTable("Specifications", "public");
+ });
+
+ modelBuilder.Entity("Netina.Domain.Entities.Reviews.Review", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("Comment")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp without time zone");
+
+ b.Property("CreatedBy")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("IsAdmin")
+ .HasColumnType("boolean");
+
+ b.Property("IsBuyer")
+ .HasColumnType("boolean");
+
+ b.Property("IsConfirmed")
+ .HasColumnType("boolean");
+
+ b.Property("IsRemoved")
+ .HasColumnType("boolean");
+
+ b.Property("ModifiedAt")
+ .HasColumnType("timestamp without time zone");
+
+ b.Property