spree_api 4.3.0 → 4.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (351) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/concerns/spree/api/v2/caching.rb +7 -3
  3. data/app/controllers/concerns/spree/api/v2/coupon_codes_helper.rb +29 -0
  4. data/app/controllers/concerns/spree/api/v2/number_resource.rb +11 -0
  5. data/app/controllers/concerns/spree/api/v2/platform/nested_set_reposition_concern.rb +37 -0
  6. data/app/controllers/concerns/spree/api/v2/platform/promotion_calculator_params.rb +17 -0
  7. data/app/controllers/concerns/spree/api/v2/platform/promotion_rule_params.rb +16 -0
  8. data/app/controllers/concerns/spree/api/v2/product_list_includes.rb +10 -8
  9. data/app/controllers/concerns/spree/api/v2/storefront/metadata_controller_concern.rb +18 -0
  10. data/app/controllers/spree/api/v2/base_controller.rb +7 -5
  11. data/app/controllers/spree/api/v2/platform/adjustments_controller.rb +19 -0
  12. data/app/controllers/spree/api/v2/platform/classifications_controller.rb +1 -22
  13. data/app/controllers/spree/api/v2/platform/cms_pages_controller.rb +4 -0
  14. data/app/controllers/spree/api/v2/platform/cms_sections_controller.rb +13 -18
  15. data/app/controllers/spree/api/v2/platform/digital_links_controller.rb +25 -0
  16. data/app/controllers/spree/api/v2/platform/digitals_controller.rb +19 -0
  17. data/app/controllers/spree/api/v2/platform/line_items_controller.rb +59 -0
  18. data/app/controllers/spree/api/v2/platform/menu_items_controller.rb +5 -19
  19. data/app/controllers/spree/api/v2/platform/menus_controller.rb +0 -4
  20. data/app/controllers/spree/api/v2/platform/orders_controller.rb +163 -0
  21. data/app/controllers/spree/api/v2/platform/payment_methods_controller.rb +27 -0
  22. data/app/controllers/spree/api/v2/platform/payments_controller.rb +17 -0
  23. data/app/controllers/spree/api/v2/platform/products_controller.rb +5 -1
  24. data/app/controllers/spree/api/v2/platform/promotion_actions_controller.rb +30 -0
  25. data/app/controllers/spree/api/v2/platform/promotion_categories_controller.rb +19 -0
  26. data/app/controllers/spree/api/v2/platform/promotion_rules_controller.rb +25 -0
  27. data/app/controllers/spree/api/v2/platform/promotions_controller.rb +31 -0
  28. data/app/controllers/spree/api/v2/platform/resource_controller.rb +47 -16
  29. data/app/controllers/spree/api/v2/platform/roles_controller.rb +15 -0
  30. data/app/controllers/spree/api/v2/platform/shipments_controller.rb +143 -0
  31. data/app/controllers/spree/api/v2/platform/shipping_categories_controller.rb +15 -0
  32. data/app/controllers/spree/api/v2/platform/shipping_methods_controller.rb +24 -0
  33. data/app/controllers/spree/api/v2/platform/states_controller.rb +19 -0
  34. data/app/controllers/spree/api/v2/platform/stock_items_controller.rb +19 -0
  35. data/app/controllers/spree/api/v2/platform/stock_locations_controller.rb +19 -0
  36. data/app/controllers/spree/api/v2/platform/store_credit_categories_controller.rb +15 -0
  37. data/app/controllers/spree/api/v2/platform/store_credit_types_controller.rb +15 -0
  38. data/app/controllers/spree/api/v2/platform/store_credits_controller.rb +19 -0
  39. data/app/controllers/spree/api/v2/platform/tax_categories_controller.rb +19 -0
  40. data/app/controllers/spree/api/v2/platform/tax_rates_controller.rb +23 -0
  41. data/app/controllers/spree/api/v2/platform/taxonomies_controller.rb +19 -0
  42. data/app/controllers/spree/api/v2/platform/taxons_controller.rb +25 -0
  43. data/app/controllers/spree/api/v2/platform/users_controller.rb +4 -0
  44. data/app/controllers/spree/api/v2/platform/variants_controller.rb +19 -0
  45. data/app/controllers/spree/api/v2/platform/webhooks/events_controller.rb +21 -0
  46. data/app/controllers/spree/api/v2/platform/webhooks/subscribers_controller.rb +21 -0
  47. data/app/controllers/spree/api/v2/platform/wished_items_controller.rb +19 -0
  48. data/app/controllers/spree/api/v2/platform/wishlists_controller.rb +19 -0
  49. data/app/controllers/spree/api/v2/platform/zones_controller.rb +19 -0
  50. data/app/controllers/spree/api/v2/resource_controller.rb +3 -3
  51. data/app/controllers/spree/api/v2/storefront/account/addresses_controller.rb +2 -2
  52. data/app/controllers/spree/api/v2/storefront/account/credit_cards_controller.rb +4 -1
  53. data/app/controllers/spree/api/v2/storefront/cart_controller.rb +18 -28
  54. data/app/controllers/spree/api/v2/storefront/checkout_controller.rb +25 -1
  55. data/app/controllers/spree/api/v2/storefront/digitals_controller.rb +58 -0
  56. data/app/controllers/spree/api/v2/storefront/stores_controller.rb +4 -0
  57. data/app/controllers/spree/api/v2/storefront/wishlists_controller.rb +171 -0
  58. data/app/helpers/spree/api/v2/collection_options_helpers.rb +1 -1
  59. data/app/helpers/spree/api/v2/store_media_serializer_images_concern.rb +35 -0
  60. data/app/jobs/spree/webhooks/subscribers/make_request_job.rb +17 -0
  61. data/app/models/concerns/spree/webhooks/has_webhooks.rb +84 -0
  62. data/app/models/spree/api/webhooks/order_decorator.rb +43 -0
  63. data/app/models/spree/api/webhooks/payment_decorator.rb +26 -0
  64. data/app/models/spree/api/webhooks/product_decorator.rb +46 -0
  65. data/app/models/spree/api/webhooks/shipment_decorator.rb +21 -0
  66. data/app/models/spree/api/webhooks/stock_item_decorator.rb +43 -0
  67. data/app/models/spree/api/webhooks/stock_movement_decorator.rb +52 -0
  68. data/app/models/spree/api/webhooks/variant_decorator.rb +26 -0
  69. data/app/models/spree/oauth_access_grant.rb +7 -0
  70. data/app/models/spree/oauth_access_token.rb +7 -0
  71. data/app/models/spree/oauth_application.rb +15 -0
  72. data/app/models/spree/webhooks/base.rb +11 -0
  73. data/app/models/spree/webhooks/event.rb +12 -0
  74. data/app/models/spree/webhooks/subscriber.rb +61 -0
  75. data/app/serializers/concerns/spree/api/v2/resource_serializer_concern.rb +19 -1
  76. data/app/serializers/spree/api/v2/base_serializer.rb +11 -4
  77. data/app/serializers/spree/api/v2/platform/address_serializer.rb +1 -1
  78. data/app/serializers/spree/api/v2/platform/adjustment_serializer.rb +20 -0
  79. data/app/serializers/spree/api/v2/platform/asset_serializer.rb +13 -0
  80. data/app/serializers/spree/api/v2/platform/calculator_serializer.rb +17 -0
  81. data/app/serializers/spree/api/v2/platform/classification_serializer.rb +1 -1
  82. data/app/serializers/spree/api/v2/platform/cms_page_serializer.rb +1 -1
  83. data/app/serializers/spree/api/v2/platform/cms_section_image_one_serializer.rb +9 -0
  84. data/app/serializers/spree/api/v2/platform/cms_section_image_three_serializer.rb +9 -0
  85. data/app/serializers/spree/api/v2/platform/cms_section_image_two_serializer.rb +9 -0
  86. data/app/serializers/spree/api/v2/platform/cms_section_serializer.rb +8 -1
  87. data/app/serializers/spree/api/v2/platform/country_serializer.rb +1 -1
  88. data/app/serializers/spree/api/v2/platform/credit_card_serializer.rb +14 -0
  89. data/app/serializers/spree/api/v2/platform/customer_return_serializer.rb +17 -0
  90. data/app/serializers/spree/api/v2/platform/digital_link_serializer.rb +16 -0
  91. data/app/serializers/spree/api/v2/platform/digital_serializer.rb +30 -0
  92. data/app/serializers/spree/api/v2/platform/feature_page_serializer.rb +11 -0
  93. data/app/serializers/spree/api/v2/platform/hero_image_serializer.rb +10 -0
  94. data/app/serializers/spree/api/v2/platform/homepage_serializer.rb +11 -0
  95. data/app/serializers/spree/api/v2/platform/image_gallery_serializer.rb +10 -0
  96. data/app/serializers/spree/api/v2/platform/inventory_unit_serializer.rb +19 -0
  97. data/app/serializers/spree/api/v2/platform/line_item_serializer.rb +19 -0
  98. data/app/serializers/spree/api/v2/platform/log_entry_serializer.rb +13 -0
  99. data/app/serializers/spree/api/v2/platform/menu_item_serializer.rb +1 -1
  100. data/app/serializers/spree/api/v2/platform/menu_serializer.rb +1 -1
  101. data/app/serializers/spree/api/v2/platform/option_type_serializer.rb +1 -1
  102. data/app/serializers/spree/api/v2/platform/option_value_serializer.rb +1 -1
  103. data/app/serializers/spree/api/v2/platform/order_promotion_serializer.rb +14 -0
  104. data/app/serializers/spree/api/v2/platform/order_serializer.rb +31 -0
  105. data/app/serializers/spree/api/v2/platform/payment_capture_event_serializer.rb +13 -0
  106. data/app/serializers/spree/api/v2/platform/payment_method_serializer.rb +18 -0
  107. data/app/serializers/spree/api/v2/platform/payment_serializer.rb +21 -0
  108. data/app/serializers/spree/api/v2/platform/price_serializer.rb +19 -0
  109. data/app/serializers/spree/api/v2/platform/product_property_serializer.rb +1 -1
  110. data/app/serializers/spree/api/v2/platform/product_serializer.rb +7 -3
  111. data/app/serializers/spree/api/v2/platform/promotion_action_line_item_serializer.rb +14 -0
  112. data/app/serializers/spree/api/v2/platform/promotion_action_serializer.rb +19 -0
  113. data/app/serializers/spree/api/v2/platform/promotion_category_serializer.rb +13 -0
  114. data/app/serializers/spree/api/v2/platform/promotion_rule_serializer.rb +21 -0
  115. data/app/serializers/spree/api/v2/platform/promotion_serializer.rb +17 -0
  116. data/app/serializers/spree/api/v2/platform/property_serializer.rb +11 -0
  117. data/app/serializers/spree/api/v2/platform/prototype_serializer.rb +15 -0
  118. data/app/serializers/spree/api/v2/platform/refund_reason_serializer.rb +11 -0
  119. data/app/serializers/spree/api/v2/platform/refund_serializer.rb +16 -0
  120. data/app/serializers/spree/api/v2/platform/reimbursement_credit_serializer.rb +10 -0
  121. data/app/serializers/spree/api/v2/platform/reimbursement_serializer.rb +18 -0
  122. data/app/serializers/spree/api/v2/platform/reimbursement_type_serializer.rb +11 -0
  123. data/app/serializers/spree/api/v2/platform/return_authorization_reason_serializer.rb +11 -0
  124. data/app/serializers/spree/api/v2/platform/return_authorization_serializer.rb +17 -0
  125. data/app/serializers/spree/api/v2/platform/return_item_serializer.rb +16 -0
  126. data/app/serializers/spree/api/v2/platform/role_serializer.rb +11 -0
  127. data/app/serializers/spree/api/v2/platform/shipment_serializer.rb +22 -0
  128. data/app/serializers/spree/api/v2/platform/shipping_category_serializer.rb +11 -0
  129. data/app/serializers/spree/api/v2/platform/shipping_method_serializer.rb +16 -0
  130. data/app/serializers/spree/api/v2/platform/shipping_rate_serializer.rb +15 -0
  131. data/app/serializers/spree/api/v2/platform/side_by_side_image_serializer.rb +10 -0
  132. data/app/serializers/spree/api/v2/platform/standard_page_serializer.rb +11 -0
  133. data/app/serializers/spree/api/v2/platform/state_change_serializer.rb +13 -0
  134. data/app/serializers/spree/api/v2/platform/state_serializer.rb +1 -1
  135. data/app/serializers/spree/api/v2/platform/stock_item_serializer.rb +1 -3
  136. data/app/serializers/spree/api/v2/platform/stock_location_serializer.rb +2 -4
  137. data/app/serializers/spree/api/v2/platform/stock_movement_serializer.rb +11 -0
  138. data/app/serializers/spree/api/v2/platform/stock_transfer_serializer.rb +15 -0
  139. data/app/serializers/spree/api/v2/platform/store_credit_category_serializer.rb +12 -0
  140. data/app/serializers/spree/api/v2/platform/store_credit_event_serializer.rb +14 -0
  141. data/app/serializers/spree/api/v2/platform/store_credit_serializer.rb +18 -0
  142. data/app/serializers/spree/api/v2/platform/store_credit_type_serializer.rb +12 -0
  143. data/app/serializers/spree/api/v2/platform/store_serializer.rb +2 -1
  144. data/app/serializers/spree/api/v2/platform/tax_category_serializer.rb +2 -2
  145. data/app/serializers/spree/api/v2/platform/tax_rate_serializer.rb +14 -0
  146. data/app/serializers/spree/api/v2/platform/taxon_serializer.rb +1 -1
  147. data/app/serializers/spree/api/v2/platform/taxonomy_serializer.rb +1 -1
  148. data/app/serializers/spree/api/v2/platform/user_serializer.rb +1 -1
  149. data/app/serializers/spree/api/v2/platform/variant_serializer.rb +3 -2
  150. data/app/serializers/spree/api/v2/platform/webhooks/event_serializer.rb +15 -0
  151. data/app/serializers/spree/api/v2/platform/webhooks/subscriber_serializer.rb +13 -0
  152. data/app/serializers/spree/api/v2/platform/wished_item_serializer.rb +29 -0
  153. data/app/serializers/spree/api/v2/platform/wishlist_serializer.rb +19 -0
  154. data/app/serializers/spree/api/v2/platform/zone_member_serializer.rb +13 -0
  155. data/app/serializers/spree/api/v2/platform/zone_serializer.rb +13 -0
  156. data/app/serializers/spree/v2/storefront/address_serializer.rb +1 -1
  157. data/app/serializers/spree/v2/storefront/cart_serializer.rb +1 -1
  158. data/app/serializers/spree/v2/storefront/cms_section_serializer.rb +8 -4
  159. data/app/serializers/spree/v2/storefront/credit_card_serializer.rb +1 -1
  160. data/app/serializers/spree/v2/storefront/digital_link_serializer.rb +11 -0
  161. data/app/serializers/spree/v2/storefront/estimated_shipping_rate_serializer.rb +2 -2
  162. data/app/serializers/spree/v2/storefront/line_item_serializer.rb +2 -1
  163. data/app/serializers/spree/v2/storefront/option_type_serializer.rb +1 -1
  164. data/app/serializers/spree/v2/storefront/option_value_serializer.rb +1 -1
  165. data/app/serializers/spree/v2/storefront/order_serializer.rb +9 -0
  166. data/app/serializers/spree/v2/storefront/payment_method_serializer.rb +1 -1
  167. data/app/serializers/spree/v2/storefront/payment_serializer.rb +1 -1
  168. data/app/serializers/spree/v2/storefront/product_property_serializer.rb +1 -1
  169. data/app/serializers/spree/v2/storefront/product_serializer.rb +2 -2
  170. data/app/serializers/spree/v2/storefront/promotion_serializer.rb +1 -1
  171. data/app/serializers/spree/v2/storefront/shipment_serializer.rb +5 -1
  172. data/app/serializers/spree/v2/storefront/store_credit_serializer.rb +1 -1
  173. data/app/serializers/spree/v2/storefront/store_serializer.rb +5 -10
  174. data/app/serializers/spree/v2/storefront/taxon_serializer.rb +1 -1
  175. data/app/serializers/spree/v2/storefront/taxonomy_serializer.rb +1 -1
  176. data/app/serializers/spree/v2/storefront/user_serializer.rb +1 -1
  177. data/app/serializers/spree/v2/storefront/variant_serializer.rb +1 -1
  178. data/app/serializers/spree/v2/storefront/wished_item_serializer.rb +29 -0
  179. data/app/serializers/spree/v2/storefront/wishlist_serializer.rb +17 -0
  180. data/app/services/spree/webhooks/subscribers/handle_request.rb +73 -0
  181. data/app/services/spree/webhooks/subscribers/make_request.rb +82 -0
  182. data/app/services/spree/webhooks/subscribers/queue_requests.rb +23 -0
  183. data/app/services/spree/webhooks.rb +13 -0
  184. data/config/i18n-tasks.yml +40 -0
  185. data/config/initializers/doorkeeper.rb +12 -12
  186. data/config/locales/en.yml +29 -27
  187. data/config/routes.rb +84 -179
  188. data/db/migrate/20210902162826_create_spree_webhooks_tables.rb +16 -0
  189. data/db/migrate/20210919183228_enable_polymorphic_resource_owner.rb +21 -0
  190. data/db/migrate/20211025162826_create_spree_webhooks_events.rb +14 -0
  191. data/docs/oauth/index.yml +126 -33
  192. data/docs/v2/platform/index.yaml +19696 -1734
  193. data/docs/v2/storefront/index.yaml +15050 -14553
  194. data/lib/spree/api/configuration.rb +11 -0
  195. data/lib/spree/api/dependencies.rb +165 -0
  196. data/lib/spree/api/engine.rb +10 -5
  197. data/lib/spree/api/testing_support/factories/oauth_application_factory.rb +6 -0
  198. data/lib/spree/api/testing_support/factories/webhook_event_factory.rb +27 -0
  199. data/lib/spree/api/testing_support/factories/webhook_subscriber_factory.rb +13 -0
  200. data/lib/spree/api/testing_support/factories.rb +3 -0
  201. data/lib/spree/api/testing_support/jobs.rb +18 -0
  202. data/lib/spree/api/testing_support/matchers/webhooks.rb +67 -0
  203. data/lib/spree/api/testing_support/serializers.rb +25 -0
  204. data/lib/spree/api/testing_support/spree_webhooks.rb +9 -0
  205. data/lib/spree/api/testing_support/v2/base.rb +1 -1
  206. data/lib/spree/api/testing_support/v2/current_order.rb +34 -1
  207. data/lib/spree/api/testing_support/v2/platform_contexts.rb +100 -52
  208. data/lib/spree/api/testing_support/v2/serializers_params.rb +3 -1
  209. data/lib/spree/api.rb +0 -3
  210. data/lib/spree_api.rb +0 -1
  211. data/spec/fixtures/files/icon_256x256.jpg +0 -0
  212. data/spree_api.gemspec +15 -16
  213. metadata +163 -177
  214. data/app/controllers/spree/api/base_controller.rb +0 -171
  215. data/app/controllers/spree/api/errors_controller.rb +0 -9
  216. data/app/controllers/spree/api/v1/addresses_controller.rb +0 -46
  217. data/app/controllers/spree/api/v1/checkouts_controller.rb +0 -106
  218. data/app/controllers/spree/api/v1/classifications_controller.rb +0 -21
  219. data/app/controllers/spree/api/v1/countries_controller.rb +0 -22
  220. data/app/controllers/spree/api/v1/credit_cards_controller.rb +0 -26
  221. data/app/controllers/spree/api/v1/customer_returns_controller.rb +0 -25
  222. data/app/controllers/spree/api/v1/images_controller.rb +0 -58
  223. data/app/controllers/spree/api/v1/inventory_units_controller.rb +0 -54
  224. data/app/controllers/spree/api/v1/line_items_controller.rb +0 -70
  225. data/app/controllers/spree/api/v1/option_types_controller.rb +0 -60
  226. data/app/controllers/spree/api/v1/option_values_controller.rb +0 -62
  227. data/app/controllers/spree/api/v1/orders_controller.rb +0 -160
  228. data/app/controllers/spree/api/v1/payments_controller.rb +0 -82
  229. data/app/controllers/spree/api/v1/product_properties_controller.rb +0 -73
  230. data/app/controllers/spree/api/v1/products_controller.rb +0 -131
  231. data/app/controllers/spree/api/v1/promotions_controller.rb +0 -30
  232. data/app/controllers/spree/api/v1/properties_controller.rb +0 -70
  233. data/app/controllers/spree/api/v1/reimbursements_controller.rb +0 -25
  234. data/app/controllers/spree/api/v1/return_authorizations_controller.rb +0 -70
  235. data/app/controllers/spree/api/v1/shipments_controller.rb +0 -196
  236. data/app/controllers/spree/api/v1/states_controller.rb +0 -36
  237. data/app/controllers/spree/api/v1/stock_items_controller.rb +0 -82
  238. data/app/controllers/spree/api/v1/stock_locations_controller.rb +0 -53
  239. data/app/controllers/spree/api/v1/stock_movements_controller.rb +0 -45
  240. data/app/controllers/spree/api/v1/stores_controller.rb +0 -56
  241. data/app/controllers/spree/api/v1/taxonomies_controller.rb +0 -67
  242. data/app/controllers/spree/api/v1/taxons_controller.rb +0 -100
  243. data/app/controllers/spree/api/v1/users_controller.rb +0 -97
  244. data/app/controllers/spree/api/v1/variants_controller.rb +0 -81
  245. data/app/controllers/spree/api/v1/zones_controller.rb +0 -55
  246. data/app/helpers/spree/api/api_helpers.rb +0 -190
  247. data/app/models/spree/api_configuration.rb +0 -10
  248. data/app/models/spree/api_dependencies.rb +0 -111
  249. data/app/views/spree/api/errors/gateway_error.rabl +0 -2
  250. data/app/views/spree/api/errors/invalid_api_key.rabl +0 -2
  251. data/app/views/spree/api/errors/invalid_resource.rabl +0 -3
  252. data/app/views/spree/api/errors/must_specify_api_key.rabl +0 -2
  253. data/app/views/spree/api/errors/not_found.rabl +0 -2
  254. data/app/views/spree/api/errors/unauthorized.rabl +0 -2
  255. data/app/views/spree/api/v1/addresses/show.rabl +0 -10
  256. data/app/views/spree/api/v1/adjustments/show.rabl +0 -4
  257. data/app/views/spree/api/v1/countries/index.rabl +0 -7
  258. data/app/views/spree/api/v1/countries/show.rabl +0 -5
  259. data/app/views/spree/api/v1/credit_cards/index.rabl +0 -7
  260. data/app/views/spree/api/v1/credit_cards/show.rabl +0 -3
  261. data/app/views/spree/api/v1/customer_returns/index.rabl +0 -7
  262. data/app/views/spree/api/v1/images/index.rabl +0 -4
  263. data/app/views/spree/api/v1/images/new.rabl +0 -3
  264. data/app/views/spree/api/v1/images/show.rabl +0 -6
  265. data/app/views/spree/api/v1/inventory_units/show.rabl +0 -2
  266. data/app/views/spree/api/v1/line_items/new.rabl +0 -3
  267. data/app/views/spree/api/v1/line_items/show.rabl +0 -14
  268. data/app/views/spree/api/v1/option_types/index.rabl +0 -3
  269. data/app/views/spree/api/v1/option_types/new.rabl +0 -3
  270. data/app/views/spree/api/v1/option_types/show.rabl +0 -5
  271. data/app/views/spree/api/v1/option_values/index.rabl +0 -3
  272. data/app/views/spree/api/v1/option_values/new.rabl +0 -3
  273. data/app/views/spree/api/v1/option_values/show.rabl +0 -2
  274. data/app/views/spree/api/v1/orders/address.rabl +0 -0
  275. data/app/views/spree/api/v1/orders/canceled.rabl +0 -0
  276. data/app/views/spree/api/v1/orders/cart.rabl +0 -0
  277. data/app/views/spree/api/v1/orders/complete.rabl +0 -0
  278. data/app/views/spree/api/v1/orders/could_not_apply_coupon.rabl +0 -2
  279. data/app/views/spree/api/v1/orders/could_not_transition.rabl +0 -3
  280. data/app/views/spree/api/v1/orders/index.rabl +0 -7
  281. data/app/views/spree/api/v1/orders/insufficient_quantity.rabl +0 -2
  282. data/app/views/spree/api/v1/orders/invalid_shipping_method.rabl +0 -2
  283. data/app/views/spree/api/v1/orders/mine.rabl +0 -9
  284. data/app/views/spree/api/v1/orders/order.rabl +0 -10
  285. data/app/views/spree/api/v1/orders/payment.rabl +0 -3
  286. data/app/views/spree/api/v1/orders/show.rabl +0 -51
  287. data/app/views/spree/api/v1/payments/credit_over_limit.rabl +0 -2
  288. data/app/views/spree/api/v1/payments/index.rabl +0 -7
  289. data/app/views/spree/api/v1/payments/new.rabl +0 -5
  290. data/app/views/spree/api/v1/payments/show.rabl +0 -2
  291. data/app/views/spree/api/v1/payments/update_forbidden.rabl +0 -2
  292. data/app/views/spree/api/v1/product_properties/index.rabl +0 -7
  293. data/app/views/spree/api/v1/product_properties/new.rabl +0 -2
  294. data/app/views/spree/api/v1/product_properties/show.rabl +0 -2
  295. data/app/views/spree/api/v1/products/index.rabl +0 -9
  296. data/app/views/spree/api/v1/products/new.rabl +0 -3
  297. data/app/views/spree/api/v1/products/product.rabl +0 -1
  298. data/app/views/spree/api/v1/products/show.rabl +0 -36
  299. data/app/views/spree/api/v1/promotions/handler.rabl +0 -5
  300. data/app/views/spree/api/v1/promotions/show.rabl +0 -2
  301. data/app/views/spree/api/v1/properties/index.rabl +0 -7
  302. data/app/views/spree/api/v1/properties/new.rabl +0 -2
  303. data/app/views/spree/api/v1/properties/show.rabl +0 -2
  304. data/app/views/spree/api/v1/reimbursements/index.rabl +0 -7
  305. data/app/views/spree/api/v1/return_authorizations/index.rabl +0 -7
  306. data/app/views/spree/api/v1/return_authorizations/new.rabl +0 -3
  307. data/app/views/spree/api/v1/return_authorizations/show.rabl +0 -2
  308. data/app/views/spree/api/v1/shared/stock_location_required.rabl +0 -2
  309. data/app/views/spree/api/v1/shipments/big.rabl +0 -48
  310. data/app/views/spree/api/v1/shipments/cannot_ready_shipment.rabl +0 -2
  311. data/app/views/spree/api/v1/shipments/mine.rabl +0 -9
  312. data/app/views/spree/api/v1/shipments/show.rabl +0 -32
  313. data/app/views/spree/api/v1/shipments/small.rabl +0 -37
  314. data/app/views/spree/api/v1/shipping_rates/show.rabl +0 -2
  315. data/app/views/spree/api/v1/states/index.rabl +0 -12
  316. data/app/views/spree/api/v1/states/show.rabl +0 -2
  317. data/app/views/spree/api/v1/stock_items/index.rabl +0 -7
  318. data/app/views/spree/api/v1/stock_items/show.rabl +0 -5
  319. data/app/views/spree/api/v1/stock_locations/index.rabl +0 -7
  320. data/app/views/spree/api/v1/stock_locations/show.rabl +0 -8
  321. data/app/views/spree/api/v1/stock_movements/index.rabl +0 -7
  322. data/app/views/spree/api/v1/stock_movements/show.rabl +0 -5
  323. data/app/views/spree/api/v1/stores/index.rabl +0 -4
  324. data/app/views/spree/api/v1/stores/show.rabl +0 -2
  325. data/app/views/spree/api/v1/tags/index.rabl +0 -9
  326. data/app/views/spree/api/v1/taxonomies/index.rabl +0 -7
  327. data/app/views/spree/api/v1/taxonomies/jstree.rabl +0 -7
  328. data/app/views/spree/api/v1/taxonomies/nested.rabl +0 -11
  329. data/app/views/spree/api/v1/taxonomies/new.rabl +0 -3
  330. data/app/views/spree/api/v1/taxonomies/show.rabl +0 -15
  331. data/app/views/spree/api/v1/taxons/index.rabl +0 -10
  332. data/app/views/spree/api/v1/taxons/jstree.rabl +0 -7
  333. data/app/views/spree/api/v1/taxons/new.rabl +0 -3
  334. data/app/views/spree/api/v1/taxons/show.rabl +0 -6
  335. data/app/views/spree/api/v1/taxons/taxons.rabl +0 -5
  336. data/app/views/spree/api/v1/users/index.rabl +0 -7
  337. data/app/views/spree/api/v1/users/new.rabl +0 -3
  338. data/app/views/spree/api/v1/users/show.rabl +0 -11
  339. data/app/views/spree/api/v1/variants/big.rabl +0 -14
  340. data/app/views/spree/api/v1/variants/index.rabl +0 -9
  341. data/app/views/spree/api/v1/variants/new.rabl +0 -2
  342. data/app/views/spree/api/v1/variants/show.rabl +0 -3
  343. data/app/views/spree/api/v1/variants/small.rabl +0 -18
  344. data/app/views/spree/api/v1/zones/index.rabl +0 -7
  345. data/app/views/spree/api/v1/zones/show.rabl +0 -6
  346. data/config/initializers/rabl.rb +0 -9
  347. data/lib/spree/api/controller_setup.rb +0 -19
  348. data/lib/spree/api/responders/rabl_template.rb +0 -28
  349. data/lib/spree/api/responders.rb +0 -11
  350. data/lib/spree/api/testing_support/helpers.rb +0 -44
  351. data/lib/spree/api/testing_support/setup.rb +0 -16
@@ -0,0 +1,11 @@
1
+ module Spree
2
+ module Api
3
+ module V2
4
+ module Platform
5
+ class ShippingCategorySerializer < BaseSerializer
6
+ include ResourceSerializerConcern
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,16 @@
1
+ module Spree
2
+ module Api
3
+ module V2
4
+ module Platform
5
+ class ShippingMethodSerializer < BaseSerializer
6
+ attributes :name, :code, :admin_name, :display_on, :tracking_url, :created_at, :updated_at, :deleted_at, :public_metadata, :private_metadata
7
+
8
+ has_many :shipping_categories
9
+ has_many :shipping_rates
10
+ belongs_to :tax_category
11
+ has_one :calculator
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,15 @@
1
+ module Spree
2
+ module Api
3
+ module V2
4
+ module Platform
5
+ class ShippingRateSerializer < BaseSerializer
6
+ include ResourceSerializerConcern
7
+
8
+ belongs_to :shipment
9
+ belongs_to :tax_rate
10
+ belongs_to :shipping_method
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,10 @@
1
+ module Spree
2
+ module Api
3
+ module V2
4
+ module Platform
5
+ class SideBySideImageSerializer < CmsSectionSerializer
6
+ end
7
+ end
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,11 @@
1
+ module Spree
2
+ module Api
3
+ module V2
4
+ module Platform
5
+ class StandardPageSerializer < CmsPageSerializer
6
+ # Place holder serializer for Webhooks.
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,13 @@
1
+ module Spree
2
+ module Api
3
+ module V2
4
+ module Platform
5
+ class StateChangeSerializer < BaseSerializer
6
+ include ResourceSerializerConcern
7
+
8
+ belongs_to :user
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -3,7 +3,7 @@ module Spree
3
3
  module V2
4
4
  module Platform
5
5
  class StateSerializer < BaseSerializer
6
- include ::Spree::Api::V2::ResourceSerializerConcern
6
+ include ResourceSerializerConcern
7
7
 
8
8
  belongs_to :country
9
9
  end
@@ -3,9 +3,7 @@ module Spree
3
3
  module V2
4
4
  module Platform
5
5
  class StockItemSerializer < BaseSerializer
6
- include ::Spree::Api::V2::ResourceSerializerConcern
7
-
8
- set_type :stock_item
6
+ include ResourceSerializerConcern
9
7
 
10
8
  attribute :is_available do |stock_item|
11
9
  stock_item.available?
@@ -3,12 +3,10 @@ module Spree
3
3
  module V2
4
4
  module Platform
5
5
  class StockLocationSerializer < BaseSerializer
6
- include ::Spree::Api::V2::ResourceSerializerConcern
6
+ include ResourceSerializerConcern
7
7
 
8
8
  attributes :name
9
-
10
- has_many :shipments
11
- has_many :stock_items
9
+ belongs_to :country
12
10
  end
13
11
  end
14
12
  end
@@ -0,0 +1,11 @@
1
+ module Spree
2
+ module Api
3
+ module V2
4
+ module Platform
5
+ class StockMovementSerializer < BaseSerializer
6
+ include ResourceSerializerConcern
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,15 @@
1
+ module Spree
2
+ module Api
3
+ module V2
4
+ module Platform
5
+ class StockTransferSerializer < BaseSerializer
6
+ include ResourceSerializerConcern
7
+
8
+ belongs_to :destination_location, serializer: :stock_location
9
+ belongs_to :source_location, serializer: :stock_location
10
+ has_many :stock_movements
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,12 @@
1
+ module Spree
2
+ module Api
3
+ module V2
4
+ module Platform
5
+ class StoreCreditCategorySerializer < BaseSerializer
6
+ include ResourceSerializerConcern
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end
12
+
@@ -0,0 +1,14 @@
1
+ module Spree
2
+ module Api
3
+ module V2
4
+ module Platform
5
+ class StoreCreditEventSerializer < BaseSerializer
6
+ include ResourceSerializerConcern
7
+
8
+ belongs_to :store_credit
9
+ belongs_to :originator, polymorphic: true
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,18 @@
1
+ module Spree
2
+ module Api
3
+ module V2
4
+ module Platform
5
+ class StoreCreditSerializer < BaseSerializer
6
+ include ResourceSerializerConcern
7
+
8
+ belongs_to :user
9
+ belongs_to :created_by, serializer: :user, type: :user
10
+ belongs_to :store_credit_category, object_method_name: :category, id_method_name: :category_id
11
+ belongs_to :store_credit_type, object_method_name: :credit_type, id_method_name: :type_id
12
+
13
+ has_many :store_credit_events
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,12 @@
1
+ module Spree
2
+ module Api
3
+ module V2
4
+ module Platform
5
+ class StoreCreditTypeSerializer < BaseSerializer
6
+ include ResourceSerializerConcern
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end
12
+
@@ -3,7 +3,8 @@ module Spree
3
3
  module V2
4
4
  module Platform
5
5
  class StoreSerializer < BaseSerializer
6
- include ::Spree::Api::V2::ResourceSerializerConcern
6
+ include ResourceSerializerConcern
7
+ include StoreMediaSerializerImagesConcern
7
8
 
8
9
  has_many :menus
9
10
  has_one :default_country, serializer: :country, record_type: :country, id_method_name: :default_country_id
@@ -3,9 +3,9 @@ module Spree
3
3
  module V2
4
4
  module Platform
5
5
  class TaxCategorySerializer < BaseSerializer
6
- include ::Spree::Api::V2::ResourceSerializerConcern
6
+ include ResourceSerializerConcern
7
7
 
8
- # TODO: add tax_rates
8
+ has_many :tax_rates
9
9
  end
10
10
  end
11
11
  end
@@ -0,0 +1,14 @@
1
+ module Spree
2
+ module Api
3
+ module V2
4
+ module Platform
5
+ class TaxRateSerializer < BaseSerializer
6
+ include ResourceSerializerConcern
7
+
8
+ belongs_to :zone
9
+ belongs_to :tax_category
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
@@ -3,7 +3,7 @@ module Spree
3
3
  module V2
4
4
  module Platform
5
5
  class TaxonSerializer < BaseSerializer
6
- include ::Spree::Api::V2::ResourceSerializerConcern
6
+ include ResourceSerializerConcern
7
7
 
8
8
  attributes :pretty_name, :seo_title
9
9
 
@@ -3,7 +3,7 @@ module Spree
3
3
  module V2
4
4
  module Platform
5
5
  class TaxonomySerializer < BaseSerializer
6
- include ::Spree::Api::V2::ResourceSerializerConcern
6
+ include ResourceSerializerConcern
7
7
 
8
8
  has_many :taxons
9
9
  has_one :root, serializer: :taxon
@@ -5,7 +5,7 @@ module Spree
5
5
  class UserSerializer < BaseSerializer
6
6
  set_type :user
7
7
 
8
- attributes :email, :created_at, :updated_at
8
+ attributes :email, :first_name, :last_name, :created_at, :updated_at, :public_metadata, :private_metadata
9
9
 
10
10
  attribute :average_order_value do |user, params|
11
11
  price_stats(user.report_values_for(:average_order_value, params[:store]))
@@ -3,8 +3,8 @@ module Spree
3
3
  module V2
4
4
  module Platform
5
5
  class VariantSerializer < BaseSerializer
6
- include ::Spree::Api::V2::ResourceSerializerConcern
7
- include ::Spree::Api::V2::DisplayMoneyHelper
6
+ include ResourceSerializerConcern
7
+ include DisplayMoneyHelper
8
8
 
9
9
  attributes :name, :options_text, :total_on_hand
10
10
 
@@ -46,6 +46,7 @@ module Spree
46
46
 
47
47
  belongs_to :product
48
48
  belongs_to :tax_category
49
+ has_many :digitals
49
50
  has_many :images
50
51
  has_many :option_values
51
52
  has_many :stock_items
@@ -0,0 +1,15 @@
1
+ module Spree
2
+ module Api
3
+ module V2
4
+ module Platform
5
+ module Webhooks
6
+ class EventSerializer < BaseSerializer
7
+ include ResourceSerializerConcern
8
+
9
+ belongs_to :subscriber
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,13 @@
1
+ module Spree
2
+ module Api
3
+ module V2
4
+ module Platform
5
+ module Webhooks
6
+ class SubscriberSerializer < BaseSerializer
7
+ include ResourceSerializerConcern
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,29 @@
1
+ module Spree
2
+ module Api
3
+ module V2
4
+ module Platform
5
+ class WishedItemSerializer < BaseSerializer
6
+ include ResourceSerializerConcern
7
+
8
+ attribute :price do |wished_item, params|
9
+ wished_item.price(currency: params[:currency])
10
+ end
11
+
12
+ attribute :total do |wished_item, params|
13
+ wished_item.total(currency: params[:currency])
14
+ end
15
+
16
+ attribute :display_price do |wished_item, params|
17
+ wished_item.display_price(currency: params[:currency]).to_s
18
+ end
19
+
20
+ attribute :display_total do |wished_item, params|
21
+ wished_item.display_total(currency: params[:currency]).to_s
22
+ end
23
+
24
+ belongs_to :variant
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,19 @@
1
+ module Spree
2
+ module Api
3
+ module V2
4
+ module Platform
5
+ class WishlistSerializer < BaseSerializer
6
+ include ResourceSerializerConcern
7
+
8
+ attributes :token
9
+
10
+ attribute :variant_included do |wishlist, params|
11
+ wishlist.include?(params[:is_variant_included])
12
+ end
13
+
14
+ has_many :wished_items
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,13 @@
1
+ module Spree
2
+ module Api
3
+ module V2
4
+ module Platform
5
+ class ZoneMemberSerializer < BaseSerializer
6
+ include ResourceSerializerConcern
7
+
8
+ belongs_to :zoneable, polymorphic: true
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ module Spree
2
+ module Api
3
+ module V2
4
+ module Platform
5
+ class ZoneSerializer < BaseSerializer
6
+ include ResourceSerializerConcern
7
+
8
+ has_many :zone_members
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -5,7 +5,7 @@ module Spree
5
5
  set_type :address
6
6
 
7
7
  attributes :firstname, :lastname, :address1, :address2, :city, :zipcode, :phone, :state_name,
8
- :company, :country_name, :country_iso3, :country_iso, :label
8
+ :company, :country_name, :country_iso3, :country_iso, :label, :public_metadata
9
9
 
10
10
  attribute :state_code do |address|
11
11
  address.state_abbr
@@ -10,7 +10,7 @@ module Spree
10
10
  :display_item_total, :display_ship_total, :display_adjustment_total, :display_tax_total,
11
11
  :promo_total, :display_promo_total, :item_count, :special_instructions, :display_total,
12
12
  :pre_tax_item_amount, :display_pre_tax_item_amount, :pre_tax_total, :display_pre_tax_total,
13
- :shipment_state, :payment_state
13
+ :shipment_state, :payment_state, :public_metadata
14
14
 
15
15
  has_many :line_items
16
16
  has_many :variants
@@ -6,10 +6,10 @@ module Spree
6
6
 
7
7
  attributes :name, :content, :settings, :link, :fit, :type, :position
8
8
 
9
- Spree::CmsSection::IMAGE_COUNT.each do |count|
10
- Spree::CmsSection::IMAGE_SIZE.each do |size|
9
+ Spree::CmsSectionImage::IMAGE_COUNT.each do |count|
10
+ Spree::CmsSectionImage::IMAGE_SIZE.each do |size|
11
11
  attribute "img_#{count}_#{size}".to_sym do |section|
12
- if section.send("image_#{count}").attached? && section.send("img_#{count}_#{size}").present?
12
+ if section.send("image_#{count}")&.attachment&.attached? && section.send("img_#{count}_#{size}").present?
13
13
  url_helpers = Rails.application.routes.url_helpers
14
14
  url_helpers.rails_representation_path(section.send("img_#{count}_#{size}"), only_path: true)
15
15
  end
@@ -21,7 +21,11 @@ module Spree
21
21
  section.fullscreen?
22
22
  end
23
23
 
24
- belongs_to :linked_resource, polymorphic: true
24
+ belongs_to :linked_resource, polymorphic: {
25
+ Spree::Cms::Pages::StandardPage => :cms_page,
26
+ Spree::Cms::Pages::FeaturePage => :cms_page,
27
+ Spree::Cms::Pages::Homepage => :cms_page
28
+ }
25
29
  end
26
30
  end
27
31
  end
@@ -4,7 +4,7 @@ module Spree
4
4
  class CreditCardSerializer < BaseSerializer
5
5
  set_type :credit_card
6
6
 
7
- attributes :cc_type, :last_digits, :month, :year, :name, :default
7
+ attributes :cc_type, :last_digits, :month, :year, :name, :default, :public_metadata
8
8
 
9
9
  belongs_to :payment_method
10
10
  end
@@ -0,0 +1,11 @@
1
+ module Spree
2
+ module V2
3
+ module Storefront
4
+ class DigitalLinkSerializer < BaseSerializer
5
+ set_type :digital_link
6
+
7
+ attribute :token
8
+ end
9
+ end
10
+ end
11
+ end
@@ -13,11 +13,11 @@ module Spree
13
13
  end
14
14
 
15
15
  attributes :display_cost, :display_final_price do |object, params|
16
- Spree::Money.new(object.cost, currency: params[:currency])
16
+ Spree::Money.new(object.cost, currency: params[:currency]).to_s
17
17
  end
18
18
 
19
19
  attribute :display_tax_amount do |object, params|
20
- Spree::Money.new(object.tax_amount, currency: params[:currency])
20
+ Spree::Money.new(object.tax_amount, currency: params[:currency]).to_s
21
21
  end
22
22
 
23
23
  attribute :free do |object|
@@ -10,9 +10,10 @@ module Spree
10
10
  :discounted_amount, :display_discounted_amount,
11
11
  :display_additional_tax_total, :promo_total, :display_promo_total,
12
12
  :included_tax_total, :display_included_tax_total,
13
- :pre_tax_amount, :display_pre_tax_amount
13
+ :pre_tax_amount, :display_pre_tax_amount, :public_metadata
14
14
 
15
15
  belongs_to :variant
16
+ has_many :digital_links
16
17
  end
17
18
  end
18
19
  end
@@ -4,7 +4,7 @@ module Spree
4
4
  class OptionTypeSerializer < BaseSerializer
5
5
  set_type :option_type
6
6
 
7
- attributes :name, :presentation, :position
7
+ attributes :name, :presentation, :position, :public_metadata
8
8
 
9
9
  has_many :option_values
10
10
  end
@@ -4,7 +4,7 @@ module Spree
4
4
  class OptionValueSerializer < BaseSerializer
5
5
  set_type :option_value
6
6
 
7
- attributes :name, :presentation, :position
7
+ attributes :name, :presentation, :position, :public_metadata
8
8
 
9
9
  belongs_to :option_type
10
10
  end
@@ -0,0 +1,9 @@
1
+ module Spree
2
+ module V2
3
+ module Storefront
4
+ class OrderSerializer < CartSerializer
5
+ set_type :order
6
+ end
7
+ end
8
+ end
9
+ end
@@ -4,7 +4,7 @@ module Spree
4
4
  class PaymentMethodSerializer < BaseSerializer
5
5
  set_type :payment_method
6
6
 
7
- attributes :type, :name, :description
7
+ attributes :type, :name, :description, :public_metadata
8
8
 
9
9
  attribute :preferences do |object|
10
10
  object.public_preferences.as_json
@@ -8,7 +8,7 @@ module Spree
8
8
  has_one :payment_method
9
9
 
10
10
  attributes :amount, :response_code, :number, :cvv_response_code, :cvv_response_message,
11
- :payment_method_id, :payment_method_name, :state
11
+ :payment_method_id, :payment_method_name, :state, :public_metadata
12
12
  end
13
13
  end
14
14
  end
@@ -4,7 +4,7 @@ module Spree
4
4
  class ProductPropertySerializer < BaseSerializer
5
5
  set_type :product_property
6
6
 
7
- attribute :value, :filter_param
7
+ attribute :value, :filter_param, :show_property, :position
8
8
 
9
9
  attribute :name do |product_property|
10
10
  product_property.property_name
@@ -6,7 +6,7 @@ module Spree
6
6
 
7
7
  set_type :product
8
8
 
9
- attributes :name, :description, :available_on, :slug, :meta_description, :meta_keywords, :updated_at, :sku
9
+ attributes :name, :description, :available_on, :slug, :meta_description, :meta_keywords, :updated_at, :sku, :barcode, :public_metadata
10
10
 
11
11
  attribute :purchasable do |product|
12
12
  product.purchasable?
@@ -49,7 +49,7 @@ module Spree
49
49
  has_many :product_properties
50
50
 
51
51
  has_many :taxons, serializer: :taxon, record_type: :taxon do |object, params|
52
- object.taxons_for_store(params[:store])
52
+ object.taxons_for_store(params[:store]).order(:id)
53
53
  end
54
54
 
55
55
  # all images from all variants
@@ -5,7 +5,7 @@ module Spree
5
5
  set_id :promotion_id
6
6
  set_type :promotion
7
7
 
8
- attributes :name, :description, :amount, :display_amount, :code
8
+ attributes :name, :description, :amount, :display_amount, :code, :public_metadata
9
9
  end
10
10
  end
11
11
  end
@@ -5,15 +5,19 @@ module Spree
5
5
  set_type :shipment
6
6
 
7
7
  attributes :number, :final_price, :display_final_price,
8
- :state, :shipped_at, :tracking_url
8
+ :state, :shipped_at, :tracking_url, :public_metadata
9
9
 
10
10
  attribute :free do |shipment|
11
11
  shipment.free?
12
12
  end
13
13
 
14
14
  has_many :shipping_rates
15
+ has_one :selected_shipping_rate, serializer: :shipping_rate
15
16
 
16
17
  belongs_to :stock_location
18
+ has_many :line_items do |shipment|
19
+ shipment.line_items
20
+ end
17
21
  end
18
22
  end
19
23
  end
@@ -10,7 +10,7 @@ module Spree
10
10
  id_method_name: :type_id,
11
11
  serializer: :store_credit_type
12
12
 
13
- attributes :amount, :amount_used, :created_at
13
+ attributes :amount, :amount_used, :created_at, :public_metadata
14
14
  end
15
15
  end
16
16
  end