Files
FrontOffice.BFF/src/FrontOffice.BFF.Application/DiscountShopCQ/Queries/GetMyDiscountCart/GetMyDiscountCartResponseDto.cs
masoodafar-web 9a42060653 feat: Add Protobuf definitions for Network Membership service
- Introduced `networkmembership.proto` with RPC methods for retrieving user network tree, statistics, and position.
- Implemented HTTP annotations for gRPC transcoding in the service methods.
- Added support for Google API annotations in `annotations.proto` and `http.proto`.
- Created `ConfigureServices.cs` to register FluentValidation for the Protobuf services.
- Updated project file to include necessary dependencies for gRPC and Protobuf.
2025-12-04 19:53:47 +03:30

78 lines
1.9 KiB
C#

namespace FrontOffice.BFF.Application.DiscountShopCQ.Queries.GetMyDiscountCart;
public class GetMyDiscountCartResponseDto
{
/// <summary>
/// آیتم‌های سبد خرید
/// </summary>
public List<DiscountCartItemDto> Items { get; set; } = new();
/// <summary>
/// جمع کل قیمت (بدون تخفیف)
/// </summary>
public long TotalPrice { get; set; }
/// <summary>
/// جمع کل تخفیف
/// </summary>
public long TotalDiscountAmount { get; set; }
/// <summary>
/// مبلغ قابل پرداخت
/// </summary>
public long PayableAmount => TotalPrice - TotalDiscountAmount;
/// <summary>
/// تعداد کل آیتم‌ها
/// </summary>
public int TotalItemCount => Items.Sum(i => i.Count);
}
public class DiscountCartItemDto
{
/// <summary>
/// شناسه آیتم سبد
/// </summary>
public long Id { get; set; }
/// <summary>
/// شناسه محصول
/// </summary>
public long ProductId { get; set; }
/// <summary>
/// عنوان محصول
/// </summary>
public string ProductTitle { get; set; } = string.Empty;
/// <summary>
/// قیمت واحد
/// </summary>
public long UnitPrice { get; set; }
/// <summary>
/// تعداد
/// </summary>
public int Count { get; set; }
/// <summary>
/// درصد تخفیف
/// </summary>
public int MaxDiscountPercent { get; set; }
/// <summary>
/// مبلغ تخفیف
/// </summary>
public long DiscountAmount { get; set; }
/// <summary>
/// قیمت کل ردیف
/// </summary>
public long TotalPrice => UnitPrice * Count;
/// <summary>
/// مسیر تصویر
/// </summary>
public string ThumbnailPath { get; set; } = string.Empty;
}