-
Notifications
You must be signed in to change notification settings - Fork 20
Added more Locales and Currencies. Made som fixes for ProductValueDat… #18
base: master
Are you sure you want to change the base?
Conversation
…aConverter, when more than one currency and some of them are null
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a bunch for this PR! I have reviewed your changes and added some comments. I am interested to hear your thoughts.
In order to easier follow the changes made, feel free to create multiple PRs for the different fixes you have done.
Thanks again!
Value = date | ||
}; | ||
Value = date.ToString("yyyy-MM-dd HH:mm:ss") | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: fix indentation
Value = date | ||
}; | ||
Value = date.ToString("yyyy-MM-dd HH:mm:ss") | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: fix indentation
Value = date | ||
}; | ||
Value = date.ToString("yyyy-MM-dd HH:mm:ss") | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: fix indentation
@@ -12,7 +12,7 @@ public static UpdatedCriteria Equals(DateTime date) | |||
return new UpdatedCriteria | |||
{ | |||
Operator = Operators.Equal, | |||
Value = date | |||
Value = date.ToString("yyyy-MM-dd HH:mm:ss") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit hesitant to add a call to ToString
here. Is this date format accepted throughout the Akeneo API? If so, we should update the AkeneoSerializerSettings
to set DateFormatHandling
accordingly.
return FilterAsync<TModel>(queryString, limit, ct); | ||
} | ||
|
||
public async Task<PaginationResult<TModel>> FilterAsync<TModel>(string queryString, int limit = 10, CancellationToken ct = default(CancellationToken)) where TModel : ModelBase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just thinking out load here... the signature for FilterAsync
has a string argument for queryString
, and this overload also accepts a limit
that is combined with the queryString
... I think this overload is redundant, as the client could create the &limiy=
query string herself. Thoughts?
@@ -62,16 +62,32 @@ public AkeneoClient(Uri apiEndPoint, IAuthenticationClient authClient) : base(ap | |||
return FilterAsync<TModel>(queryString, ct); | |||
} | |||
|
|||
public async Task<PaginationResult<TModel>> FilterAsync<TModel>(string queryString, CancellationToken ct = default(CancellationToken)) where TModel : ModelBase | |||
public Task<PaginationResult<TModel>> SearchAsync<TModel>(IEnumerable<Criteria> criterias, int limit = 10, CancellationToken ct = default(CancellationToken)) where TModel : ModelBase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it makes sense with a limit parameter here. But instead of creating a new method, we should extend the existing one and have a check like
if(limit > 0)
{
// append limit to query string
}
The ProductValueDataConverter is failing when there are more then one currency and one or more of these currencies are null. Sugesting a fix that I have tested and used in my nopCommerce Integration plugin.
Also I have added all Locals and Currencies and made a fix for the dates string used in search. They were failing in my setup.