From 7c9f38d7d014e3018669a8496990484a375dc3b9 Mon Sep 17 00:00:00 2001 From: "VIAGOGO\\Amarjit.Gill" Date: Tue, 3 Sep 2019 10:41:42 -0400 Subject: [PATCH] Adding fix for getting changes to sales --- ReleaseNotes.md | 3 +++ Version.props | 2 +- src/GogoKit/Clients/SalesClient.cs | 8 +++++++- src/GogoKit/Models/Request/SaleRequest.cs | 22 ++++++++++++++++++++-- 4 files changed, 31 insertions(+), 4 deletions(-) diff --git a/ReleaseNotes.md b/ReleaseNotes.md index 5538859..06ac966 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -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 diff --git a/Version.props b/Version.props index bc380dc..106b0ba 100644 --- a/Version.props +++ b/Version.props @@ -1,6 +1,6 @@  - 1.3.0 + 1.3.1 diff --git a/src/GogoKit/Clients/SalesClient.cs b/src/GogoKit/Clients/SalesClient.cs index 2d2c2bc..4da4325 100644 --- a/src/GogoKit/Clients/SalesClient.cs +++ b/src/GogoKit/Clients/SalesClient.cs @@ -70,7 +70,13 @@ public Task> GetAllChangesAsync(Link nextLink) { return GetAllChangesAsync( nextLink, - new SaleRequest {Sort = new[] {new Sort("resource_version", SortDirection.Ascending)}}); + new SaleRequest + { + Sort = new[] + { + new Sort(SaleSort.ResourceVersion, SortDirection.Ascending) + } + }); } public Task> GetAllChangesAsync( diff --git a/src/GogoKit/Models/Request/SaleRequest.cs b/src/GogoKit/Models/Request/SaleRequest.cs index bce55c9..e09accc 100644 --- a/src/GogoKit/Models/Request/SaleRequest.cs +++ b/src/GogoKit/Models/Request/SaleRequest.cs @@ -1,6 +1,24 @@ -namespace GogoKit.Models.Request +using System.Collections.Generic; + +namespace GogoKit.Models.Request { - public class SaleRequest : RequestParameters + public class SaleRequest : RequestParameters { + protected override IDictionary SortFieldNameMap => + new Dictionary + { + {SaleSort.CreatedAt, "created_at"}, + {SaleSort.ResourceVersion, "resource_version"} + }; + } + + public enum SaleEmbed + { + } + + public enum SaleSort + { + CreatedAt, + ResourceVersion } }