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.
- checksums.yaml +4 -4
- data/app/controllers/spree/api/base_controller.rb +9 -12
- data/app/controllers/spree/api/checkouts_controller.rb +3 -5
- data/app/controllers/spree/api/orders_controller.rb +2 -12
- data/app/controllers/spree/api/payments_controller.rb +0 -1
- data/app/controllers/spree/api/resource_controller.rb +2 -0
- data/app/controllers/spree/api/shipments_controller.rb +17 -6
- data/app/controllers/spree/api/stock_items_controller.rb +6 -0
- data/app/helpers/spree/api/api_helpers.rb +3 -4
- data/app/views/.rubocop.yml +4 -0
- data/app/views/spree/api/address_books/show.json.jbuilder +11 -0
- data/app/views/spree/api/addresses/_address.json.jbuilder +17 -0
- data/app/views/spree/api/addresses/show.json.jbuilder +1 -0
- data/app/views/spree/api/adjustments/_adjustment.json.jbuilder +4 -0
- data/app/views/spree/api/config/money.json.jbuilder +1 -0
- data/app/views/spree/api/config/show.json.jbuilder +2 -0
- data/app/views/spree/api/countries/index.json.jbuilder +2 -0
- data/app/views/spree/api/countries/show.json.jbuilder +4 -0
- data/app/views/spree/api/credit_cards/_credit_card.json.jbuilder +10 -0
- data/app/views/spree/api/credit_cards/index.json.jbuilder +4 -0
- data/app/views/spree/api/credit_cards/show.json.jbuilder +1 -0
- data/app/views/spree/api/errors/delete_restriction.json.jbuilder +1 -0
- data/app/views/spree/api/errors/gateway_error.json.jbuilder +1 -0
- data/app/views/spree/api/errors/invalid_api_key.json.jbuilder +1 -0
- data/app/views/spree/api/errors/invalid_resource.json.jbuilder +2 -0
- data/app/views/spree/api/errors/must_specify_api_key.json.jbuilder +1 -0
- data/app/views/spree/api/errors/not_found.json.jbuilder +1 -0
- data/app/views/spree/api/errors/unauthorized.json.jbuilder +1 -0
- data/app/views/spree/api/errors/variant_not_in_stock_transfer.json.jbuilder +1 -0
- data/app/views/spree/api/images/_image.json.jbuilder +5 -0
- data/app/views/spree/api/images/index.json.jbuilder +3 -0
- data/app/views/spree/api/images/show.json.jbuilder +1 -0
- data/app/views/spree/api/inventory_units/show.json.jbuilder +1 -0
- data/app/views/spree/api/line_items/_line_item.json.jbuilder +16 -0
- data/app/views/spree/api/line_items/new.json.jbuilder +2 -0
- data/app/views/spree/api/line_items/show.json.jbuilder +1 -0
- data/app/views/spree/api/option_types/_option_type.json.jbuilder +4 -0
- data/app/views/spree/api/option_types/index.json.jbuilder +3 -0
- data/app/views/spree/api/option_types/show.json.jbuilder +1 -0
- data/app/views/spree/api/option_values/_option_value.json.jbuilder +1 -0
- data/app/views/spree/api/option_values/index.json.jbuilder +3 -0
- data/app/views/spree/api/option_values/show.json.jbuilder +1 -0
- data/app/views/spree/api/orders/_big.json.jbuilder +49 -0
- data/app/views/spree/api/orders/_order.json.jbuilder +10 -0
- data/app/views/spree/api/orders/could_not_apply_coupon.json.jbuilder +1 -0
- data/app/views/spree/api/orders/could_not_transition.json.jbuilder +2 -0
- data/app/views/spree/api/orders/expected_total_mismatch.json.jbuilder +1 -0
- data/app/views/spree/api/orders/index.json.jbuilder +4 -0
- data/app/views/spree/api/orders/invalid_shipping_method.json.jbuilder +1 -0
- data/app/views/spree/api/orders/mine.json.jbuilder +4 -0
- data/app/views/spree/api/orders/show.json.jbuilder +1 -0
- data/app/views/spree/api/payments/credit_over_limit.json.jbuilder +1 -0
- data/app/views/spree/api/payments/index.json.jbuilder +2 -0
- data/app/views/spree/api/payments/new.json.jbuilder +4 -0
- data/app/views/spree/api/payments/show.json.jbuilder +1 -0
- data/app/views/spree/api/payments/update_forbidden.json.jbuilder +1 -0
- data/app/views/spree/api/product_properties/index.json.jbuilder +4 -0
- data/app/views/spree/api/product_properties/new.json.jbuilder +2 -0
- data/app/views/spree/api/product_properties/show.json.jbuilder +1 -0
- data/app/views/spree/api/products/_product.json.jbuilder +34 -0
- data/app/views/spree/api/products/index.json.jbuilder +4 -0
- data/app/views/spree/api/products/new.json.jbuilder +2 -0
- data/app/views/spree/api/products/show.json.jbuilder +1 -0
- data/app/views/spree/api/promotions/handler.json.jbuilder +4 -0
- data/app/views/spree/api/promotions/show.json.jbuilder +1 -0
- data/app/views/spree/api/properties/index.json.jbuilder +4 -0
- data/app/views/spree/api/properties/new.json.jbuilder +2 -0
- data/app/views/spree/api/properties/show.json.jbuilder +1 -0
- data/app/views/spree/api/return_authorizations/index.json.jbuilder +4 -0
- data/app/views/spree/api/return_authorizations/new.json.jbuilder +2 -0
- data/app/views/spree/api/return_authorizations/show.json.jbuilder +1 -0
- data/app/views/spree/api/shared/_pagination.json.jbuilder +5 -0
- data/app/views/spree/api/shipments/_big.json.jbuilder +51 -0
- data/app/views/spree/api/shipments/_small.json.jbuilder +32 -0
- data/app/views/spree/api/shipments/cannot_ready_shipment.json.jbuilder +1 -0
- data/app/views/spree/api/shipments/mine.json.jbuilder +4 -0
- data/app/views/spree/api/shipments/show.json.jbuilder +31 -0
- data/app/views/spree/api/shipping_rates/_shipping_rate.json.jbuilder +2 -0
- data/app/views/spree/api/states/index.json.jbuilder +5 -0
- data/app/views/spree/api/states/show.json.jbuilder +1 -0
- data/app/views/spree/api/stock_items/_stock_item.json.jbuilder +4 -0
- data/app/views/spree/api/stock_items/index.json.jbuilder +4 -0
- data/app/views/spree/api/stock_items/show.json.jbuilder +1 -0
- data/app/views/spree/api/stock_locations/_stock_location.json.jbuilder +15 -0
- data/app/views/spree/api/stock_locations/index.json.jbuilder +4 -0
- data/app/views/spree/api/stock_locations/show.json.jbuilder +1 -0
- data/app/views/spree/api/stock_movements/_stock_movement.json.jbuilder +4 -0
- data/app/views/spree/api/stock_movements/index.json.jbuilder +4 -0
- data/app/views/spree/api/stock_movements/show.json.jbuilder +1 -0
- data/app/views/spree/api/stock_transfers/receive.json.jbuilder +4 -0
- data/app/views/spree/api/store_credit_events/mine.json.jbuilder +5 -0
- data/app/views/spree/api/stores/index.json.jbuilder +1 -0
- data/app/views/spree/api/stores/show.json.jbuilder +1 -0
- data/app/views/spree/api/taxonomies/_nested.json.jbuilder +8 -0
- data/app/views/spree/api/taxonomies/_taxonomy.json.jbuilder +11 -0
- data/app/views/spree/api/taxonomies/index.json.jbuilder +4 -0
- data/app/views/spree/api/taxonomies/jstree.json.jbuilder +6 -0
- data/app/views/spree/api/taxonomies/new.json.jbuilder +2 -0
- data/app/views/spree/api/taxonomies/show.json.jbuilder +1 -0
- data/app/views/spree/api/taxons/_taxon.json.jbuilder +2 -0
- data/app/views/spree/api/taxons/_taxons.json.jbuilder +4 -0
- data/app/views/spree/api/taxons/index.json.jbuilder +7 -0
- data/app/views/spree/api/taxons/jstree.json.jbuilder +8 -0
- data/app/views/spree/api/taxons/new.json.jbuilder +2 -0
- data/app/views/spree/api/taxons/show.json.jbuilder +1 -0
- data/app/views/spree/api/transfer_items/_transfer_item.json.jbuilder +5 -0
- data/app/views/spree/api/transfer_items/show.json.jbuilder +1 -0
- data/app/views/spree/api/users/_user.json.jbuilder +15 -0
- data/app/views/spree/api/users/index.json.jbuilder +4 -0
- data/app/views/spree/api/users/new.json.jbuilder +2 -0
- data/app/views/spree/api/users/show.json.jbuilder +1 -0
- data/app/views/spree/api/variants/_big.json.jbuilder +13 -0
- data/app/views/spree/api/variants/_small.json.jbuilder +16 -0
- data/app/views/spree/api/variants/index.json.jbuilder +4 -0
- data/app/views/spree/api/variants/new.json.jbuilder +2 -0
- data/app/views/spree/api/variants/show.json.jbuilder +1 -0
- data/app/views/spree/api/zones/_zone.json.jbuilder +4 -0
- data/app/views/spree/api/zones/index.json.jbuilder +4 -0
- data/app/views/spree/api/zones/show.json.jbuilder +1 -0
- data/config/locales/en.yml +1 -0
- data/lib/spree/api/engine.rb +0 -14
- data/lib/spree/api.rb +1 -1
- data/lib/spree_api.rb +1 -0
- data/solidus_api.gemspec +3 -1
- data/spec/controllers/spree/api/base_controller_spec.rb +0 -56
- data/spec/requests/spree/api/checkouts_controller_spec.rb +8 -13
- data/spec/requests/spree/api/orders_controller_spec.rb +7 -60
- data/spec/requests/spree/api/payments_controller_spec.rb +0 -11
- data/spec/requests/spree/api/shipments_controller_spec.rb +16 -1
- data/spec/requests/spree/api/states_controller_spec.rb +1 -0
- data/spec/requests/spree/api/taxons_controller_spec.rb +25 -0
- data/spec/requests/spree/api/users_controller_spec.rb +1 -1
- data/spec/support/be_paginated_matcher.rb +7 -0
- data/spec/test_views/spree/api/widgets/_widget.json.jbuilder +1 -0
- data/spec/test_views/spree/api/widgets/index.json.jbuilder +7 -0
- data/spec/test_views/spree/api/widgets/new.json.jbuilder +1 -0
- data/spec/test_views/spree/api/widgets/show.json.jbuilder +1 -0
- metadata +166 -111
- data/app/views/spree/api/address_books/show.v1.rabl +0 -7
- data/app/views/spree/api/addresses/show.v1.rabl +0 -10
- data/app/views/spree/api/adjustments/show.v1.rabl +0 -4
- data/app/views/spree/api/config/money.v1.rabl +0 -2
- data/app/views/spree/api/config/show.v1.rabl +0 -3
- data/app/views/spree/api/countries/index.v1.rabl +0 -7
- data/app/views/spree/api/countries/show.v1.rabl +0 -5
- data/app/views/spree/api/credit_cards/index.v1.rabl +0 -7
- data/app/views/spree/api/credit_cards/show.v1.rabl +0 -7
- data/app/views/spree/api/errors/gateway_error.v1.rabl +0 -2
- data/app/views/spree/api/errors/invalid_api_key.v1.rabl +0 -2
- data/app/views/spree/api/errors/invalid_resource.v1.rabl +0 -3
- data/app/views/spree/api/errors/must_specify_api_key.v1.rabl +0 -2
- data/app/views/spree/api/errors/not_found.v1.rabl +0 -2
- data/app/views/spree/api/errors/unauthorized.v1.rabl +0 -2
- data/app/views/spree/api/errors/variant_not_in_stock_transfer.v1.rabl +0 -2
- data/app/views/spree/api/images/index.v1.rabl +0 -4
- data/app/views/spree/api/images/show.v1.rabl +0 -6
- data/app/views/spree/api/inventory_units/show.rabl +0 -2
- data/app/views/spree/api/line_items/new.v1.rabl +0 -3
- data/app/views/spree/api/line_items/show.v1.rabl +0 -15
- data/app/views/spree/api/option_types/index.v1.rabl +0 -3
- data/app/views/spree/api/option_types/show.v1.rabl +0 -5
- data/app/views/spree/api/option_values/index.v1.rabl +0 -3
- data/app/views/spree/api/option_values/show.v1.rabl +0 -2
- data/app/views/spree/api/orders/could_not_apply_coupon.v1.rabl +0 -2
- data/app/views/spree/api/orders/could_not_transition.v1.rabl +0 -3
- data/app/views/spree/api/orders/expected_total_mismatch.v1.rabl +0 -2
- data/app/views/spree/api/orders/index.v1.rabl +0 -7
- data/app/views/spree/api/orders/invalid_shipping_method.v1.rabl +0 -2
- data/app/views/spree/api/orders/mine.v1.rabl +0 -9
- data/app/views/spree/api/orders/order.v1.rabl +0 -9
- data/app/views/spree/api/orders/show.v1.rabl +0 -53
- data/app/views/spree/api/payments/credit_over_limit.v1.rabl +0 -2
- data/app/views/spree/api/payments/index.v1.rabl +0 -7
- data/app/views/spree/api/payments/new.v1.rabl +0 -5
- data/app/views/spree/api/payments/show.v1.rabl +0 -2
- data/app/views/spree/api/payments/update_forbidden.v1.rabl +0 -2
- data/app/views/spree/api/product_properties/index.v1.rabl +0 -7
- data/app/views/spree/api/product_properties/new.v1.rabl +0 -2
- data/app/views/spree/api/product_properties/show.v1.rabl +0 -2
- data/app/views/spree/api/products/index.v1.rabl +0 -9
- data/app/views/spree/api/products/new.v1.rabl +0 -3
- data/app/views/spree/api/products/product.v1.rabl +0 -1
- data/app/views/spree/api/products/show.v1.rabl +0 -42
- data/app/views/spree/api/promotions/handler.v1.rabl +0 -5
- data/app/views/spree/api/promotions/show.v1.rabl +0 -2
- data/app/views/spree/api/properties/index.v1.rabl +0 -7
- data/app/views/spree/api/properties/new.v1.rabl +0 -2
- data/app/views/spree/api/properties/show.v1.rabl +0 -2
- data/app/views/spree/api/return_authorizations/index.v1.rabl +0 -7
- data/app/views/spree/api/return_authorizations/new.v1.rabl +0 -3
- data/app/views/spree/api/return_authorizations/show.v1.rabl +0 -2
- data/app/views/spree/api/shipments/big.v1.rabl +0 -55
- data/app/views/spree/api/shipments/cannot_ready_shipment.v1.rabl +0 -2
- data/app/views/spree/api/shipments/mine.v1.rabl +0 -9
- data/app/views/spree/api/shipments/show.v1.rabl +0 -32
- data/app/views/spree/api/shipments/small.v1.rabl +0 -37
- data/app/views/spree/api/shipping_rates/show.v1.rabl +0 -2
- data/app/views/spree/api/states/index.v1.rabl +0 -14
- data/app/views/spree/api/states/show.v1.rabl +0 -2
- data/app/views/spree/api/stock_items/index.v1.rabl +0 -7
- data/app/views/spree/api/stock_items/show.v1.rabl +0 -5
- data/app/views/spree/api/stock_locations/index.v1.rabl +0 -7
- data/app/views/spree/api/stock_locations/show.v1.rabl +0 -8
- data/app/views/spree/api/stock_movements/index.v1.rabl +0 -7
- data/app/views/spree/api/stock_movements/show.v1.rabl +0 -5
- data/app/views/spree/api/stock_transfers/receive.v1.rabl +0 -5
- data/app/views/spree/api/store_credit_events/mine.v1.rabl +0 -10
- data/app/views/spree/api/stores/index.v1.rabl +0 -4
- data/app/views/spree/api/stores/show.v1.rabl +0 -2
- data/app/views/spree/api/taxonomies/index.v1.rabl +0 -7
- data/app/views/spree/api/taxonomies/jstree.rabl +0 -8
- data/app/views/spree/api/taxonomies/nested.v1.rabl +0 -11
- data/app/views/spree/api/taxonomies/new.v1.rabl +0 -3
- data/app/views/spree/api/taxonomies/show.v1.rabl +0 -15
- data/app/views/spree/api/taxons/index.v1.rabl +0 -12
- data/app/views/spree/api/taxons/jstree.rabl +0 -8
- data/app/views/spree/api/taxons/new.v1.rabl +0 -3
- data/app/views/spree/api/taxons/show.v1.rabl +0 -6
- data/app/views/spree/api/taxons/taxons.v1.rabl +0 -5
- data/app/views/spree/api/transfer_items/show.v1.rabl +0 -6
- data/app/views/spree/api/users/index.v1.rabl +0 -7
- data/app/views/spree/api/users/new.v1.rabl +0 -3
- data/app/views/spree/api/users/show.v1.rabl +0 -10
- data/app/views/spree/api/variants/big.v1.rabl +0 -20
- data/app/views/spree/api/variants/index.v1.rabl +0 -9
- data/app/views/spree/api/variants/new.v1.rabl +0 -2
- data/app/views/spree/api/variants/show.v1.rabl +0 -3
- data/app/views/spree/api/variants/small.v1.rabl +0 -17
- data/app/views/spree/api/zones/index.v1.rabl +0 -7
- data/app/views/spree/api/zones/show.v1.rabl +0 -6
- data/config/initializers/rails5_rabl_hacks.rb +0 -12
- data/spec/test_views/spree/api/widgets/index.v1.rabl +0 -7
- data/spec/test_views/spree/api/widgets/new.v1.rabl +0 -2
- data/spec/test_views/spree/api/widgets/show.v1.rabl +0 -2
@@ -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,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,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,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 +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,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,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,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,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,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 }
|