nat-henderson / terraform-provider-dominos

The Terraform plugin for the Dominos Pizza provider.
MIT License
1.11k stars 86 forks source link

Support for coupon codes #3

Open Nowaker opened 5 years ago

Nowaker commented 5 years ago

Coupons list: https://www.dominos.com/en/pages/order/#!/section/Coupons/category/All/

Example coupon: image

Its URL: https://www.dominos.com/en/pages/order/#!/order/coupons/new?code=5152&qty=1

Coupon price $9.99 vs $17.99 standard price is a big deal. To me - it's order or no order!

Please add support for coupons - if possible. Searching for coupons using data resources would be cool but the minimum viable solution is being able to provide coupon code (e.g. 5152).

lamroger commented 5 years ago

I dont know Go but i was able to hardcode the Coupons string in resource_order.go with this and rebuild to support it.

"Coupons": []map[string]interface{}{map[string]interface{}{"Code": "8682","Qty": "1","ID": "3"}},
lamroger commented 5 years ago

Also, shout out to Store #4336 in DC for canceling my duplicated orders!

Nowaker commented 5 years ago

shout out to Store #4336 in DC for canceling my duplicated orders!

Next goal: backend implementation for terraform destroy? :laughing: :laughing: :laughing:

nat-henderson commented 5 years ago

Oh yeah, I can definitely add a coupon data source, and throw coupons into the order validator. The errors you get out if the coupons are not valid are frankly incomprehensible, and it's not obvious that it's possible to implement coupon validation, though.