terraform-provider-dominos icon indicating copy to clipboard operation
terraform-provider-dominos copied to clipboard

Support for coupon codes

Open Nowaker opened this issue 5 years ago • 4 comments

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).

Nowaker avatar Apr 03 '19 15:04 Nowaker

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 avatar May 03 '19 17:05 lamroger

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

lamroger avatar May 03 '19 17:05 lamroger

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

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

Nowaker avatar May 04 '19 06:05 Nowaker

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.

nat-henderson avatar May 07 '19 09:05 nat-henderson