✨ Add DiversitySecondaryValue to SubProduct
- 🖼️ Update SubProductActionDialogBox.razor layout Adjust grid item sizes and add new input field for DiversitySecondaryValue. - 🧑💻 Update SubProductActionDialogBoxViewModel Include DiversitySecondaryValue parameter in command constructors. - 📈 Increment version in Netina.AdminPanel.PWA.csproj Update AssemblyVersion and FileVersion to 1.12.22.38. - 🆕 Add BrandDiscountMapper.g.cs Introduce static partial class BrandDiscountMapper in Netina.Domain.Mappers. - 🗃️ Add migration 20250414120653_EditSubProductValue.cs Add DiversitySecondaryValue column to Products table. - 🏷️ Update SubProduct related classes and methods Add DiversitySecondaryValue property to CreateSubProductCommand, UpdateSubProductCommand, and SubProductSDto. - 🛠️ Modify command handlers Update CreateSubProductCommandHandler and UpdateSubProductCommandHandler to handle DiversitySecondaryValue. - 🗄️ Update Product.Aggregate.cs and SubProduct.cs Include DiversitySecondaryValue property in SubProduct class. - 🔄 Update SubProductMapper.g.cs Map DiversitySecondaryValue property in SubProductMapper. Changes made by Amir.H Khademimaster
parent
1d29f39cbc
commit
13751e452a
|
@ -5,6 +5,7 @@ public sealed record CreateSubProductCommand(
|
|||
Guid ParentId,
|
||||
ProductDiversity Diversity,
|
||||
string DiversityValue,
|
||||
string DiversitySecondaryValue,
|
||||
string DiversityDescription,
|
||||
string PersianName,
|
||||
double Cost,
|
||||
|
@ -19,6 +20,7 @@ public sealed record UpdateSubProductCommand(
|
|||
Guid ParentId,
|
||||
ProductDiversity Diversity,
|
||||
string DiversityValue,
|
||||
string DiversitySecondaryValue,
|
||||
string DiversityDescription,
|
||||
string PersianName,
|
||||
double Cost,
|
||||
|
|
|
@ -12,4 +12,5 @@ public class SubProductSDto : BaseDto<SubProductSDto,SubProduct>
|
|||
public ProductDiversity Diversity { get; set; }
|
||||
public string DiversityValue { get; set; } = string.Empty;
|
||||
public string DiversityDescription { get; set; } = string.Empty;
|
||||
public string DiversitySecondaryValue { get; set; } = string.Empty;
|
||||
}
|
|
@ -107,6 +107,7 @@ public partial class SubProduct
|
|||
Guid parentId,
|
||||
ProductDiversity diversity,
|
||||
string diversityValue,
|
||||
string diversitySecondaryValue,
|
||||
string diversityDescription,
|
||||
string persianName,
|
||||
string englishName,
|
||||
|
@ -129,6 +130,7 @@ public partial class SubProduct
|
|||
parentId,
|
||||
diversity,
|
||||
diversityValue,
|
||||
diversitySecondaryValue,
|
||||
diversityDescription,
|
||||
persianName,
|
||||
englishName,
|
||||
|
|
|
@ -14,6 +14,7 @@ public partial class SubProduct : Product
|
|||
Guid parentId,
|
||||
ProductDiversity diversity,
|
||||
string diversityValue,
|
||||
string diversitySecondaryValue,
|
||||
string diversityDescription,
|
||||
string persianName,
|
||||
string englishName,
|
||||
|
@ -53,6 +54,7 @@ public partial class SubProduct : Product
|
|||
ParentId = parentId;
|
||||
Diversity = diversity;
|
||||
DiversityValue = diversityValue;
|
||||
DiversitySecondaryValue = diversitySecondaryValue;
|
||||
DiversityDescription = diversityDescription;
|
||||
}
|
||||
|
||||
|
@ -61,5 +63,6 @@ public partial class SubProduct : Product
|
|||
|
||||
public ProductDiversity Diversity { get; internal set; }
|
||||
public string DiversityValue { get; internal set; } = string.Empty;
|
||||
public string DiversitySecondaryValue { get; internal set; } = string.Empty;
|
||||
public string DiversityDescription { get; internal set; } = string.Empty;
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
namespace Netina.Domain.Mappers
|
||||
{
|
||||
public static partial class BrandDiscountMapper
|
||||
{
|
||||
}
|
||||
}
|
|
@ -15,6 +15,7 @@ namespace Netina.Domain.Mappers
|
|||
ParentId = (Guid?)p1.ParentId,
|
||||
Diversity = p1.Diversity,
|
||||
DiversityValue = p1.DiversityValue,
|
||||
DiversitySecondaryValue = p1.DiversitySecondaryValue,
|
||||
DiversityDescription = p1.DiversityDescription,
|
||||
PersianName = p1.PersianName,
|
||||
Cost = p1.Cost,
|
||||
|
@ -37,6 +38,7 @@ namespace Netina.Domain.Mappers
|
|||
result.ParentId = (Guid?)p2.ParentId;
|
||||
result.Diversity = p2.Diversity;
|
||||
result.DiversityValue = p2.DiversityValue;
|
||||
result.DiversitySecondaryValue = p2.DiversitySecondaryValue;
|
||||
result.DiversityDescription = p2.DiversityDescription;
|
||||
result.PersianName = p2.PersianName;
|
||||
result.Cost = p2.Cost;
|
||||
|
@ -63,6 +65,7 @@ namespace Netina.Domain.Mappers
|
|||
Diversity = p4.Diversity,
|
||||
DiversityValue = p4.DiversityValue,
|
||||
DiversityDescription = p4.DiversityDescription,
|
||||
DiversitySecondaryValue = p4.DiversitySecondaryValue,
|
||||
Id = p4.Id,
|
||||
CreatedAt = p4.CreatedAt
|
||||
};
|
||||
|
@ -85,6 +88,7 @@ namespace Netina.Domain.Mappers
|
|||
result.Diversity = p5.Diversity;
|
||||
result.DiversityValue = p5.DiversityValue;
|
||||
result.DiversityDescription = p5.DiversityDescription;
|
||||
result.DiversitySecondaryValue = p5.DiversitySecondaryValue;
|
||||
result.Id = p5.Id;
|
||||
result.CreatedAt = p5.CreatedAt;
|
||||
return result;
|
||||
|
@ -102,6 +106,7 @@ namespace Netina.Domain.Mappers
|
|||
Diversity = p7.Diversity,
|
||||
DiversityValue = p7.DiversityValue,
|
||||
DiversityDescription = p7.DiversityDescription,
|
||||
DiversitySecondaryValue = p7.DiversitySecondaryValue,
|
||||
Id = p7.Id,
|
||||
CreatedAt = p7.CreatedAt
|
||||
};
|
||||
|
|
|
@ -21,6 +21,7 @@ public class CreateSubProductCommandHandler(IRepositoryWrapper repositoryWrapper
|
|||
request.ParentId,
|
||||
request.Diversity,
|
||||
request.DiversityValue,
|
||||
request.DiversitySecondaryValue,
|
||||
request.DiversityDescription,
|
||||
$"{parent.PersianName} - {request.DiversityDescription}",
|
||||
parent.EnglishName,
|
||||
|
|
|
@ -26,6 +26,7 @@ public class UpdateSubProductCommandHandler(IRepositoryWrapper repositoryWrapper
|
|||
request.ParentId,
|
||||
request.Diversity,
|
||||
request.DiversityValue,
|
||||
request.DiversitySecondaryValue,
|
||||
request.DiversityDescription,
|
||||
$"{parent.PersianName} - {request.DiversityDescription}",
|
||||
parent.EnglishName,
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,30 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace NetinaShop.Repository.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class EditSubProductValue : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "DiversitySecondaryValue",
|
||||
schema: "public",
|
||||
table: "Products",
|
||||
type: "text",
|
||||
nullable: true);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DiversitySecondaryValue",
|
||||
schema: "public",
|
||||
table: "Products");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1724,6 +1724,10 @@ namespace NetinaShop.Repository.Migrations
|
|||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("DiversitySecondaryValue")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("DiversityValue")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
|
Loading…
Reference in New Issue