jaikamat / clubhouse-pos-importer

Monorepo for an LGS's inventory management system
1 stars 0 forks source link

Min, max price filters #266

Closed jaikamat closed 3 years ago

jaikamat commented 3 years ago

image

Summary

This PR improves upon previously implemented price-filtering by introducing min and max prices for a given inventory query, which easily allows staff to hone in on not only prices less than or greater than a singular price, but also on a range of prices. This is extremely useful for inventory ordering, format inclusion (2DH staples), and curating physical store displays.

Additionally, I chose to rescope Formik form types here. Previously, we were translating from form to query types in the form component, and that logic should live a level up in the parent. So, rather than passing down a doSubmit prop with signature (formValues: FilterQueryTypes) => void and having to cast these types in the form itself, we use (formValues: FormTypes) => void instead. Now, we can invoke doSubmit with the form values, and the parent submission handler will convert these types to necessary query types.