Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[API clean up] Make OFN independent of spree_api #4054

Open
luisramos0 opened this issue Jul 18, 2019 · 0 comments

Comments

@luisramos0
Copy link
Contributor

commented Jul 18, 2019

What we should change and why (this is tech debt)

We need to drop spree_api dependency and bring what's needed to OFN.
Although there are quite a few controllers in spree_api that are not overridden in OFN, most of then will either not be applicable to OFN because of differences in models (like stock_transfers) or not funcional in OFN because of differences in processes (like checkouts_controller).

There are 24 controllers in spree_api:

  • 5 are overridden in OFN and most probably working: line_items_controller_decorator, products_controller_decorator, shipments_controller_decorator, users_controller, variants_controller_decorator

The rest are all not overriden in OFN:

  • 7 are most probably working: countries_controller, states_controller, zones_controller, taxonomies_controller, taxons_controller, images_controller, addresses_controller
  • 4 are maybe functional but remotely useful for OFN right now: inventory_units_controller, option_types_controller, option_values_controller, return_authorizations_controller
  • 4 are not functional and would need work to be functional: checkouts_controller (due to ofn checkout customizations), product_properties_controller, properties_controller (due to cache control, at least), payments_controller (due to adjustments)
  • 4 are not applicable or not usable in OFN: stock_locations_controller, stock_movements_controller, stock_items_controller (doesnt make sense to expose this level of granularity in the OFN api, stock levels are managed at variant level), orders_controller (OFN has it's own /api/orders_controller)

From this list we can already see that, most probably, we need to bring the 7 working ones to OFN and probably none of the other ones are needed to keep OFN working as is without spree_api.

The major advantage is that we will have the OFN api in a single place and the extra advantage is that this will enable us to convert the views of these 7 api resources from rabl to ams and thus have the OFN API build with one single uniform tech stack.

At some point in the future we will need to adapt (or rebuild!) checkout and payments to OFN so that we offer the ability for external apps to checkout using the OFN API. For now, we can ignore this and just keep the functionality we have.

Context

This comes as part of the OFN API clean up process started with it's documentation in #3001

Impact and timeline

This will need to be done before we clean up the api side of OFN, it will make things a lot easier because we are basically removing a lot of code in spree that we either dont use or is not working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.