spree_api 5.1.0.beta4 → 5.1.0.rc1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/controllers/spree/api/v2/platform/gift_cards_controller.rb +19 -0
- data/app/controllers/spree/api/v2/platform/users_controller.rb +5 -0
- data/app/serializers/spree/api/v2/platform/gift_card_serializer.rb +17 -0
- data/app/serializers/spree/v2/storefront/cart_serializer.rb +1 -0
- data/app/serializers/spree/v2/storefront/gift_card_serializer.rb +14 -0
- data/config/locales/en.yml +3 -0
- data/config/routes.rb +3 -0
- data/lib/spree/api/dependencies.rb +4 -0
- metadata +9 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a0f927e718e33bb6fd02e6700486268417da7fa69705112444a289cd2e0f6c02
|
4
|
+
data.tar.gz: 8882e1d01b9a4d13c2f53a7f59a965d9a82de59cc7b81d299c51e36d7f7e2a82
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a2cd84be93d0300cd3cb45a0093c70e373d725c7ada5bf9772931321b5c5a9e7b347fb29109e9d78d3a3f5ee5ade0e507e624695ddd5382a9b3e8a1a3fa20634
|
7
|
+
data.tar.gz: 7be8feeea237ce2247fa9ecb02a629342fb802a3351ec703f0b376aed4b729d63eba16a939ad6eebc62a7e5ab2bb96d4b5bcfd7dd03dc3e0cb30f08eb9ef1e64
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Spree
|
2
|
+
module Api
|
3
|
+
module V2
|
4
|
+
module Platform
|
5
|
+
class GiftCardsController < ResourceController
|
6
|
+
private
|
7
|
+
|
8
|
+
def model_class
|
9
|
+
Spree::GiftCard
|
10
|
+
end
|
11
|
+
|
12
|
+
def permitted_resource_params
|
13
|
+
params.require(:gift_card).permit(permitted_gift_card_attributes)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -25,6 +25,11 @@ module Spree
|
|
25
25
|
def spree_permitted_attributes
|
26
26
|
super + [:password, :password_confirmation]
|
27
27
|
end
|
28
|
+
|
29
|
+
# we need to override this method to avoid trying to create user role when creating a user
|
30
|
+
def ensure_current_store(_resource)
|
31
|
+
# do nothing
|
32
|
+
end
|
28
33
|
end
|
29
34
|
end
|
30
35
|
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module Spree
|
2
|
+
module V2
|
3
|
+
module Storefront
|
4
|
+
class GiftCardSerializer < BaseSerializer
|
5
|
+
set_type :gift_card
|
6
|
+
|
7
|
+
attributes :amount, :amount_used, :amount_remaining, :display_amount, :display_amount_used,
|
8
|
+
:display_amount_remaining, :expires_at
|
9
|
+
|
10
|
+
attribute :code, &:display_code
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
data/config/locales/en.yml
CHANGED
@@ -29,6 +29,9 @@ en:
|
|
29
29
|
digitals:
|
30
30
|
missing_file: 'Missing Digital Item: attachment'
|
31
31
|
unauthorized: Error, you are not authorized to access this asset
|
32
|
+
gift_card:
|
33
|
+
amount_not_valid: Gift card amount is not valid
|
34
|
+
not_found: Gift card is not found
|
32
35
|
metadata:
|
33
36
|
invalid_params: Public and private metadata parameters should be objects
|
34
37
|
wishlist:
|
data/config/routes.rb
CHANGED
@@ -32,6 +32,10 @@ module Spree
|
|
32
32
|
storefront_checkout_get_shipping_rates_service: -> { Spree::Dependencies.checkout_get_shipping_rates_service },
|
33
33
|
storefront_checkout_select_shipping_method_service: -> { Spree::Dependencies.checkout_select_shipping_method_service },
|
34
34
|
|
35
|
+
# gift cards
|
36
|
+
storefront_gift_card_apply_service: -> { Spree::Dependencies.gift_card_apply_service },
|
37
|
+
storefront_gift_card_remove_service: -> { Spree::Dependencies.gift_card_remove_service },
|
38
|
+
|
35
39
|
# account services
|
36
40
|
storefront_account_create_service: -> { Spree::Dependencies.account_create_service },
|
37
41
|
storefront_account_update_service: -> { Spree::Dependencies.account_update_service },
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.1.0.
|
4
|
+
version: 5.1.0.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Bigg
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2025-
|
13
|
+
date: 2025-07-02 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: jsonapi-rspec
|
@@ -102,14 +102,14 @@ dependencies:
|
|
102
102
|
requirements:
|
103
103
|
- - '='
|
104
104
|
- !ruby/object:Gem::Version
|
105
|
-
version: 5.1.0.
|
105
|
+
version: 5.1.0.rc1
|
106
106
|
type: :runtime
|
107
107
|
prerelease: false
|
108
108
|
version_requirements: !ruby/object:Gem::Requirement
|
109
109
|
requirements:
|
110
110
|
- - '='
|
111
111
|
- !ruby/object:Gem::Version
|
112
|
-
version: 5.1.0.
|
112
|
+
version: 5.1.0.rc1
|
113
113
|
description: Spree's API
|
114
114
|
email:
|
115
115
|
- hello@spreecommerce.org
|
@@ -137,6 +137,7 @@ files:
|
|
137
137
|
- app/controllers/spree/api/v2/platform/data_feeds_controller.rb
|
138
138
|
- app/controllers/spree/api/v2/platform/digital_links_controller.rb
|
139
139
|
- app/controllers/spree/api/v2/platform/digitals_controller.rb
|
140
|
+
- app/controllers/spree/api/v2/platform/gift_cards_controller.rb
|
140
141
|
- app/controllers/spree/api/v2/platform/line_items_controller.rb
|
141
142
|
- app/controllers/spree/api/v2/platform/option_types_controller.rb
|
142
143
|
- app/controllers/spree/api/v2/platform/option_values_controller.rb
|
@@ -225,6 +226,7 @@ files:
|
|
225
226
|
- app/serializers/spree/api/v2/platform/data_feed_serializer.rb
|
226
227
|
- app/serializers/spree/api/v2/platform/digital_link_serializer.rb
|
227
228
|
- app/serializers/spree/api/v2/platform/digital_serializer.rb
|
229
|
+
- app/serializers/spree/api/v2/platform/gift_card_serializer.rb
|
228
230
|
- app/serializers/spree/api/v2/platform/image_serializer.rb
|
229
231
|
- app/serializers/spree/api/v2/platform/inventory_unit_serializer.rb
|
230
232
|
- app/serializers/spree/api/v2/platform/line_item_serializer.rb
|
@@ -291,6 +293,7 @@ files:
|
|
291
293
|
- app/serializers/spree/v2/storefront/credit_card_serializer.rb
|
292
294
|
- app/serializers/spree/v2/storefront/digital_link_serializer.rb
|
293
295
|
- app/serializers/spree/v2/storefront/estimated_shipping_rate_serializer.rb
|
296
|
+
- app/serializers/spree/v2/storefront/gift_card_serializer.rb
|
294
297
|
- app/serializers/spree/v2/storefront/image_serializer.rb
|
295
298
|
- app/serializers/spree/v2/storefront/line_item_serializer.rb
|
296
299
|
- app/serializers/spree/v2/storefront/option_type_serializer.rb
|
@@ -364,9 +367,9 @@ licenses:
|
|
364
367
|
- BSD-3-Clause
|
365
368
|
metadata:
|
366
369
|
bug_tracker_uri: https://github.com/spree/spree/issues
|
367
|
-
changelog_uri: https://github.com/spree/spree/releases/tag/v5.1.0.
|
370
|
+
changelog_uri: https://github.com/spree/spree/releases/tag/v5.1.0.rc1
|
368
371
|
documentation_uri: https://docs.spreecommerce.org/
|
369
|
-
source_code_uri: https://github.com/spree/spree/tree/v5.1.0.
|
372
|
+
source_code_uri: https://github.com/spree/spree/tree/v5.1.0.rc1
|
370
373
|
post_install_message:
|
371
374
|
rdoc_options: []
|
372
375
|
require_paths:
|