Let's assume that you filter the products to import on find products to import method by family not null. The command on crontab will only then filter on these products, but if you also have the webhook enabled and you create or change a product without a family the current webhook controller will import this.
I can think of two solutions: the first is to dispatch a custom event on the webhook controller with the $resource parameter so you can say if the resource is to import or to skip. This solution requires that you "duplicate" the search conditions.
Another is to introduce a new service that, given the "product" array from Akeneo says if it is to import or not. This requires to change a little the ImportCommand, but the filter terms are maintained only on one point.
Let's assume that you filter the products to import on find products to import method by family not null. The command on crontab will only then filter on these products, but if you also have the webhook enabled and you create or change a product without a family the current webhook controller will import this.
I can think of two solutions: the first is to dispatch a custom event on the webhook controller with the $resource parameter so you can say if the resource is to import or to skip. This solution requires that you "duplicate" the search conditions. Another is to introduce a new service that, given the "product" array from Akeneo says if it is to import or not. This requires to change a little the ImportCommand, but the filter terms are maintained only on one point.