feat : add first purchase discount
parent
acd24336b2
commit
aae924e77b
|
@ -32,8 +32,8 @@
|
|||
"LastName": "سیستم"
|
||||
},
|
||||
"StorageSetting": {
|
||||
"AccessKey": "d37a1cc6acfea3a6f92c538ef0f6601f1edcdc9143942b6470e5d1032aa6bfe2",
|
||||
"SecretKey": "979313b7-30fb-40ff-94d8-d0390d3fa876",
|
||||
"AccessKey": "979313b7-30fb-40ff-94d8-d0390d3fa876",
|
||||
"SecretKey": "d37a1cc6acfea3a6f92c538ef0f6601f1edcdc9143942b6470e5d1032aa6bfe2",
|
||||
"BucketKey": "vesmeh-content"
|
||||
},
|
||||
"JwtSettings": {
|
||||
|
|
|
@ -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.4.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" />
|
||||
|
|
|
@ -3,10 +3,12 @@
|
|||
public class CalculateOrderDiscountCommandHandler : IRequestHandler<CalculateOrderDiscountCommand , double>
|
||||
{
|
||||
private readonly IRepositoryWrapper _repositoryWrapper;
|
||||
private readonly ICurrentUserService _currentUserService;
|
||||
|
||||
public CalculateOrderDiscountCommandHandler(IRepositoryWrapper repositoryWrapper)
|
||||
public CalculateOrderDiscountCommandHandler(IRepositoryWrapper repositoryWrapper,ICurrentUserService currentUserService)
|
||||
{
|
||||
_repositoryWrapper = repositoryWrapper;
|
||||
_currentUserService = currentUserService;
|
||||
}
|
||||
public async Task<double> Handle(CalculateOrderDiscountCommand request, CancellationToken cancellationToken)
|
||||
{
|
||||
|
@ -20,6 +22,27 @@ public class CalculateOrderDiscountCommandHandler : IRequestHandler<CalculateOrd
|
|||
if (discount == null)
|
||||
throw new AppException("تخفیف وجود منقضی شده است یا وجود ندارد", ApiResultStatusCode.NotFound);
|
||||
|
||||
if (_currentUserService.UserId != null && Guid.TryParse(_currentUserService.UserId, out Guid userId))
|
||||
{
|
||||
var discountedUserOrder = await _repositoryWrapper.SetRepository<Order>()
|
||||
.TableNoTracking
|
||||
.FirstOrDefaultAsync(f => f.UserId == userId && f.DiscountCode == discount.Code, cancellationToken);
|
||||
if (discountedUserOrder != null)
|
||||
throw new AppException("شما یک بار از این کد تخفیف استفاده کرده اید", ApiResultStatusCode.BadRequest);
|
||||
}
|
||||
|
||||
if (discount.IsForFirstPurchase)
|
||||
{
|
||||
if (_currentUserService.UserId != null && Guid.TryParse(_currentUserService.UserId, out Guid firstPurchaseUserId))
|
||||
{
|
||||
var userOrderCount = await _repositoryWrapper.SetRepository<Order>()
|
||||
.TableNoTracking
|
||||
.CountAsync(f => f.UserId == firstPurchaseUserId && f.DiscountCode == discount.Code, cancellationToken);
|
||||
if (userOrderCount > 0)
|
||||
throw new AppException("شما قبلا خریدی داشته اید و نمیتوانید از تخفیف اولین خرید استفاده کنید", ApiResultStatusCode.BadRequest);
|
||||
}
|
||||
}
|
||||
|
||||
double discountPrice = 0;
|
||||
double totalPrice = 0;
|
||||
if (discount.Type == DiscountType.All)
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
namespace NetinaShop.Domain.CommandQueries.Commands;
|
||||
|
||||
public sealed record CreateDiscountCommand(string Code,
|
||||
string Description,
|
||||
int DiscountPercent,
|
||||
long DiscountAmount,
|
||||
bool HasCode,
|
||||
|
@ -18,12 +19,14 @@ bool IsInfinity,
|
|||
long UseCount,
|
||||
bool IsForInvitation,
|
||||
bool IsSpecialOffer,
|
||||
bool IsForFirstPurchase,
|
||||
Guid ProductId,
|
||||
Guid CategoryId) : IRequest<DiscountLDto>;
|
||||
|
||||
public sealed record UpdateDiscountCommand(
|
||||
Guid Id,
|
||||
string Code,
|
||||
string Description,
|
||||
int DiscountPercent,
|
||||
long DiscountAmount,
|
||||
bool HasCode,
|
||||
|
@ -41,6 +44,7 @@ public sealed record UpdateDiscountCommand(
|
|||
long UseCount,
|
||||
bool IsForInvitation,
|
||||
bool IsSpecialOffer,
|
||||
bool IsForFirstPurchase,
|
||||
Guid ProductId,
|
||||
Guid CategoryId) : IRequest<bool>;
|
||||
|
||||
|
@ -48,4 +52,4 @@ public sealed record CreateSaleCooperationDiscount(Guid CorporateUserId) : IRequ
|
|||
|
||||
public sealed record DeleteDiscountCommand(Guid Id) : IRequest<bool>;
|
||||
|
||||
public sealed record CalculateOrderDiscountCommand(string DiscountCode,Order Order) : IRequest<double>;
|
||||
public sealed record CalculateOrderDiscountCommand(string DiscountCode, Order Order) : IRequest<double>;
|
|
@ -3,6 +3,7 @@
|
|||
public class DiscountLDto : BaseDto<DiscountLDto,Discount>
|
||||
{
|
||||
public string Code { get; set; } = string.Empty;
|
||||
public string Description { get; set; } = string.Empty;
|
||||
public int DiscountPercent { get; set; }
|
||||
public long DiscountAmount { get; set; }
|
||||
public bool HasCode { get; set; }
|
||||
|
@ -24,4 +25,5 @@ public class DiscountLDto : BaseDto<DiscountLDto,Discount>
|
|||
public string ProductName { get; set; } = string.Empty;
|
||||
public Guid CategoryId { get; set; }
|
||||
public string CategoryName { get; set; } = string.Empty;
|
||||
public bool IsForFirstPurchase { get; set; }
|
||||
}
|
|
@ -3,6 +3,7 @@
|
|||
public class DiscountSDto : BaseDto<DiscountSDto,Discount>
|
||||
{
|
||||
public string Code { get; set; } = string.Empty;
|
||||
public string Description { get; set; } = string.Empty;
|
||||
public int DiscountPercent { get; set; }
|
||||
public long DiscountAmount { get; set; }
|
||||
public bool HasCode { get; set; }
|
||||
|
@ -19,4 +20,5 @@ public class DiscountSDto : BaseDto<DiscountSDto,Discount>
|
|||
public long UseCount { get; set; }
|
||||
public bool IsSpecialOffer { get; set; }
|
||||
public bool IsForInvitation { get; set; }
|
||||
public bool IsForFirstPurchase { get; set; }
|
||||
}
|
|
@ -9,9 +9,12 @@ public partial class CategoryDiscount : Discount
|
|||
|
||||
}
|
||||
|
||||
public CategoryDiscount(string code, int discountPercent, long discountAmount, bool hasCode, DiscountAmountType amountType, DiscountType type, int count,bool immortal, DateTime startDate, DateTime expireDate, long priceFloor, bool hasPriceFloor, long priceCeiling, bool hasPriceCeiling, bool isInfinity, long useCount, bool isForInvitation,bool isSpecialOffer, Guid categoryId)
|
||||
: base(code, discountPercent, discountAmount, hasCode, amountType, type, count, startDate, expireDate, priceFloor, hasPriceFloor, priceCeiling, hasPriceCeiling, isInfinity, useCount,
|
||||
isForInvitation, isSpecialOffer, immortal)
|
||||
public CategoryDiscount(string code, string description, int discountPercent, long discountAmount, bool hasCode, DiscountAmountType amountType, DiscountType type,
|
||||
int count, bool immortal, DateTime startDate, DateTime expireDate, long priceFloor, bool hasPriceFloor, long priceCeiling,
|
||||
bool hasPriceCeiling, bool isInfinity, long useCount, bool isForInvitation,
|
||||
bool isForFirstPurchase, bool isSpecialOffer , Guid categoryId)
|
||||
: base(code, description, discountPercent, discountAmount, hasCode, amountType, type, count, startDate, expireDate, priceFloor, hasPriceFloor, priceCeiling, hasPriceCeiling, isInfinity, useCount,
|
||||
isForInvitation, isSpecialOffer,isForFirstPurchase, immortal)
|
||||
{
|
||||
CategoryId = categoryId;
|
||||
}
|
||||
|
|
|
@ -2,9 +2,13 @@
|
|||
|
||||
public partial class Discount
|
||||
{
|
||||
public static Discount Create(string code, int discountPercent, long discountAmount, bool hasCode, DiscountAmountType amountType, DiscountType type, int count,bool immortal, DateTime startDate, DateTime expireDate, long priceFloor, bool hasPriceFloor, long priceCeiling, bool hasPriceCeiling, bool isInfinity, long useCount, bool isForInvitation,bool isSpecialOffer)
|
||||
public static Discount Create(string code,string description, int discountPercent, long discountAmount, bool hasCode, DiscountAmountType amountType, DiscountType type,
|
||||
int count,bool immortal, DateTime startDate, DateTime expireDate, long priceFloor, bool hasPriceFloor, long priceCeiling,
|
||||
bool hasPriceCeiling, bool isInfinity, long useCount, bool isForInvitation,
|
||||
bool isForFirstPurchase, bool isSpecialOffer)
|
||||
{
|
||||
return new Discount(code,
|
||||
return new Discount(code,
|
||||
description,
|
||||
discountPercent,
|
||||
discountAmount,
|
||||
hasCode,
|
||||
|
@ -21,6 +25,7 @@ public partial class Discount
|
|||
useCount,
|
||||
isForInvitation,
|
||||
isSpecialOffer,
|
||||
isForFirstPurchase,
|
||||
immortal);
|
||||
}
|
||||
|
||||
|
@ -36,20 +41,26 @@ public partial class Discount
|
|||
|
||||
public partial class ProductDiscount
|
||||
{
|
||||
public static ProductDiscount Create(string code, int discountPercent, long discountAmount, bool hasCode, DiscountAmountType amountType, DiscountType type, int count, bool immortal, DateTime startDate, DateTime expireDate, long priceFloor, bool hasPriceFloor, long priceCeiling, bool hasPriceCeiling, bool isInfinity, long useCount, bool isForInvitation ,bool isSpecialOffer, Guid productId)
|
||||
public static ProductDiscount Create(string code, string description, int discountPercent, long discountAmount, bool hasCode, DiscountAmountType amountType, DiscountType type,
|
||||
int count, bool immortal, DateTime startDate, DateTime expireDate, long priceFloor, bool hasPriceFloor, long priceCeiling,
|
||||
bool hasPriceCeiling, bool isInfinity, long useCount, bool isForInvitation,
|
||||
bool isForFirstPurchase, bool isSpecialOffer, Guid productId)
|
||||
{
|
||||
return new ProductDiscount(code, discountPercent, discountAmount, hasCode, amountType, type, count,immortal, startDate,
|
||||
return new ProductDiscount(code,description, discountPercent, discountAmount, hasCode, amountType, type, count,immortal, startDate,
|
||||
expireDate, priceFloor, hasPriceFloor, priceCeiling, hasPriceCeiling, isInfinity, useCount,
|
||||
isForInvitation, isSpecialOffer, productId);
|
||||
isForInvitation, isForFirstPurchase, isSpecialOffer, productId);
|
||||
}
|
||||
}
|
||||
|
||||
public partial class CategoryDiscount
|
||||
{
|
||||
public static CategoryDiscount Create(string code, int discountPercent, long discountAmount, bool hasCode, DiscountAmountType amountType, DiscountType type, int count, bool immortal, DateTime startDate, DateTime expireDate, long priceFloor, bool hasPriceFloor, long priceCeiling, bool hasPriceCeiling, bool isInfinity, long useCount, bool isForInvitation, bool isSpecialOffer, Guid categoryId)
|
||||
public static CategoryDiscount Create(string code, string description, int discountPercent, long discountAmount, bool hasCode, DiscountAmountType amountType, DiscountType type,
|
||||
int count, bool immortal, DateTime startDate, DateTime expireDate, long priceFloor, bool hasPriceFloor, long priceCeiling,
|
||||
bool hasPriceCeiling, bool isInfinity, long useCount, bool isForInvitation,
|
||||
bool isForFirstPurchase, bool isSpecialOffer, Guid categoryId)
|
||||
{
|
||||
return new CategoryDiscount(code, discountPercent, discountAmount, hasCode, amountType, type, count,immortal, startDate,
|
||||
return new CategoryDiscount(code,description, discountPercent, discountAmount, hasCode, amountType, type, count,immortal, startDate,
|
||||
expireDate, priceFloor, hasPriceFloor, priceCeiling, hasPriceCeiling, isInfinity, useCount,
|
||||
isForInvitation,isSpecialOffer, categoryId);
|
||||
isForInvitation, isForFirstPurchase,isSpecialOffer, categoryId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ public partial class Discount : ApiEntity
|
|||
}
|
||||
|
||||
public Discount(string code,
|
||||
string description,
|
||||
int discountPercent,
|
||||
long discountAmount,
|
||||
bool hasCode,
|
||||
|
@ -29,9 +30,11 @@ public partial class Discount : ApiEntity
|
|||
long useCount,
|
||||
bool isForInvitation,
|
||||
bool isSpecialOffer,
|
||||
bool isForFirstPurchase,
|
||||
bool immortal)
|
||||
{
|
||||
Code = code;
|
||||
Description = description;
|
||||
DiscountPercent = discountPercent;
|
||||
DiscountAmount = discountAmount;
|
||||
HasCode = hasCode;
|
||||
|
@ -48,9 +51,11 @@ public partial class Discount : ApiEntity
|
|||
UseCount = useCount;
|
||||
IsForInvitation = isForInvitation;
|
||||
IsSpecialOffer = isSpecialOffer;
|
||||
IsForFirstPurchase = isForFirstPurchase;
|
||||
Immortal = immortal;
|
||||
}
|
||||
public string Code { get; internal set; } = string.Empty;
|
||||
public string Description { get; internal set; } = string.Empty;
|
||||
public int DiscountPercent { get; internal set; }
|
||||
public long DiscountAmount { get; internal set; }
|
||||
public bool HasCode { get; internal set; }
|
||||
|
@ -69,6 +74,7 @@ public partial class Discount : ApiEntity
|
|||
public bool IsSpecialOffer { get; internal set; }
|
||||
public bool IsForInvitation { get; internal set; }
|
||||
public bool IsForSaleCooperation { get; internal set; }
|
||||
public bool IsForFirstPurchase { get; internal set; }
|
||||
|
||||
|
||||
public Guid? CorporateUserId { get; internal set; }
|
||||
|
|
|
@ -7,8 +7,12 @@ public partial class ProductDiscount : Discount
|
|||
|
||||
}
|
||||
|
||||
public ProductDiscount(string code, int discountPercent, long discountAmount, bool hasCode, DiscountAmountType amountType, DiscountType type, int count, bool immortal, DateTime startDate, DateTime expireDate, long priceFloor, bool hasPriceFloor, long priceCeiling, bool hasPriceCeiling, bool isInfinity, long useCount, bool isForInvitation,bool isSpecialOffer,Guid productId)
|
||||
: base(code, discountPercent, discountAmount, hasCode, amountType, type, count, startDate, expireDate, priceFloor, hasPriceFloor, priceCeiling, hasPriceCeiling, isInfinity, useCount, isForInvitation, isSpecialOffer, immortal)
|
||||
public ProductDiscount(string code, string description, int discountPercent, long discountAmount, bool hasCode, DiscountAmountType amountType, DiscountType type,
|
||||
int count, bool immortal, DateTime startDate, DateTime expireDate, long priceFloor, bool hasPriceFloor, long priceCeiling,
|
||||
bool hasPriceCeiling, bool isInfinity, long useCount, bool isForInvitation,
|
||||
bool isForFirstPurchase, bool isSpecialOffer,Guid productId)
|
||||
: base(code,description, discountPercent, discountAmount, hasCode, amountType, type, count, startDate,
|
||||
expireDate, priceFloor, hasPriceFloor, priceCeiling, hasPriceCeiling, isInfinity, useCount, isForInvitation, isSpecialOffer,isForFirstPurchase, immortal)
|
||||
{
|
||||
ProductId = productId;
|
||||
}
|
||||
|
|
|
@ -3,11 +3,11 @@
|
|||
public enum DiscountType
|
||||
{
|
||||
[Display(Name = "همه اقلام")]
|
||||
All,
|
||||
All = 0,
|
||||
[Display(Name = "محصولی")]
|
||||
Product,
|
||||
Product = 1,
|
||||
[Display(Name = "دسته ای")]
|
||||
Category,
|
||||
Category = 2,
|
||||
[Display(Name = "مشترکی")]
|
||||
Subscriber
|
||||
Subscriber = 3
|
||||
}
|
|
@ -13,6 +13,7 @@ namespace NetinaShop.Domain.Mappers
|
|||
return p1 == null ? null : new Discount()
|
||||
{
|
||||
Code = p1.Code,
|
||||
Description = p1.Description,
|
||||
DiscountPercent = p1.DiscountPercent,
|
||||
DiscountAmount = p1.DiscountAmount,
|
||||
HasCode = p1.HasCode,
|
||||
|
@ -30,6 +31,7 @@ namespace NetinaShop.Domain.Mappers
|
|||
UseCount = p1.UseCount,
|
||||
IsSpecialOffer = p1.IsSpecialOffer,
|
||||
IsForInvitation = p1.IsForInvitation,
|
||||
IsForFirstPurchase = p1.IsForFirstPurchase,
|
||||
Id = p1.Id,
|
||||
CreatedAt = p1.CreatedAt
|
||||
};
|
||||
|
@ -43,6 +45,7 @@ namespace NetinaShop.Domain.Mappers
|
|||
Discount result = p3 ?? new Discount();
|
||||
|
||||
result.Code = p2.Code;
|
||||
result.Description = p2.Description;
|
||||
result.DiscountPercent = p2.DiscountPercent;
|
||||
result.DiscountAmount = p2.DiscountAmount;
|
||||
result.HasCode = p2.HasCode;
|
||||
|
@ -60,6 +63,7 @@ namespace NetinaShop.Domain.Mappers
|
|||
result.UseCount = p2.UseCount;
|
||||
result.IsSpecialOffer = p2.IsSpecialOffer;
|
||||
result.IsForInvitation = p2.IsForInvitation;
|
||||
result.IsForFirstPurchase = p2.IsForFirstPurchase;
|
||||
result.Id = p2.Id;
|
||||
result.CreatedAt = p2.CreatedAt;
|
||||
return result;
|
||||
|
@ -68,6 +72,7 @@ namespace NetinaShop.Domain.Mappers
|
|||
public static Expression<Func<DiscountLDto, Discount>> ProjectToDiscount => p4 => new Discount()
|
||||
{
|
||||
Code = p4.Code,
|
||||
Description = p4.Description,
|
||||
DiscountPercent = p4.DiscountPercent,
|
||||
DiscountAmount = p4.DiscountAmount,
|
||||
HasCode = p4.HasCode,
|
||||
|
@ -85,6 +90,7 @@ namespace NetinaShop.Domain.Mappers
|
|||
UseCount = p4.UseCount,
|
||||
IsSpecialOffer = p4.IsSpecialOffer,
|
||||
IsForInvitation = p4.IsForInvitation,
|
||||
IsForFirstPurchase = p4.IsForFirstPurchase,
|
||||
Id = p4.Id,
|
||||
CreatedAt = p4.CreatedAt
|
||||
};
|
||||
|
@ -93,6 +99,7 @@ namespace NetinaShop.Domain.Mappers
|
|||
return p5 == null ? null : new DiscountLDto()
|
||||
{
|
||||
Code = p5.Code,
|
||||
Description = p5.Description,
|
||||
DiscountPercent = p5.DiscountPercent,
|
||||
DiscountAmount = p5.DiscountAmount,
|
||||
HasCode = p5.HasCode,
|
||||
|
@ -110,6 +117,7 @@ namespace NetinaShop.Domain.Mappers
|
|||
UseCount = p5.UseCount,
|
||||
IsSpecialOffer = p5.IsSpecialOffer,
|
||||
IsForInvitation = p5.IsForInvitation,
|
||||
IsForFirstPurchase = p5.IsForFirstPurchase,
|
||||
Id = p5.Id,
|
||||
CreatedAt = p5.CreatedAt
|
||||
};
|
||||
|
@ -123,6 +131,7 @@ namespace NetinaShop.Domain.Mappers
|
|||
DiscountLDto result = p7 ?? new DiscountLDto();
|
||||
|
||||
result.Code = p6.Code;
|
||||
result.Description = p6.Description;
|
||||
result.DiscountPercent = p6.DiscountPercent;
|
||||
result.DiscountAmount = p6.DiscountAmount;
|
||||
result.HasCode = p6.HasCode;
|
||||
|
@ -140,6 +149,7 @@ namespace NetinaShop.Domain.Mappers
|
|||
result.UseCount = p6.UseCount;
|
||||
result.IsSpecialOffer = p6.IsSpecialOffer;
|
||||
result.IsForInvitation = p6.IsForInvitation;
|
||||
result.IsForFirstPurchase = p6.IsForFirstPurchase;
|
||||
result.Id = p6.Id;
|
||||
result.CreatedAt = p6.CreatedAt;
|
||||
return result;
|
||||
|
@ -148,6 +158,7 @@ namespace NetinaShop.Domain.Mappers
|
|||
public static Expression<Func<Discount, DiscountLDto>> ProjectToLDto => p8 => new DiscountLDto()
|
||||
{
|
||||
Code = p8.Code,
|
||||
Description = p8.Description,
|
||||
DiscountPercent = p8.DiscountPercent,
|
||||
DiscountAmount = p8.DiscountAmount,
|
||||
HasCode = p8.HasCode,
|
||||
|
@ -165,6 +176,7 @@ namespace NetinaShop.Domain.Mappers
|
|||
UseCount = p8.UseCount,
|
||||
IsSpecialOffer = p8.IsSpecialOffer,
|
||||
IsForInvitation = p8.IsForInvitation,
|
||||
IsForFirstPurchase = p8.IsForFirstPurchase,
|
||||
Id = p8.Id,
|
||||
CreatedAt = p8.CreatedAt
|
||||
};
|
||||
|
@ -173,6 +185,7 @@ namespace NetinaShop.Domain.Mappers
|
|||
return p9 == null ? null : new Discount()
|
||||
{
|
||||
Code = p9.Code,
|
||||
Description = p9.Description,
|
||||
DiscountPercent = p9.DiscountPercent,
|
||||
DiscountAmount = p9.DiscountAmount,
|
||||
HasCode = p9.HasCode,
|
||||
|
@ -189,6 +202,7 @@ namespace NetinaShop.Domain.Mappers
|
|||
UseCount = p9.UseCount,
|
||||
IsSpecialOffer = p9.IsSpecialOffer,
|
||||
IsForInvitation = p9.IsForInvitation,
|
||||
IsForFirstPurchase = p9.IsForFirstPurchase,
|
||||
Id = p9.Id,
|
||||
CreatedAt = p9.CreatedAt
|
||||
};
|
||||
|
@ -202,6 +216,7 @@ namespace NetinaShop.Domain.Mappers
|
|||
Discount result = p11 ?? new Discount();
|
||||
|
||||
result.Code = p10.Code;
|
||||
result.Description = p10.Description;
|
||||
result.DiscountPercent = p10.DiscountPercent;
|
||||
result.DiscountAmount = p10.DiscountAmount;
|
||||
result.HasCode = p10.HasCode;
|
||||
|
@ -218,6 +233,7 @@ namespace NetinaShop.Domain.Mappers
|
|||
result.UseCount = p10.UseCount;
|
||||
result.IsSpecialOffer = p10.IsSpecialOffer;
|
||||
result.IsForInvitation = p10.IsForInvitation;
|
||||
result.IsForFirstPurchase = p10.IsForFirstPurchase;
|
||||
result.Id = p10.Id;
|
||||
result.CreatedAt = p10.CreatedAt;
|
||||
return result;
|
||||
|
@ -228,6 +244,7 @@ namespace NetinaShop.Domain.Mappers
|
|||
return p12 == null ? null : new DiscountSDto()
|
||||
{
|
||||
Code = p12.Code,
|
||||
Description = p12.Description,
|
||||
DiscountPercent = p12.DiscountPercent,
|
||||
DiscountAmount = p12.DiscountAmount,
|
||||
HasCode = p12.HasCode,
|
||||
|
@ -244,6 +261,7 @@ namespace NetinaShop.Domain.Mappers
|
|||
UseCount = p12.UseCount,
|
||||
IsSpecialOffer = p12.IsSpecialOffer,
|
||||
IsForInvitation = p12.IsForInvitation,
|
||||
IsForFirstPurchase = p12.IsForFirstPurchase,
|
||||
Id = p12.Id,
|
||||
CreatedAt = p12.CreatedAt
|
||||
};
|
||||
|
@ -257,6 +275,7 @@ namespace NetinaShop.Domain.Mappers
|
|||
DiscountSDto result = p14 ?? new DiscountSDto();
|
||||
|
||||
result.Code = p13.Code;
|
||||
result.Description = p13.Description;
|
||||
result.DiscountPercent = p13.DiscountPercent;
|
||||
result.DiscountAmount = p13.DiscountAmount;
|
||||
result.HasCode = p13.HasCode;
|
||||
|
@ -273,6 +292,7 @@ namespace NetinaShop.Domain.Mappers
|
|||
result.UseCount = p13.UseCount;
|
||||
result.IsSpecialOffer = p13.IsSpecialOffer;
|
||||
result.IsForInvitation = p13.IsForInvitation;
|
||||
result.IsForFirstPurchase = p13.IsForFirstPurchase;
|
||||
result.Id = p13.Id;
|
||||
result.CreatedAt = p13.CreatedAt;
|
||||
return result;
|
||||
|
@ -281,6 +301,7 @@ namespace NetinaShop.Domain.Mappers
|
|||
public static Expression<Func<Discount, DiscountSDto>> ProjectToSDto => p15 => new DiscountSDto()
|
||||
{
|
||||
Code = p15.Code,
|
||||
Description = p15.Description,
|
||||
DiscountPercent = p15.DiscountPercent,
|
||||
DiscountAmount = p15.DiscountAmount,
|
||||
HasCode = p15.HasCode,
|
||||
|
@ -297,6 +318,7 @@ namespace NetinaShop.Domain.Mappers
|
|||
UseCount = p15.UseCount,
|
||||
IsSpecialOffer = p15.IsSpecialOffer,
|
||||
IsForInvitation = p15.IsForInvitation,
|
||||
IsForFirstPurchase = p15.IsForFirstPurchase,
|
||||
Id = p15.Id,
|
||||
CreatedAt = p15.CreatedAt
|
||||
};
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<!--<PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
|
@ -9,14 +9,14 @@
|
|||
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Mapster" Version="7.4.0" />
|
||||
<PackageReference Include="Mapster.Core" Version="1.2.1" />
|
||||
<PackageReference Include="Mapster" Version="7.3.0" />
|
||||
<PackageReference Include="Mapster.Core" Version="1.2.0" />
|
||||
<PackageReference Include="MediatR" Version="12.2.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Identity.Stores" Version="8.0.3" />
|
||||
<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>
|
||||
|
|
|
@ -13,29 +13,32 @@ public class CreateDiscountCommandHandler : IRequestHandler<CreateDiscountComman
|
|||
switch (request.Type)
|
||||
{
|
||||
case DiscountType.All:
|
||||
var ent = Discount.Create(request.Code, request.DiscountPercent, request.DiscountAmount, request.HasCode, request.AmountType, request.Type, request.Count,request.IsImmortal, request.StartDate, request.ExpireDate, request.PriceFloor, request.HasPriceFloor, request.PriceCeiling, request.HasPriceCeiling, request.IsInfinity, request.UseCount, request.IsForInvitation,request.IsSpecialOffer);
|
||||
var ent = Discount.Create(request.Code,request.Description, request.DiscountPercent, request.DiscountAmount,
|
||||
request.HasCode, request.AmountType, request.Type, request.Count,request.IsImmortal, request.StartDate,
|
||||
request.ExpireDate, request.PriceFloor, request.HasPriceFloor, request.PriceCeiling, request.HasPriceCeiling,
|
||||
request.IsInfinity, request.UseCount, request.IsForInvitation,request.IsForFirstPurchase,request.IsSpecialOffer);
|
||||
_repositoryWrapper.SetRepository<Discount>().Add(ent);
|
||||
break;
|
||||
case DiscountType.Category:
|
||||
var catDis = CategoryDiscount.Create(request.Code, request.DiscountPercent, request.DiscountAmount, request.HasCode,
|
||||
var catDis = CategoryDiscount.Create(request.Code,request.Description, request.DiscountPercent, request.DiscountAmount, request.HasCode,
|
||||
request.AmountType, request.Type, request.Count,request.IsImmortal, request.StartDate, request.ExpireDate, request.PriceFloor,
|
||||
request.HasPriceFloor, request.PriceCeiling, request.HasPriceCeiling, request.IsInfinity, request.UseCount,
|
||||
request.IsForInvitation,request.IsSpecialOffer, request.CategoryId);
|
||||
request.IsForInvitation,request.IsForFirstPurchase,request.IsSpecialOffer, request.CategoryId);
|
||||
_repositoryWrapper.SetRepository<CategoryDiscount>().Add(catDis);
|
||||
break;
|
||||
|
||||
case DiscountType.Product:
|
||||
var productDis = ProductDiscount.Create(request.Code, request.DiscountPercent, request.DiscountAmount, request.HasCode,
|
||||
var productDis = ProductDiscount.Create(request.Code,request.Description, request.DiscountPercent, request.DiscountAmount, request.HasCode,
|
||||
request.AmountType, request.Type, request.Count, request.IsImmortal, request.StartDate, request.ExpireDate, request.PriceFloor,
|
||||
request.HasPriceFloor, request.PriceCeiling, request.HasPriceCeiling, request.IsInfinity, request.UseCount,
|
||||
request.IsForInvitation, request.IsSpecialOffer,request.ProductId);
|
||||
request.IsForInvitation,request.IsForFirstPurchase, request.IsSpecialOffer,request.ProductId);
|
||||
_repositoryWrapper.SetRepository<ProductDiscount>().Add(productDis);
|
||||
break;
|
||||
default:
|
||||
var def = Discount.Create(request.Code, request.DiscountPercent, request.DiscountAmount, request.HasCode,
|
||||
var def = Discount.Create(request.Code,request.Description, request.DiscountPercent, request.DiscountAmount, request.HasCode,
|
||||
request.AmountType, request.Type, request.Count, request.IsImmortal, request.StartDate, request.ExpireDate, request.PriceFloor,
|
||||
request.HasPriceFloor, request.PriceCeiling, request.HasPriceCeiling, request.IsInfinity, request.UseCount,
|
||||
request.IsForInvitation,request.IsSpecialOffer);
|
||||
request.IsForInvitation, request.IsForFirstPurchase,request.IsSpecialOffer);
|
||||
_repositoryWrapper.SetRepository<Discount>().Add(def);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -34,9 +34,9 @@ public class CreateSaleCooperationDiscountHandler : IRequestHandler<CreateSaleCo
|
|||
if (foundedDiscount == null)
|
||||
{
|
||||
var code = StringExtensions.GetId();
|
||||
foundedDiscount = Discount.Create(code, 10, 0, true,
|
||||
foundedDiscount = Discount.Create(code,$"کد مخصوص همکاری در فروش برای کاربر - {user.FirstName} {user.LastName}", 10, 0, true,
|
||||
DiscountAmountType.Percent, DiscountType.All, 0, true, DateTime.Today, DateTime.Today.AddYears(10), 0,
|
||||
false, 0, false, true, 0, false, false);
|
||||
false, 0, false, true, 0, false, false,false);
|
||||
foundedDiscount.SetCorporate(userId);
|
||||
|
||||
_repositoryWrapper.SetRepository<Discount>().Add(foundedDiscount);
|
||||
|
|
|
@ -12,11 +12,12 @@ public class GetDiscountsQueryHandler : IRequestHandler<GetDiscountsQuery, List<
|
|||
}
|
||||
public async Task<List<DiscountSDto>> Handle(GetDiscountsQuery request, CancellationToken cancellationToken)
|
||||
{
|
||||
return await _repositoryWrapper.SetRepository<Discount>().TableNoTracking
|
||||
var discounts = await _repositoryWrapper.SetRepository<Discount>().TableNoTracking
|
||||
.Where(d=>!d.IsSpecialOffer)
|
||||
.OrderByDescending(b => b.CreatedAt)
|
||||
.Skip(request.Page * 15).Take(15)
|
||||
.Select(DiscountMapper.ProjectToSDto)
|
||||
.ToListAsync(cancellationToken);
|
||||
return discounts;
|
||||
}
|
||||
}
|
|
@ -18,7 +18,12 @@ public class UpdateDiscountCommandHandler : IRequestHandler<UpdateDiscountComman
|
|||
var ent = await _repositoryWrapper.SetRepository<Discount>().TableNoTracking.FirstOrDefaultAsync(d=>d.Id==request.Id,cancellationToken);
|
||||
if (ent == null)
|
||||
throw new AppException("Discount not found", ApiResultStatusCode.NotFound);
|
||||
var newEnt = Discount.Create(request.Code, request.DiscountPercent, request.DiscountAmount, request.HasCode, request.AmountType, request.Type, request.Count,request.IsImmortal, request.StartDate, request.ExpireDate, request.PriceFloor, request.HasPriceFloor, request.PriceCeiling, request.HasPriceCeiling, request.IsInfinity, request.UseCount, request.IsForInvitation, request.IsSpecialOffer);
|
||||
var newEnt = Discount.Create(request.Code,request.Description,
|
||||
request.DiscountPercent, request.DiscountAmount, request.HasCode,
|
||||
request.AmountType, request.Type, request.Count,request.IsImmortal,
|
||||
request.StartDate, request.ExpireDate, request.PriceFloor, request.HasPriceFloor,
|
||||
request.PriceCeiling, request.HasPriceCeiling, request.IsInfinity,
|
||||
request.UseCount, request.IsForInvitation,request.IsForFirstPurchase, request.IsSpecialOffer);
|
||||
newEnt.Id = ent.Id;
|
||||
newEnt.CreatedAt = ent.CreatedAt;
|
||||
newEnt.CreatedBy = ent.CreatedBy;
|
||||
|
@ -29,10 +34,12 @@ public class UpdateDiscountCommandHandler : IRequestHandler<UpdateDiscountComman
|
|||
if (catEnt == null)
|
||||
throw new AppException("Discount not found", ApiResultStatusCode.NotFound);
|
||||
|
||||
var catDis = CategoryDiscount.Create(request.Code, request.DiscountPercent, request.DiscountAmount, request.HasCode,
|
||||
request.AmountType, request.Type, request.Count, request.IsImmortal, request.StartDate, request.ExpireDate, request.PriceFloor,
|
||||
request.HasPriceFloor, request.PriceCeiling, request.HasPriceCeiling, request.IsInfinity, request.UseCount,
|
||||
request.IsForInvitation,request.IsSpecialOffer, request.CategoryId);
|
||||
var catDis = CategoryDiscount.Create(request.Code, request.Description,
|
||||
request.DiscountPercent, request.DiscountAmount, request.HasCode,
|
||||
request.AmountType, request.Type, request.Count, request.IsImmortal,
|
||||
request.StartDate, request.ExpireDate, request.PriceFloor, request.HasPriceFloor,
|
||||
request.PriceCeiling, request.HasPriceCeiling, request.IsInfinity,
|
||||
request.UseCount, request.IsForInvitation, request.IsForFirstPurchase, request.IsSpecialOffer, request.CategoryId);
|
||||
catDis.Id = catEnt.Id;
|
||||
catDis.CreatedAt = catEnt.CreatedAt;
|
||||
catDis.CreatedBy = catEnt.CreatedBy;
|
||||
|
@ -44,10 +51,12 @@ public class UpdateDiscountCommandHandler : IRequestHandler<UpdateDiscountComman
|
|||
if (productEnt == null)
|
||||
throw new AppException("Discount not found", ApiResultStatusCode.NotFound);
|
||||
|
||||
var productDis = ProductDiscount.Create(request.Code, request.DiscountPercent, request.DiscountAmount, request.HasCode,
|
||||
request.AmountType, request.Type, request.Count, request.IsImmortal, request.StartDate, request.ExpireDate, request.PriceFloor,
|
||||
request.HasPriceFloor, request.PriceCeiling, request.HasPriceCeiling, request.IsInfinity, request.UseCount,
|
||||
request.IsForInvitation, request.IsSpecialOffer, request.ProductId);
|
||||
var productDis = ProductDiscount.Create(request.Code, request.Description,
|
||||
request.DiscountPercent, request.DiscountAmount, request.HasCode,
|
||||
request.AmountType, request.Type, request.Count, request.IsImmortal,
|
||||
request.StartDate, request.ExpireDate, request.PriceFloor, request.HasPriceFloor,
|
||||
request.PriceCeiling, request.HasPriceCeiling, request.IsInfinity,
|
||||
request.UseCount, request.IsForInvitation, request.IsForFirstPurchase, request.IsSpecialOffer, request.ProductId);
|
||||
productDis.Id = productEnt.Id;
|
||||
productDis.CreatedAt = productEnt.CreatedAt;
|
||||
productDis.CreatedBy = productEnt.CreatedBy;
|
||||
|
|
1817
NetinaShop.Repository/Migrations/20240414120218_editDiscountAddFirstPurchase.Designer.cs
generated
100644
1817
NetinaShop.Repository/Migrations/20240414120218_editDiscountAddFirstPurchase.Designer.cs
generated
100644
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -147,6 +147,7 @@ namespace NetinaShop.Repository.Migrations
|
|||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Description")
|
||||
|
@ -164,6 +165,7 @@ namespace NetinaShop.Repository.Migrations
|
|||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ModifiedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<Guid>("OrderId")
|
||||
|
@ -173,6 +175,7 @@ namespace NetinaShop.Repository.Migrations
|
|||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("RemovedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("Status")
|
||||
|
@ -214,6 +217,7 @@ namespace NetinaShop.Repository.Migrations
|
|||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("IsRemoved")
|
||||
|
@ -226,6 +230,7 @@ namespace NetinaShop.Repository.Migrations
|
|||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ModifiedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("ReadingTime")
|
||||
|
@ -235,6 +240,7 @@ namespace NetinaShop.Repository.Migrations
|
|||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("RemovedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Summery")
|
||||
|
@ -266,6 +272,7 @@ namespace NetinaShop.Repository.Migrations
|
|||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Description")
|
||||
|
@ -279,6 +286,7 @@ namespace NetinaShop.Repository.Migrations
|
|||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ModifiedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
|
@ -289,6 +297,7 @@ namespace NetinaShop.Repository.Migrations
|
|||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("RemovedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
@ -306,6 +315,7 @@ namespace NetinaShop.Repository.Migrations
|
|||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Description")
|
||||
|
@ -326,6 +336,7 @@ namespace NetinaShop.Repository.Migrations
|
|||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ModifiedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("PageUrl")
|
||||
|
@ -340,6 +351,7 @@ namespace NetinaShop.Repository.Migrations
|
|||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("RemovedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
@ -370,6 +382,11 @@ namespace NetinaShop.Repository.Migrations
|
|||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<long>("DiscountAmount")
|
||||
|
@ -398,6 +415,9 @@ namespace NetinaShop.Repository.Migrations
|
|||
b.Property<bool>("Immortal")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("IsForFirstPurchase")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("IsForInvitation")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
|
@ -417,6 +437,7 @@ namespace NetinaShop.Repository.Migrations
|
|||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ModifiedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<long>("PriceCeiling")
|
||||
|
@ -429,6 +450,7 @@ namespace NetinaShop.Repository.Migrations
|
|||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("RemovedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("StartDate")
|
||||
|
@ -461,6 +483,7 @@ namespace NetinaShop.Repository.Migrations
|
|||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("DeliveredAt")
|
||||
|
@ -499,6 +522,7 @@ namespace NetinaShop.Repository.Migrations
|
|||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ModifiedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("OrderAt")
|
||||
|
@ -526,6 +550,7 @@ namespace NetinaShop.Repository.Migrations
|
|||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("RemovedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<double>("ServicePrice")
|
||||
|
@ -565,6 +590,7 @@ namespace NetinaShop.Repository.Migrations
|
|||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<double>("DeliveryCost")
|
||||
|
@ -577,6 +603,7 @@ namespace NetinaShop.Repository.Migrations
|
|||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ModifiedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<Guid>("OrderId")
|
||||
|
@ -586,6 +613,7 @@ namespace NetinaShop.Repository.Migrations
|
|||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("RemovedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<Guid>("ShippingId")
|
||||
|
@ -620,6 +648,7 @@ namespace NetinaShop.Repository.Migrations
|
|||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("HasDiscount")
|
||||
|
@ -632,6 +661,7 @@ namespace NetinaShop.Repository.Migrations
|
|||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ModifiedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<Guid>("OrderId")
|
||||
|
@ -665,6 +695,7 @@ namespace NetinaShop.Repository.Migrations
|
|||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("RemovedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
@ -686,6 +717,7 @@ namespace NetinaShop.Repository.Migrations
|
|||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Description")
|
||||
|
@ -702,6 +734,7 @@ namespace NetinaShop.Repository.Migrations
|
|||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ModifiedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
|
@ -715,6 +748,7 @@ namespace NetinaShop.Repository.Migrations
|
|||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("RemovedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
@ -746,6 +780,7 @@ namespace NetinaShop.Repository.Migrations
|
|||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("EnglishName")
|
||||
|
@ -772,6 +807,7 @@ namespace NetinaShop.Repository.Migrations
|
|||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ModifiedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<double>("PackingCost")
|
||||
|
@ -788,6 +824,7 @@ namespace NetinaShop.Repository.Migrations
|
|||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("RemovedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("ReviewCount")
|
||||
|
@ -834,6 +871,7 @@ namespace NetinaShop.Repository.Migrations
|
|||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("IsBuyer")
|
||||
|
@ -849,6 +887,7 @@ namespace NetinaShop.Repository.Migrations
|
|||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ModifiedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<Guid>("ProductId")
|
||||
|
@ -861,6 +900,7 @@ namespace NetinaShop.Repository.Migrations
|
|||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("RemovedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Title")
|
||||
|
@ -889,6 +929,7 @@ namespace NetinaShop.Repository.Migrations
|
|||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Detail")
|
||||
|
@ -905,6 +946,7 @@ namespace NetinaShop.Repository.Migrations
|
|||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ModifiedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<Guid?>("ParentId")
|
||||
|
@ -917,6 +959,7 @@ namespace NetinaShop.Repository.Migrations
|
|||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("RemovedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Title")
|
||||
|
@ -946,6 +989,7 @@ namespace NetinaShop.Repository.Migrations
|
|||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Discriminator")
|
||||
|
@ -977,6 +1021,7 @@ namespace NetinaShop.Repository.Migrations
|
|||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ModifiedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
|
@ -987,6 +1032,7 @@ namespace NetinaShop.Repository.Migrations
|
|||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("RemovedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
@ -1136,6 +1182,7 @@ namespace NetinaShop.Repository.Migrations
|
|||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Email")
|
||||
|
@ -1149,6 +1196,7 @@ namespace NetinaShop.Repository.Migrations
|
|||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ModifiedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("PhoneNumber")
|
||||
|
@ -1159,6 +1207,7 @@ namespace NetinaShop.Repository.Migrations
|
|||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("RemovedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
@ -1188,6 +1237,7 @@ namespace NetinaShop.Repository.Migrations
|
|||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("IsRemoved")
|
||||
|
@ -1203,6 +1253,7 @@ namespace NetinaShop.Repository.Migrations
|
|||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ModifiedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Plaque")
|
||||
|
@ -1229,6 +1280,7 @@ namespace NetinaShop.Repository.Migrations
|
|||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("RemovedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<Guid>("UserId")
|
||||
|
@ -1251,6 +1303,7 @@ namespace NetinaShop.Repository.Migrations
|
|||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("IsRemoved")
|
||||
|
@ -1260,6 +1313,7 @@ namespace NetinaShop.Repository.Migrations
|
|||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ModifiedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<Guid>("ProductId")
|
||||
|
@ -1269,6 +1323,7 @@ namespace NetinaShop.Repository.Migrations
|
|||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("RemovedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<Guid>("UserId")
|
||||
|
@ -1293,6 +1348,7 @@ namespace NetinaShop.Repository.Migrations
|
|||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<double>("DeliveryCost")
|
||||
|
@ -1314,6 +1370,7 @@ namespace NetinaShop.Repository.Migrations
|
|||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ModifiedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
|
@ -1324,6 +1381,7 @@ namespace NetinaShop.Repository.Migrations
|
|||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("RemovedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("WarehouseName")
|
||||
|
|
Loading…
Reference in New Issue