solidus_api 2.3.1 → 2.4.0.beta1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of solidus_api might be problematic. Click here for more details.

Files changed (234) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/spree/api/base_controller.rb +9 -12
  3. data/app/controllers/spree/api/checkouts_controller.rb +3 -5
  4. data/app/controllers/spree/api/orders_controller.rb +2 -12
  5. data/app/controllers/spree/api/payments_controller.rb +0 -1
  6. data/app/controllers/spree/api/resource_controller.rb +2 -0
  7. data/app/controllers/spree/api/shipments_controller.rb +17 -6
  8. data/app/controllers/spree/api/stock_items_controller.rb +6 -0
  9. data/app/helpers/spree/api/api_helpers.rb +3 -4
  10. data/app/views/.rubocop.yml +4 -0
  11. data/app/views/spree/api/address_books/show.json.jbuilder +11 -0
  12. data/app/views/spree/api/addresses/_address.json.jbuilder +17 -0
  13. data/app/views/spree/api/addresses/show.json.jbuilder +1 -0
  14. data/app/views/spree/api/adjustments/_adjustment.json.jbuilder +4 -0
  15. data/app/views/spree/api/config/money.json.jbuilder +1 -0
  16. data/app/views/spree/api/config/show.json.jbuilder +2 -0
  17. data/app/views/spree/api/countries/index.json.jbuilder +2 -0
  18. data/app/views/spree/api/countries/show.json.jbuilder +4 -0
  19. data/app/views/spree/api/credit_cards/_credit_card.json.jbuilder +10 -0
  20. data/app/views/spree/api/credit_cards/index.json.jbuilder +4 -0
  21. data/app/views/spree/api/credit_cards/show.json.jbuilder +1 -0
  22. data/app/views/spree/api/errors/delete_restriction.json.jbuilder +1 -0
  23. data/app/views/spree/api/errors/gateway_error.json.jbuilder +1 -0
  24. data/app/views/spree/api/errors/invalid_api_key.json.jbuilder +1 -0
  25. data/app/views/spree/api/errors/invalid_resource.json.jbuilder +2 -0
  26. data/app/views/spree/api/errors/must_specify_api_key.json.jbuilder +1 -0
  27. data/app/views/spree/api/errors/not_found.json.jbuilder +1 -0
  28. data/app/views/spree/api/errors/unauthorized.json.jbuilder +1 -0
  29. data/app/views/spree/api/errors/variant_not_in_stock_transfer.json.jbuilder +1 -0
  30. data/app/views/spree/api/images/_image.json.jbuilder +5 -0
  31. data/app/views/spree/api/images/index.json.jbuilder +3 -0
  32. data/app/views/spree/api/images/show.json.jbuilder +1 -0
  33. data/app/views/spree/api/inventory_units/show.json.jbuilder +1 -0
  34. data/app/views/spree/api/line_items/_line_item.json.jbuilder +16 -0
  35. data/app/views/spree/api/line_items/new.json.jbuilder +2 -0
  36. data/app/views/spree/api/line_items/show.json.jbuilder +1 -0
  37. data/app/views/spree/api/option_types/_option_type.json.jbuilder +4 -0
  38. data/app/views/spree/api/option_types/index.json.jbuilder +3 -0
  39. data/app/views/spree/api/option_types/show.json.jbuilder +1 -0
  40. data/app/views/spree/api/option_values/_option_value.json.jbuilder +1 -0
  41. data/app/views/spree/api/option_values/index.json.jbuilder +3 -0
  42. data/app/views/spree/api/option_values/show.json.jbuilder +1 -0
  43. data/app/views/spree/api/orders/_big.json.jbuilder +49 -0
  44. data/app/views/spree/api/orders/_order.json.jbuilder +10 -0
  45. data/app/views/spree/api/orders/could_not_apply_coupon.json.jbuilder +1 -0
  46. data/app/views/spree/api/orders/could_not_transition.json.jbuilder +2 -0
  47. data/app/views/spree/api/orders/expected_total_mismatch.json.jbuilder +1 -0
  48. data/app/views/spree/api/orders/index.json.jbuilder +4 -0
  49. data/app/views/spree/api/orders/invalid_shipping_method.json.jbuilder +1 -0
  50. data/app/views/spree/api/orders/mine.json.jbuilder +4 -0
  51. data/app/views/spree/api/orders/show.json.jbuilder +1 -0
  52. data/app/views/spree/api/payments/credit_over_limit.json.jbuilder +1 -0
  53. data/app/views/spree/api/payments/index.json.jbuilder +2 -0
  54. data/app/views/spree/api/payments/new.json.jbuilder +4 -0
  55. data/app/views/spree/api/payments/show.json.jbuilder +1 -0
  56. data/app/views/spree/api/payments/update_forbidden.json.jbuilder +1 -0
  57. data/app/views/spree/api/product_properties/index.json.jbuilder +4 -0
  58. data/app/views/spree/api/product_properties/new.json.jbuilder +2 -0
  59. data/app/views/spree/api/product_properties/show.json.jbuilder +1 -0
  60. data/app/views/spree/api/products/_product.json.jbuilder +34 -0
  61. data/app/views/spree/api/products/index.json.jbuilder +4 -0
  62. data/app/views/spree/api/products/new.json.jbuilder +2 -0
  63. data/app/views/spree/api/products/show.json.jbuilder +1 -0
  64. data/app/views/spree/api/promotions/handler.json.jbuilder +4 -0
  65. data/app/views/spree/api/promotions/show.json.jbuilder +1 -0
  66. data/app/views/spree/api/properties/index.json.jbuilder +4 -0
  67. data/app/views/spree/api/properties/new.json.jbuilder +2 -0
  68. data/app/views/spree/api/properties/show.json.jbuilder +1 -0
  69. data/app/views/spree/api/return_authorizations/index.json.jbuilder +4 -0
  70. data/app/views/spree/api/return_authorizations/new.json.jbuilder +2 -0
  71. data/app/views/spree/api/return_authorizations/show.json.jbuilder +1 -0
  72. data/app/views/spree/api/shared/_pagination.json.jbuilder +5 -0
  73. data/app/views/spree/api/shipments/_big.json.jbuilder +51 -0
  74. data/app/views/spree/api/shipments/_small.json.jbuilder +32 -0
  75. data/app/views/spree/api/shipments/cannot_ready_shipment.json.jbuilder +1 -0
  76. data/app/views/spree/api/shipments/mine.json.jbuilder +4 -0
  77. data/app/views/spree/api/shipments/show.json.jbuilder +31 -0
  78. data/app/views/spree/api/shipping_rates/_shipping_rate.json.jbuilder +2 -0
  79. data/app/views/spree/api/states/index.json.jbuilder +5 -0
  80. data/app/views/spree/api/states/show.json.jbuilder +1 -0
  81. data/app/views/spree/api/stock_items/_stock_item.json.jbuilder +4 -0
  82. data/app/views/spree/api/stock_items/index.json.jbuilder +4 -0
  83. data/app/views/spree/api/stock_items/show.json.jbuilder +1 -0
  84. data/app/views/spree/api/stock_locations/_stock_location.json.jbuilder +15 -0
  85. data/app/views/spree/api/stock_locations/index.json.jbuilder +4 -0
  86. data/app/views/spree/api/stock_locations/show.json.jbuilder +1 -0
  87. data/app/views/spree/api/stock_movements/_stock_movement.json.jbuilder +4 -0
  88. data/app/views/spree/api/stock_movements/index.json.jbuilder +4 -0
  89. data/app/views/spree/api/stock_movements/show.json.jbuilder +1 -0
  90. data/app/views/spree/api/stock_transfers/receive.json.jbuilder +4 -0
  91. data/app/views/spree/api/store_credit_events/mine.json.jbuilder +5 -0
  92. data/app/views/spree/api/stores/index.json.jbuilder +1 -0
  93. data/app/views/spree/api/stores/show.json.jbuilder +1 -0
  94. data/app/views/spree/api/taxonomies/_nested.json.jbuilder +8 -0
  95. data/app/views/spree/api/taxonomies/_taxonomy.json.jbuilder +11 -0
  96. data/app/views/spree/api/taxonomies/index.json.jbuilder +4 -0
  97. data/app/views/spree/api/taxonomies/jstree.json.jbuilder +6 -0
  98. data/app/views/spree/api/taxonomies/new.json.jbuilder +2 -0
  99. data/app/views/spree/api/taxonomies/show.json.jbuilder +1 -0
  100. data/app/views/spree/api/taxons/_taxon.json.jbuilder +2 -0
  101. data/app/views/spree/api/taxons/_taxons.json.jbuilder +4 -0
  102. data/app/views/spree/api/taxons/index.json.jbuilder +7 -0
  103. data/app/views/spree/api/taxons/jstree.json.jbuilder +8 -0
  104. data/app/views/spree/api/taxons/new.json.jbuilder +2 -0
  105. data/app/views/spree/api/taxons/show.json.jbuilder +1 -0
  106. data/app/views/spree/api/transfer_items/_transfer_item.json.jbuilder +5 -0
  107. data/app/views/spree/api/transfer_items/show.json.jbuilder +1 -0
  108. data/app/views/spree/api/users/_user.json.jbuilder +15 -0
  109. data/app/views/spree/api/users/index.json.jbuilder +4 -0
  110. data/app/views/spree/api/users/new.json.jbuilder +2 -0
  111. data/app/views/spree/api/users/show.json.jbuilder +1 -0
  112. data/app/views/spree/api/variants/_big.json.jbuilder +13 -0
  113. data/app/views/spree/api/variants/_small.json.jbuilder +16 -0
  114. data/app/views/spree/api/variants/index.json.jbuilder +4 -0
  115. data/app/views/spree/api/variants/new.json.jbuilder +2 -0
  116. data/app/views/spree/api/variants/show.json.jbuilder +1 -0
  117. data/app/views/spree/api/zones/_zone.json.jbuilder +4 -0
  118. data/app/views/spree/api/zones/index.json.jbuilder +4 -0
  119. data/app/views/spree/api/zones/show.json.jbuilder +1 -0
  120. data/config/locales/en.yml +1 -0
  121. data/lib/spree/api/engine.rb +0 -14
  122. data/lib/spree/api.rb +1 -1
  123. data/lib/spree_api.rb +1 -0
  124. data/solidus_api.gemspec +3 -1
  125. data/spec/controllers/spree/api/base_controller_spec.rb +0 -56
  126. data/spec/requests/spree/api/checkouts_controller_spec.rb +8 -13
  127. data/spec/requests/spree/api/orders_controller_spec.rb +7 -60
  128. data/spec/requests/spree/api/payments_controller_spec.rb +0 -11
  129. data/spec/requests/spree/api/shipments_controller_spec.rb +16 -1
  130. data/spec/requests/spree/api/states_controller_spec.rb +1 -0
  131. data/spec/requests/spree/api/taxons_controller_spec.rb +25 -0
  132. data/spec/requests/spree/api/users_controller_spec.rb +1 -1
  133. data/spec/support/be_paginated_matcher.rb +7 -0
  134. data/spec/test_views/spree/api/widgets/_widget.json.jbuilder +1 -0
  135. data/spec/test_views/spree/api/widgets/index.json.jbuilder +7 -0
  136. data/spec/test_views/spree/api/widgets/new.json.jbuilder +1 -0
  137. data/spec/test_views/spree/api/widgets/show.json.jbuilder +1 -0
  138. metadata +166 -111
  139. data/app/views/spree/api/address_books/show.v1.rabl +0 -7
  140. data/app/views/spree/api/addresses/show.v1.rabl +0 -10
  141. data/app/views/spree/api/adjustments/show.v1.rabl +0 -4
  142. data/app/views/spree/api/config/money.v1.rabl +0 -2
  143. data/app/views/spree/api/config/show.v1.rabl +0 -3
  144. data/app/views/spree/api/countries/index.v1.rabl +0 -7
  145. data/app/views/spree/api/countries/show.v1.rabl +0 -5
  146. data/app/views/spree/api/credit_cards/index.v1.rabl +0 -7
  147. data/app/views/spree/api/credit_cards/show.v1.rabl +0 -7
  148. data/app/views/spree/api/errors/gateway_error.v1.rabl +0 -2
  149. data/app/views/spree/api/errors/invalid_api_key.v1.rabl +0 -2
  150. data/app/views/spree/api/errors/invalid_resource.v1.rabl +0 -3
  151. data/app/views/spree/api/errors/must_specify_api_key.v1.rabl +0 -2
  152. data/app/views/spree/api/errors/not_found.v1.rabl +0 -2
  153. data/app/views/spree/api/errors/unauthorized.v1.rabl +0 -2
  154. data/app/views/spree/api/errors/variant_not_in_stock_transfer.v1.rabl +0 -2
  155. data/app/views/spree/api/images/index.v1.rabl +0 -4
  156. data/app/views/spree/api/images/show.v1.rabl +0 -6
  157. data/app/views/spree/api/inventory_units/show.rabl +0 -2
  158. data/app/views/spree/api/line_items/new.v1.rabl +0 -3
  159. data/app/views/spree/api/line_items/show.v1.rabl +0 -15
  160. data/app/views/spree/api/option_types/index.v1.rabl +0 -3
  161. data/app/views/spree/api/option_types/show.v1.rabl +0 -5
  162. data/app/views/spree/api/option_values/index.v1.rabl +0 -3
  163. data/app/views/spree/api/option_values/show.v1.rabl +0 -2
  164. data/app/views/spree/api/orders/could_not_apply_coupon.v1.rabl +0 -2
  165. data/app/views/spree/api/orders/could_not_transition.v1.rabl +0 -3
  166. data/app/views/spree/api/orders/expected_total_mismatch.v1.rabl +0 -2
  167. data/app/views/spree/api/orders/index.v1.rabl +0 -7
  168. data/app/views/spree/api/orders/invalid_shipping_method.v1.rabl +0 -2
  169. data/app/views/spree/api/orders/mine.v1.rabl +0 -9
  170. data/app/views/spree/api/orders/order.v1.rabl +0 -9
  171. data/app/views/spree/api/orders/show.v1.rabl +0 -53
  172. data/app/views/spree/api/payments/credit_over_limit.v1.rabl +0 -2
  173. data/app/views/spree/api/payments/index.v1.rabl +0 -7
  174. data/app/views/spree/api/payments/new.v1.rabl +0 -5
  175. data/app/views/spree/api/payments/show.v1.rabl +0 -2
  176. data/app/views/spree/api/payments/update_forbidden.v1.rabl +0 -2
  177. data/app/views/spree/api/product_properties/index.v1.rabl +0 -7
  178. data/app/views/spree/api/product_properties/new.v1.rabl +0 -2
  179. data/app/views/spree/api/product_properties/show.v1.rabl +0 -2
  180. data/app/views/spree/api/products/index.v1.rabl +0 -9
  181. data/app/views/spree/api/products/new.v1.rabl +0 -3
  182. data/app/views/spree/api/products/product.v1.rabl +0 -1
  183. data/app/views/spree/api/products/show.v1.rabl +0 -42
  184. data/app/views/spree/api/promotions/handler.v1.rabl +0 -5
  185. data/app/views/spree/api/promotions/show.v1.rabl +0 -2
  186. data/app/views/spree/api/properties/index.v1.rabl +0 -7
  187. data/app/views/spree/api/properties/new.v1.rabl +0 -2
  188. data/app/views/spree/api/properties/show.v1.rabl +0 -2
  189. data/app/views/spree/api/return_authorizations/index.v1.rabl +0 -7
  190. data/app/views/spree/api/return_authorizations/new.v1.rabl +0 -3
  191. data/app/views/spree/api/return_authorizations/show.v1.rabl +0 -2
  192. data/app/views/spree/api/shipments/big.v1.rabl +0 -55
  193. data/app/views/spree/api/shipments/cannot_ready_shipment.v1.rabl +0 -2
  194. data/app/views/spree/api/shipments/mine.v1.rabl +0 -9
  195. data/app/views/spree/api/shipments/show.v1.rabl +0 -32
  196. data/app/views/spree/api/shipments/small.v1.rabl +0 -37
  197. data/app/views/spree/api/shipping_rates/show.v1.rabl +0 -2
  198. data/app/views/spree/api/states/index.v1.rabl +0 -14
  199. data/app/views/spree/api/states/show.v1.rabl +0 -2
  200. data/app/views/spree/api/stock_items/index.v1.rabl +0 -7
  201. data/app/views/spree/api/stock_items/show.v1.rabl +0 -5
  202. data/app/views/spree/api/stock_locations/index.v1.rabl +0 -7
  203. data/app/views/spree/api/stock_locations/show.v1.rabl +0 -8
  204. data/app/views/spree/api/stock_movements/index.v1.rabl +0 -7
  205. data/app/views/spree/api/stock_movements/show.v1.rabl +0 -5
  206. data/app/views/spree/api/stock_transfers/receive.v1.rabl +0 -5
  207. data/app/views/spree/api/store_credit_events/mine.v1.rabl +0 -10
  208. data/app/views/spree/api/stores/index.v1.rabl +0 -4
  209. data/app/views/spree/api/stores/show.v1.rabl +0 -2
  210. data/app/views/spree/api/taxonomies/index.v1.rabl +0 -7
  211. data/app/views/spree/api/taxonomies/jstree.rabl +0 -8
  212. data/app/views/spree/api/taxonomies/nested.v1.rabl +0 -11
  213. data/app/views/spree/api/taxonomies/new.v1.rabl +0 -3
  214. data/app/views/spree/api/taxonomies/show.v1.rabl +0 -15
  215. data/app/views/spree/api/taxons/index.v1.rabl +0 -12
  216. data/app/views/spree/api/taxons/jstree.rabl +0 -8
  217. data/app/views/spree/api/taxons/new.v1.rabl +0 -3
  218. data/app/views/spree/api/taxons/show.v1.rabl +0 -6
  219. data/app/views/spree/api/taxons/taxons.v1.rabl +0 -5
  220. data/app/views/spree/api/transfer_items/show.v1.rabl +0 -6
  221. data/app/views/spree/api/users/index.v1.rabl +0 -7
  222. data/app/views/spree/api/users/new.v1.rabl +0 -3
  223. data/app/views/spree/api/users/show.v1.rabl +0 -10
  224. data/app/views/spree/api/variants/big.v1.rabl +0 -20
  225. data/app/views/spree/api/variants/index.v1.rabl +0 -9
  226. data/app/views/spree/api/variants/new.v1.rabl +0 -2
  227. data/app/views/spree/api/variants/show.v1.rabl +0 -3
  228. data/app/views/spree/api/variants/small.v1.rabl +0 -17
  229. data/app/views/spree/api/zones/index.v1.rabl +0 -7
  230. data/app/views/spree/api/zones/show.v1.rabl +0 -6
  231. data/config/initializers/rails5_rabl_hacks.rb +0 -12
  232. data/spec/test_views/spree/api/widgets/index.v1.rabl +0 -7
  233. data/spec/test_views/spree/api/widgets/new.v1.rabl +0 -2
  234. data/spec/test_views/spree/api/widgets/show.v1.rabl +0 -2
@@ -1,3 +0,0 @@
1
- object false
2
- node(:default_country_id) { Spree::Country.default.id }
3
- node(:default_country_iso) { Spree::Config[:default_country_iso] }
@@ -1,7 +0,0 @@
1
- object false
2
- child(@countries => :countries) do
3
- attributes *country_attributes
4
- end
5
- node(:count) { @countries.count }
6
- node(:current_page) { @countries.current_page }
7
- node(:pages) { @countries.total_pages }
@@ -1,5 +0,0 @@
1
- object @country
2
- attributes *country_attributes
3
- child :states => :states do
4
- attributes :id, :name, :abbr, :country_id
5
- end
@@ -1,7 +0,0 @@
1
- object false
2
- child(@credit_cards => :credit_cards) do
3
- extends "spree/api/credit_cards/show"
4
- end
5
- node(:count) { @credit_cards.count }
6
- node(:current_page) { @credit_cards.current_page }
7
- node(:pages) { @credit_cards.total_pages }
@@ -1,7 +0,0 @@
1
- object @credit_card
2
- cache [I18n.locale, root_object]
3
- attributes *creditcard_attributes
4
-
5
- child :address do
6
- extends "spree/api/addresses/show"
7
- end
@@ -1,2 +0,0 @@
1
- object false
2
- node(:error) { I18n.t(:gateway_error, scope: "spree.api", text: @error) }
@@ -1,2 +0,0 @@
1
- object false
2
- node(:error) { I18n.t(:invalid_api_key, :key => api_key, :scope => "spree.api") }
@@ -1,3 +0,0 @@
1
- object false
2
- node(:error) { I18n.t(:invalid_resource, :scope => "spree.api") }
3
- node(:errors) { @resource.errors.to_hash }
@@ -1,2 +0,0 @@
1
- object false
2
- node(:error) { I18n.t(:must_specify_api_key, :scope => "spree.api") }
@@ -1,2 +0,0 @@
1
- object false
2
- node(:error) { I18n.t(:resource_not_found, :scope => "spree.api") }
@@ -1,2 +0,0 @@
1
- object false
2
- node(:error) { I18n.t(:unauthorized, :scope => "spree.api") }
@@ -1,2 +0,0 @@
1
- object false
2
- node(:error) { Spree.t(:item_not_in_stock_transfer) }
@@ -1,4 +0,0 @@
1
- object false
2
- child(@images => :images) do
3
- extends "spree/api/images/show"
4
- end
@@ -1,6 +0,0 @@
1
- object @image
2
- attributes *image_attributes
3
- attributes :viewable_type, :viewable_id
4
- Spree::Image.attachment_definitions[:attachment][:styles].each do |k,v|
5
- node("#{k}_url") { |i| i.attachment.url(k) }
6
- end
@@ -1,2 +0,0 @@
1
- object @inventory_unit
2
- attributes *inventory_unit_attributes
@@ -1,3 +0,0 @@
1
- object false
2
- node(:attributes) { [*line_item_attributes] - [:id] }
3
- node(:required_attributes) { [:variant_id, :quantity] }
@@ -1,15 +0,0 @@
1
- object @line_item
2
- cache [I18n.locale, root_object]
3
- attributes *line_item_attributes
4
- node(:single_display_amount) { |li| li.single_display_amount.to_s }
5
- node(:display_amount) { |li| li.display_amount.to_s }
6
- node(:total) { |li| li.total }
7
- child :variant do
8
- extends "spree/api/variants/small"
9
- attributes :product_id
10
- child(:images => :images) { extends "spree/api/images/show" }
11
- end
12
-
13
- child :adjustments => :adjustments do
14
- extends "spree/api/adjustments/show"
15
- end
@@ -1,3 +0,0 @@
1
- collection @option_types
2
-
3
- extends "spree/api/option_types/show"
@@ -1,5 +0,0 @@
1
- object @option_type
2
- attributes *option_type_attributes
3
- child :option_values => :option_values do
4
- attributes *option_value_attributes
5
- end
@@ -1,3 +0,0 @@
1
- collection @option_values
2
-
3
- extends "spree/api/option_values/show"
@@ -1,2 +0,0 @@
1
- object @option_value
2
- attributes *option_value_attributes
@@ -1,2 +0,0 @@
1
- object false
2
- node(:error) { @coupon_message }
@@ -1,3 +0,0 @@
1
- object false
2
- node(:error) { I18n.t(:could_not_transition, scope: "spree.api.order") }
3
- node(:errors) { @order.errors.to_hash }
@@ -1,2 +0,0 @@
1
- object false
2
- node(:errors) { {expected_total: [I18n.t(:expected_total_mismatch, scope: "spree.api.order")]} }
@@ -1,7 +0,0 @@
1
- object false
2
- child(@orders => :orders) do
3
- extends "spree/api/orders/order"
4
- end
5
- node(:count) { @orders.count }
6
- node(:current_page) { @orders.current_page }
7
- node(:pages) { @orders.total_pages }
@@ -1,2 +0,0 @@
1
- object false
2
- node(:errors) { [I18n.t(:invalid_shipping_method, :scope => "spree.api.order")] }
@@ -1,9 +0,0 @@
1
- object false
2
-
3
- child(@orders => :orders) do
4
- extends "spree/api/orders/show"
5
- end
6
-
7
- node(:count) { @orders.count }
8
- node(:current_page) { @orders.current_page }
9
- node(:pages) { @orders.total_pages }
@@ -1,9 +0,0 @@
1
- cache [I18n.locale, root_object]
2
- attributes *order_attributes
3
- node(:display_item_total) { |o| o.display_item_total.to_s }
4
- node(:total_quantity) { |o| o.line_items.sum(:quantity) }
5
- node(:display_total) { |o| o.display_total.to_s }
6
- node(:display_ship_total) { |o| o.display_ship_total }
7
- node(:display_tax_total) { |o| o.display_tax_total }
8
- node(:token) { |o| o.guest_token }
9
- node(:checkout_steps) { |o| o.checkout_steps }
@@ -1,53 +0,0 @@
1
- object @order
2
- extends "spree/api/orders/order"
3
-
4
- child :available_payment_methods => :payment_methods do
5
- attributes :id, :name, :partial_name
6
- attributes :partial_name, as: :method_type
7
- end
8
-
9
- child :billing_address => :bill_address do
10
- extends "spree/api/addresses/show"
11
- end
12
-
13
- child :shipping_address => :ship_address do
14
- extends "spree/api/addresses/show"
15
- end
16
-
17
- child :line_items => :line_items do
18
- extends "spree/api/line_items/show"
19
- end
20
-
21
- child :payments => :payments do
22
- attributes *payment_attributes
23
-
24
- child :payment_method => :payment_method do
25
- attributes :id, :name
26
- end
27
-
28
- child :source => :source do
29
- attributes *payment_source_attributes
30
- if @current_user_roles.include?('admin')
31
- attributes *(payment_source_attributes + [:gateway_customer_profile_id, :gateway_payment_profile_id])
32
- else
33
- attributes *payment_source_attributes
34
- end
35
- end
36
- end
37
-
38
- child :shipments => :shipments do
39
- extends "spree/api/shipments/small"
40
- end
41
-
42
- child :adjustments => :adjustments do
43
- extends "spree/api/adjustments/show"
44
- end
45
-
46
- # Necessary for backend's order interface
47
- node :permissions do
48
- { can_update: current_ability.can?(:update, root_object) }
49
- end
50
-
51
- child :valid_credit_cards => :credit_cards do
52
- extends "spree/api/credit_cards/show"
53
- end
@@ -1,2 +0,0 @@
1
- object false
2
- node(:error) { I18n.t(:credit_over_limit, :limit => @payment.credit_allowed, :scope => 'spree.api.payment') }
@@ -1,7 +0,0 @@
1
- object false
2
- child(@payments => :payments) do
3
- attributes *payment_attributes
4
- end
5
- node(:count) { @payments.count }
6
- node(:current_page) { @payments.current_page }
7
- node(:pages) { @payments.total_pages }
@@ -1,5 +0,0 @@
1
- object false
2
- node(:attributes) { [*payment_attributes] }
3
- child @payment_methods => :payment_methods do
4
- attributes *payment_method_attributes
5
- end
@@ -1,2 +0,0 @@
1
- object @payment
2
- attributes *payment_attributes
@@ -1,2 +0,0 @@
1
- object false
2
- node(:error) { I18n.t(:update_forbidden, :state => @payment.state, :scope => 'spree.api.payment') }
@@ -1,7 +0,0 @@
1
- object false
2
- child(@product_properties => :product_properties) do
3
- attributes *product_property_attributes
4
- end
5
- node(:count) { @product_properties.count }
6
- node(:current_page) { @product_properties.current_page }
7
- node(:pages) { @product_properties.total_pages }
@@ -1,2 +0,0 @@
1
- node(:attributes) { [*product_property_attributes] }
2
- node(:required_attributes) { [] }
@@ -1,2 +0,0 @@
1
- object @product_property
2
- attributes *product_property_attributes
@@ -1,9 +0,0 @@
1
- object false
2
- node(:count) { @products.size }
3
- node(:total_count) { @products.total_count }
4
- node(:current_page) { @products.current_page }
5
- node(:per_page) { @products.limit_value }
6
- node(:pages) { @products.total_pages }
7
- child(@products => :products) do
8
- extends "spree/api/products/show"
9
- end
@@ -1,3 +0,0 @@
1
- object false
2
- node(:attributes) { [*product_attributes] }
3
- node(:required_attributes) { required_fields_for(Spree::Product) }
@@ -1 +0,0 @@
1
- attributes *product_attributes
@@ -1,42 +0,0 @@
1
- object @product
2
- cache [I18n.locale, @current_user_roles.include?('admin'), current_pricing_options, root_object]
3
-
4
- @product_attributes ||= product_attributes
5
- attributes(*@product_attributes)
6
-
7
- node(:display_price) { |p| p.display_price.to_s }
8
-
9
- @exclude_data ||= {}
10
- unless @exclude_data[:variants]
11
- node(:has_variants) { |p| p.has_variants? }
12
-
13
- child :master => :master do
14
- extends "spree/api/variants/small"
15
- end
16
-
17
- child :variants => :variants do
18
- extends "spree/api/variants/small"
19
- end
20
- end
21
-
22
- unless @exclude_data[:option_types]
23
- child :option_types => :option_types do
24
- attributes(*option_type_attributes)
25
- end
26
- end
27
-
28
- unless @exclude_data[:product_properties]
29
- child :product_properties => :product_properties do
30
- attributes(*product_property_attributes)
31
- end
32
- end
33
-
34
- unless @exclude_data[:classifications]
35
- child :classifications => :classifications do
36
- attributes :taxon_id, :position
37
-
38
- child(:taxon) do
39
- extends "spree/api/taxons/show"
40
- end
41
- end
42
- end
@@ -1,5 +0,0 @@
1
- object false
2
- node(:success) { @handler.success }
3
- node(:error) { @handler.error }
4
- node(:successful) { @handler.successful? }
5
- node(:status_code) { @handler.status_code }
@@ -1,2 +0,0 @@
1
- object @promotion
2
- attributes *promotion_attributes
@@ -1,7 +0,0 @@
1
- object false
2
- child(@properties => :properties) do
3
- attributes *property_attributes
4
- end
5
- node(:count) { @properties.count }
6
- node(:current_page) { @properties.current_page }
7
- node(:pages) { @properties.total_pages }
@@ -1,2 +0,0 @@
1
- node(:attributes) { [*property_attributes] }
2
- node(:required_attributes) { [] }
@@ -1,2 +0,0 @@
1
- object @property
2
- attributes *property_attributes
@@ -1,7 +0,0 @@
1
- object false
2
- child(@return_authorizations => :return_authorizations) do
3
- attributes *return_authorization_attributes
4
- end
5
- node(:count) { @return_authorizations.count }
6
- node(:current_page) { @return_authorizations.current_page }
7
- node(:pages) { @return_authorizations.total_pages }
@@ -1,3 +0,0 @@
1
- object false
2
- node(:attributes) { [*return_authorization_attributes] }
3
- node(:required_attributes) { required_fields_for(Spree::ReturnAuthorization) }
@@ -1,2 +0,0 @@
1
- object @return_authorization
2
- attributes *return_authorization_attributes
@@ -1,55 +0,0 @@
1
- object @shipment
2
- cache @shipment
3
- attributes *shipment_attributes
4
-
5
- child selected_shipping_rate: :selected_shipping_rate do
6
- extends "spree/api/shipping_rates/show"
7
- end
8
-
9
- child inventory_units: :inventory_units do
10
- object @inventory_unit
11
- attributes *inventory_unit_attributes
12
-
13
- child :variant do
14
- extends "spree/api/variants/small"
15
- attributes :product_id
16
- child(images: :images) { extends "spree/api/images/show" }
17
- end
18
-
19
- child :line_item do
20
- attributes *line_item_attributes
21
- node(:single_display_amount) { |li| li.single_display_amount.to_s }
22
- node(:display_amount) { |li| li.display_amount.to_s }
23
- node(:total) { |li| li.total }
24
- end
25
- end
26
-
27
- child order: :order do
28
- extends "spree/api/orders/order"
29
-
30
- child billing_address: :bill_address do
31
- extends "spree/api/addresses/show"
32
- end
33
-
34
- child shipping_address: :ship_address do
35
- extends "spree/api/addresses/show"
36
- end
37
-
38
- child adjustments: :adjustments do
39
- extends "spree/api/adjustments/show"
40
- end
41
-
42
- child payments: :payments do
43
- attributes :id, :amount, :display_amount, :state
44
- child source: :source do |s|
45
- attrs = [:id]
46
- if s.respond_to?(:cc_type)
47
- attrs << :cc_type
48
- end
49
- attributes *attrs
50
- end
51
- child payment_method: :payment_method do
52
- attributes :id, :name
53
- end
54
- end
55
- end
@@ -1,2 +0,0 @@
1
- object false
2
- node(:error) { I18n.t(:cannot_ready, :scope => "spree.api.shipment") }
@@ -1,9 +0,0 @@
1
- object false
2
-
3
- node(:count) { @shipments.count }
4
- node(:current_page) { @shipments.current_page }
5
- node(:pages) { @shipments.total_pages }
6
-
7
- child(@shipments => :shipments) do
8
- extends "spree/api/shipments/big"
9
- end
@@ -1,32 +0,0 @@
1
- object @shipment
2
- cache [I18n.locale, root_object]
3
- attributes *shipment_attributes
4
- node(:order_id) { |shipment| shipment.order.number }
5
- node(:stock_location_name) { |shipment| shipment.stock_location.name }
6
-
7
- child :shipping_rates => :shipping_rates do
8
- extends "spree/api/shipping_rates/show"
9
- end
10
-
11
- child :selected_shipping_rate => :selected_shipping_rate do
12
- extends "spree/api/shipping_rates/show"
13
- end
14
-
15
- child :shipping_methods => :shipping_methods do
16
- attributes :id, :name
17
- child :zones => :zones do
18
- attributes :id, :name, :description
19
- end
20
-
21
- child :shipping_categories => :shipping_categories do
22
- attributes :id, :name
23
- end
24
- end
25
-
26
- child :manifest => :manifest do
27
- child :variant => :variant do
28
- extends "spree/api/variants/small"
29
- end
30
- node(:quantity) { |m| m.quantity }
31
- node(:states) { |m| m.states }
32
- end
@@ -1,37 +0,0 @@
1
- object @shipment
2
- cache [I18n.locale, 'small_shipment', root_object]
3
-
4
- attributes *shipment_attributes
5
- node(:order_id) { |shipment| shipment.order.number }
6
- node(:stock_location_name) { |shipment| shipment.stock_location.name }
7
-
8
- child :shipping_rates => :shipping_rates do
9
- extends "spree/api/shipping_rates/show"
10
- end
11
-
12
- child :selected_shipping_rate => :selected_shipping_rate do
13
- extends "spree/api/shipping_rates/show"
14
- end
15
-
16
- child :shipping_methods => :shipping_methods do
17
- attributes :id, :code, :name
18
- child :zones => :zones do
19
- attributes :id, :name, :description
20
- end
21
-
22
- child :shipping_categories => :shipping_categories do
23
- attributes :id, :name
24
- end
25
- end
26
-
27
- child :manifest => :manifest do
28
- glue(:variant) do
29
- attribute :id => :variant_id
30
- end
31
- node(:quantity) { |m| m.quantity }
32
- node(:states) { |m| m.states }
33
- end
34
-
35
- child :adjustments => :adjustments do
36
- extends "spree/api/adjustments/show"
37
- end
@@ -1,2 +0,0 @@
1
- attributes :id, :name, :cost, :selected, :shipping_method_id, :shipping_method_code
2
- node(:display_cost) { |sr| sr.display_cost.to_s }
@@ -1,14 +0,0 @@
1
- object false
2
- if @country
3
- node(:states_required) { @country.states_required }
4
- end
5
-
6
- child(@states => :states) do
7
- attributes *state_attributes
8
- end
9
-
10
- if @states.respond_to?(:total_pages)
11
- node(:count) { @states.count }
12
- node(:current_page) { @states.current_page }
13
- node(:pages) { @states.total_pages }
14
- end
@@ -1,2 +0,0 @@
1
- object @state
2
- attributes *state_attributes
@@ -1,7 +0,0 @@
1
- object false
2
- child(@stock_items => :stock_items) do
3
- extends 'spree/api/stock_items/show'
4
- end
5
- node(:count) { @stock_items.count }
6
- node(:current_page) { @stock_items.current_page }
7
- node(:pages) { @stock_items.total_pages }
@@ -1,5 +0,0 @@
1
- object @stock_item
2
- attributes *stock_item_attributes
3
- child(:variant) do
4
- extends "spree/api/variants/small"
5
- end
@@ -1,7 +0,0 @@
1
- object false
2
- child(@stock_locations => :stock_locations) do
3
- extends 'spree/api/stock_locations/show'
4
- end
5
- node(:count) { @stock_locations.count }
6
- node(:current_page) { @stock_locations.current_page }
7
- node(:pages) { @stock_locations.total_pages }
@@ -1,8 +0,0 @@
1
- object @stock_location
2
- attributes *stock_location_attributes
3
- child(:country) do |address|
4
- attributes *country_attributes
5
- end
6
- child(:state) do |address|
7
- attributes *state_attributes
8
- end
@@ -1,7 +0,0 @@
1
- object false
2
- child(@stock_movements => :stock_movements) do
3
- extends 'spree/api/stock_movements/show'
4
- end
5
- node(:count) { @stock_movements.count }
6
- node(:current_page) { @stock_movements.current_page }
7
- node(:pages) { @stock_movements.total_pages }
@@ -1,5 +0,0 @@
1
- object @stock_movement
2
- attributes *stock_movement_attributes
3
- child :stock_item do
4
- extends "spree/api/stock_items/show"
5
- end
@@ -1,5 +0,0 @@
1
- object @stock_transfer
2
- attributes *stock_transfer_attributes
3
- node(:received_item) do
4
- partial('spree/api/transfer_items/show', object: @transfer_item)
5
- end
@@ -1,10 +0,0 @@
1
- object false
2
-
3
- child(@store_credit_events => :store_credit_events) do
4
- attributes *store_credit_history_attributes
5
- node(:order_number) { |event| event.order.try(:number) }
6
- end
7
-
8
- node(:count) { @store_credit_events.count }
9
- node(:current_page) { @store_credit_events.current_page }
10
- node(:pages) { @store_credit_events.total_pages }
@@ -1,4 +0,0 @@
1
- object false
2
- child(@stores => :stores) do
3
- attributes *store_attributes
4
- end
@@ -1,2 +0,0 @@
1
- object @store
2
- attributes *store_attributes
@@ -1,7 +0,0 @@
1
- object false
2
- child(@taxonomies => :taxonomies) do
3
- extends "spree/api/taxonomies/show"
4
- end
5
- node(:count) { @taxonomies.count }
6
- node(:current_page) { @taxonomies.current_page }
7
- node(:pages) { @taxonomies.total_pages }