RIAEvangelist / node-dominos-pizza-api

This is a node.js wrapper for the dominos pizza apis
MIT License
548 stars 132 forks source link

First pass on menu parsing #41

Closed julianh2o closed 9 years ago

julianh2o commented 9 years ago

I've created a few new classes: Menu, MenuItem, and MenuCategory

Store.getMenu now populates the callback's second parameter with a parsed menu as a Menu object. (Note: At some point we should break compatibility and make this return only a Menu object. Users who need the raw object can use Menu.getRaw())

The Menu parsing is currently being showcased in dominos-store-menu.js. I've edited this example to print out the menu in a hierarchical fashion.

I've added a basic smoke test for the menu parsing under menu_test.js

I'll be adding more functionality to this soon, but this seems stable and functional so far.

In this pull request, I've also commented out a line of debugging information in Order.mergeResponse.

RIAEvangelist commented 9 years ago

Now is the time to make breaking changes.

Go for it. If you make the edits, they should show up in this PR still. Then we can pull it all in one request.

Looks good!

julianh2o commented 9 years ago

Alright, updated all of the occurrences I found. This will break compatibility in other people's code. To get the menu in the original format call Menu.getRaw()

RIAEvangelist commented 9 years ago

OK, we'll hold onto this code until we confirm coupons working and then release as a major version upgrade.

RIAEvangelist commented 9 years ago

@julianh2o does this close #32 ?

RIAEvangelist commented 9 years ago

actually we'll push sooner than expected with phone bug and tracking bug fixes

julianh2o commented 9 years ago

Nah, it doesn't close it. There is a bunch more functionality I want to get into the Menu before I'll close it. It's stable and a step in the right direction, but I'd like to add more linking and easy API calls and a bunch more examples and tests.

PS. my Amazon Echo ordered me a pizza the other day using this API :)

RIAEvangelist commented 9 years ago

Dude... SWEET! Do you have the code up?

julianh2o commented 9 years ago

It's not up yet, the code is really jenky right now and running as a daemon. I'll be working on it though and I'll let you know when I get it to a place that it's ready to see the light of day.

RIAEvangelist commented 9 years ago

cool!