Break out some of the create logic in CreateOrderService into tested, mockable subroutines
Remove return type restriction for method getOrderReferrerValue of AbstractConfigHelper / ConfigHelper because presence of Wayfair's Order Referrer is not 100% guaranteed, use a float|null type hint instead.
Rename most variables in CreateOrderService to disambiguate them and to imply namespace (plenty vs wf)
Rename query result variables to results instead of mapping, to improve code readability
Main Fixes
Filters out invalid Warehouse IDs when Orders are created
Fixes https://github.com/wayfair-contribs/plentymarkets-plugin/issues/197 (regression) by adding a getter for the logger in
Repository
and repairing its child classes to use the getter when logging errors.Testing Efforts
Code Health
create
logic inCreateOrderService
into tested, mockable subroutinesgetOrderReferrerValue
ofAbstractConfigHelper
/ConfigHelper
because presence of Wayfair's Order Referrer is not 100% guaranteed, use afloat|null
type hint instead.CreateOrderService
to disambiguate them and to imply namespace (plenty
vswf
)results
instead ofmapping
, to improve code readability