✨ 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,
|
Guid ParentId,
|
||||||
ProductDiversity Diversity,
|
ProductDiversity Diversity,
|
||||||
string DiversityValue,
|
string DiversityValue,
|
||||||
|
string DiversitySecondaryValue,
|
||||||
string DiversityDescription,
|
string DiversityDescription,
|
||||||
string PersianName,
|
string PersianName,
|
||||||
double Cost,
|
double Cost,
|
||||||
|
@ -19,6 +20,7 @@ public sealed record UpdateSubProductCommand(
|
||||||
Guid ParentId,
|
Guid ParentId,
|
||||||
ProductDiversity Diversity,
|
ProductDiversity Diversity,
|
||||||
string DiversityValue,
|
string DiversityValue,
|
||||||
|
string DiversitySecondaryValue,
|
||||||
string DiversityDescription,
|
string DiversityDescription,
|
||||||
string PersianName,
|
string PersianName,
|
||||||
double Cost,
|
double Cost,
|
||||||
|
|
|
@ -12,4 +12,5 @@ public class SubProductSDto : BaseDto<SubProductSDto,SubProduct>
|
||||||
public ProductDiversity Diversity { get; set; }
|
public ProductDiversity Diversity { get; set; }
|
||||||
public string DiversityValue { get; set; } = string.Empty;
|
public string DiversityValue { get; set; } = string.Empty;
|
||||||
public string DiversityDescription { 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,
|
Guid parentId,
|
||||||
ProductDiversity diversity,
|
ProductDiversity diversity,
|
||||||
string diversityValue,
|
string diversityValue,
|
||||||
|
string diversitySecondaryValue,
|
||||||
string diversityDescription,
|
string diversityDescription,
|
||||||
string persianName,
|
string persianName,
|
||||||
string englishName,
|
string englishName,
|
||||||
|
@ -129,6 +130,7 @@ public partial class SubProduct
|
||||||
parentId,
|
parentId,
|
||||||
diversity,
|
diversity,
|
||||||
diversityValue,
|
diversityValue,
|
||||||
|
diversitySecondaryValue,
|
||||||
diversityDescription,
|
diversityDescription,
|
||||||
persianName,
|
persianName,
|
||||||
englishName,
|
englishName,
|
||||||
|
|
|
@ -14,6 +14,7 @@ public partial class SubProduct : Product
|
||||||
Guid parentId,
|
Guid parentId,
|
||||||
ProductDiversity diversity,
|
ProductDiversity diversity,
|
||||||
string diversityValue,
|
string diversityValue,
|
||||||
|
string diversitySecondaryValue,
|
||||||
string diversityDescription,
|
string diversityDescription,
|
||||||
string persianName,
|
string persianName,
|
||||||
string englishName,
|
string englishName,
|
||||||
|
@ -53,6 +54,7 @@ public partial class SubProduct : Product
|
||||||
ParentId = parentId;
|
ParentId = parentId;
|
||||||
Diversity = diversity;
|
Diversity = diversity;
|
||||||
DiversityValue = diversityValue;
|
DiversityValue = diversityValue;
|
||||||
|
DiversitySecondaryValue = diversitySecondaryValue;
|
||||||
DiversityDescription = diversityDescription;
|
DiversityDescription = diversityDescription;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,5 +63,6 @@ public partial class SubProduct : Product
|
||||||
|
|
||||||
public ProductDiversity Diversity { get; internal set; }
|
public ProductDiversity Diversity { get; internal set; }
|
||||||
public string DiversityValue { get; internal set; } = string.Empty;
|
public string DiversityValue { get; internal set; } = string.Empty;
|
||||||
|
public string DiversitySecondaryValue { get; internal set; } = string.Empty;
|
||||||
public string DiversityDescription { 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,
|
ParentId = (Guid?)p1.ParentId,
|
||||||
Diversity = p1.Diversity,
|
Diversity = p1.Diversity,
|
||||||
DiversityValue = p1.DiversityValue,
|
DiversityValue = p1.DiversityValue,
|
||||||
|
DiversitySecondaryValue = p1.DiversitySecondaryValue,
|
||||||
DiversityDescription = p1.DiversityDescription,
|
DiversityDescription = p1.DiversityDescription,
|
||||||
PersianName = p1.PersianName,
|
PersianName = p1.PersianName,
|
||||||
Cost = p1.Cost,
|
Cost = p1.Cost,
|
||||||
|
@ -37,6 +38,7 @@ namespace Netina.Domain.Mappers
|
||||||
result.ParentId = (Guid?)p2.ParentId;
|
result.ParentId = (Guid?)p2.ParentId;
|
||||||
result.Diversity = p2.Diversity;
|
result.Diversity = p2.Diversity;
|
||||||
result.DiversityValue = p2.DiversityValue;
|
result.DiversityValue = p2.DiversityValue;
|
||||||
|
result.DiversitySecondaryValue = p2.DiversitySecondaryValue;
|
||||||
result.DiversityDescription = p2.DiversityDescription;
|
result.DiversityDescription = p2.DiversityDescription;
|
||||||
result.PersianName = p2.PersianName;
|
result.PersianName = p2.PersianName;
|
||||||
result.Cost = p2.Cost;
|
result.Cost = p2.Cost;
|
||||||
|
@ -63,6 +65,7 @@ namespace Netina.Domain.Mappers
|
||||||
Diversity = p4.Diversity,
|
Diversity = p4.Diversity,
|
||||||
DiversityValue = p4.DiversityValue,
|
DiversityValue = p4.DiversityValue,
|
||||||
DiversityDescription = p4.DiversityDescription,
|
DiversityDescription = p4.DiversityDescription,
|
||||||
|
DiversitySecondaryValue = p4.DiversitySecondaryValue,
|
||||||
Id = p4.Id,
|
Id = p4.Id,
|
||||||
CreatedAt = p4.CreatedAt
|
CreatedAt = p4.CreatedAt
|
||||||
};
|
};
|
||||||
|
@ -85,6 +88,7 @@ namespace Netina.Domain.Mappers
|
||||||
result.Diversity = p5.Diversity;
|
result.Diversity = p5.Diversity;
|
||||||
result.DiversityValue = p5.DiversityValue;
|
result.DiversityValue = p5.DiversityValue;
|
||||||
result.DiversityDescription = p5.DiversityDescription;
|
result.DiversityDescription = p5.DiversityDescription;
|
||||||
|
result.DiversitySecondaryValue = p5.DiversitySecondaryValue;
|
||||||
result.Id = p5.Id;
|
result.Id = p5.Id;
|
||||||
result.CreatedAt = p5.CreatedAt;
|
result.CreatedAt = p5.CreatedAt;
|
||||||
return result;
|
return result;
|
||||||
|
@ -102,6 +106,7 @@ namespace Netina.Domain.Mappers
|
||||||
Diversity = p7.Diversity,
|
Diversity = p7.Diversity,
|
||||||
DiversityValue = p7.DiversityValue,
|
DiversityValue = p7.DiversityValue,
|
||||||
DiversityDescription = p7.DiversityDescription,
|
DiversityDescription = p7.DiversityDescription,
|
||||||
|
DiversitySecondaryValue = p7.DiversitySecondaryValue,
|
||||||
Id = p7.Id,
|
Id = p7.Id,
|
||||||
CreatedAt = p7.CreatedAt
|
CreatedAt = p7.CreatedAt
|
||||||
};
|
};
|
||||||
|
|
|
@ -21,6 +21,7 @@ public class CreateSubProductCommandHandler(IRepositoryWrapper repositoryWrapper
|
||||||
request.ParentId,
|
request.ParentId,
|
||||||
request.Diversity,
|
request.Diversity,
|
||||||
request.DiversityValue,
|
request.DiversityValue,
|
||||||
|
request.DiversitySecondaryValue,
|
||||||
request.DiversityDescription,
|
request.DiversityDescription,
|
||||||
$"{parent.PersianName} - {request.DiversityDescription}",
|
$"{parent.PersianName} - {request.DiversityDescription}",
|
||||||
parent.EnglishName,
|
parent.EnglishName,
|
||||||
|
|
|
@ -26,6 +26,7 @@ public class UpdateSubProductCommandHandler(IRepositoryWrapper repositoryWrapper
|
||||||
request.ParentId,
|
request.ParentId,
|
||||||
request.Diversity,
|
request.Diversity,
|
||||||
request.DiversityValue,
|
request.DiversityValue,
|
||||||
|
request.DiversitySecondaryValue,
|
||||||
request.DiversityDescription,
|
request.DiversityDescription,
|
||||||
$"{parent.PersianName} - {request.DiversityDescription}",
|
$"{parent.PersianName} - {request.DiversityDescription}",
|
||||||
parent.EnglishName,
|
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()
|
.IsRequired()
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("DiversitySecondaryValue")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.Property<string>("DiversityValue")
|
b.Property<string>("DiversityValue")
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
Loading…
Reference in New Issue