Add PriceList functionality with RetailPrice and AgencyMarginPercent

This commit is contained in:
2026-09-09 16:28:57 +05:30
parent 58d67495d2
commit 7dbeaa722a
6 changed files with 168 additions and 51 deletions
@@ -2,16 +2,30 @@ namespace Distribution.Features.PriceList;
public record CreatePriceListRequest(string Name, Guid? RegionId, DateTime EffectiveFrom, DateTime EffectiveTo);
public record UpdatePriceListRequest(string Name, Guid? RegionId, DateTime EffectiveFrom, DateTime EffectiveTo);
public record UpdatePriceListRequest(string Name, Guid? RegionId, DateTime EffectiveFrom, DateTime EffectiveTo, bool IsActive);
public record UpsertPriceListItemRequest(decimal Price, decimal? MinPrice = null);
public record UpsertPriceListItemRequest(
decimal Price,
decimal? MinPrice = null,
decimal? RetailPrice = null,
decimal? AgencyMarginPercent = null);
public record PriceListItemResponse(Guid Id, Guid ItemId, string Sku, string ItemName, decimal Price, decimal? MinPrice);
public record PriceListItemResponse(
Guid Id,
Guid ItemId,
string Sku,
string ItemName,
decimal Price,
decimal? MinPrice,
decimal? RetailPrice,
decimal? AgencyMarginPercent);
/// <summary>
/// A resolved price with its negotiable floor. MinPrice null = no negotiation, Price is fixed.
/// A resolved price with its negotiable floor, plus the informational retail price and agency
/// margin when the resolution came from an actual PriceListItem (both null on the Item.SalePrice
/// fallback, since neither is tracked at the item level).
/// </summary>
public record PriceResolution(decimal Price, decimal? MinPrice);
public record PriceResolution(decimal Price, decimal? MinPrice, decimal? RetailPrice, decimal? AgencyMarginPercent);
public record PriceListResponse(
Guid Id,