Skip to content
This repository has been archived by the owner on Mar 24, 2020. It is now read-only.

VRR - rewrite Queue and Request classes as ValueObjects #684

Open
mcritchlow opened this issue Jul 12, 2019 · 0 comments
Open

VRR - rewrite Queue and Request classes as ValueObjects #684

mcritchlow opened this issue Jul 12, 2019 · 0 comments

Comments

@mcritchlow
Copy link
Member

Descriptive summary

At the moment, the Aeon::Request and to a somewhat lesser extent Aeon::Queue are hiding the Aeon properties that are being returned from the various API calls.

The Request API call, for example, returns a json hash with over 40 properties. And as far as I can tell, there only about 4 actually used:

  • id (transactionNumber)
  • email (comes from a separate API call to get the user data)
  • itemTitle
  • transactionStatus

It would be nice to have a more firm, explicit contract with the API as to the expectations of what fields the application is using, and what format we expect the values for those properties to be in.

One way we could do this, at least for Request, is to replace the Hashie::Mash setup with the ValueSemantics gem: https://github.com/tomdalling/value_semantics Personally I would be a big fan of this approach, and would feel more comfortable carrying it forward into a future dams system.

Rationale

The Aeon API is very new, and has already exhibited problems in dealing with batch requests, and therefore seems relatively likely to break our assumptions about the data we're getting back at some point in the future. The Hashie::Mash current solution works quite well, but if the API changes, we would get more useful, direct feedback if we had a more explicit contract w/ the API.

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

No branches or pull requests

1 participant