Skip to content
This repository has been archived by the owner on May 12, 2023. It is now read-only.

Added more Locales and Currencies. Made som fixes for ProductValueDat… #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

objecta
Copy link

@objecta objecta commented Jul 6, 2017

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.

…aConverter, when more than one currency and some of them are null
Copy link
Owner

@pardahlman pardahlman left a 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")
};
Copy link
Owner

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")
};
Copy link
Owner

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")
};
Copy link
Owner

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")
Copy link
Owner

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
Copy link
Owner

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
Copy link
Owner

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
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants