Skip to content

Commit

Permalink
Merge pull request #42 from viagogo/fixchangedsales
Browse files Browse the repository at this point in the history
Adding fix for getting changes to sales
  • Loading branch information
AmarjitGill authored Sep 3, 2019
2 parents 22f3acc + 7c9f38d commit 047bb1c
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 4 deletions.
3 changes: 3 additions & 0 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### New in 1.3.1 (Released (2019/08/19)
* Bug fix for Getting Changed Sales

### New in 1.3.0 (Released (2019/08/19)
* Add change ticket type to sales client

Expand Down
2 changes: 1 addition & 1 deletion Version.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<VersionPrefix>1.3.0</VersionPrefix>
<VersionPrefix>1.3.1</VersionPrefix>
<VersionSuffix>
</VersionSuffix>
</PropertyGroup>
Expand Down
8 changes: 7 additions & 1 deletion src/GogoKit/Clients/SalesClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,13 @@ public Task<ChangedResources<Sale>> GetAllChangesAsync(Link nextLink)
{
return GetAllChangesAsync(
nextLink,
new SaleRequest {Sort = new[] {new Sort<string>("resource_version", SortDirection.Ascending)}});
new SaleRequest
{
Sort = new[]
{
new Sort<SaleSort>(SaleSort.ResourceVersion, SortDirection.Ascending)
}
});
}

public Task<ChangedResources<Sale>> GetAllChangesAsync(
Expand Down
22 changes: 20 additions & 2 deletions src/GogoKit/Models/Request/SaleRequest.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
namespace GogoKit.Models.Request
using System.Collections.Generic;

namespace GogoKit.Models.Request
{
public class SaleRequest : RequestParameters<string, string>
public class SaleRequest : RequestParameters<SaleEmbed, SaleSort>
{
protected override IDictionary<SaleSort, string> SortFieldNameMap =>
new Dictionary<SaleSort, string>
{
{SaleSort.CreatedAt, "created_at"},
{SaleSort.ResourceVersion, "resource_version"}
};
}

public enum SaleEmbed
{
}

public enum SaleSort
{
CreatedAt,
ResourceVersion
}
}

0 comments on commit 047bb1c

Please sign in to comment.