Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,8 @@ public async Task AddProductToDeal()
{
var newDealProduct = new NewDealProduct(1, 10, 30)
{
DiscountPercentage = 55,
Discount = 55,
DiscountType = "percentage",
EnabledFlag = true
};

Expand All @@ -742,7 +743,8 @@ public async Task AddProductToDeal()
Assert.Equal(10, dealProduct.ItemPrice);
Assert.Equal(30, dealProduct.Quantity);
Assert.Equal(135, dealProduct.Sum);
Assert.Equal(55, dealProduct.DiscountPercentage);
Assert.Equal(55, dealProduct.Discount);
Assert.Equal("percentage", dealProduct.DiscountType);

// Cleanup
await fixture.DeleteProduct(1, dealProduct.ProductAttachmentId.Value);
Expand All @@ -764,7 +766,8 @@ public async Task UpdateDealProduct()
ItemPrice = 44,
Quantity = 1,
Duration = 1,
DiscountPercentage = 11
Discount = 11,
DiscountType = "percentage"
};

var updatedDealProduct = await fixture.UpdateProduct(1, createdDealProduct.ProductAttachmentId.Value, dealProductUpdate);
Expand Down
7 changes: 5 additions & 2 deletions src/Pipedrive.net/Models/Request/Deals/DealProductUpdate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ public class DealProductUpdate
[JsonProperty("quantity")]
public long Quantity { get; set; }

[JsonProperty("discount_percentage")]
public decimal DiscountPercentage { get; set; }
[JsonProperty("discount")]
public decimal Discount { get; set; }

[JsonProperty("discount_type")]
public string DiscountType { get; set; }

[JsonProperty("duration")]
public long Duration { get; set; } = 1;
Expand Down
7 changes: 5 additions & 2 deletions src/Pipedrive.net/Models/Request/Deals/NewDealProduct.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ public class NewDealProduct
[JsonProperty("quantity")]
public long Quantity { get; set; }

[JsonProperty("discount_percentage")]
public decimal DiscountPercentage { get; set; }
[JsonProperty("discount")]
public decimal Discount { get; set; }

[JsonProperty("discount_type")]
public string DiscountType { get; set; }

[JsonProperty("duration")]
public long Duration { get; set; } = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ public abstract class AbstractDealProduct
[JsonProperty("item_price")]
public decimal ItemPrice { get; set; }

[JsonProperty("discount_percentage")]
public decimal DiscountPercentage { get; set; }
[JsonProperty("discount")]
public decimal Discount { get; set; }

[JsonProperty("discount_type")]
public string DiscountType { get; set; }

[JsonProperty("duration")]
public long Duration { get; set; }
Expand Down