From 72606fe5d23b2ef6cb630d6dcd9926ecb5b2b5af Mon Sep 17 00:00:00 2001 From: k4th Date: Thu, 15 Aug 2024 07:51:52 +0200 Subject: [PATCH 1/9] Add tests --- Gemfile | 2 + Gemfile.lock | 24 +- bin/console | 3 - lib/beyond_api/concerns/connection.rb | 9 + .../services/product_management/category.rb | 16 ++ .../services/authentication/token_spec.rb | 32 +++ .../product_management/category_spec.rb | 71 +++++ spec/spec_helper.rb | 15 +- spec/support/vcr.rb | 41 +++ .../refreshes_the_token.yml | 67 +++++ ...retrieves_token_via_authorization_code.yml | 61 +++++ ...retrieves_token_via_client_credentials.yml | 66 +++++ .../_all/returns_all_categories.yml | 150 ++++++++++ .../_create/creates_a_new_category.yml | 187 +++++++++++++ .../_destroy/deletes_a_category.yml | 247 +++++++++++++++++ .../_find/returns_a_category.yml | 256 ++++++++++++++++++ .../_update/updates_an_existing_category.yml | 256 ++++++++++++++++++ 17 files changed, 1482 insertions(+), 21 deletions(-) create mode 100644 spec/beyond_api/services/authentication/token_spec.rb create mode 100644 spec/beyond_api/services/product_management/category_spec.rb create mode 100644 spec/support/vcr.rb create mode 100644 spec/vcr_cassettes/BeyondApi_Authentication_Token/refreshes_the_token.yml create mode 100644 spec/vcr_cassettes/BeyondApi_Authentication_Token/retrieves_token_via_authorization_code.yml create mode 100644 spec/vcr_cassettes/BeyondApi_Authentication_Token/retrieves_token_via_client_credentials.yml create mode 100644 spec/vcr_cassettes/BeyondApi_ProductManagement_Category/_all/returns_all_categories.yml create mode 100644 spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_create/creates_a_new_category.yml create mode 100644 spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_destroy/deletes_a_category.yml create mode 100644 spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_find/returns_a_category.yml create mode 100644 spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_update/updates_an_existing_category.yml diff --git a/Gemfile b/Gemfile index cd70397..a46f237 100644 --- a/Gemfile +++ b/Gemfile @@ -13,5 +13,7 @@ end group :test do gem "factory_bot" + gem "jwt" + gem "vcr" gem "webmock" end diff --git a/Gemfile.lock b/Gemfile.lock index 89fcb53..9ea306e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -10,23 +10,24 @@ PATH GEM remote: https://rubygems.org/ specs: - activesupport (7.1.3.4) + activesupport (7.2.0) base64 bigdecimal - concurrent-ruby (~> 1.0, >= 1.0.2) + concurrent-ruby (~> 1.0, >= 1.3.1) connection_pool (>= 2.2.5) drb i18n (>= 1.6, < 2) + logger (>= 1.4.2) minitest (>= 5.1) - mutex_m - tzinfo (~> 2.0) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) addressable (2.8.7) public_suffix (>= 2.0.2, < 7.0) ast (2.4.2) base64 (0.2.0) bigdecimal (3.1.8) coderay (1.1.3) - concurrent-ruby (1.3.3) + concurrent-ruby (1.3.4) connection_pool (2.4.1) crack (1.0.0) bigdecimal @@ -49,15 +50,16 @@ GEM i18n (1.14.5) concurrent-ruby (~> 1.0) json (2.7.2) + jwt (2.8.2) + base64 language_server-protocol (3.17.0.3) logger (1.6.0) method_source (1.1.0) minitest (5.24.1) - mutex_m (0.2.0) net-http (0.4.1) uri - parallel (1.25.1) - parser (3.3.4.0) + parallel (1.26.2) + parser (3.3.4.2) ast (~> 2.4.1) racc pry (0.14.2) @@ -68,7 +70,7 @@ GEM rainbow (3.1.1) rake (10.5.0) regexp_parser (2.9.2) - rexml (3.3.4) + rexml (3.3.5) strscan rspec (3.13.0) rspec-core (~> 3.13.0) @@ -108,11 +110,13 @@ GEM rubocop-rspec_rails (2.29.1) rubocop (~> 1.61) ruby-progressbar (1.13.0) + securerandom (0.3.1) strscan (3.1.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) unicode-display_width (2.5.0) uri (0.13.0) + vcr (6.2.0) webmock (3.23.1) addressable (>= 2.8.0) crack (>= 0.3.2) @@ -130,11 +134,13 @@ DEPENDENCIES dotenv (~> 2.7) factory_bot faker (~> 2.2) + jwt pry rake (~> 10.0) rspec (~> 3.0) rubocop rubocop-rspec (~> 2.4) + vcr webmock yard (~> 0.9) diff --git a/bin/console b/bin/console index ce7d2fa..89df3af 100755 --- a/bin/console +++ b/bin/console @@ -9,9 +9,6 @@ unless ENV["CLIENT_ID"].nil? && ENV["CLIENT_SECRET"].nil? BeyondApi.setup do |config| config.client_id = ENV["CLIENT_ID"] config.client_secret = ENV["CLIENT_SECRET"] - config.remove_response_links = true - config.remove_response_key_underscores = true - config.object_struct_responses = false end end diff --git a/lib/beyond_api/concerns/connection.rb b/lib/beyond_api/concerns/connection.rb index 8bdd68e..806a3b9 100644 --- a/lib/beyond_api/concerns/connection.rb +++ b/lib/beyond_api/concerns/connection.rb @@ -10,6 +10,15 @@ def get(path, params = {}) handle_request { agent.get(path, parse_request(params)) } end + def put(path, body = {}, params = {}) + handle_request do + agent.put(path, body) do |request| + request.params = parse_request(params) + request.body = parse_request(body) + end + end + end + def post(path, body = {}, params = {}) handle_request do agent.post(path, body) do |request| diff --git a/lib/beyond_api/services/product_management/category.rb b/lib/beyond_api/services/product_management/category.rb index a2c4058..8e27ebe 100644 --- a/lib/beyond_api/services/product_management/category.rb +++ b/lib/beyond_api/services/product_management/category.rb @@ -4,6 +4,22 @@ class Category < BaseService def find(id) get("categories/#{id}") end + + def all(params = {}) + fetch_all_pages("categories", params) + end + + def create(body) + post("categories", body) + end + + def update(id, body) + put("categories/#{id}", body) + end + + def destroy(id) + delete("categories/#{id}") + end end end end diff --git a/spec/beyond_api/services/authentication/token_spec.rb b/spec/beyond_api/services/authentication/token_spec.rb new file mode 100644 index 0000000..388a5be --- /dev/null +++ b/spec/beyond_api/services/authentication/token_spec.rb @@ -0,0 +1,32 @@ +RSpec.describe 'BeyondApi::Authentication::Token', vcr: true do + let(:client) do + BeyondApi::Authentication::Token.new( + api_url: ENV["API_URL"], + client_id: ENV["CLIENT_ID"], + client_secret: ENV["CLIENT_SECRET"] + ) + end + + it "retrieves token via client credentials" do + response = client.client_credentials + expect(response).not_to be nil + expect(response[:access_token].class).to be(String) + expect(response[:refresh_token]).to be(nil) + end + + it "retrieves token via authorization code" do + expect { + response = client.get('abcde') + }.to raise_error(BeyondApi::Error) do |error| + expect(error.response[:error]).to eq("invalid_grant") + expect(error.response[:error_description]).to eq("Invalid authorization code: abcde") + end + end + + it "refreshes the token" do + response = client.refresh(ENV["REFRESH_TOKEN"]) + expect(response).not_to be nil + expect(response[:access_token].class).to be(String) + expect(response[:refresh_token].class).to be(String) + end +end diff --git a/spec/beyond_api/services/product_management/category_spec.rb b/spec/beyond_api/services/product_management/category_spec.rb new file mode 100644 index 0000000..af4eb5a --- /dev/null +++ b/spec/beyond_api/services/product_management/category_spec.rb @@ -0,0 +1,71 @@ +RSpec.describe 'BeyondApi::ProductManagement::Category', vcr: true do + before do + @client = BeyondApi::ProductManagement::Category.new( + api_url: ENV["API_URL"], + access_token: auth_client.client_credentials[:access_token] + ) + end + + describe ".all" do + it "returns all categories" do + response = @client.all + + expect(response).not_to be nil + expect(response.dig(:embedded, :categories)).to be_kind_of(Array) + expect(response.dig(:page)).to be_kind_of(Hash) + end + end + + context "with category" do + before(:each) do + @category = @client.create( + name: "Team42 Category", + type: "SMART", + default_sort: "HIGHEST_PRICE_FIRST" + ) + end + + describe ".find" do + it "returns a category" do + response = @client.find(@category[:id]) + expect(response[:name]).to eq("Team42 Category") + end + end + + describe ".create" do + it "creates a new category" do + expect(@category).not_to be nil + expect(@category[:name]).to eq("Team42 Category") + expect(@category[:type]).to eq("SMART") + expect(@category[:default_sort]).to eq("HIGHEST_PRICE_FIRST") + end + end + + describe ".update" do + it "updates an existing category" do + updated_category_data = { + name: "Updated Test Category", + type: "SMART", + default_sort: "LOWEST_PRICE_FIRST" + } + + updated_category = @client.update(@category[:id], updated_category_data) + expect(updated_category).not_to be nil + expect(updated_category[:name]).to eq("Updated Test Category") + expect(updated_category[:default_sort]).to eq("LOWEST_PRICE_FIRST") + end + end + + describe ".destroy" do + it "deletes a category" do + response = @client.destroy(@category[:id]) + expect(response).to be {} + end + end + + after(:each) do + @client.destroy(@category[:id]) + rescue BeyondApi::Error + end + end +end \ No newline at end of file diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index aababc9..fdee6d3 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -22,15 +22,9 @@ FactoryBot.find_definitions end - config.after(:suite) do - session = BeyondApi::Session.new(api_url: ENV["SHOP_URL"]) - session.token.client_credentials - - products = session.products.all - products.embedded.products.each do |product| - session.products.delete(product.id) - end - end + AppRoot = File.expand_path(File.dirname("vcr.rb")) + + load "#{AppRoot}/spec/support/vcr.rb" end BeyondApi.setup do |config| @@ -38,3 +32,6 @@ config.client_secret = ENV["CLIENT_SECRET"] end +def auth_client + BeyondApi::Authentication::Token.new(api_url: ENV["API_URL"]) +end diff --git a/spec/support/vcr.rb b/spec/support/vcr.rb new file mode 100644 index 0000000..a64f116 --- /dev/null +++ b/spec/support/vcr.rb @@ -0,0 +1,41 @@ +require "jwt" +require "vcr" + +VCR.configure do |config| + config.cassette_library_dir = "spec/vcr_cassettes" + config.hook_into :webmock + config.configure_rspec_metadata! + config.ignore_localhost = true + config.default_cassette_options = { + match_requests_on: [ :method, :uri, :body ] + } + + config.filter_sensitive_data("") do |interaction| + authorizations = interaction.request.headers["Authorization"].first + if (match = authorizations.match(/^(Bearer|Basic)\s+([^,\s]+)/)) + match.captures.last + end + end + + config.filter_sensitive_data("") do |interaction| + response_body = JSON.parse(interaction.response.body) + response_body["access_token"] if response_body.is_a?(Hash) + rescue JSON::ParserError + nil + end + + config.filter_sensitive_data("") do |interaction| + response_body = JSON.parse(interaction.response.body) + response_body["refresh_token"] if response_body.is_a?(Hash) + rescue JSON::ParserError + nil + end + + config.filter_sensitive_data("") do |interaction| + ENV["REFRESH_TOKEN"] + end + + config.filter_sensitive_data("") do |interaction| + JWT.encode({ exp: (DateTime.now + 1.year).to_i }, nil, "HS256") + end +end diff --git a/spec/vcr_cassettes/BeyondApi_Authentication_Token/refreshes_the_token.yml b/spec/vcr_cassettes/BeyondApi_Authentication_Token/refreshes_the_token.yml new file mode 100644 index 0000000..2b60320 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Authentication_Token/refreshes_the_token.yml @@ -0,0 +1,67 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=refresh_token&refresh_token= + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 15 Aug 2024 05:50:20 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.075' + X-B3-Traceid: + - c18d2bd93a06719e6588e4467bb349ee + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "refresh_token" : "", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1723701020, + "jti" : "PmaCtIyee05EfeXa+hPsFx9lHNA=" + } + recorded_at: Thu, 15 Aug 2024 05:50:20 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Authentication_Token/retrieves_token_via_authorization_code.yml b/spec/vcr_cassettes/BeyondApi_Authentication_Token/retrieves_token_via_authorization_code.yml new file mode 100644 index 0000000..cf69795 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Authentication_Token/retrieves_token_via_authorization_code.yml @@ -0,0 +1,61 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?code=abcde&grant_type=authorization_code + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 400 + message: Bad Request + headers: + Date: + - Thu, 15 Aug 2024 05:50:20 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.044' + X-B3-Traceid: + - 7b2e726e3d43a71295be89159def3075 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "error" : "invalid_grant", + "error_description" : "Invalid authorization code: abcde" + } + recorded_at: Thu, 15 Aug 2024 05:50:20 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Authentication_Token/retrieves_token_via_client_credentials.yml b/spec/vcr_cassettes/BeyondApi_Authentication_Token/retrieves_token_via_client_credentials.yml new file mode 100644 index 0000000..0fc99a4 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Authentication_Token/retrieves_token_via_client_credentials.yml @@ -0,0 +1,66 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 15 Aug 2024 05:50:19 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.095' + X-B3-Traceid: + - 1d24f62f4177873de211bb403233304f + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1723701019, + "jti" : "Dh7TEvFcW6H+YC4g0EK6QMBXpRk=" + } + recorded_at: Thu, 15 Aug 2024 05:50:19 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/_all/returns_all_categories.yml b/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/_all/returns_all_categories.yml new file mode 100644 index 0000000..96dbf5e --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/_all/returns_all_categories.yml @@ -0,0 +1,150 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 15 Aug 2024 05:50:20 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.082' + X-B3-Traceid: + - 7ff3e2bf420f231962f1e03701b7fb4c + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1723701020, + "jti" : "AzUxPPnMSDVwQzlYwq21RqK7Hhc=" + } + recorded_at: Thu, 15 Aug 2024 05:50:20 GMT +- request: + method: get + uri: https://team42-beyond-api.beyondshop.cloud/api/categories + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 15 Aug 2024 05:50:20 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.033' + X-B3-Traceid: + - ab0c4f8b027b155f7625393937bc7f5b + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_embedded" : { + "categories" : [ { + "_id" : "8a4a8f6a-e3d9-4616-9e89-12c42c084534", + "name" : "DO-NOT-DELETE Category", + "type" : "SMART", + "defaultSort" : "HIGHEST_PRICE_FIRST", + "filters" : [ ], + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories/8a4a8f6a-e3d9-4616-9e89-12c42c084534" + }, + "category" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories/8a4a8f6a-e3d9-4616-9e89-12c42c084534" + } + } + } ] + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories?page=0&size=20" + } + }, + "page" : { + "size" : 20, + "totalElements" : 1, + "totalPages" : 1, + "number" : 0 + } + } + recorded_at: Thu, 15 Aug 2024 05:50:20 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_create/creates_a_new_category.yml b/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_create/creates_a_new_category.yml new file mode 100644 index 0000000..3dc82e0 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_create/creates_a_new_category.yml @@ -0,0 +1,187 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 15 Aug 2024 05:50:21 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.073' + X-B3-Traceid: + - 372d3ca1e7683a3f7c09cc397164562d + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1723701021, + "jti" : "so7eqPGyCHGcPK7pPPAplw2rfs8=" + } + recorded_at: Thu, 15 Aug 2024 05:50:21 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/categories + body: + encoding: UTF-8 + string: '{"name":"Team42 Category","type":"SMART","defaultSort":"HIGHEST_PRICE_FIRST"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Thu, 15 Aug 2024 05:50:21 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/categories/858904b2-b10e-41ce-8f7b-f45d947541f8 + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.026' + X-B3-Traceid: + - e445c425ef3ec4fc665eed40f2d0e795 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "858904b2-b10e-41ce-8f7b-f45d947541f8", + "name" : "Team42 Category", + "type" : "SMART", + "defaultSort" : "HIGHEST_PRICE_FIRST", + "filters" : [ ], + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories/858904b2-b10e-41ce-8f7b-f45d947541f8" + }, + "category" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories/858904b2-b10e-41ce-8f7b-f45d947541f8" + } + } + } + recorded_at: Thu, 15 Aug 2024 05:50:21 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/categories/858904b2-b10e-41ce-8f7b-f45d947541f8 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Thu, 15 Aug 2024 05:50:21 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.035' + X-B3-Traceid: + - e94b20026dd6d8eddaf88ce320f3e72e + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Thu, 15 Aug 2024 05:50:21 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_destroy/deletes_a_category.yml b/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_destroy/deletes_a_category.yml new file mode 100644 index 0000000..9c745fd --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_destroy/deletes_a_category.yml @@ -0,0 +1,247 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 15 Aug 2024 05:50:22 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.096' + X-B3-Traceid: + - 606cb88d38b8b4554d5af7e25b1c74a7 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1723701022, + "jti" : "aGbiZCt009T6WsRpZJKGG9qyE9k=" + } + recorded_at: Thu, 15 Aug 2024 05:50:22 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/categories + body: + encoding: UTF-8 + string: '{"name":"Team42 Category","type":"SMART","defaultSort":"HIGHEST_PRICE_FIRST"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Thu, 15 Aug 2024 05:50:22 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/categories/137ceb34-0cf7-4139-a3bf-a82e70a89d0e + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.029' + X-B3-Traceid: + - 520802273f52194d6ebdcd88fdc58c10 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "137ceb34-0cf7-4139-a3bf-a82e70a89d0e", + "name" : "Team42 Category", + "type" : "SMART", + "defaultSort" : "HIGHEST_PRICE_FIRST", + "filters" : [ ], + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories/137ceb34-0cf7-4139-a3bf-a82e70a89d0e" + }, + "category" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories/137ceb34-0cf7-4139-a3bf-a82e70a89d0e" + } + } + } + recorded_at: Thu, 15 Aug 2024 05:50:22 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/categories/137ceb34-0cf7-4139-a3bf-a82e70a89d0e + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Thu, 15 Aug 2024 05:50:22 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.034' + X-B3-Traceid: + - e1e2b024ec648b363314194887e83d37 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Thu, 15 Aug 2024 05:50:22 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/categories/137ceb34-0cf7-4139-a3bf-a82e70a89d0e + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 404 + message: Not Found + headers: + Date: + - Thu, 15 Aug 2024 05:50:22 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.012' + X-B3-Traceid: + - a4088d26abaa83a66d8d978aa7725fb8 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "errorId" : "resource-not-found", + "details" : { }, + "message" : "No Category found for '137ceb34-0cf7-4139-a3bf-a82e70a89d0e'", + "traceId" : "a4088d26abaa83a66d8d978aa7725fb8" + } + recorded_at: Thu, 15 Aug 2024 05:50:22 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_find/returns_a_category.yml b/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_find/returns_a_category.yml new file mode 100644 index 0000000..8ed95ea --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_find/returns_a_category.yml @@ -0,0 +1,256 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 15 Aug 2024 05:50:20 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.081' + X-B3-Traceid: + - 3507e56fa0bd34971c418c20b3d4f1d7 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1723701020, + "jti" : "WwBYg3bre0BOmDWi5RJZOHafF74=" + } + recorded_at: Thu, 15 Aug 2024 05:50:20 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/categories + body: + encoding: UTF-8 + string: '{"name":"Team42 Category","type":"SMART","defaultSort":"HIGHEST_PRICE_FIRST"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Thu, 15 Aug 2024 05:50:20 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/categories/db518b84-206e-43d6-9622-2c7c766210ef + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.034' + X-B3-Traceid: + - 5affc1e741a9298b0538e310d224698f + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "db518b84-206e-43d6-9622-2c7c766210ef", + "name" : "Team42 Category", + "type" : "SMART", + "defaultSort" : "HIGHEST_PRICE_FIRST", + "filters" : [ ], + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories/db518b84-206e-43d6-9622-2c7c766210ef" + }, + "category" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories/db518b84-206e-43d6-9622-2c7c766210ef" + } + } + } + recorded_at: Thu, 15 Aug 2024 05:50:20 GMT +- request: + method: get + uri: https://team42-beyond-api.beyondshop.cloud/api/categories/db518b84-206e-43d6-9622-2c7c766210ef + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 15 Aug 2024 05:50:21 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.018' + X-B3-Traceid: + - b17e54f0095a440dc56ece5e54375993 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "db518b84-206e-43d6-9622-2c7c766210ef", + "name" : "Team42 Category", + "type" : "SMART", + "defaultSort" : "HIGHEST_PRICE_FIRST", + "filters" : [ ], + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories/db518b84-206e-43d6-9622-2c7c766210ef" + }, + "category" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories/db518b84-206e-43d6-9622-2c7c766210ef" + } + } + } + recorded_at: Thu, 15 Aug 2024 05:50:20 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/categories/db518b84-206e-43d6-9622-2c7c766210ef + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Thu, 15 Aug 2024 05:50:21 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.037' + X-B3-Traceid: + - bb2005104a0dac4e67a81c958f0bd58e + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Thu, 15 Aug 2024 05:50:21 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_update/updates_an_existing_category.yml b/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_update/updates_an_existing_category.yml new file mode 100644 index 0000000..67b46db --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_update/updates_an_existing_category.yml @@ -0,0 +1,256 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 15 Aug 2024 05:50:21 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.086' + X-B3-Traceid: + - d4b64c9c323ad01623e86c399b796097 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1723701021, + "jti" : "f2uXsKDemqxSVnHCT3aceQOcbQA=" + } + recorded_at: Thu, 15 Aug 2024 05:50:21 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/categories + body: + encoding: UTF-8 + string: '{"name":"Team42 Category","type":"SMART","defaultSort":"HIGHEST_PRICE_FIRST"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Thu, 15 Aug 2024 05:50:21 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/categories/fca1f910-388f-4b2e-9b67-a6dbecef199d + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.044' + X-B3-Traceid: + - 05ef4940f2a010a010695eb26ac6868a + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "fca1f910-388f-4b2e-9b67-a6dbecef199d", + "name" : "Team42 Category", + "type" : "SMART", + "defaultSort" : "HIGHEST_PRICE_FIRST", + "filters" : [ ], + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories/fca1f910-388f-4b2e-9b67-a6dbecef199d" + }, + "category" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories/fca1f910-388f-4b2e-9b67-a6dbecef199d" + } + } + } + recorded_at: Thu, 15 Aug 2024 05:50:21 GMT +- request: + method: put + uri: https://team42-beyond-api.beyondshop.cloud/api/categories/fca1f910-388f-4b2e-9b67-a6dbecef199d + body: + encoding: UTF-8 + string: '{"name":"Updated Test Category","type":"SMART","defaultSort":"LOWEST_PRICE_FIRST"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 15 Aug 2024 05:50:21 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.045' + X-B3-Traceid: + - 418ac8e9b19b16d33dc4b8309bfe7f78 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "fca1f910-388f-4b2e-9b67-a6dbecef199d", + "name" : "Updated Test Category", + "type" : "SMART", + "defaultSort" : "LOWEST_PRICE_FIRST", + "filters" : [ ], + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories/fca1f910-388f-4b2e-9b67-a6dbecef199d" + }, + "category" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories/fca1f910-388f-4b2e-9b67-a6dbecef199d" + } + } + } + recorded_at: Thu, 15 Aug 2024 05:50:21 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/categories/fca1f910-388f-4b2e-9b67-a6dbecef199d + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Thu, 15 Aug 2024 05:50:22 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.034' + X-B3-Traceid: + - 6c17c91d246b6f5eee1ac4c567c7055f + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Thu, 15 Aug 2024 05:50:22 GMT +recorded_with: VCR 6.2.0 From 10a1133ccd48e65e375c43eee567cb12dd911eab Mon Sep 17 00:00:00 2001 From: k4th Date: Fri, 16 Aug 2024 13:19:38 +0200 Subject: [PATCH 2/9] Rename variables --- .../services/authentication/token_spec.rb | 14 +++----------- .../services/product_management/category_spec.rb | 16 ++++++++-------- spec/spec_helper.rb | 6 +++++- 3 files changed, 16 insertions(+), 20 deletions(-) diff --git a/spec/beyond_api/services/authentication/token_spec.rb b/spec/beyond_api/services/authentication/token_spec.rb index 388a5be..6de2055 100644 --- a/spec/beyond_api/services/authentication/token_spec.rb +++ b/spec/beyond_api/services/authentication/token_spec.rb @@ -1,14 +1,6 @@ RSpec.describe 'BeyondApi::Authentication::Token', vcr: true do - let(:client) do - BeyondApi::Authentication::Token.new( - api_url: ENV["API_URL"], - client_id: ENV["CLIENT_ID"], - client_secret: ENV["CLIENT_SECRET"] - ) - end - it "retrieves token via client credentials" do - response = client.client_credentials + response = auth_client.client_credentials expect(response).not_to be nil expect(response[:access_token].class).to be(String) expect(response[:refresh_token]).to be(nil) @@ -16,7 +8,7 @@ it "retrieves token via authorization code" do expect { - response = client.get('abcde') + response = auth_client.get('abcde') }.to raise_error(BeyondApi::Error) do |error| expect(error.response[:error]).to eq("invalid_grant") expect(error.response[:error_description]).to eq("Invalid authorization code: abcde") @@ -24,7 +16,7 @@ end it "refreshes the token" do - response = client.refresh(ENV["REFRESH_TOKEN"]) + response = auth_client.refresh(ENV["REFRESH_TOKEN"]) expect(response).not_to be nil expect(response[:access_token].class).to be(String) expect(response[:refresh_token].class).to be(String) diff --git a/spec/beyond_api/services/product_management/category_spec.rb b/spec/beyond_api/services/product_management/category_spec.rb index af4eb5a..4322d6c 100644 --- a/spec/beyond_api/services/product_management/category_spec.rb +++ b/spec/beyond_api/services/product_management/category_spec.rb @@ -1,6 +1,6 @@ RSpec.describe 'BeyondApi::ProductManagement::Category', vcr: true do - before do - @client = BeyondApi::ProductManagement::Category.new( + let(:client) do + BeyondApi::ProductManagement::Category.new( api_url: ENV["API_URL"], access_token: auth_client.client_credentials[:access_token] ) @@ -8,7 +8,7 @@ describe ".all" do it "returns all categories" do - response = @client.all + response = client.all expect(response).not_to be nil expect(response.dig(:embedded, :categories)).to be_kind_of(Array) @@ -18,7 +18,7 @@ context "with category" do before(:each) do - @category = @client.create( + @category = client.create( name: "Team42 Category", type: "SMART", default_sort: "HIGHEST_PRICE_FIRST" @@ -27,7 +27,7 @@ describe ".find" do it "returns a category" do - response = @client.find(@category[:id]) + response = client.find(@category[:id]) expect(response[:name]).to eq("Team42 Category") end end @@ -49,7 +49,7 @@ default_sort: "LOWEST_PRICE_FIRST" } - updated_category = @client.update(@category[:id], updated_category_data) + updated_category = client.update(@category[:id], updated_category_data) expect(updated_category).not_to be nil expect(updated_category[:name]).to eq("Updated Test Category") expect(updated_category[:default_sort]).to eq("LOWEST_PRICE_FIRST") @@ -58,13 +58,13 @@ describe ".destroy" do it "deletes a category" do - response = @client.destroy(@category[:id]) + response = client.destroy(@category[:id]) expect(response).to be {} end end after(:each) do - @client.destroy(@category[:id]) + client.destroy(@category[:id]) rescue BeyondApi::Error end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index fdee6d3..c42004f 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -33,5 +33,9 @@ end def auth_client - BeyondApi::Authentication::Token.new(api_url: ENV["API_URL"]) + BeyondApi::Authentication::Token.new( + api_url: ENV["API_URL"], + client_id: ENV["CLIENT_ID"], + client_secret: ENV["CLIENT_SECRET"] + ) end From bbbf7579b7b3a3da60c84459ce4d6168a9d24eb1 Mon Sep 17 00:00:00 2001 From: k4th Date: Mon, 19 Aug 2024 08:25:49 +0200 Subject: [PATCH 3/9] Update tests --- .../services/authentication/signer.rb | 4 +- .../services/product_management/category.rb | 4 +- .../services/product_management/image.rb | 2 +- .../services/product_management/product.rb | 6 +- .../services/product_management/variation.rb | 2 +- .../services/storefront/script_tag.rb | 4 +- .../services/authentication/signer_spec.rb | 30 + .../services/authentication/token_spec.rb | 2 +- .../services/checkout/shipping_zone_spec.rb | 13 + .../product_management/category_spec.rb | 45 +- .../services/product_management/image_spec.rb | 13 + .../product_management/product_spec.rb | 36 ++ spec/factories/category_data.rb | 14 + spec/factories/product_data.rb | 103 ++++ .../refreshes_the_token.yml | 67 --- ...retrieves_token_via_authorization_code.yml | 61 -- ...retrieves_token_via_client_credentials.yml | 66 --- .../_all/returns_all_categories.yml | 150 ----- .../_create/creates_a_new_category.yml | 187 ------ .../_destroy/deletes_a_category.yml | 247 -------- .../_find/returns_a_category.yml | 256 -------- .../_update/updates_an_existing_category.yml | 256 -------- .../_all/returns_all_products.yml | 559 ++++++++++++++++++ .../_create/creates_a_new_product.yml | 265 +++++++++ .../with_product/_find/returns_a_product.yml | 460 ++++++++++++++ 25 files changed, 1523 insertions(+), 1329 deletions(-) create mode 100644 spec/beyond_api/services/authentication/signer_spec.rb create mode 100644 spec/beyond_api/services/checkout/shipping_zone_spec.rb create mode 100644 spec/beyond_api/services/product_management/image_spec.rb create mode 100644 spec/beyond_api/services/product_management/product_spec.rb create mode 100644 spec/factories/category_data.rb create mode 100644 spec/factories/product_data.rb delete mode 100644 spec/vcr_cassettes/BeyondApi_Authentication_Token/refreshes_the_token.yml delete mode 100644 spec/vcr_cassettes/BeyondApi_Authentication_Token/retrieves_token_via_authorization_code.yml delete mode 100644 spec/vcr_cassettes/BeyondApi_Authentication_Token/retrieves_token_via_client_credentials.yml delete mode 100644 spec/vcr_cassettes/BeyondApi_ProductManagement_Category/_all/returns_all_categories.yml delete mode 100644 spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_create/creates_a_new_category.yml delete mode 100644 spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_destroy/deletes_a_category.yml delete mode 100644 spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_find/returns_a_category.yml delete mode 100644 spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_update/updates_an_existing_category.yml create mode 100644 spec/vcr_cassettes/BeyondApi_ProductManagement_Product/_all/returns_all_products.yml create mode 100644 spec/vcr_cassettes/BeyondApi_ProductManagement_Product/with_product/_create/creates_a_new_product.yml create mode 100644 spec/vcr_cassettes/BeyondApi_ProductManagement_Product/with_product/_find/returns_a_product.yml diff --git a/lib/beyond_api/services/authentication/signer.rb b/lib/beyond_api/services/authentication/signer.rb index 2e67b2d..2711809 100644 --- a/lib/beyond_api/services/authentication/signer.rb +++ b/lib/beyond_api/services/authentication/signer.rb @@ -9,8 +9,8 @@ def create post("signers") end - def destroy(id) - delete("signers/#{id}") + def delete(id) + Connection.delete("signers/#{id}") end end end diff --git a/lib/beyond_api/services/product_management/category.rb b/lib/beyond_api/services/product_management/category.rb index 8e27ebe..27602c4 100644 --- a/lib/beyond_api/services/product_management/category.rb +++ b/lib/beyond_api/services/product_management/category.rb @@ -17,8 +17,8 @@ def update(id, body) put("categories/#{id}", body) end - def destroy(id) - delete("categories/#{id}") + def delete(id) + Connection.delete("categories/#{id}") end end end diff --git a/lib/beyond_api/services/product_management/image.rb b/lib/beyond_api/services/product_management/image.rb index 72b0cb4..658af3c 100644 --- a/lib/beyond_api/services/product_management/image.rb +++ b/lib/beyond_api/services/product_management/image.rb @@ -2,7 +2,7 @@ module BeyondApi module ProductManagement class Image < BaseService def all(id, params = {}) - get("products/#{id}/images") + get("products/#{id}/images", params) end end end diff --git a/lib/beyond_api/services/product_management/product.rb b/lib/beyond_api/services/product_management/product.rb index 1ad5c35..31a6f77 100644 --- a/lib/beyond_api/services/product_management/product.rb +++ b/lib/beyond_api/services/product_management/product.rb @@ -2,7 +2,11 @@ module BeyondApi module ProductManagement class Product < BaseService def all(params = {}) - fetch_all_pages("/products", params) + fetch_all_pages("products", params) + end + + def create(body) + post("products", body) end def find(id) diff --git a/lib/beyond_api/services/product_management/variation.rb b/lib/beyond_api/services/product_management/variation.rb index 41ba8b2..1af3319 100644 --- a/lib/beyond_api/services/product_management/variation.rb +++ b/lib/beyond_api/services/product_management/variation.rb @@ -2,7 +2,7 @@ module BeyondApi module ProductManagement class Variation < BaseService def all(id, params = {}) - get("products/#{id}/variations") + get("products/#{id}/variations", params) end end end diff --git a/lib/beyond_api/services/storefront/script_tag.rb b/lib/beyond_api/services/storefront/script_tag.rb index 6c5eaed..d3491ca 100644 --- a/lib/beyond_api/services/storefront/script_tag.rb +++ b/lib/beyond_api/services/storefront/script_tag.rb @@ -11,8 +11,8 @@ def create(script_url) post("script-tags", script_url:) end - def destroy(id) - delete("script-tags/#{id}") + def delete(id) + Connection.delete("script-tags/#{id}") end end end diff --git a/spec/beyond_api/services/authentication/signer_spec.rb b/spec/beyond_api/services/authentication/signer_spec.rb new file mode 100644 index 0000000..aa310d1 --- /dev/null +++ b/spec/beyond_api/services/authentication/signer_spec.rb @@ -0,0 +1,30 @@ +RSpec.describe BeyondApi::Authentication::Signer, vcr: true do + let(:client) { described_class.new(api_url: ENV["API_URL"], access_token: auth_client.client_credentials[:access_token]) } + + describe '#all' do + it 'returns all signers' do + signers = client.all + + expect(signers.dig(:embedded, :signers)).to be_an(Array) + end + end + + context "with signer" do + before(:each) do + @signer = client.create + end + + describe '#create' do + it 'creates a new signer' do + expect(@signer).to be_a(Hash) + end + end + + describe '#delete' do + it 'deletes a signer' do + response = client.delete(@signer[:id]) + expect(response).to be {} + end + end + end +end \ No newline at end of file diff --git a/spec/beyond_api/services/authentication/token_spec.rb b/spec/beyond_api/services/authentication/token_spec.rb index 6de2055..35d6f4b 100644 --- a/spec/beyond_api/services/authentication/token_spec.rb +++ b/spec/beyond_api/services/authentication/token_spec.rb @@ -1,4 +1,4 @@ -RSpec.describe 'BeyondApi::Authentication::Token', vcr: true do +RSpec.describe BeyondApi::Authentication::Token, vcr: true do it "retrieves token via client credentials" do response = auth_client.client_credentials expect(response).not_to be nil diff --git a/spec/beyond_api/services/checkout/shipping_zone_spec.rb b/spec/beyond_api/services/checkout/shipping_zone_spec.rb new file mode 100644 index 0000000..1e58553 --- /dev/null +++ b/spec/beyond_api/services/checkout/shipping_zone_spec.rb @@ -0,0 +1,13 @@ +RSpec.describe BeyondApi::Checkout::ShippingZone, vcr: true do + let(:client) { described_class.new(api_url: ENV["API_URL"], access_token: auth_client.client_credentials[:access_token]) } + + describe ".all" do + it "returns all shipping_zones" do + response = client.all + + expect(response).not_to be nil + expect(response.dig(:embedded, :shipping_zones)).to be_kind_of(Array) + expect(response.dig(:page)).to be_kind_of(Hash) + end + end +end diff --git a/spec/beyond_api/services/product_management/category_spec.rb b/spec/beyond_api/services/product_management/category_spec.rb index 4322d6c..a3752b6 100644 --- a/spec/beyond_api/services/product_management/category_spec.rb +++ b/spec/beyond_api/services/product_management/category_spec.rb @@ -1,10 +1,5 @@ -RSpec.describe 'BeyondApi::ProductManagement::Category', vcr: true do - let(:client) do - BeyondApi::ProductManagement::Category.new( - api_url: ENV["API_URL"], - access_token: auth_client.client_credentials[:access_token] - ) - end +RSpec.describe BeyondApi::ProductManagement::Category, vcr: true do + let(:client) { described_class.new(api_url: ENV["API_URL"], access_token: auth_client.client_credentials[:access_token]) } describe ".all" do it "returns all categories" do @@ -18,18 +13,7 @@ context "with category" do before(:each) do - @category = client.create( - name: "Team42 Category", - type: "SMART", - default_sort: "HIGHEST_PRICE_FIRST" - ) - end - - describe ".find" do - it "returns a category" do - response = client.find(@category[:id]) - expect(response[:name]).to eq("Team42 Category") - end + @category = client.create(build(:category_data)) end describe ".create" do @@ -41,31 +25,34 @@ end end + describe ".find" do + it "returns a category" do + response = client.find(@category[:id]) + expect(response[:name]).to eq("Team42 Category") + end + end + describe ".update" do it "updates an existing category" do - updated_category_data = { - name: "Updated Test Category", - type: "SMART", - default_sort: "LOWEST_PRICE_FIRST" - } + updated_category_data = FactoryBot.build(:category_data, :lowest_price_first) updated_category = client.update(@category[:id], updated_category_data) expect(updated_category).not_to be nil - expect(updated_category[:name]).to eq("Updated Test Category") + expect(updated_category[:name]).to eq("Category with lowest price first") expect(updated_category[:default_sort]).to eq("LOWEST_PRICE_FIRST") end end - describe ".destroy" do + describe ".delete" do it "deletes a category" do - response = client.destroy(@category[:id]) + response = client.delete(@category[:id]) expect(response).to be {} end end after(:each) do - client.destroy(@category[:id]) + client.delete(@category[:id]) rescue BeyondApi::Error end end -end \ No newline at end of file +end diff --git a/spec/beyond_api/services/product_management/image_spec.rb b/spec/beyond_api/services/product_management/image_spec.rb new file mode 100644 index 0000000..79c14f1 --- /dev/null +++ b/spec/beyond_api/services/product_management/image_spec.rb @@ -0,0 +1,13 @@ +RSpec.describe BeyondApi::ProductManagement::Image, vcr: true do + let(:client) { described_class.new(api_url: ENV["API_URL"], access_token: auth_client.client_credentials[:access_token]) } + + describe ".all" do + it "returns all images" do + response = client.all("4bf6d53d-dfb2-4468-b6f9-f6e6265bc0bc") + + expect(response).not_to be nil + expect(response.dig(:embedded, :images)).to be_kind_of(Array) + expect(response.dig(:page)).to be_kind_of(Hash) + end + end +end diff --git a/spec/beyond_api/services/product_management/product_spec.rb b/spec/beyond_api/services/product_management/product_spec.rb new file mode 100644 index 0000000..d9b9b90 --- /dev/null +++ b/spec/beyond_api/services/product_management/product_spec.rb @@ -0,0 +1,36 @@ +RSpec.describe BeyondApi::ProductManagement::Product, vcr: true do + let(:client) { described_class.new(api_url: ENV["API_URL"], access_token: auth_client.client_credentials[:access_token]) } + + describe ".all" do + it "returns all products" do + response = client.all + + expect(response).not_to be nil + expect(response.dig(:embedded, :products)).to be_kind_of(Array) + expect(response.dig(:page)).to be_kind_of(Hash) + end + end + + context "with product" do + before(:each) do + @product = client.create(build(:product_data)) + end + + describe ".create" do + it "creates a new product" do + expect(@product).not_to be nil + expect(@product[:name]).to eq("Team42 Product") + expect(@product[:essential_features]).to eq("Dry. 12% alcohol. Best vine variety.") + expect(@product[:tags]).to eq(["Bestseller", "Red Wine", "Sale"]) + expect(@product[:product_identifiers]).to eq([{ type: "EAN", value: "9780134308135" }]) + end + end + + describe ".find" do + it "returns a product" do + response = client.find(@product[:id]) + expect(response[:name]).to eq("Team42 Product") + end + end + end +end diff --git a/spec/factories/category_data.rb b/spec/factories/category_data.rb new file mode 100644 index 0000000..116b674 --- /dev/null +++ b/spec/factories/category_data.rb @@ -0,0 +1,14 @@ +FactoryBot.define do + factory :category_data, class: Hash do + name { "Team42 Category" } + type { "SMART" } + default_sort { "HIGHEST_PRICE_FIRST" } + + trait :lowest_price_first do + name { "Category with lowest price first" } + default_sort { "LOWEST_PRICE_FIRST" } + end + + initialize_with { attributes } + end +end \ No newline at end of file diff --git a/spec/factories/product_data.rb b/spec/factories/product_data.rb new file mode 100644 index 0000000..67e6f28 --- /dev/null +++ b/spec/factories/product_data.rb @@ -0,0 +1,103 @@ +FactoryBot.define do + factory :product_data, class: Hash do + name { "Team42 Product" } + description { "Spain\nRioja Tempranillo" } + manufacturer { "Grape Vineyard" } + essential_features { "Dry. 12% alcohol. Best vine variety." } + tags { ["Bestseller", "Red Wine", "Sale"] } + + product_identifiers do + [ + { + type: "EAN", + value: "9780134308135" + } + ] + end + + sales_price do + { + tax_model: "GROSS", + amount: 8.7, + currency: "GBP" + } + end + + list_price do + { + tax_model: "GROSS", + amount: 10.95, + currency: "GBP" + } + end + + manufacturer_price do + { + tax_model: "GROSS", + amount: 11.95, + currency: "GBP" + } + end + + visible { true } + tax_class { "REGULAR" } + + shipping_weight do + { + value: 1175.0, + display_unit: "GRAMS" + } + end + + max_order_quantity { 6 } + + shipping_dimension do + { + length: 1500, + width: 1000, + height: 2000 + } + end + + ref_price do + { + ref_quantity: 1, + unit: "LITER", + quantity: 0.75, + price: { + tax_model: "GROSS", + amount: 11.6, + currency: "GBP" + } + } + end + + shipping_period do + { + min: 2, + max: 4, + display_unit: "WEEKS" + } + end + + pickup_period do + { + min: 1, + max: 2, + display_unit: "WEEKS" + } + end + + product_labels do + [ + { + type: "NEW", + active_from: "2024-08-13T11:31:30.210787732", + active_until: "2024-09-10T11:31:30.210787732" + } + ] + end + + initialize_with { attributes } + end +end diff --git a/spec/vcr_cassettes/BeyondApi_Authentication_Token/refreshes_the_token.yml b/spec/vcr_cassettes/BeyondApi_Authentication_Token/refreshes_the_token.yml deleted file mode 100644 index 2b60320..0000000 --- a/spec/vcr_cassettes/BeyondApi_Authentication_Token/refreshes_the_token.yml +++ /dev/null @@ -1,67 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=refresh_token&refresh_token= - body: - encoding: UTF-8 - string: "{}" - headers: - Accept: - - application/json - Content-Type: - - application/json - User-Agent: - - Faraday v2.10.1 - Authorization: - - Basic - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - response: - status: - code: 200 - message: OK - headers: - Date: - - Thu, 15 Aug 2024 05:50:20 GMT - Content-Type: - - application/json;charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Cache-Control: - - no-store - Pragma: - - no-cache - X-Content-Type-Options: - - nosniff - X-Xss-Protection: - - 1; mode=block - Strict-Transport-Security: - - max-age=31536000 ; includeSubDomains - X-Frame-Options: - - DENY - Server: - - epages-beyond - X-Request-Time: - - '0.075' - X-B3-Traceid: - - c18d2bd93a06719e6588e4467bb349ee - X-Hello-Human: - - Come work with us! https://developer.epages.com/devjobs/ - body: - encoding: UTF-8 - string: |- - { - "access_token" : "", - "token_type" : "bearer", - "refresh_token" : "", - "expires_in" : 3599, - "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", - "tenantId" : 8542, - "iat" : 1723701020, - "jti" : "PmaCtIyee05EfeXa+hPsFx9lHNA=" - } - recorded_at: Thu, 15 Aug 2024 05:50:20 GMT -recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Authentication_Token/retrieves_token_via_authorization_code.yml b/spec/vcr_cassettes/BeyondApi_Authentication_Token/retrieves_token_via_authorization_code.yml deleted file mode 100644 index cf69795..0000000 --- a/spec/vcr_cassettes/BeyondApi_Authentication_Token/retrieves_token_via_authorization_code.yml +++ /dev/null @@ -1,61 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?code=abcde&grant_type=authorization_code - body: - encoding: UTF-8 - string: "{}" - headers: - Accept: - - application/json - Content-Type: - - application/json - User-Agent: - - Faraday v2.10.1 - Authorization: - - Basic - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - response: - status: - code: 400 - message: Bad Request - headers: - Date: - - Thu, 15 Aug 2024 05:50:20 GMT - Content-Type: - - application/json - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Cache-Control: - - no-store - Pragma: - - no-cache - X-Content-Type-Options: - - nosniff - X-Xss-Protection: - - 1; mode=block - Strict-Transport-Security: - - max-age=31536000 ; includeSubDomains - X-Frame-Options: - - DENY - Server: - - epages-beyond - X-Request-Time: - - '0.044' - X-B3-Traceid: - - 7b2e726e3d43a71295be89159def3075 - X-Hello-Human: - - Come work with us! https://developer.epages.com/devjobs/ - body: - encoding: UTF-8 - string: |- - { - "error" : "invalid_grant", - "error_description" : "Invalid authorization code: abcde" - } - recorded_at: Thu, 15 Aug 2024 05:50:20 GMT -recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Authentication_Token/retrieves_token_via_client_credentials.yml b/spec/vcr_cassettes/BeyondApi_Authentication_Token/retrieves_token_via_client_credentials.yml deleted file mode 100644 index 0fc99a4..0000000 --- a/spec/vcr_cassettes/BeyondApi_Authentication_Token/retrieves_token_via_client_credentials.yml +++ /dev/null @@ -1,66 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials - body: - encoding: UTF-8 - string: "{}" - headers: - Accept: - - application/json - Content-Type: - - application/json - User-Agent: - - Faraday v2.10.1 - Authorization: - - Basic - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - response: - status: - code: 200 - message: OK - headers: - Date: - - Thu, 15 Aug 2024 05:50:19 GMT - Content-Type: - - application/json;charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Cache-Control: - - no-store - Pragma: - - no-cache - X-Content-Type-Options: - - nosniff - X-Xss-Protection: - - 1; mode=block - Strict-Transport-Security: - - max-age=31536000 ; includeSubDomains - X-Frame-Options: - - DENY - Server: - - epages-beyond - X-Request-Time: - - '0.095' - X-B3-Traceid: - - 1d24f62f4177873de211bb403233304f - X-Hello-Human: - - Come work with us! https://developer.epages.com/devjobs/ - body: - encoding: UTF-8 - string: |- - { - "access_token" : "", - "token_type" : "bearer", - "expires_in" : 3599, - "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", - "tenantId" : 8542, - "iat" : 1723701019, - "jti" : "Dh7TEvFcW6H+YC4g0EK6QMBXpRk=" - } - recorded_at: Thu, 15 Aug 2024 05:50:19 GMT -recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/_all/returns_all_categories.yml b/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/_all/returns_all_categories.yml deleted file mode 100644 index 96dbf5e..0000000 --- a/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/_all/returns_all_categories.yml +++ /dev/null @@ -1,150 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials - body: - encoding: UTF-8 - string: "{}" - headers: - Accept: - - application/json - Content-Type: - - application/json - User-Agent: - - Faraday v2.10.1 - Authorization: - - Basic - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - response: - status: - code: 200 - message: OK - headers: - Date: - - Thu, 15 Aug 2024 05:50:20 GMT - Content-Type: - - application/json;charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Cache-Control: - - no-store - Pragma: - - no-cache - X-Content-Type-Options: - - nosniff - X-Xss-Protection: - - 1; mode=block - Strict-Transport-Security: - - max-age=31536000 ; includeSubDomains - X-Frame-Options: - - DENY - Server: - - epages-beyond - X-Request-Time: - - '0.082' - X-B3-Traceid: - - 7ff3e2bf420f231962f1e03701b7fb4c - X-Hello-Human: - - Come work with us! https://developer.epages.com/devjobs/ - body: - encoding: UTF-8 - string: |- - { - "access_token" : "", - "token_type" : "bearer", - "expires_in" : 3599, - "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", - "tenantId" : 8542, - "iat" : 1723701020, - "jti" : "AzUxPPnMSDVwQzlYwq21RqK7Hhc=" - } - recorded_at: Thu, 15 Aug 2024 05:50:20 GMT -- request: - method: get - uri: https://team42-beyond-api.beyondshop.cloud/api/categories - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - application/json - Content-Type: - - application/json - User-Agent: - - Faraday v2.10.1 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - response: - status: - code: 200 - message: OK - headers: - Date: - - Thu, 15 Aug 2024 05:50:20 GMT - Content-Type: - - application/json - Transfer-Encoding: - - chunked - Connection: - - keep-alive - X-Content-Type-Options: - - nosniff - X-Xss-Protection: - - 1; mode=block - Cache-Control: - - no-cache, no-store, max-age=0, must-revalidate - Pragma: - - no-cache - Expires: - - '0' - X-Frame-Options: - - DENY - Server: - - epages-beyond - X-Request-Time: - - '0.033' - X-B3-Traceid: - - ab0c4f8b027b155f7625393937bc7f5b - X-Hello-Human: - - Come work with us! https://developer.epages.com/devjobs/ - body: - encoding: UTF-8 - string: |- - { - "_embedded" : { - "categories" : [ { - "_id" : "8a4a8f6a-e3d9-4616-9e89-12c42c084534", - "name" : "DO-NOT-DELETE Category", - "type" : "SMART", - "defaultSort" : "HIGHEST_PRICE_FIRST", - "filters" : [ ], - "_links" : { - "self" : { - "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories/8a4a8f6a-e3d9-4616-9e89-12c42c084534" - }, - "category" : { - "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories/8a4a8f6a-e3d9-4616-9e89-12c42c084534" - } - } - } ] - }, - "_links" : { - "self" : { - "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories?page=0&size=20" - } - }, - "page" : { - "size" : 20, - "totalElements" : 1, - "totalPages" : 1, - "number" : 0 - } - } - recorded_at: Thu, 15 Aug 2024 05:50:20 GMT -recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_create/creates_a_new_category.yml b/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_create/creates_a_new_category.yml deleted file mode 100644 index 3dc82e0..0000000 --- a/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_create/creates_a_new_category.yml +++ /dev/null @@ -1,187 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials - body: - encoding: UTF-8 - string: "{}" - headers: - Accept: - - application/json - Content-Type: - - application/json - User-Agent: - - Faraday v2.10.1 - Authorization: - - Basic - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - response: - status: - code: 200 - message: OK - headers: - Date: - - Thu, 15 Aug 2024 05:50:21 GMT - Content-Type: - - application/json;charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Cache-Control: - - no-store - Pragma: - - no-cache - X-Content-Type-Options: - - nosniff - X-Xss-Protection: - - 1; mode=block - Strict-Transport-Security: - - max-age=31536000 ; includeSubDomains - X-Frame-Options: - - DENY - Server: - - epages-beyond - X-Request-Time: - - '0.073' - X-B3-Traceid: - - 372d3ca1e7683a3f7c09cc397164562d - X-Hello-Human: - - Come work with us! https://developer.epages.com/devjobs/ - body: - encoding: UTF-8 - string: |- - { - "access_token" : "", - "token_type" : "bearer", - "expires_in" : 3599, - "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", - "tenantId" : 8542, - "iat" : 1723701021, - "jti" : "so7eqPGyCHGcPK7pPPAplw2rfs8=" - } - recorded_at: Thu, 15 Aug 2024 05:50:21 GMT -- request: - method: post - uri: https://team42-beyond-api.beyondshop.cloud/api/categories - body: - encoding: UTF-8 - string: '{"name":"Team42 Category","type":"SMART","defaultSort":"HIGHEST_PRICE_FIRST"}' - headers: - Accept: - - application/json - Content-Type: - - application/json - User-Agent: - - Faraday v2.10.1 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - response: - status: - code: 201 - message: Created - headers: - Date: - - Thu, 15 Aug 2024 05:50:21 GMT - Content-Type: - - application/json - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Location: - - https://team42-beyond-api.beyondshop.cloud/api/categories/858904b2-b10e-41ce-8f7b-f45d947541f8 - X-Content-Type-Options: - - nosniff - X-Xss-Protection: - - 1; mode=block - Cache-Control: - - no-cache, no-store, max-age=0, must-revalidate - Pragma: - - no-cache - Expires: - - '0' - X-Frame-Options: - - DENY - Server: - - epages-beyond - X-Request-Time: - - '0.026' - X-B3-Traceid: - - e445c425ef3ec4fc665eed40f2d0e795 - X-Hello-Human: - - Come work with us! https://developer.epages.com/devjobs/ - body: - encoding: UTF-8 - string: |- - { - "_id" : "858904b2-b10e-41ce-8f7b-f45d947541f8", - "name" : "Team42 Category", - "type" : "SMART", - "defaultSort" : "HIGHEST_PRICE_FIRST", - "filters" : [ ], - "_links" : { - "self" : { - "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories/858904b2-b10e-41ce-8f7b-f45d947541f8" - }, - "category" : { - "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories/858904b2-b10e-41ce-8f7b-f45d947541f8" - } - } - } - recorded_at: Thu, 15 Aug 2024 05:50:21 GMT -- request: - method: delete - uri: https://team42-beyond-api.beyondshop.cloud/api/categories/858904b2-b10e-41ce-8f7b-f45d947541f8 - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - application/json - Content-Type: - - application/json - User-Agent: - - Faraday v2.10.1 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - response: - status: - code: 204 - message: No Content - headers: - Date: - - Thu, 15 Aug 2024 05:50:21 GMT - Connection: - - keep-alive - X-Content-Type-Options: - - nosniff - X-Xss-Protection: - - 1; mode=block - Cache-Control: - - no-cache, no-store, max-age=0, must-revalidate - Pragma: - - no-cache - Expires: - - '0' - X-Frame-Options: - - DENY - Server: - - epages-beyond - X-Request-Time: - - '0.035' - X-B3-Traceid: - - e94b20026dd6d8eddaf88ce320f3e72e - X-Hello-Human: - - Come work with us! https://developer.epages.com/devjobs/ - body: - encoding: UTF-8 - string: '' - recorded_at: Thu, 15 Aug 2024 05:50:21 GMT -recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_destroy/deletes_a_category.yml b/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_destroy/deletes_a_category.yml deleted file mode 100644 index 9c745fd..0000000 --- a/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_destroy/deletes_a_category.yml +++ /dev/null @@ -1,247 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials - body: - encoding: UTF-8 - string: "{}" - headers: - Accept: - - application/json - Content-Type: - - application/json - User-Agent: - - Faraday v2.10.1 - Authorization: - - Basic - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - response: - status: - code: 200 - message: OK - headers: - Date: - - Thu, 15 Aug 2024 05:50:22 GMT - Content-Type: - - application/json;charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Cache-Control: - - no-store - Pragma: - - no-cache - X-Content-Type-Options: - - nosniff - X-Xss-Protection: - - 1; mode=block - Strict-Transport-Security: - - max-age=31536000 ; includeSubDomains - X-Frame-Options: - - DENY - Server: - - epages-beyond - X-Request-Time: - - '0.096' - X-B3-Traceid: - - 606cb88d38b8b4554d5af7e25b1c74a7 - X-Hello-Human: - - Come work with us! https://developer.epages.com/devjobs/ - body: - encoding: UTF-8 - string: |- - { - "access_token" : "", - "token_type" : "bearer", - "expires_in" : 3599, - "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", - "tenantId" : 8542, - "iat" : 1723701022, - "jti" : "aGbiZCt009T6WsRpZJKGG9qyE9k=" - } - recorded_at: Thu, 15 Aug 2024 05:50:22 GMT -- request: - method: post - uri: https://team42-beyond-api.beyondshop.cloud/api/categories - body: - encoding: UTF-8 - string: '{"name":"Team42 Category","type":"SMART","defaultSort":"HIGHEST_PRICE_FIRST"}' - headers: - Accept: - - application/json - Content-Type: - - application/json - User-Agent: - - Faraday v2.10.1 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - response: - status: - code: 201 - message: Created - headers: - Date: - - Thu, 15 Aug 2024 05:50:22 GMT - Content-Type: - - application/json - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Location: - - https://team42-beyond-api.beyondshop.cloud/api/categories/137ceb34-0cf7-4139-a3bf-a82e70a89d0e - X-Content-Type-Options: - - nosniff - X-Xss-Protection: - - 1; mode=block - Cache-Control: - - no-cache, no-store, max-age=0, must-revalidate - Pragma: - - no-cache - Expires: - - '0' - X-Frame-Options: - - DENY - Server: - - epages-beyond - X-Request-Time: - - '0.029' - X-B3-Traceid: - - 520802273f52194d6ebdcd88fdc58c10 - X-Hello-Human: - - Come work with us! https://developer.epages.com/devjobs/ - body: - encoding: UTF-8 - string: |- - { - "_id" : "137ceb34-0cf7-4139-a3bf-a82e70a89d0e", - "name" : "Team42 Category", - "type" : "SMART", - "defaultSort" : "HIGHEST_PRICE_FIRST", - "filters" : [ ], - "_links" : { - "self" : { - "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories/137ceb34-0cf7-4139-a3bf-a82e70a89d0e" - }, - "category" : { - "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories/137ceb34-0cf7-4139-a3bf-a82e70a89d0e" - } - } - } - recorded_at: Thu, 15 Aug 2024 05:50:22 GMT -- request: - method: delete - uri: https://team42-beyond-api.beyondshop.cloud/api/categories/137ceb34-0cf7-4139-a3bf-a82e70a89d0e - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - application/json - Content-Type: - - application/json - User-Agent: - - Faraday v2.10.1 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - response: - status: - code: 204 - message: No Content - headers: - Date: - - Thu, 15 Aug 2024 05:50:22 GMT - Connection: - - keep-alive - X-Content-Type-Options: - - nosniff - X-Xss-Protection: - - 1; mode=block - Cache-Control: - - no-cache, no-store, max-age=0, must-revalidate - Pragma: - - no-cache - Expires: - - '0' - X-Frame-Options: - - DENY - Server: - - epages-beyond - X-Request-Time: - - '0.034' - X-B3-Traceid: - - e1e2b024ec648b363314194887e83d37 - X-Hello-Human: - - Come work with us! https://developer.epages.com/devjobs/ - body: - encoding: UTF-8 - string: '' - recorded_at: Thu, 15 Aug 2024 05:50:22 GMT -- request: - method: delete - uri: https://team42-beyond-api.beyondshop.cloud/api/categories/137ceb34-0cf7-4139-a3bf-a82e70a89d0e - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - application/json - Content-Type: - - application/json - User-Agent: - - Faraday v2.10.1 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - response: - status: - code: 404 - message: Not Found - headers: - Date: - - Thu, 15 Aug 2024 05:50:22 GMT - Content-Type: - - application/json - Transfer-Encoding: - - chunked - Connection: - - keep-alive - X-Content-Type-Options: - - nosniff - X-Xss-Protection: - - 1; mode=block - Cache-Control: - - no-cache, no-store, max-age=0, must-revalidate - Pragma: - - no-cache - Expires: - - '0' - X-Frame-Options: - - DENY - Server: - - epages-beyond - X-Request-Time: - - '0.012' - X-B3-Traceid: - - a4088d26abaa83a66d8d978aa7725fb8 - X-Hello-Human: - - Come work with us! https://developer.epages.com/devjobs/ - body: - encoding: UTF-8 - string: |- - { - "errorId" : "resource-not-found", - "details" : { }, - "message" : "No Category found for '137ceb34-0cf7-4139-a3bf-a82e70a89d0e'", - "traceId" : "a4088d26abaa83a66d8d978aa7725fb8" - } - recorded_at: Thu, 15 Aug 2024 05:50:22 GMT -recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_find/returns_a_category.yml b/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_find/returns_a_category.yml deleted file mode 100644 index 8ed95ea..0000000 --- a/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_find/returns_a_category.yml +++ /dev/null @@ -1,256 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials - body: - encoding: UTF-8 - string: "{}" - headers: - Accept: - - application/json - Content-Type: - - application/json - User-Agent: - - Faraday v2.10.1 - Authorization: - - Basic - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - response: - status: - code: 200 - message: OK - headers: - Date: - - Thu, 15 Aug 2024 05:50:20 GMT - Content-Type: - - application/json;charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Cache-Control: - - no-store - Pragma: - - no-cache - X-Content-Type-Options: - - nosniff - X-Xss-Protection: - - 1; mode=block - Strict-Transport-Security: - - max-age=31536000 ; includeSubDomains - X-Frame-Options: - - DENY - Server: - - epages-beyond - X-Request-Time: - - '0.081' - X-B3-Traceid: - - 3507e56fa0bd34971c418c20b3d4f1d7 - X-Hello-Human: - - Come work with us! https://developer.epages.com/devjobs/ - body: - encoding: UTF-8 - string: |- - { - "access_token" : "", - "token_type" : "bearer", - "expires_in" : 3599, - "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", - "tenantId" : 8542, - "iat" : 1723701020, - "jti" : "WwBYg3bre0BOmDWi5RJZOHafF74=" - } - recorded_at: Thu, 15 Aug 2024 05:50:20 GMT -- request: - method: post - uri: https://team42-beyond-api.beyondshop.cloud/api/categories - body: - encoding: UTF-8 - string: '{"name":"Team42 Category","type":"SMART","defaultSort":"HIGHEST_PRICE_FIRST"}' - headers: - Accept: - - application/json - Content-Type: - - application/json - User-Agent: - - Faraday v2.10.1 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - response: - status: - code: 201 - message: Created - headers: - Date: - - Thu, 15 Aug 2024 05:50:20 GMT - Content-Type: - - application/json - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Location: - - https://team42-beyond-api.beyondshop.cloud/api/categories/db518b84-206e-43d6-9622-2c7c766210ef - X-Content-Type-Options: - - nosniff - X-Xss-Protection: - - 1; mode=block - Cache-Control: - - no-cache, no-store, max-age=0, must-revalidate - Pragma: - - no-cache - Expires: - - '0' - X-Frame-Options: - - DENY - Server: - - epages-beyond - X-Request-Time: - - '0.034' - X-B3-Traceid: - - 5affc1e741a9298b0538e310d224698f - X-Hello-Human: - - Come work with us! https://developer.epages.com/devjobs/ - body: - encoding: UTF-8 - string: |- - { - "_id" : "db518b84-206e-43d6-9622-2c7c766210ef", - "name" : "Team42 Category", - "type" : "SMART", - "defaultSort" : "HIGHEST_PRICE_FIRST", - "filters" : [ ], - "_links" : { - "self" : { - "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories/db518b84-206e-43d6-9622-2c7c766210ef" - }, - "category" : { - "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories/db518b84-206e-43d6-9622-2c7c766210ef" - } - } - } - recorded_at: Thu, 15 Aug 2024 05:50:20 GMT -- request: - method: get - uri: https://team42-beyond-api.beyondshop.cloud/api/categories/db518b84-206e-43d6-9622-2c7c766210ef - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - application/json - Content-Type: - - application/json - User-Agent: - - Faraday v2.10.1 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - response: - status: - code: 200 - message: OK - headers: - Date: - - Thu, 15 Aug 2024 05:50:21 GMT - Content-Type: - - application/json - Transfer-Encoding: - - chunked - Connection: - - keep-alive - X-Content-Type-Options: - - nosniff - X-Xss-Protection: - - 1; mode=block - Cache-Control: - - no-cache, no-store, max-age=0, must-revalidate - Pragma: - - no-cache - Expires: - - '0' - X-Frame-Options: - - DENY - Server: - - epages-beyond - X-Request-Time: - - '0.018' - X-B3-Traceid: - - b17e54f0095a440dc56ece5e54375993 - X-Hello-Human: - - Come work with us! https://developer.epages.com/devjobs/ - body: - encoding: UTF-8 - string: |- - { - "_id" : "db518b84-206e-43d6-9622-2c7c766210ef", - "name" : "Team42 Category", - "type" : "SMART", - "defaultSort" : "HIGHEST_PRICE_FIRST", - "filters" : [ ], - "_links" : { - "self" : { - "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories/db518b84-206e-43d6-9622-2c7c766210ef" - }, - "category" : { - "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories/db518b84-206e-43d6-9622-2c7c766210ef" - } - } - } - recorded_at: Thu, 15 Aug 2024 05:50:20 GMT -- request: - method: delete - uri: https://team42-beyond-api.beyondshop.cloud/api/categories/db518b84-206e-43d6-9622-2c7c766210ef - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - application/json - Content-Type: - - application/json - User-Agent: - - Faraday v2.10.1 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - response: - status: - code: 204 - message: No Content - headers: - Date: - - Thu, 15 Aug 2024 05:50:21 GMT - Connection: - - keep-alive - X-Content-Type-Options: - - nosniff - X-Xss-Protection: - - 1; mode=block - Cache-Control: - - no-cache, no-store, max-age=0, must-revalidate - Pragma: - - no-cache - Expires: - - '0' - X-Frame-Options: - - DENY - Server: - - epages-beyond - X-Request-Time: - - '0.037' - X-B3-Traceid: - - bb2005104a0dac4e67a81c958f0bd58e - X-Hello-Human: - - Come work with us! https://developer.epages.com/devjobs/ - body: - encoding: UTF-8 - string: '' - recorded_at: Thu, 15 Aug 2024 05:50:21 GMT -recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_update/updates_an_existing_category.yml b/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_update/updates_an_existing_category.yml deleted file mode 100644 index 67b46db..0000000 --- a/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_update/updates_an_existing_category.yml +++ /dev/null @@ -1,256 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials - body: - encoding: UTF-8 - string: "{}" - headers: - Accept: - - application/json - Content-Type: - - application/json - User-Agent: - - Faraday v2.10.1 - Authorization: - - Basic - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - response: - status: - code: 200 - message: OK - headers: - Date: - - Thu, 15 Aug 2024 05:50:21 GMT - Content-Type: - - application/json;charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Cache-Control: - - no-store - Pragma: - - no-cache - X-Content-Type-Options: - - nosniff - X-Xss-Protection: - - 1; mode=block - Strict-Transport-Security: - - max-age=31536000 ; includeSubDomains - X-Frame-Options: - - DENY - Server: - - epages-beyond - X-Request-Time: - - '0.086' - X-B3-Traceid: - - d4b64c9c323ad01623e86c399b796097 - X-Hello-Human: - - Come work with us! https://developer.epages.com/devjobs/ - body: - encoding: UTF-8 - string: |- - { - "access_token" : "", - "token_type" : "bearer", - "expires_in" : 3599, - "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", - "tenantId" : 8542, - "iat" : 1723701021, - "jti" : "f2uXsKDemqxSVnHCT3aceQOcbQA=" - } - recorded_at: Thu, 15 Aug 2024 05:50:21 GMT -- request: - method: post - uri: https://team42-beyond-api.beyondshop.cloud/api/categories - body: - encoding: UTF-8 - string: '{"name":"Team42 Category","type":"SMART","defaultSort":"HIGHEST_PRICE_FIRST"}' - headers: - Accept: - - application/json - Content-Type: - - application/json - User-Agent: - - Faraday v2.10.1 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - response: - status: - code: 201 - message: Created - headers: - Date: - - Thu, 15 Aug 2024 05:50:21 GMT - Content-Type: - - application/json - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Location: - - https://team42-beyond-api.beyondshop.cloud/api/categories/fca1f910-388f-4b2e-9b67-a6dbecef199d - X-Content-Type-Options: - - nosniff - X-Xss-Protection: - - 1; mode=block - Cache-Control: - - no-cache, no-store, max-age=0, must-revalidate - Pragma: - - no-cache - Expires: - - '0' - X-Frame-Options: - - DENY - Server: - - epages-beyond - X-Request-Time: - - '0.044' - X-B3-Traceid: - - 05ef4940f2a010a010695eb26ac6868a - X-Hello-Human: - - Come work with us! https://developer.epages.com/devjobs/ - body: - encoding: UTF-8 - string: |- - { - "_id" : "fca1f910-388f-4b2e-9b67-a6dbecef199d", - "name" : "Team42 Category", - "type" : "SMART", - "defaultSort" : "HIGHEST_PRICE_FIRST", - "filters" : [ ], - "_links" : { - "self" : { - "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories/fca1f910-388f-4b2e-9b67-a6dbecef199d" - }, - "category" : { - "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories/fca1f910-388f-4b2e-9b67-a6dbecef199d" - } - } - } - recorded_at: Thu, 15 Aug 2024 05:50:21 GMT -- request: - method: put - uri: https://team42-beyond-api.beyondshop.cloud/api/categories/fca1f910-388f-4b2e-9b67-a6dbecef199d - body: - encoding: UTF-8 - string: '{"name":"Updated Test Category","type":"SMART","defaultSort":"LOWEST_PRICE_FIRST"}' - headers: - Accept: - - application/json - Content-Type: - - application/json - User-Agent: - - Faraday v2.10.1 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - response: - status: - code: 200 - message: OK - headers: - Date: - - Thu, 15 Aug 2024 05:50:21 GMT - Content-Type: - - application/json - Transfer-Encoding: - - chunked - Connection: - - keep-alive - X-Content-Type-Options: - - nosniff - X-Xss-Protection: - - 1; mode=block - Cache-Control: - - no-cache, no-store, max-age=0, must-revalidate - Pragma: - - no-cache - Expires: - - '0' - X-Frame-Options: - - DENY - Server: - - epages-beyond - X-Request-Time: - - '0.045' - X-B3-Traceid: - - 418ac8e9b19b16d33dc4b8309bfe7f78 - X-Hello-Human: - - Come work with us! https://developer.epages.com/devjobs/ - body: - encoding: UTF-8 - string: |- - { - "_id" : "fca1f910-388f-4b2e-9b67-a6dbecef199d", - "name" : "Updated Test Category", - "type" : "SMART", - "defaultSort" : "LOWEST_PRICE_FIRST", - "filters" : [ ], - "_links" : { - "self" : { - "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories/fca1f910-388f-4b2e-9b67-a6dbecef199d" - }, - "category" : { - "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories/fca1f910-388f-4b2e-9b67-a6dbecef199d" - } - } - } - recorded_at: Thu, 15 Aug 2024 05:50:21 GMT -- request: - method: delete - uri: https://team42-beyond-api.beyondshop.cloud/api/categories/fca1f910-388f-4b2e-9b67-a6dbecef199d - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - application/json - Content-Type: - - application/json - User-Agent: - - Faraday v2.10.1 - Authorization: - - Bearer - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - response: - status: - code: 204 - message: No Content - headers: - Date: - - Thu, 15 Aug 2024 05:50:22 GMT - Connection: - - keep-alive - X-Content-Type-Options: - - nosniff - X-Xss-Protection: - - 1; mode=block - Cache-Control: - - no-cache, no-store, max-age=0, must-revalidate - Pragma: - - no-cache - Expires: - - '0' - X-Frame-Options: - - DENY - Server: - - epages-beyond - X-Request-Time: - - '0.034' - X-B3-Traceid: - - 6c17c91d246b6f5eee1ac4c567c7055f - X-Hello-Human: - - Come work with us! https://developer.epages.com/devjobs/ - body: - encoding: UTF-8 - string: '' - recorded_at: Thu, 15 Aug 2024 05:50:22 GMT -recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_ProductManagement_Product/_all/returns_all_products.yml b/spec/vcr_cassettes/BeyondApi_ProductManagement_Product/_all/returns_all_products.yml new file mode 100644 index 0000000..53c14ea --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_ProductManagement_Product/_all/returns_all_products.yml @@ -0,0 +1,559 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 06:13:43 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.098' + X-B3-Traceid: + - d5f36a0ed8968b897ca10114fb554be2 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1724048023, + "jti" : "wbmjEm3sklF053GJQPRcuTGUOeM=" + } + recorded_at: Mon, 19 Aug 2024 06:13:42 GMT +- request: + method: get + uri: https://team42-beyond-api.beyondshop.cloud/api/products + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 06:13:43 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.059' + X-B3-Traceid: + - 1bb4216510732544b0381d5e21097911 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_embedded" : { + "products" : [ { + "_id" : "4bf6d53d-dfb2-4468-b6f9-f6e6265bc0bc", + "lastModifiedAt" : "2024-08-18T21:43:42.669", + "sku" : "1000", + "salesPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 8.7, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 7.25, + "taxRate" : 0.2 + } + }, + "listPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 10.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.125, + "taxRate" : 0.2 + } + }, + "manufacturerPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.95833, + "taxRate" : 0.2 + } + }, + "tags" : [ "Sale", "Bestseller", "Red Wine" ], + "productIdentifiers" : [ { + "type" : "EAN", + "value" : "9780134308135" + } ], + "visible" : true, + "taxClass" : "REGULAR", + "shippingWeight" : { + "value" : 1175.0, + "displayUnit" : "GRAMS" + }, + "maxOrderQuantity" : 6, + "shippingDimension" : { + "length" : 1500, + "width" : 1000, + "height" : 2000 + }, + "refPrice" : { + "refQuantity" : 1, + "unit" : "LITER", + "quantity" : 0.75, + "price" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.6, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.6667, + "taxRate" : 0.2 + } + } + }, + "shippingPeriod" : { + "min" : 2, + "max" : 4, + "displayUnit" : "WEEKS" + }, + "pickupPeriod" : { + "min" : 1, + "max" : 2, + "displayUnit" : "WEEKS" + }, + "name" : "Team42 Product", + "description" : "Spain\nRioja Tempranillo", + "manufacturer" : "Grape Vineyard", + "essentialFeatures" : "Dry. 12% alcohol. Best vine variety.", + "variationAttributes" : [ ], + "customText" : null, + "productLabels" : [ { + "type" : "NEW", + "activeFrom" : "2024-08-13T11:31:30.211", + "activeUntil" : "2024-09-10T11:31:30.211" + } ], + "isVariationProduct" : false, + "_embedded" : { + "availability" : { + "availabilityState" : "IN_STOCK", + "availableStock" : null, + "stockThreshold" : null, + "purchasable" : true, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4bf6d53d-dfb2-4468-b6f9-f6e6265bc0bc/availability" + } + } + } + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4bf6d53d-dfb2-4468-b6f9-f6e6265bc0bc" + }, + "availability" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4bf6d53d-dfb2-4468-b6f9-f6e6265bc0bc/availability" + }, + "attributes" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4bf6d53d-dfb2-4468-b6f9-f6e6265bc0bc/attributes" + }, + "attachments" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4bf6d53d-dfb2-4468-b6f9-f6e6265bc0bc/attachments" + }, + "images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4bf6d53d-dfb2-4468-b6f9-f6e6265bc0bc/images" + }, + "default-image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4bf6d53d-dfb2-4468-b6f9-f6e6265bc0bc/default-image" + }, + "videos" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4bf6d53d-dfb2-4468-b6f9-f6e6265bc0bc/videos" + }, + "cross-sells" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4bf6d53d-dfb2-4468-b6f9-f6e6265bc0bc/cross-sells" + }, + "multiple-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4bf6d53d-dfb2-4468-b6f9-f6e6265bc0bc/multiple-images" + }, + "external-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4bf6d53d-dfb2-4468-b6f9-f6e6265bc0bc/external-images" + }, + "additional-descriptions" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4bf6d53d-dfb2-4468-b6f9-f6e6265bc0bc/additional-descriptions" + } + } + }, { + "_id" : "cb3463f8-90b1-4d0b-a071-d577e9686696", + "lastModifiedAt" : "2024-08-19T05:59:22.945", + "sku" : "1006", + "salesPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 8.7, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 7.25, + "taxRate" : 0.2 + } + }, + "listPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 10.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.125, + "taxRate" : 0.2 + } + }, + "manufacturerPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.95833, + "taxRate" : 0.2 + } + }, + "tags" : [ "Sale", "Bestseller", "Red Wine" ], + "productIdentifiers" : [ { + "type" : "EAN", + "value" : "9780134308135" + } ], + "visible" : true, + "taxClass" : "REGULAR", + "shippingWeight" : { + "value" : 1175.0, + "displayUnit" : "GRAMS" + }, + "maxOrderQuantity" : 6, + "shippingDimension" : { + "length" : 1500, + "width" : 1000, + "height" : 2000 + }, + "refPrice" : { + "refQuantity" : 1, + "unit" : "LITER", + "quantity" : 0.75, + "price" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.6, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.6667, + "taxRate" : 0.2 + } + } + }, + "shippingPeriod" : { + "min" : 2, + "max" : 4, + "displayUnit" : "WEEKS" + }, + "pickupPeriod" : { + "min" : 1, + "max" : 2, + "displayUnit" : "WEEKS" + }, + "name" : "Team42 Product", + "description" : "Spain\nRioja Tempranillo", + "manufacturer" : "Grape Vineyard", + "essentialFeatures" : "Dry. 12% alcohol. Best vine variety.", + "variationAttributes" : [ ], + "customText" : null, + "productLabels" : [ { + "type" : "NEW", + "activeFrom" : "2024-08-13T11:31:30.211", + "activeUntil" : "2024-09-10T11:31:30.211" + } ], + "isVariationProduct" : false, + "_embedded" : { + "availability" : { + "availabilityState" : "IN_STOCK", + "availableStock" : null, + "stockThreshold" : null, + "purchasable" : true, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/cb3463f8-90b1-4d0b-a071-d577e9686696/availability" + } + } + } + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/cb3463f8-90b1-4d0b-a071-d577e9686696" + }, + "availability" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/cb3463f8-90b1-4d0b-a071-d577e9686696/availability" + }, + "attributes" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/cb3463f8-90b1-4d0b-a071-d577e9686696/attributes" + }, + "attachments" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/cb3463f8-90b1-4d0b-a071-d577e9686696/attachments" + }, + "images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/cb3463f8-90b1-4d0b-a071-d577e9686696/images" + }, + "default-image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/cb3463f8-90b1-4d0b-a071-d577e9686696/default-image" + }, + "videos" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/cb3463f8-90b1-4d0b-a071-d577e9686696/videos" + }, + "cross-sells" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/cb3463f8-90b1-4d0b-a071-d577e9686696/cross-sells" + }, + "multiple-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/cb3463f8-90b1-4d0b-a071-d577e9686696/multiple-images" + }, + "external-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/cb3463f8-90b1-4d0b-a071-d577e9686696/external-images" + }, + "additional-descriptions" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/cb3463f8-90b1-4d0b-a071-d577e9686696/additional-descriptions" + } + } + }, { + "_id" : "6c1fba11-2983-4cff-bdd1-8d485fd4e836", + "lastModifiedAt" : "2024-08-19T05:59:23.355", + "sku" : "1007", + "salesPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 8.7, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 7.25, + "taxRate" : 0.2 + } + }, + "listPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 10.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.125, + "taxRate" : 0.2 + } + }, + "manufacturerPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.95833, + "taxRate" : 0.2 + } + }, + "tags" : [ "Sale", "Bestseller", "Red Wine" ], + "productIdentifiers" : [ { + "type" : "EAN", + "value" : "9780134308135" + } ], + "visible" : true, + "taxClass" : "REGULAR", + "shippingWeight" : { + "value" : 1175.0, + "displayUnit" : "GRAMS" + }, + "maxOrderQuantity" : 6, + "shippingDimension" : { + "length" : 1500, + "width" : 1000, + "height" : 2000 + }, + "refPrice" : { + "refQuantity" : 1, + "unit" : "LITER", + "quantity" : 0.75, + "price" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.6, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.6667, + "taxRate" : 0.2 + } + } + }, + "shippingPeriod" : { + "min" : 2, + "max" : 4, + "displayUnit" : "WEEKS" + }, + "pickupPeriod" : { + "min" : 1, + "max" : 2, + "displayUnit" : "WEEKS" + }, + "name" : "Team42 Product", + "description" : "Spain\nRioja Tempranillo", + "manufacturer" : "Grape Vineyard", + "essentialFeatures" : "Dry. 12% alcohol. Best vine variety.", + "variationAttributes" : [ ], + "customText" : null, + "productLabels" : [ { + "type" : "NEW", + "activeFrom" : "2024-08-13T11:31:30.211", + "activeUntil" : "2024-09-10T11:31:30.211" + } ], + "isVariationProduct" : false, + "_embedded" : { + "availability" : { + "availabilityState" : "IN_STOCK", + "availableStock" : null, + "stockThreshold" : null, + "purchasable" : true, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/6c1fba11-2983-4cff-bdd1-8d485fd4e836/availability" + } + } + } + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/6c1fba11-2983-4cff-bdd1-8d485fd4e836" + }, + "availability" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/6c1fba11-2983-4cff-bdd1-8d485fd4e836/availability" + }, + "attributes" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/6c1fba11-2983-4cff-bdd1-8d485fd4e836/attributes" + }, + "attachments" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/6c1fba11-2983-4cff-bdd1-8d485fd4e836/attachments" + }, + "images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/6c1fba11-2983-4cff-bdd1-8d485fd4e836/images" + }, + "default-image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/6c1fba11-2983-4cff-bdd1-8d485fd4e836/default-image" + }, + "videos" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/6c1fba11-2983-4cff-bdd1-8d485fd4e836/videos" + }, + "cross-sells" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/6c1fba11-2983-4cff-bdd1-8d485fd4e836/cross-sells" + }, + "multiple-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/6c1fba11-2983-4cff-bdd1-8d485fd4e836/multiple-images" + }, + "external-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/6c1fba11-2983-4cff-bdd1-8d485fd4e836/external-images" + }, + "additional-descriptions" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/6c1fba11-2983-4cff-bdd1-8d485fd4e836/additional-descriptions" + } + } + } ] + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products?page=0&size=20" + }, + "search" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/search" + } + }, + "page" : { + "size" : 20, + "totalElements" : 3, + "totalPages" : 1, + "number" : 0 + } + } + recorded_at: Mon, 19 Aug 2024 06:13:43 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_ProductManagement_Product/with_product/_create/creates_a_new_product.yml b/spec/vcr_cassettes/BeyondApi_ProductManagement_Product/with_product/_create/creates_a_new_product.yml new file mode 100644 index 0000000..f0e43ab --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_ProductManagement_Product/with_product/_create/creates_a_new_product.yml @@ -0,0 +1,265 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 06:13:43 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.085' + X-B3-Traceid: + - 106773ef766c850d4abdd663005975d6 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1724048023, + "jti" : "no4BNV9le4jdYPwVubX5/joQQKI=" + } + recorded_at: Mon, 19 Aug 2024 06:13:43 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/products + body: + encoding: UTF-8 + string: '{"name":"Team42 Product","description":"Spain\nRioja Tempranillo","manufacturer":"Grape + Vineyard","essentialFeatures":"Dry. 12% alcohol. Best vine variety.","tags":["Bestseller","Red + Wine","Sale"],"productIdentifiers":[{"type":"EAN","value":"9780134308135"}],"salesPrice":{"taxModel":"GROSS","amount":8.7,"currency":"GBP"},"listPrice":{"taxModel":"GROSS","amount":10.95,"currency":"GBP"},"manufacturerPrice":{"taxModel":"GROSS","amount":11.95,"currency":"GBP"},"visible":true,"taxClass":"REGULAR","shippingWeight":{"value":1175.0,"displayUnit":"GRAMS"},"maxOrderQuantity":6,"shippingDimension":{"length":1500,"width":1000,"height":2000},"refPrice":{"refQuantity":1,"unit":"LITER","quantity":0.75,"price":{"taxModel":"GROSS","amount":11.6,"currency":"GBP"}},"shippingPeriod":{"min":2,"max":4,"displayUnit":"WEEKS"},"pickupPeriod":{"min":1,"max":2,"displayUnit":"WEEKS"},"productLabels":[{"type":"NEW","activeFrom":"2024-08-13T11:31:30.210787732","activeUntil":"2024-09-10T11:31:30.210787732"}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Mon, 19 Aug 2024 06:13:43 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/products/622de456-b829-4840-ae51-908c3c4c6e72 + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.167' + X-B3-Traceid: + - 53cf7e966ae413885a6038246feccac7 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "622de456-b829-4840-ae51-908c3c4c6e72", + "lastModifiedAt" : "2024-08-19T06:13:43.611930663", + "sku" : "1008", + "salesPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 8.7, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 7.25, + "taxRate" : 0.2 + } + }, + "listPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 10.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.125, + "taxRate" : 0.2 + } + }, + "manufacturerPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.95833333333333333333333, + "taxRate" : 0.2 + } + }, + "tags" : [ "Bestseller", "Red Wine", "Sale" ], + "productIdentifiers" : [ { + "type" : "EAN", + "value" : "9780134308135" + } ], + "visible" : true, + "taxClass" : "REGULAR", + "shippingWeight" : { + "value" : 1175.0, + "displayUnit" : "GRAMS" + }, + "maxOrderQuantity" : 6, + "shippingDimension" : { + "length" : 1500, + "width" : 1000, + "height" : 2000 + }, + "refPrice" : { + "refQuantity" : 1, + "unit" : "LITER", + "quantity" : 0.75, + "price" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.6, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.6667, + "taxRate" : 0.2 + } + } + }, + "shippingPeriod" : { + "min" : 2, + "max" : 4, + "displayUnit" : "WEEKS" + }, + "pickupPeriod" : { + "min" : 1, + "max" : 2, + "displayUnit" : "WEEKS" + }, + "name" : "Team42 Product", + "description" : "Spain\nRioja Tempranillo", + "manufacturer" : "Grape Vineyard", + "essentialFeatures" : "Dry. 12% alcohol. Best vine variety.", + "variationAttributes" : [ ], + "customText" : null, + "productLabels" : [ { + "type" : "NEW", + "activeFrom" : "2024-08-13T11:31:30.210787732", + "activeUntil" : "2024-09-10T11:31:30.210787732" + } ], + "isVariationProduct" : false, + "_embedded" : { + "availability" : { + "availabilityState" : "IN_STOCK", + "availableStock" : null, + "stockThreshold" : null, + "purchasable" : true, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/622de456-b829-4840-ae51-908c3c4c6e72/availability" + } + } + } + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/622de456-b829-4840-ae51-908c3c4c6e72" + }, + "availability" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/622de456-b829-4840-ae51-908c3c4c6e72/availability" + }, + "attributes" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/622de456-b829-4840-ae51-908c3c4c6e72/attributes" + }, + "attachments" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/622de456-b829-4840-ae51-908c3c4c6e72/attachments" + }, + "images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/622de456-b829-4840-ae51-908c3c4c6e72/images" + }, + "default-image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/622de456-b829-4840-ae51-908c3c4c6e72/default-image" + }, + "videos" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/622de456-b829-4840-ae51-908c3c4c6e72/videos" + }, + "cross-sells" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/622de456-b829-4840-ae51-908c3c4c6e72/cross-sells" + }, + "multiple-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/622de456-b829-4840-ae51-908c3c4c6e72/multiple-images" + }, + "external-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/622de456-b829-4840-ae51-908c3c4c6e72/external-images" + }, + "additional-descriptions" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/622de456-b829-4840-ae51-908c3c4c6e72/additional-descriptions" + } + } + } + recorded_at: Mon, 19 Aug 2024 06:13:43 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_ProductManagement_Product/with_product/_find/returns_a_product.yml b/spec/vcr_cassettes/BeyondApi_ProductManagement_Product/with_product/_find/returns_a_product.yml new file mode 100644 index 0000000..7cfd7ca --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_ProductManagement_Product/with_product/_find/returns_a_product.yml @@ -0,0 +1,460 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 06:13:43 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.104' + X-B3-Traceid: + - fcc97b55c81bd4cabec510e5a30bd056 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1724048023, + "jti" : "06B85BvxBJ2hdbx/0dtllDESTAw=" + } + recorded_at: Mon, 19 Aug 2024 06:13:43 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/products + body: + encoding: UTF-8 + string: '{"name":"Team42 Product","description":"Spain\nRioja Tempranillo","manufacturer":"Grape + Vineyard","essentialFeatures":"Dry. 12% alcohol. Best vine variety.","tags":["Bestseller","Red + Wine","Sale"],"productIdentifiers":[{"type":"EAN","value":"9780134308135"}],"salesPrice":{"taxModel":"GROSS","amount":8.7,"currency":"GBP"},"listPrice":{"taxModel":"GROSS","amount":10.95,"currency":"GBP"},"manufacturerPrice":{"taxModel":"GROSS","amount":11.95,"currency":"GBP"},"visible":true,"taxClass":"REGULAR","shippingWeight":{"value":1175.0,"displayUnit":"GRAMS"},"maxOrderQuantity":6,"shippingDimension":{"length":1500,"width":1000,"height":2000},"refPrice":{"refQuantity":1,"unit":"LITER","quantity":0.75,"price":{"taxModel":"GROSS","amount":11.6,"currency":"GBP"}},"shippingPeriod":{"min":2,"max":4,"displayUnit":"WEEKS"},"pickupPeriod":{"min":1,"max":2,"displayUnit":"WEEKS"},"productLabels":[{"type":"NEW","activeFrom":"2024-08-13T11:31:30.210787732","activeUntil":"2024-09-10T11:31:30.210787732"}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Mon, 19 Aug 2024 06:13:44 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.118' + X-B3-Traceid: + - 0a105ba76ed042b8991a26d55e9c9bd5 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "78c2e576-a3a2-4180-badc-02e9a5dbec1c", + "lastModifiedAt" : "2024-08-19T06:13:44.056298618", + "sku" : "1009", + "salesPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 8.7, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 7.25, + "taxRate" : 0.2 + } + }, + "listPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 10.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.125, + "taxRate" : 0.2 + } + }, + "manufacturerPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.95833333333333333333333, + "taxRate" : 0.2 + } + }, + "tags" : [ "Bestseller", "Red Wine", "Sale" ], + "productIdentifiers" : [ { + "type" : "EAN", + "value" : "9780134308135" + } ], + "visible" : true, + "taxClass" : "REGULAR", + "shippingWeight" : { + "value" : 1175.0, + "displayUnit" : "GRAMS" + }, + "maxOrderQuantity" : 6, + "shippingDimension" : { + "length" : 1500, + "width" : 1000, + "height" : 2000 + }, + "refPrice" : { + "refQuantity" : 1, + "unit" : "LITER", + "quantity" : 0.75, + "price" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.6, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.6667, + "taxRate" : 0.2 + } + } + }, + "shippingPeriod" : { + "min" : 2, + "max" : 4, + "displayUnit" : "WEEKS" + }, + "pickupPeriod" : { + "min" : 1, + "max" : 2, + "displayUnit" : "WEEKS" + }, + "name" : "Team42 Product", + "description" : "Spain\nRioja Tempranillo", + "manufacturer" : "Grape Vineyard", + "essentialFeatures" : "Dry. 12% alcohol. Best vine variety.", + "variationAttributes" : [ ], + "customText" : null, + "productLabels" : [ { + "type" : "NEW", + "activeFrom" : "2024-08-13T11:31:30.210787732", + "activeUntil" : "2024-09-10T11:31:30.210787732" + } ], + "isVariationProduct" : false, + "_embedded" : { + "availability" : { + "availabilityState" : "IN_STOCK", + "availableStock" : null, + "stockThreshold" : null, + "purchasable" : true, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/availability" + } + } + } + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c" + }, + "availability" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/availability" + }, + "attributes" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/attributes" + }, + "attachments" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/attachments" + }, + "images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/images" + }, + "default-image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/default-image" + }, + "videos" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/videos" + }, + "cross-sells" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/cross-sells" + }, + "multiple-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/multiple-images" + }, + "external-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/external-images" + }, + "additional-descriptions" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/additional-descriptions" + } + } + } + recorded_at: Mon, 19 Aug 2024 06:13:44 GMT +- request: + method: get + uri: https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 06:13:44 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.029' + X-B3-Traceid: + - cfefacb3c35ac7180bd7b5431781aec5 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "78c2e576-a3a2-4180-badc-02e9a5dbec1c", + "lastModifiedAt" : "2024-08-19T06:13:44.056", + "sku" : "1009", + "salesPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 8.7, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 7.25, + "taxRate" : 0.2 + } + }, + "listPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 10.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.125, + "taxRate" : 0.2 + } + }, + "manufacturerPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.95833, + "taxRate" : 0.2 + } + }, + "tags" : [ "Sale", "Bestseller", "Red Wine" ], + "productIdentifiers" : [ { + "type" : "EAN", + "value" : "9780134308135" + } ], + "visible" : true, + "taxClass" : "REGULAR", + "shippingWeight" : { + "value" : 1175.0, + "displayUnit" : "GRAMS" + }, + "maxOrderQuantity" : 6, + "shippingDimension" : { + "length" : 1500, + "width" : 1000, + "height" : 2000 + }, + "refPrice" : { + "refQuantity" : 1, + "unit" : "LITER", + "quantity" : 0.75, + "price" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.6, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.6667, + "taxRate" : 0.2 + } + } + }, + "shippingPeriod" : { + "min" : 2, + "max" : 4, + "displayUnit" : "WEEKS" + }, + "pickupPeriod" : { + "min" : 1, + "max" : 2, + "displayUnit" : "WEEKS" + }, + "name" : "Team42 Product", + "description" : "Spain\nRioja Tempranillo", + "manufacturer" : "Grape Vineyard", + "essentialFeatures" : "Dry. 12% alcohol. Best vine variety.", + "variationAttributes" : [ ], + "customText" : null, + "productLabels" : [ { + "type" : "NEW", + "activeFrom" : "2024-08-13T11:31:30.211", + "activeUntil" : "2024-09-10T11:31:30.211" + } ], + "isVariationProduct" : false, + "_embedded" : { + "availability" : { + "availabilityState" : "IN_STOCK", + "availableStock" : null, + "stockThreshold" : null, + "purchasable" : true, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/availability" + } + } + } + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c" + }, + "availability" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/availability" + }, + "attributes" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/attributes" + }, + "attachments" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/attachments" + }, + "images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/images" + }, + "default-image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/default-image" + }, + "videos" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/videos" + }, + "cross-sells" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/cross-sells" + }, + "multiple-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/multiple-images" + }, + "external-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/external-images" + }, + "additional-descriptions" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/additional-descriptions" + } + } + } + recorded_at: Mon, 19 Aug 2024 06:13:44 GMT +recorded_with: VCR 6.2.0 From 6677db6fc04e0412241a6bb3d747901a9c3cfb52 Mon Sep 17 00:00:00 2001 From: k4th Date: Mon, 19 Aug 2024 08:41:37 +0200 Subject: [PATCH 4/9] Update tests --- .../services/authentication/signer.rb | 4 +- .../services/product_management/category.rb | 4 +- .../services/storefront/script_tag.rb | 4 +- .../services/webhook/subscription.rb | 4 +- spec/beyond_api/resources/products_spec.rb | 78 - .../resources/products_view_spec.rb | 15 - spec/beyond_api/resources/variations_spec.rb | 93 - .../services/authentication/signer_spec.rb | 4 +- .../product_management/category_spec.rb | 6 +- .../_all/returns_all_signers.yml | 159 ++ .../_create/creates_a_new_signer.yml | 131 + .../with_signer/_destroy/deletes_a_signer.yml | 185 ++ .../refreshes_the_token.yml | 67 + ...retrieves_token_via_authorization_code.yml | 61 + ...retrieves_token_via_client_credentials.yml | 66 + .../_all/returns_all_shipping_zones.yml | 136 + .../_all/returns_all_categories.yml | 150 + .../_create/creates_a_new_category.yml | 187 ++ .../_destroy/deletes_a_category.yml | 247 ++ .../_find/returns_a_category.yml | 256 ++ .../_update/updates_an_existing_category.yml | 256 ++ .../_all/returns_all_images.yml | 136 + .../_all/returns_all_products.yml | 2413 ++++++++++++++++- .../_create/creates_a_new_product.yml | 52 +- .../with_product/_find/returns_a_product.yml | 92 +- 25 files changed, 4523 insertions(+), 283 deletions(-) delete mode 100644 spec/beyond_api/resources/products_spec.rb delete mode 100644 spec/beyond_api/resources/products_view_spec.rb delete mode 100644 spec/beyond_api/resources/variations_spec.rb create mode 100644 spec/vcr_cassettes/BeyondApi_Authentication_Signer/_all/returns_all_signers.yml create mode 100644 spec/vcr_cassettes/BeyondApi_Authentication_Signer/with_signer/_create/creates_a_new_signer.yml create mode 100644 spec/vcr_cassettes/BeyondApi_Authentication_Signer/with_signer/_destroy/deletes_a_signer.yml create mode 100644 spec/vcr_cassettes/BeyondApi_Authentication_Token/refreshes_the_token.yml create mode 100644 spec/vcr_cassettes/BeyondApi_Authentication_Token/retrieves_token_via_authorization_code.yml create mode 100644 spec/vcr_cassettes/BeyondApi_Authentication_Token/retrieves_token_via_client_credentials.yml create mode 100644 spec/vcr_cassettes/BeyondApi_Checkout_ShippingZone/_all/returns_all_shipping_zones.yml create mode 100644 spec/vcr_cassettes/BeyondApi_ProductManagement_Category/_all/returns_all_categories.yml create mode 100644 spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_create/creates_a_new_category.yml create mode 100644 spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_destroy/deletes_a_category.yml create mode 100644 spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_find/returns_a_category.yml create mode 100644 spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_update/updates_an_existing_category.yml create mode 100644 spec/vcr_cassettes/BeyondApi_ProductManagement_Image/_all/returns_all_images.yml diff --git a/lib/beyond_api/services/authentication/signer.rb b/lib/beyond_api/services/authentication/signer.rb index 2711809..2e67b2d 100644 --- a/lib/beyond_api/services/authentication/signer.rb +++ b/lib/beyond_api/services/authentication/signer.rb @@ -9,8 +9,8 @@ def create post("signers") end - def delete(id) - Connection.delete("signers/#{id}") + def destroy(id) + delete("signers/#{id}") end end end diff --git a/lib/beyond_api/services/product_management/category.rb b/lib/beyond_api/services/product_management/category.rb index 27602c4..8e27ebe 100644 --- a/lib/beyond_api/services/product_management/category.rb +++ b/lib/beyond_api/services/product_management/category.rb @@ -17,8 +17,8 @@ def update(id, body) put("categories/#{id}", body) end - def delete(id) - Connection.delete("categories/#{id}") + def destroy(id) + delete("categories/#{id}") end end end diff --git a/lib/beyond_api/services/storefront/script_tag.rb b/lib/beyond_api/services/storefront/script_tag.rb index d3491ca..6c5eaed 100644 --- a/lib/beyond_api/services/storefront/script_tag.rb +++ b/lib/beyond_api/services/storefront/script_tag.rb @@ -11,8 +11,8 @@ def create(script_url) post("script-tags", script_url:) end - def delete(id) - Connection.delete("script-tags/#{id}") + def destroy(id) + delete("script-tags/#{id}") end end end diff --git a/lib/beyond_api/services/webhook/subscription.rb b/lib/beyond_api/services/webhook/subscription.rb index 97d1668..349f80f 100644 --- a/lib/beyond_api/services/webhook/subscription.rb +++ b/lib/beyond_api/services/webhook/subscription.rb @@ -15,8 +15,8 @@ def delete_all end end - def delete(id) - Connection.delete("webhook-subscriptions/#{id}") + def destroy(id) + delete("webhook-subscriptions/#{id}") end def find(id) diff --git a/spec/beyond_api/resources/products_spec.rb b/spec/beyond_api/resources/products_spec.rb deleted file mode 100644 index db72897..0000000 --- a/spec/beyond_api/resources/products_spec.rb +++ /dev/null @@ -1,78 +0,0 @@ -# frozen_string_literal: true - -RSpec.describe 'BeyondApi::Products' do - let!(:session) do - session = BeyondApi::Session.new(api_url: ENV["SHOP_URL"]) - session.token.client_credentials - end - - let(:product) { @product = session.products.create(FactoryBot.build(:product)) } - - let!(:file_path) do - app_root = File.expand_path(File.dirname("ext.rb")) - "#{app_root}/spec/files/" - end - - describe "non existing product" do - it "create a new regular product and " do - product = session.products.create(FactoryBot.build(:product)) - - expect(product).not_to be nil - expect(product.id).not_to be nil - end - end - - - describe "product exist" do - it "find a product sending an ID" do - response = session.products.find(product.id) - expect(response).not_to be nil - expect(response.id).to eq(product.id) - end - - - it "upload multiple images" do - files = [ - "#{file_path}image1.png", - "#{file_path}image2.png" - ] - - images = session.products.upload_multiple_images(product.id, - files, - ["image1.png", "image2.png"]) - expect(images).not_to be nil - expect(images.embedded.images.is_a?(Array)).to eq true - end - - it "upload a single image" do - file = "#{file_path}image1.png" - - image = session.products.upload_image(product.id, file, "image3.png") - expect(image).not_to be nil - expect(image).to eq true - end - - it "sort product images" do - files = [ - "#{file_path}image1.png", - "#{file_path}image2.png" - ] - - session.products.upload_multiple_images(product.id, - files, - ["image1.png", "image2.png"]) - - images = session.products.images(product.id) - - images_sorted = images.embedded.images.sort_by(&:position).reverse.map(&:id) - - sorted = session.products.sort_images(product.id, images_sorted) - - images = session.products.images(product.id) - - expect(sorted).not_to be nil - expect(sorted).to eq true - expect(images.embedded.images.map(&:id)).to eq images_sorted - end - end -end diff --git a/spec/beyond_api/resources/products_view_spec.rb b/spec/beyond_api/resources/products_view_spec.rb deleted file mode 100644 index d76d054..0000000 --- a/spec/beyond_api/resources/products_view_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -RSpec.describe 'BeyondApi::ProductsView' do - let!(:session) do - session = BeyondApi::Session.new(api_url: ENV["SHOP_URL"]) - session.token.client_credentials - end - - let(:product) { @product = session.products.create(FactoryBot.build(:product)) } - - it "list products with specific tag" do - response = session.products_view.search_by_tag("beyond_api-ruby_client") - expect(response).not_to be nil - expect(response.embedded.products.class).to be(Array) - expect(response.embedded.products.size).to be >= 1 - end -end diff --git a/spec/beyond_api/resources/variations_spec.rb b/spec/beyond_api/resources/variations_spec.rb deleted file mode 100644 index af774b5..0000000 --- a/spec/beyond_api/resources/variations_spec.rb +++ /dev/null @@ -1,93 +0,0 @@ -# frozen_string_literal: true - -RSpec.describe 'BeyondApi::Variations' do - let!(:file_path) do - app_root = File.expand_path(File.dirname("ext.rb")) - "#{app_root}/spec/files/" - end - - let!(:session) do - session = BeyondApi::Session.new(api_url: ENV["SHOP_URL"]) - session.token.client_credentials - end - - let(:product) { session.products.create(FactoryBot.build(:product, :with_variations)) } - let(:variation) do - session.variations.all(product.id).embedded.variations.first - end - let(:default_image_property) do - body = [{ - property: "defaultImage", - enabled: true - }] - session.products.update_variation_properties(product.id, body) - end - - context "Create variation" do - it "Update image variation property" do - body = [{ - property: "defaultImage", - enabled: true - }] - response = session.products.update_variation_properties(product.id, body) - - expect(response).not_to be nil - default_image_prop = response.embedded.variation_properties.find { |prop| prop.property == "defaultImage" } - - expect(default_image_prop).not_to be nil - expect(default_image_prop.enabled).to be true - end - - it "Upload multiple images" do - files = [ - "#{file_path}image1.png", - "#{file_path}image2.png" - ] - - default_image_property - response = session.variations.upload_multiple_images(product.id, - variation.id, - files, - ["image1.png", "image2.png"]) - - expect(response).not_to be nil - end - - it "Upload a single image" do - file = "#{file_path}image1.png" - - default_image_property - response = session.variations.upload_multiple_images(product.id, - variation.id, - file, - "variation1.png") - - expect(response).not_to be nil - end - - it "sort variation images" do - files = [ - "#{file_path}image1.png", - "#{file_path}image2.png" - ] - - default_image_property - response = session.variations.upload_multiple_images(product.id, - variation.id, - files, - ["image1.png", "image2.png"]) - - images = session.variations.images(product.id, variation.id) - - images_sorted = images.embedded.images.sort_by(&:position).reverse.map(&:id) - - sorted = session.variations.sort_images(product.id, variation.id, images_sorted) - - images = session.variations.images(product.id, variation.id) - - expect(sorted).not_to be nil - expect(sorted).to eq true - expect(images.embedded.images.map(&:id)).to eq images_sorted - end - end -end diff --git a/spec/beyond_api/services/authentication/signer_spec.rb b/spec/beyond_api/services/authentication/signer_spec.rb index aa310d1..de8bd76 100644 --- a/spec/beyond_api/services/authentication/signer_spec.rb +++ b/spec/beyond_api/services/authentication/signer_spec.rb @@ -20,9 +20,9 @@ end end - describe '#delete' do + describe '#destroy' do it 'deletes a signer' do - response = client.delete(@signer[:id]) + response = client.destroy(@signer[:id]) expect(response).to be {} end end diff --git a/spec/beyond_api/services/product_management/category_spec.rb b/spec/beyond_api/services/product_management/category_spec.rb index a3752b6..01e048e 100644 --- a/spec/beyond_api/services/product_management/category_spec.rb +++ b/spec/beyond_api/services/product_management/category_spec.rb @@ -43,15 +43,15 @@ end end - describe ".delete" do + describe ".destroy" do it "deletes a category" do - response = client.delete(@category[:id]) + response = client.destroy(@category[:id]) expect(response).to be {} end end after(:each) do - client.delete(@category[:id]) + client.destroy(@category[:id]) rescue BeyondApi::Error end end diff --git a/spec/vcr_cassettes/BeyondApi_Authentication_Signer/_all/returns_all_signers.yml b/spec/vcr_cassettes/BeyondApi_Authentication_Signer/_all/returns_all_signers.yml new file mode 100644 index 0000000..030cc77 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Authentication_Signer/_all/returns_all_signers.yml @@ -0,0 +1,159 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 06:40:41 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.097' + X-B3-Traceid: + - '0636875c3bbcbab7867bda535fe5e243' + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1724049641, + "jti" : "8JwEzj6jy1EWDAYb40//fdukLso=" + } + recorded_at: Mon, 19 Aug 2024 06:40:41 GMT +- request: + method: get + uri: https://team42-beyond-api.beyondshop.cloud/api/signers + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 06:40:41 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.025' + X-B3-Traceid: + - 50d800fb4b92bedd1b243cbfadba6fb4 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_embedded" : { + "signers" : [ { + "_id" : "3c910dd7-65d8-4ee5-af7d-dd82de834d4b", + "createdAt" : "2024-08-19T06:37:59.951", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/signers/3c910dd7-65d8-4ee5-af7d-dd82de834d4b" + } + } + }, { + "_id" : "7add803f-df8a-46a4-9e75-5afd75b01adc", + "createdAt" : "2024-08-19T06:36:40.976", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/signers/7add803f-df8a-46a4-9e75-5afd75b01adc" + } + } + }, { + "_id" : "82920cfb-e1ab-4b3c-8e33-5702d86f6876", + "createdAt" : "2024-08-19T06:37:28.279", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/signers/82920cfb-e1ab-4b3c-8e33-5702d86f6876" + } + } + }, { + "_id" : "b3de5fef-8385-4df4-a9a5-74a5aacb1277", + "createdAt" : "2024-08-19T06:35:38.891", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/signers/b3de5fef-8385-4df4-a9a5-74a5aacb1277" + } + } + } ] + } + } + recorded_at: Mon, 19 Aug 2024 06:40:41 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Authentication_Signer/with_signer/_create/creates_a_new_signer.yml b/spec/vcr_cassettes/BeyondApi_Authentication_Signer/with_signer/_create/creates_a_new_signer.yml new file mode 100644 index 0000000..f826990 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Authentication_Signer/with_signer/_create/creates_a_new_signer.yml @@ -0,0 +1,131 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 06:40:41 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.107' + X-B3-Traceid: + - 76c69d85f495cae946b442180d524db6 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1724049641, + "jti" : "J/GfScnFC3pMwwgs5YDiIVP1HXo=" + } + recorded_at: Mon, 19 Aug 2024 06:40:41 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/signers + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 06:40:41 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.037' + X-B3-Traceid: + - 701352c68f255753f503b83c7fc89eba + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "2248041d-692c-4367-afc0-345cc68eab34", + "sharedSecret" : "59dh9nooefbgcqjnqtggu5s5j4", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/signers/2248041d-692c-4367-afc0-345cc68eab34" + } + } + } + recorded_at: Mon, 19 Aug 2024 06:40:41 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Authentication_Signer/with_signer/_destroy/deletes_a_signer.yml b/spec/vcr_cassettes/BeyondApi_Authentication_Signer/with_signer/_destroy/deletes_a_signer.yml new file mode 100644 index 0000000..7b368bd --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Authentication_Signer/with_signer/_destroy/deletes_a_signer.yml @@ -0,0 +1,185 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 06:40:41 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.109' + X-B3-Traceid: + - d72048fff4e94acf0c52280599675dd9 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1724049641, + "jti" : "DjCpOBsqfphiDcCkDgpoRP4k5EM=" + } + recorded_at: Mon, 19 Aug 2024 06:40:41 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/signers + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 06:40:42 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.040' + X-B3-Traceid: + - c0ee336f1e05d262a21d2b02500caa18 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "494bf9b6-6550-486c-af70-1f6ba20efc15", + "sharedSecret" : "7i089vqpip8rp1rr8knpvtn9vf", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/signers/494bf9b6-6550-486c-af70-1f6ba20efc15" + } + } + } + recorded_at: Mon, 19 Aug 2024 06:40:42 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/signers/494bf9b6-6550-486c-af70-1f6ba20efc15 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 06:40:42 GMT + Content-Length: + - '0' + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.046' + X-B3-Traceid: + - 4ff4a18a386e580d5cb7bad07cd18f96 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Mon, 19 Aug 2024 06:40:42 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Authentication_Token/refreshes_the_token.yml b/spec/vcr_cassettes/BeyondApi_Authentication_Token/refreshes_the_token.yml new file mode 100644 index 0000000..b3d84ca --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Authentication_Token/refreshes_the_token.yml @@ -0,0 +1,67 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=refresh_token&refresh_token= + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 06:40:42 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.068' + X-B3-Traceid: + - 763a7dd5f009d1ffbc6fbf526ebed43e + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "refresh_token" : "", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1724049642, + "jti" : "DrMFA8sRZZLLJO+ba+Jand8vQA0=" + } + recorded_at: Mon, 19 Aug 2024 06:40:42 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Authentication_Token/retrieves_token_via_authorization_code.yml b/spec/vcr_cassettes/BeyondApi_Authentication_Token/retrieves_token_via_authorization_code.yml new file mode 100644 index 0000000..33b231f --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Authentication_Token/retrieves_token_via_authorization_code.yml @@ -0,0 +1,61 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?code=abcde&grant_type=authorization_code + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 400 + message: Bad Request + headers: + Date: + - Mon, 19 Aug 2024 06:40:42 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.065' + X-B3-Traceid: + - f7ff23495578391a48e8521e43b1713c + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "error" : "invalid_grant", + "error_description" : "Invalid authorization code: abcde" + } + recorded_at: Mon, 19 Aug 2024 06:40:42 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Authentication_Token/retrieves_token_via_client_credentials.yml b/spec/vcr_cassettes/BeyondApi_Authentication_Token/retrieves_token_via_client_credentials.yml new file mode 100644 index 0000000..ef2289a --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Authentication_Token/retrieves_token_via_client_credentials.yml @@ -0,0 +1,66 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 06:40:42 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.090' + X-B3-Traceid: + - 7bdb93b33bd69b735ecb9e195d0f5480 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1724049642, + "jti" : "0kCHmq0DeCKbXbVed8Em4P49/SM=" + } + recorded_at: Mon, 19 Aug 2024 06:40:42 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Checkout_ShippingZone/_all/returns_all_shipping_zones.yml b/spec/vcr_cassettes/BeyondApi_Checkout_ShippingZone/_all/returns_all_shipping_zones.yml new file mode 100644 index 0000000..a6034cf --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Checkout_ShippingZone/_all/returns_all_shipping_zones.yml @@ -0,0 +1,136 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 06:40:42 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.102' + X-B3-Traceid: + - ade04437123682156ae9bbd7667045a3 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1724049642, + "jti" : "xEIok9IjDV4GjerA3jFWgrvFXhE=" + } + recorded_at: Mon, 19 Aug 2024 06:40:42 GMT +- request: + method: get + uri: https://team42-beyond-api.beyondshop.cloud/api/shipping-zones + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 06:40:43 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.020' + X-B3-Traceid: + - a5f64146e475157a05c57418c445a262 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_embedded" : { + "shipping-zones" : [ ] + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shipping-zones?page=0&size=20" + } + }, + "page" : { + "size" : 20, + "totalElements" : 0, + "totalPages" : 0, + "number" : 0 + } + } + recorded_at: Mon, 19 Aug 2024 06:40:43 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/_all/returns_all_categories.yml b/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/_all/returns_all_categories.yml new file mode 100644 index 0000000..46bc703 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/_all/returns_all_categories.yml @@ -0,0 +1,150 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 06:40:43 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.085' + X-B3-Traceid: + - 2e5297c116f26110752a13767ed08317 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1724049643, + "jti" : "52PRN2EdpqkLoCJ/CEyh6beJ2d4=" + } + recorded_at: Mon, 19 Aug 2024 06:40:43 GMT +- request: + method: get + uri: https://team42-beyond-api.beyondshop.cloud/api/categories + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 06:40:43 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.024' + X-B3-Traceid: + - da4b1b865b4142c6ab107d91109bd7af + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_embedded" : { + "categories" : [ { + "_id" : "8a4a8f6a-e3d9-4616-9e89-12c42c084534", + "name" : "DO-NOT-DELETE Category", + "type" : "SMART", + "defaultSort" : "HIGHEST_PRICE_FIRST", + "filters" : [ ], + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories/8a4a8f6a-e3d9-4616-9e89-12c42c084534" + }, + "category" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories/8a4a8f6a-e3d9-4616-9e89-12c42c084534" + } + } + } ] + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories?page=0&size=20" + } + }, + "page" : { + "size" : 20, + "totalElements" : 1, + "totalPages" : 1, + "number" : 0 + } + } + recorded_at: Mon, 19 Aug 2024 06:40:43 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_create/creates_a_new_category.yml b/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_create/creates_a_new_category.yml new file mode 100644 index 0000000..9131453 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_create/creates_a_new_category.yml @@ -0,0 +1,187 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 06:40:43 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.091' + X-B3-Traceid: + - 9c45eb30e4575f5f4fe5cc084546e684 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1724049643, + "jti" : "8dcnvbvxhvyHoBbeBAKfSw03gyc=" + } + recorded_at: Mon, 19 Aug 2024 06:40:43 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/categories + body: + encoding: UTF-8 + string: '{"name":"Team42 Category","type":"SMART","defaultSort":"HIGHEST_PRICE_FIRST"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Mon, 19 Aug 2024 06:40:43 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/categories/464df7fc-5801-4eda-8c38-22b6ffd2a823 + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.033' + X-B3-Traceid: + - af3aeca695c94c32801e0c662b63ddb9 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "464df7fc-5801-4eda-8c38-22b6ffd2a823", + "name" : "Team42 Category", + "type" : "SMART", + "defaultSort" : "HIGHEST_PRICE_FIRST", + "filters" : [ ], + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories/464df7fc-5801-4eda-8c38-22b6ffd2a823" + }, + "category" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories/464df7fc-5801-4eda-8c38-22b6ffd2a823" + } + } + } + recorded_at: Mon, 19 Aug 2024 06:40:43 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/categories/464df7fc-5801-4eda-8c38-22b6ffd2a823 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Mon, 19 Aug 2024 06:40:43 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.047' + X-B3-Traceid: + - 7eeb8ed8a7b09af81f8874d37bb821d0 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Mon, 19 Aug 2024 06:40:43 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_destroy/deletes_a_category.yml b/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_destroy/deletes_a_category.yml new file mode 100644 index 0000000..028cc62 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_destroy/deletes_a_category.yml @@ -0,0 +1,247 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 06:40:45 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.112' + X-B3-Traceid: + - dc5d18864eaf21f13f53b1fc42fa463a + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1724049645, + "jti" : "HQfYmpl2Z0QRAzP1B3ryEq8CZ4U=" + } + recorded_at: Mon, 19 Aug 2024 06:40:45 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/categories + body: + encoding: UTF-8 + string: '{"name":"Team42 Category","type":"SMART","defaultSort":"HIGHEST_PRICE_FIRST"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Mon, 19 Aug 2024 06:40:45 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/categories/349a769f-a19b-401f-bc29-45228f4d115a + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.029' + X-B3-Traceid: + - 36495f254777047ecfac8921032839d3 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "349a769f-a19b-401f-bc29-45228f4d115a", + "name" : "Team42 Category", + "type" : "SMART", + "defaultSort" : "HIGHEST_PRICE_FIRST", + "filters" : [ ], + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories/349a769f-a19b-401f-bc29-45228f4d115a" + }, + "category" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories/349a769f-a19b-401f-bc29-45228f4d115a" + } + } + } + recorded_at: Mon, 19 Aug 2024 06:40:45 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/categories/349a769f-a19b-401f-bc29-45228f4d115a + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Mon, 19 Aug 2024 06:40:45 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.040' + X-B3-Traceid: + - fb465a06f039def22ea6a2148387eeb7 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Mon, 19 Aug 2024 06:40:45 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/categories/349a769f-a19b-401f-bc29-45228f4d115a + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 404 + message: Not Found + headers: + Date: + - Mon, 19 Aug 2024 06:40:45 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.016' + X-B3-Traceid: + - 1e6bd69e50fa94a8dd2392ccdcd99aa6 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "errorId" : "resource-not-found", + "details" : { }, + "message" : "No Category found for '349a769f-a19b-401f-bc29-45228f4d115a'", + "traceId" : "1e6bd69e50fa94a8dd2392ccdcd99aa6" + } + recorded_at: Mon, 19 Aug 2024 06:40:45 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_find/returns_a_category.yml b/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_find/returns_a_category.yml new file mode 100644 index 0000000..c727718 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_find/returns_a_category.yml @@ -0,0 +1,256 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 06:40:44 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.149' + X-B3-Traceid: + - 19f41c49ed1a0b4821d56b1f2a5199d0 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1724049644, + "jti" : "YTMVOzRnfL3aopdXeSQQogD61VQ=" + } + recorded_at: Mon, 19 Aug 2024 06:40:44 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/categories + body: + encoding: UTF-8 + string: '{"name":"Team42 Category","type":"SMART","defaultSort":"HIGHEST_PRICE_FIRST"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Mon, 19 Aug 2024 06:40:44 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/categories/380c8a2b-cff2-4789-9777-53a232f4d601 + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.025' + X-B3-Traceid: + - 872ce11570a2ae1a3862dad0b48fab19 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "380c8a2b-cff2-4789-9777-53a232f4d601", + "name" : "Team42 Category", + "type" : "SMART", + "defaultSort" : "HIGHEST_PRICE_FIRST", + "filters" : [ ], + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories/380c8a2b-cff2-4789-9777-53a232f4d601" + }, + "category" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories/380c8a2b-cff2-4789-9777-53a232f4d601" + } + } + } + recorded_at: Mon, 19 Aug 2024 06:40:44 GMT +- request: + method: get + uri: https://team42-beyond-api.beyondshop.cloud/api/categories/380c8a2b-cff2-4789-9777-53a232f4d601 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 06:40:44 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.015' + X-B3-Traceid: + - e685a6f718f5fd74732f9fcdb9c80e2a + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "380c8a2b-cff2-4789-9777-53a232f4d601", + "name" : "Team42 Category", + "type" : "SMART", + "defaultSort" : "HIGHEST_PRICE_FIRST", + "filters" : [ ], + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories/380c8a2b-cff2-4789-9777-53a232f4d601" + }, + "category" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories/380c8a2b-cff2-4789-9777-53a232f4d601" + } + } + } + recorded_at: Mon, 19 Aug 2024 06:40:44 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/categories/380c8a2b-cff2-4789-9777-53a232f4d601 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Mon, 19 Aug 2024 06:40:44 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.033' + X-B3-Traceid: + - '08eca00fb3f15ee4c11470044e64e130' + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Mon, 19 Aug 2024 06:40:44 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_update/updates_an_existing_category.yml b/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_update/updates_an_existing_category.yml new file mode 100644 index 0000000..6833082 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_update/updates_an_existing_category.yml @@ -0,0 +1,256 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 06:40:44 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.139' + X-B3-Traceid: + - eb47a37565c0c4d86ddfbc23d37a76c5 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1724049644, + "jti" : "Vy9nkOpiuE7poFaOts96U5zc7QI=" + } + recorded_at: Mon, 19 Aug 2024 06:40:44 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/categories + body: + encoding: UTF-8 + string: '{"name":"Team42 Category","type":"SMART","defaultSort":"HIGHEST_PRICE_FIRST"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Mon, 19 Aug 2024 06:40:44 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/categories/5f37b352-8c12-414f-96cf-8152e4e23d4d + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.034' + X-B3-Traceid: + - 1dc369d96881200e2c455f732c3c021c + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "5f37b352-8c12-414f-96cf-8152e4e23d4d", + "name" : "Team42 Category", + "type" : "SMART", + "defaultSort" : "HIGHEST_PRICE_FIRST", + "filters" : [ ], + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories/5f37b352-8c12-414f-96cf-8152e4e23d4d" + }, + "category" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories/5f37b352-8c12-414f-96cf-8152e4e23d4d" + } + } + } + recorded_at: Mon, 19 Aug 2024 06:40:44 GMT +- request: + method: put + uri: https://team42-beyond-api.beyondshop.cloud/api/categories/5f37b352-8c12-414f-96cf-8152e4e23d4d + body: + encoding: UTF-8 + string: '{"name":"Category with lowest price first","type":"SMART","defaultSort":"LOWEST_PRICE_FIRST"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 06:40:44 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.044' + X-B3-Traceid: + - 38668d975055f9f37ede46c518c54907 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "5f37b352-8c12-414f-96cf-8152e4e23d4d", + "name" : "Category with lowest price first", + "type" : "SMART", + "defaultSort" : "LOWEST_PRICE_FIRST", + "filters" : [ ], + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories/5f37b352-8c12-414f-96cf-8152e4e23d4d" + }, + "category" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories/5f37b352-8c12-414f-96cf-8152e4e23d4d" + } + } + } + recorded_at: Mon, 19 Aug 2024 06:40:44 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/categories/5f37b352-8c12-414f-96cf-8152e4e23d4d + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Mon, 19 Aug 2024 06:40:45 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.039' + X-B3-Traceid: + - 2dd71cfed1e43d8570f1ab33ffcdf086 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Mon, 19 Aug 2024 06:40:44 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_ProductManagement_Image/_all/returns_all_images.yml b/spec/vcr_cassettes/BeyondApi_ProductManagement_Image/_all/returns_all_images.yml new file mode 100644 index 0000000..969edad --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_ProductManagement_Image/_all/returns_all_images.yml @@ -0,0 +1,136 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 06:40:45 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.089' + X-B3-Traceid: + - 3f6f1d5807e8bf92dca5c2e04ae7048d + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1724049645, + "jti" : "zq3hO+6bHPoM3k4RR8FK0e/RkmQ=" + } + recorded_at: Mon, 19 Aug 2024 06:40:45 GMT +- request: + method: get + uri: https://team42-beyond-api.beyondshop.cloud/api/products/4bf6d53d-dfb2-4468-b6f9-f6e6265bc0bc/images + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 06:40:45 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.023' + X-B3-Traceid: + - e0ae07b6811b4d06362a57425a0a55b0 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_embedded" : { + "images" : [ ] + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4bf6d53d-dfb2-4468-b6f9-f6e6265bc0bc/images?page=0&size=20" + } + }, + "page" : { + "size" : 20, + "totalElements" : 0, + "totalPages" : 0, + "number" : 0 + } + } + recorded_at: Mon, 19 Aug 2024 06:40:45 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_ProductManagement_Product/_all/returns_all_products.yml b/spec/vcr_cassettes/BeyondApi_ProductManagement_Product/_all/returns_all_products.yml index 53c14ea..87fb499 100644 --- a/spec/vcr_cassettes/BeyondApi_ProductManagement_Product/_all/returns_all_products.yml +++ b/spec/vcr_cassettes/BeyondApi_ProductManagement_Product/_all/returns_all_products.yml @@ -23,7 +23,7 @@ http_interactions: message: OK headers: Date: - - Mon, 19 Aug 2024 06:13:43 GMT + - Mon, 19 Aug 2024 06:40:46 GMT Content-Type: - application/json;charset=utf-8 Transfer-Encoding: @@ -45,9 +45,9 @@ http_interactions: Server: - epages-beyond X-Request-Time: - - '0.098' + - '0.146' X-B3-Traceid: - - d5f36a0ed8968b897ca10114fb554be2 + - 0ec04a3cce6cafd10f5ab15b6102e7b8 X-Hello-Human: - Come work with us! https://developer.epages.com/devjobs/ body: @@ -59,10 +59,10 @@ http_interactions: "expires_in" : 3599, "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", "tenantId" : 8542, - "iat" : 1724048023, - "jti" : "wbmjEm3sklF053GJQPRcuTGUOeM=" + "iat" : 1724049646, + "jti" : "mu0JswmAtn8TgH3JWCQ9j902J4I=" } - recorded_at: Mon, 19 Aug 2024 06:13:42 GMT + recorded_at: Mon, 19 Aug 2024 06:40:46 GMT - request: method: get uri: https://team42-beyond-api.beyondshop.cloud/api/products @@ -86,7 +86,7 @@ http_interactions: message: OK headers: Date: - - Mon, 19 Aug 2024 06:13:43 GMT + - Mon, 19 Aug 2024 06:40:46 GMT Content-Type: - application/json Transfer-Encoding: @@ -108,9 +108,9 @@ http_interactions: Server: - epages-beyond X-Request-Time: - - '0.059' + - '0.227' X-B3-Traceid: - - 1bb4216510732544b0381d5e21097911 + - af2a97f1e8074796ca4f5bd8c27aeb0e X-Hello-Human: - Come work with us! https://developer.epages.com/devjobs/ body: @@ -538,22 +538,2411 @@ http_interactions: "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/6c1fba11-2983-4cff-bdd1-8d485fd4e836/additional-descriptions" } } + }, { + "_id" : "622de456-b829-4840-ae51-908c3c4c6e72", + "lastModifiedAt" : "2024-08-19T06:13:43.612", + "sku" : "1008", + "salesPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 8.7, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 7.25, + "taxRate" : 0.2 + } + }, + "listPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 10.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.125, + "taxRate" : 0.2 + } + }, + "manufacturerPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.95833, + "taxRate" : 0.2 + } + }, + "tags" : [ "Sale", "Bestseller", "Red Wine" ], + "productIdentifiers" : [ { + "type" : "EAN", + "value" : "9780134308135" + } ], + "visible" : true, + "taxClass" : "REGULAR", + "shippingWeight" : { + "value" : 1175.0, + "displayUnit" : "GRAMS" + }, + "maxOrderQuantity" : 6, + "shippingDimension" : { + "length" : 1500, + "width" : 1000, + "height" : 2000 + }, + "refPrice" : { + "refQuantity" : 1, + "unit" : "LITER", + "quantity" : 0.75, + "price" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.6, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.6667, + "taxRate" : 0.2 + } + } + }, + "shippingPeriod" : { + "min" : 2, + "max" : 4, + "displayUnit" : "WEEKS" + }, + "pickupPeriod" : { + "min" : 1, + "max" : 2, + "displayUnit" : "WEEKS" + }, + "name" : "Team42 Product", + "description" : "Spain\nRioja Tempranillo", + "manufacturer" : "Grape Vineyard", + "essentialFeatures" : "Dry. 12% alcohol. Best vine variety.", + "variationAttributes" : [ ], + "customText" : null, + "productLabels" : [ { + "type" : "NEW", + "activeFrom" : "2024-08-13T11:31:30.211", + "activeUntil" : "2024-09-10T11:31:30.211" + } ], + "isVariationProduct" : false, + "_embedded" : { + "availability" : { + "availabilityState" : "IN_STOCK", + "availableStock" : null, + "stockThreshold" : null, + "purchasable" : true, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/622de456-b829-4840-ae51-908c3c4c6e72/availability" + } + } + } + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/622de456-b829-4840-ae51-908c3c4c6e72" + }, + "availability" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/622de456-b829-4840-ae51-908c3c4c6e72/availability" + }, + "attributes" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/622de456-b829-4840-ae51-908c3c4c6e72/attributes" + }, + "attachments" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/622de456-b829-4840-ae51-908c3c4c6e72/attachments" + }, + "images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/622de456-b829-4840-ae51-908c3c4c6e72/images" + }, + "default-image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/622de456-b829-4840-ae51-908c3c4c6e72/default-image" + }, + "videos" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/622de456-b829-4840-ae51-908c3c4c6e72/videos" + }, + "cross-sells" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/622de456-b829-4840-ae51-908c3c4c6e72/cross-sells" + }, + "multiple-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/622de456-b829-4840-ae51-908c3c4c6e72/multiple-images" + }, + "external-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/622de456-b829-4840-ae51-908c3c4c6e72/external-images" + }, + "additional-descriptions" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/622de456-b829-4840-ae51-908c3c4c6e72/additional-descriptions" + } + } + }, { + "_id" : "78c2e576-a3a2-4180-badc-02e9a5dbec1c", + "lastModifiedAt" : "2024-08-19T06:13:44.056", + "sku" : "1009", + "salesPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 8.7, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 7.25, + "taxRate" : 0.2 + } + }, + "listPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 10.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.125, + "taxRate" : 0.2 + } + }, + "manufacturerPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.95833, + "taxRate" : 0.2 + } + }, + "tags" : [ "Sale", "Bestseller", "Red Wine" ], + "productIdentifiers" : [ { + "type" : "EAN", + "value" : "9780134308135" + } ], + "visible" : true, + "taxClass" : "REGULAR", + "shippingWeight" : { + "value" : 1175.0, + "displayUnit" : "GRAMS" + }, + "maxOrderQuantity" : 6, + "shippingDimension" : { + "length" : 1500, + "width" : 1000, + "height" : 2000 + }, + "refPrice" : { + "refQuantity" : 1, + "unit" : "LITER", + "quantity" : 0.75, + "price" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.6, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.6667, + "taxRate" : 0.2 + } + } + }, + "shippingPeriod" : { + "min" : 2, + "max" : 4, + "displayUnit" : "WEEKS" + }, + "pickupPeriod" : { + "min" : 1, + "max" : 2, + "displayUnit" : "WEEKS" + }, + "name" : "Team42 Product", + "description" : "Spain\nRioja Tempranillo", + "manufacturer" : "Grape Vineyard", + "essentialFeatures" : "Dry. 12% alcohol. Best vine variety.", + "variationAttributes" : [ ], + "customText" : null, + "productLabels" : [ { + "type" : "NEW", + "activeFrom" : "2024-08-13T11:31:30.211", + "activeUntil" : "2024-09-10T11:31:30.211" + } ], + "isVariationProduct" : false, + "_embedded" : { + "availability" : { + "availabilityState" : "IN_STOCK", + "availableStock" : null, + "stockThreshold" : null, + "purchasable" : true, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/availability" + } + } + } + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c" + }, + "availability" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/availability" + }, + "attributes" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/attributes" + }, + "attachments" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/attachments" + }, + "images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/images" + }, + "default-image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/default-image" + }, + "videos" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/videos" + }, + "cross-sells" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/cross-sells" + }, + "multiple-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/multiple-images" + }, + "external-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/external-images" + }, + "additional-descriptions" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/additional-descriptions" + } + } + }, { + "_id" : "d0a33d33-f629-46a5-a7d6-dbdb22dbae39", + "lastModifiedAt" : "2024-08-19T06:29:52.033", + "sku" : "1010", + "salesPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 8.7, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 7.25, + "taxRate" : 0.2 + } + }, + "listPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 10.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.125, + "taxRate" : 0.2 + } + }, + "manufacturerPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.95833, + "taxRate" : 0.2 + } + }, + "tags" : [ "Sale", "Bestseller", "Red Wine" ], + "productIdentifiers" : [ { + "type" : "EAN", + "value" : "9780134308135" + } ], + "visible" : true, + "taxClass" : "REGULAR", + "shippingWeight" : { + "value" : 1175.0, + "displayUnit" : "GRAMS" + }, + "maxOrderQuantity" : 6, + "shippingDimension" : { + "length" : 1500, + "width" : 1000, + "height" : 2000 + }, + "refPrice" : { + "refQuantity" : 1, + "unit" : "LITER", + "quantity" : 0.75, + "price" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.6, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.6667, + "taxRate" : 0.2 + } + } + }, + "shippingPeriod" : { + "min" : 2, + "max" : 4, + "displayUnit" : "WEEKS" + }, + "pickupPeriod" : { + "min" : 1, + "max" : 2, + "displayUnit" : "WEEKS" + }, + "name" : "Team42 Product", + "description" : "Spain\nRioja Tempranillo", + "manufacturer" : "Grape Vineyard", + "essentialFeatures" : "Dry. 12% alcohol. Best vine variety.", + "variationAttributes" : [ ], + "customText" : null, + "productLabels" : [ { + "type" : "NEW", + "activeFrom" : "2024-08-13T11:31:30.211", + "activeUntil" : "2024-09-10T11:31:30.211" + } ], + "isVariationProduct" : false, + "_embedded" : { + "availability" : { + "availabilityState" : "IN_STOCK", + "availableStock" : null, + "stockThreshold" : null, + "purchasable" : true, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/d0a33d33-f629-46a5-a7d6-dbdb22dbae39/availability" + } + } + } + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/d0a33d33-f629-46a5-a7d6-dbdb22dbae39" + }, + "availability" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/d0a33d33-f629-46a5-a7d6-dbdb22dbae39/availability" + }, + "attributes" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/d0a33d33-f629-46a5-a7d6-dbdb22dbae39/attributes" + }, + "attachments" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/d0a33d33-f629-46a5-a7d6-dbdb22dbae39/attachments" + }, + "images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/d0a33d33-f629-46a5-a7d6-dbdb22dbae39/images" + }, + "default-image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/d0a33d33-f629-46a5-a7d6-dbdb22dbae39/default-image" + }, + "videos" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/d0a33d33-f629-46a5-a7d6-dbdb22dbae39/videos" + }, + "cross-sells" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/d0a33d33-f629-46a5-a7d6-dbdb22dbae39/cross-sells" + }, + "multiple-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/d0a33d33-f629-46a5-a7d6-dbdb22dbae39/multiple-images" + }, + "external-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/d0a33d33-f629-46a5-a7d6-dbdb22dbae39/external-images" + }, + "additional-descriptions" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/d0a33d33-f629-46a5-a7d6-dbdb22dbae39/additional-descriptions" + } + } + }, { + "_id" : "4d16857a-a353-4e88-9cc7-ba0b9cf05c2b", + "lastModifiedAt" : "2024-08-19T06:29:52.458", + "sku" : "1011", + "salesPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 8.7, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 7.25, + "taxRate" : 0.2 + } + }, + "listPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 10.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.125, + "taxRate" : 0.2 + } + }, + "manufacturerPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.95833, + "taxRate" : 0.2 + } + }, + "tags" : [ "Sale", "Bestseller", "Red Wine" ], + "productIdentifiers" : [ { + "type" : "EAN", + "value" : "9780134308135" + } ], + "visible" : true, + "taxClass" : "REGULAR", + "shippingWeight" : { + "value" : 1175.0, + "displayUnit" : "GRAMS" + }, + "maxOrderQuantity" : 6, + "shippingDimension" : { + "length" : 1500, + "width" : 1000, + "height" : 2000 + }, + "refPrice" : { + "refQuantity" : 1, + "unit" : "LITER", + "quantity" : 0.75, + "price" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.6, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.6667, + "taxRate" : 0.2 + } + } + }, + "shippingPeriod" : { + "min" : 2, + "max" : 4, + "displayUnit" : "WEEKS" + }, + "pickupPeriod" : { + "min" : 1, + "max" : 2, + "displayUnit" : "WEEKS" + }, + "name" : "Team42 Product", + "description" : "Spain\nRioja Tempranillo", + "manufacturer" : "Grape Vineyard", + "essentialFeatures" : "Dry. 12% alcohol. Best vine variety.", + "variationAttributes" : [ ], + "customText" : null, + "productLabels" : [ { + "type" : "NEW", + "activeFrom" : "2024-08-13T11:31:30.211", + "activeUntil" : "2024-09-10T11:31:30.211" + } ], + "isVariationProduct" : false, + "_embedded" : { + "availability" : { + "availabilityState" : "IN_STOCK", + "availableStock" : null, + "stockThreshold" : null, + "purchasable" : true, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4d16857a-a353-4e88-9cc7-ba0b9cf05c2b/availability" + } + } + } + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4d16857a-a353-4e88-9cc7-ba0b9cf05c2b" + }, + "availability" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4d16857a-a353-4e88-9cc7-ba0b9cf05c2b/availability" + }, + "attributes" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4d16857a-a353-4e88-9cc7-ba0b9cf05c2b/attributes" + }, + "attachments" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4d16857a-a353-4e88-9cc7-ba0b9cf05c2b/attachments" + }, + "images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4d16857a-a353-4e88-9cc7-ba0b9cf05c2b/images" + }, + "default-image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4d16857a-a353-4e88-9cc7-ba0b9cf05c2b/default-image" + }, + "videos" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4d16857a-a353-4e88-9cc7-ba0b9cf05c2b/videos" + }, + "cross-sells" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4d16857a-a353-4e88-9cc7-ba0b9cf05c2b/cross-sells" + }, + "multiple-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4d16857a-a353-4e88-9cc7-ba0b9cf05c2b/multiple-images" + }, + "external-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4d16857a-a353-4e88-9cc7-ba0b9cf05c2b/external-images" + }, + "additional-descriptions" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4d16857a-a353-4e88-9cc7-ba0b9cf05c2b/additional-descriptions" + } + } + }, { + "_id" : "2d9923be-cc36-41f7-8585-795883ceecdc", + "lastModifiedAt" : "2024-08-19T06:30:37.637", + "sku" : "1012", + "salesPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 8.7, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 7.25, + "taxRate" : 0.2 + } + }, + "listPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 10.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.125, + "taxRate" : 0.2 + } + }, + "manufacturerPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.95833, + "taxRate" : 0.2 + } + }, + "tags" : [ "Sale", "Bestseller", "Red Wine" ], + "productIdentifiers" : [ { + "type" : "EAN", + "value" : "9780134308135" + } ], + "visible" : true, + "taxClass" : "REGULAR", + "shippingWeight" : { + "value" : 1175.0, + "displayUnit" : "GRAMS" + }, + "maxOrderQuantity" : 6, + "shippingDimension" : { + "length" : 1500, + "width" : 1000, + "height" : 2000 + }, + "refPrice" : { + "refQuantity" : 1, + "unit" : "LITER", + "quantity" : 0.75, + "price" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.6, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.6667, + "taxRate" : 0.2 + } + } + }, + "shippingPeriod" : { + "min" : 2, + "max" : 4, + "displayUnit" : "WEEKS" + }, + "pickupPeriod" : { + "min" : 1, + "max" : 2, + "displayUnit" : "WEEKS" + }, + "name" : "Team42 Product", + "description" : "Spain\nRioja Tempranillo", + "manufacturer" : "Grape Vineyard", + "essentialFeatures" : "Dry. 12% alcohol. Best vine variety.", + "variationAttributes" : [ ], + "customText" : null, + "productLabels" : [ { + "type" : "NEW", + "activeFrom" : "2024-08-13T11:31:30.211", + "activeUntil" : "2024-09-10T11:31:30.211" + } ], + "isVariationProduct" : false, + "_embedded" : { + "availability" : { + "availabilityState" : "IN_STOCK", + "availableStock" : null, + "stockThreshold" : null, + "purchasable" : true, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/2d9923be-cc36-41f7-8585-795883ceecdc/availability" + } + } + } + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/2d9923be-cc36-41f7-8585-795883ceecdc" + }, + "availability" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/2d9923be-cc36-41f7-8585-795883ceecdc/availability" + }, + "attributes" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/2d9923be-cc36-41f7-8585-795883ceecdc/attributes" + }, + "attachments" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/2d9923be-cc36-41f7-8585-795883ceecdc/attachments" + }, + "images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/2d9923be-cc36-41f7-8585-795883ceecdc/images" + }, + "default-image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/2d9923be-cc36-41f7-8585-795883ceecdc/default-image" + }, + "videos" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/2d9923be-cc36-41f7-8585-795883ceecdc/videos" + }, + "cross-sells" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/2d9923be-cc36-41f7-8585-795883ceecdc/cross-sells" + }, + "multiple-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/2d9923be-cc36-41f7-8585-795883ceecdc/multiple-images" + }, + "external-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/2d9923be-cc36-41f7-8585-795883ceecdc/external-images" + }, + "additional-descriptions" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/2d9923be-cc36-41f7-8585-795883ceecdc/additional-descriptions" + } + } + }, { + "_id" : "935f97ed-c875-4f24-9f6b-cdb6f09cbddd", + "lastModifiedAt" : "2024-08-19T06:30:38.101", + "sku" : "1013", + "salesPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 8.7, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 7.25, + "taxRate" : 0.2 + } + }, + "listPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 10.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.125, + "taxRate" : 0.2 + } + }, + "manufacturerPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.95833, + "taxRate" : 0.2 + } + }, + "tags" : [ "Sale", "Bestseller", "Red Wine" ], + "productIdentifiers" : [ { + "type" : "EAN", + "value" : "9780134308135" + } ], + "visible" : true, + "taxClass" : "REGULAR", + "shippingWeight" : { + "value" : 1175.0, + "displayUnit" : "GRAMS" + }, + "maxOrderQuantity" : 6, + "shippingDimension" : { + "length" : 1500, + "width" : 1000, + "height" : 2000 + }, + "refPrice" : { + "refQuantity" : 1, + "unit" : "LITER", + "quantity" : 0.75, + "price" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.6, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.6667, + "taxRate" : 0.2 + } + } + }, + "shippingPeriod" : { + "min" : 2, + "max" : 4, + "displayUnit" : "WEEKS" + }, + "pickupPeriod" : { + "min" : 1, + "max" : 2, + "displayUnit" : "WEEKS" + }, + "name" : "Team42 Product", + "description" : "Spain\nRioja Tempranillo", + "manufacturer" : "Grape Vineyard", + "essentialFeatures" : "Dry. 12% alcohol. Best vine variety.", + "variationAttributes" : [ ], + "customText" : null, + "productLabels" : [ { + "type" : "NEW", + "activeFrom" : "2024-08-13T11:31:30.211", + "activeUntil" : "2024-09-10T11:31:30.211" + } ], + "isVariationProduct" : false, + "_embedded" : { + "availability" : { + "availabilityState" : "IN_STOCK", + "availableStock" : null, + "stockThreshold" : null, + "purchasable" : true, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/935f97ed-c875-4f24-9f6b-cdb6f09cbddd/availability" + } + } + } + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/935f97ed-c875-4f24-9f6b-cdb6f09cbddd" + }, + "availability" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/935f97ed-c875-4f24-9f6b-cdb6f09cbddd/availability" + }, + "attributes" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/935f97ed-c875-4f24-9f6b-cdb6f09cbddd/attributes" + }, + "attachments" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/935f97ed-c875-4f24-9f6b-cdb6f09cbddd/attachments" + }, + "images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/935f97ed-c875-4f24-9f6b-cdb6f09cbddd/images" + }, + "default-image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/935f97ed-c875-4f24-9f6b-cdb6f09cbddd/default-image" + }, + "videos" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/935f97ed-c875-4f24-9f6b-cdb6f09cbddd/videos" + }, + "cross-sells" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/935f97ed-c875-4f24-9f6b-cdb6f09cbddd/cross-sells" + }, + "multiple-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/935f97ed-c875-4f24-9f6b-cdb6f09cbddd/multiple-images" + }, + "external-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/935f97ed-c875-4f24-9f6b-cdb6f09cbddd/external-images" + }, + "additional-descriptions" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/935f97ed-c875-4f24-9f6b-cdb6f09cbddd/additional-descriptions" + } + } + }, { + "_id" : "7b16492b-8a5b-4597-8e9d-cd9fcd52af0c", + "lastModifiedAt" : "2024-08-19T06:31:58.649", + "sku" : "1014", + "salesPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 8.7, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 7.25, + "taxRate" : 0.2 + } + }, + "listPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 10.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.125, + "taxRate" : 0.2 + } + }, + "manufacturerPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.95833, + "taxRate" : 0.2 + } + }, + "tags" : [ "Sale", "Bestseller", "Red Wine" ], + "productIdentifiers" : [ { + "type" : "EAN", + "value" : "9780134308135" + } ], + "visible" : true, + "taxClass" : "REGULAR", + "shippingWeight" : { + "value" : 1175.0, + "displayUnit" : "GRAMS" + }, + "maxOrderQuantity" : 6, + "shippingDimension" : { + "length" : 1500, + "width" : 1000, + "height" : 2000 + }, + "refPrice" : { + "refQuantity" : 1, + "unit" : "LITER", + "quantity" : 0.75, + "price" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.6, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.6667, + "taxRate" : 0.2 + } + } + }, + "shippingPeriod" : { + "min" : 2, + "max" : 4, + "displayUnit" : "WEEKS" + }, + "pickupPeriod" : { + "min" : 1, + "max" : 2, + "displayUnit" : "WEEKS" + }, + "name" : "Team42 Product", + "description" : "Spain\nRioja Tempranillo", + "manufacturer" : "Grape Vineyard", + "essentialFeatures" : "Dry. 12% alcohol. Best vine variety.", + "variationAttributes" : [ ], + "customText" : null, + "productLabels" : [ { + "type" : "NEW", + "activeFrom" : "2024-08-13T11:31:30.211", + "activeUntil" : "2024-09-10T11:31:30.211" + } ], + "isVariationProduct" : false, + "_embedded" : { + "availability" : { + "availabilityState" : "IN_STOCK", + "availableStock" : null, + "stockThreshold" : null, + "purchasable" : true, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/7b16492b-8a5b-4597-8e9d-cd9fcd52af0c/availability" + } + } + } + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/7b16492b-8a5b-4597-8e9d-cd9fcd52af0c" + }, + "availability" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/7b16492b-8a5b-4597-8e9d-cd9fcd52af0c/availability" + }, + "attributes" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/7b16492b-8a5b-4597-8e9d-cd9fcd52af0c/attributes" + }, + "attachments" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/7b16492b-8a5b-4597-8e9d-cd9fcd52af0c/attachments" + }, + "images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/7b16492b-8a5b-4597-8e9d-cd9fcd52af0c/images" + }, + "default-image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/7b16492b-8a5b-4597-8e9d-cd9fcd52af0c/default-image" + }, + "videos" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/7b16492b-8a5b-4597-8e9d-cd9fcd52af0c/videos" + }, + "cross-sells" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/7b16492b-8a5b-4597-8e9d-cd9fcd52af0c/cross-sells" + }, + "multiple-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/7b16492b-8a5b-4597-8e9d-cd9fcd52af0c/multiple-images" + }, + "external-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/7b16492b-8a5b-4597-8e9d-cd9fcd52af0c/external-images" + }, + "additional-descriptions" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/7b16492b-8a5b-4597-8e9d-cd9fcd52af0c/additional-descriptions" + } + } + }, { + "_id" : "575da236-82ff-4e5c-84f9-a5514ef05b23", + "lastModifiedAt" : "2024-08-19T06:31:59.05", + "sku" : "1015", + "salesPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 8.7, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 7.25, + "taxRate" : 0.2 + } + }, + "listPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 10.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.125, + "taxRate" : 0.2 + } + }, + "manufacturerPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.95833, + "taxRate" : 0.2 + } + }, + "tags" : [ "Sale", "Bestseller", "Red Wine" ], + "productIdentifiers" : [ { + "type" : "EAN", + "value" : "9780134308135" + } ], + "visible" : true, + "taxClass" : "REGULAR", + "shippingWeight" : { + "value" : 1175.0, + "displayUnit" : "GRAMS" + }, + "maxOrderQuantity" : 6, + "shippingDimension" : { + "length" : 1500, + "width" : 1000, + "height" : 2000 + }, + "refPrice" : { + "refQuantity" : 1, + "unit" : "LITER", + "quantity" : 0.75, + "price" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.6, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.6667, + "taxRate" : 0.2 + } + } + }, + "shippingPeriod" : { + "min" : 2, + "max" : 4, + "displayUnit" : "WEEKS" + }, + "pickupPeriod" : { + "min" : 1, + "max" : 2, + "displayUnit" : "WEEKS" + }, + "name" : "Team42 Product", + "description" : "Spain\nRioja Tempranillo", + "manufacturer" : "Grape Vineyard", + "essentialFeatures" : "Dry. 12% alcohol. Best vine variety.", + "variationAttributes" : [ ], + "customText" : null, + "productLabels" : [ { + "type" : "NEW", + "activeFrom" : "2024-08-13T11:31:30.211", + "activeUntil" : "2024-09-10T11:31:30.211" + } ], + "isVariationProduct" : false, + "_embedded" : { + "availability" : { + "availabilityState" : "IN_STOCK", + "availableStock" : null, + "stockThreshold" : null, + "purchasable" : true, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/575da236-82ff-4e5c-84f9-a5514ef05b23/availability" + } + } + } + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/575da236-82ff-4e5c-84f9-a5514ef05b23" + }, + "availability" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/575da236-82ff-4e5c-84f9-a5514ef05b23/availability" + }, + "attributes" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/575da236-82ff-4e5c-84f9-a5514ef05b23/attributes" + }, + "attachments" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/575da236-82ff-4e5c-84f9-a5514ef05b23/attachments" + }, + "images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/575da236-82ff-4e5c-84f9-a5514ef05b23/images" + }, + "default-image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/575da236-82ff-4e5c-84f9-a5514ef05b23/default-image" + }, + "videos" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/575da236-82ff-4e5c-84f9-a5514ef05b23/videos" + }, + "cross-sells" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/575da236-82ff-4e5c-84f9-a5514ef05b23/cross-sells" + }, + "multiple-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/575da236-82ff-4e5c-84f9-a5514ef05b23/multiple-images" + }, + "external-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/575da236-82ff-4e5c-84f9-a5514ef05b23/external-images" + }, + "additional-descriptions" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/575da236-82ff-4e5c-84f9-a5514ef05b23/additional-descriptions" + } + } + }, { + "_id" : "26221231-953b-4a1c-9025-7c72e610facd", + "lastModifiedAt" : "2024-08-19T06:35:23.365", + "sku" : "1016", + "salesPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 8.7, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 7.25, + "taxRate" : 0.2 + } + }, + "listPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 10.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.125, + "taxRate" : 0.2 + } + }, + "manufacturerPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.95833, + "taxRate" : 0.2 + } + }, + "tags" : [ "Sale", "Bestseller", "Red Wine" ], + "productIdentifiers" : [ { + "type" : "EAN", + "value" : "9780134308135" + } ], + "visible" : true, + "taxClass" : "REGULAR", + "shippingWeight" : { + "value" : 1175.0, + "displayUnit" : "GRAMS" + }, + "maxOrderQuantity" : 6, + "shippingDimension" : { + "length" : 1500, + "width" : 1000, + "height" : 2000 + }, + "refPrice" : { + "refQuantity" : 1, + "unit" : "LITER", + "quantity" : 0.75, + "price" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.6, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.6667, + "taxRate" : 0.2 + } + } + }, + "shippingPeriod" : { + "min" : 2, + "max" : 4, + "displayUnit" : "WEEKS" + }, + "pickupPeriod" : { + "min" : 1, + "max" : 2, + "displayUnit" : "WEEKS" + }, + "name" : "Team42 Product", + "description" : "Spain\nRioja Tempranillo", + "manufacturer" : "Grape Vineyard", + "essentialFeatures" : "Dry. 12% alcohol. Best vine variety.", + "variationAttributes" : [ ], + "customText" : null, + "productLabels" : [ { + "type" : "NEW", + "activeFrom" : "2024-08-13T11:31:30.211", + "activeUntil" : "2024-09-10T11:31:30.211" + } ], + "isVariationProduct" : false, + "_embedded" : { + "availability" : { + "availabilityState" : "IN_STOCK", + "availableStock" : null, + "stockThreshold" : null, + "purchasable" : true, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/26221231-953b-4a1c-9025-7c72e610facd/availability" + } + } + } + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/26221231-953b-4a1c-9025-7c72e610facd" + }, + "availability" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/26221231-953b-4a1c-9025-7c72e610facd/availability" + }, + "attributes" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/26221231-953b-4a1c-9025-7c72e610facd/attributes" + }, + "attachments" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/26221231-953b-4a1c-9025-7c72e610facd/attachments" + }, + "images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/26221231-953b-4a1c-9025-7c72e610facd/images" + }, + "default-image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/26221231-953b-4a1c-9025-7c72e610facd/default-image" + }, + "videos" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/26221231-953b-4a1c-9025-7c72e610facd/videos" + }, + "cross-sells" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/26221231-953b-4a1c-9025-7c72e610facd/cross-sells" + }, + "multiple-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/26221231-953b-4a1c-9025-7c72e610facd/multiple-images" + }, + "external-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/26221231-953b-4a1c-9025-7c72e610facd/external-images" + }, + "additional-descriptions" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/26221231-953b-4a1c-9025-7c72e610facd/additional-descriptions" + } + } + }, { + "_id" : "0b47984d-5322-4d11-9022-41137bd9ddc2", + "lastModifiedAt" : "2024-08-19T06:35:23.857", + "sku" : "1017", + "salesPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 8.7, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 7.25, + "taxRate" : 0.2 + } + }, + "listPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 10.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.125, + "taxRate" : 0.2 + } + }, + "manufacturerPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.95833, + "taxRate" : 0.2 + } + }, + "tags" : [ "Sale", "Bestseller", "Red Wine" ], + "productIdentifiers" : [ { + "type" : "EAN", + "value" : "9780134308135" + } ], + "visible" : true, + "taxClass" : "REGULAR", + "shippingWeight" : { + "value" : 1175.0, + "displayUnit" : "GRAMS" + }, + "maxOrderQuantity" : 6, + "shippingDimension" : { + "length" : 1500, + "width" : 1000, + "height" : 2000 + }, + "refPrice" : { + "refQuantity" : 1, + "unit" : "LITER", + "quantity" : 0.75, + "price" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.6, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.6667, + "taxRate" : 0.2 + } + } + }, + "shippingPeriod" : { + "min" : 2, + "max" : 4, + "displayUnit" : "WEEKS" + }, + "pickupPeriod" : { + "min" : 1, + "max" : 2, + "displayUnit" : "WEEKS" + }, + "name" : "Team42 Product", + "description" : "Spain\nRioja Tempranillo", + "manufacturer" : "Grape Vineyard", + "essentialFeatures" : "Dry. 12% alcohol. Best vine variety.", + "variationAttributes" : [ ], + "customText" : null, + "productLabels" : [ { + "type" : "NEW", + "activeFrom" : "2024-08-13T11:31:30.211", + "activeUntil" : "2024-09-10T11:31:30.211" + } ], + "isVariationProduct" : false, + "_embedded" : { + "availability" : { + "availabilityState" : "IN_STOCK", + "availableStock" : null, + "stockThreshold" : null, + "purchasable" : true, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/0b47984d-5322-4d11-9022-41137bd9ddc2/availability" + } + } + } + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/0b47984d-5322-4d11-9022-41137bd9ddc2" + }, + "availability" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/0b47984d-5322-4d11-9022-41137bd9ddc2/availability" + }, + "attributes" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/0b47984d-5322-4d11-9022-41137bd9ddc2/attributes" + }, + "attachments" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/0b47984d-5322-4d11-9022-41137bd9ddc2/attachments" + }, + "images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/0b47984d-5322-4d11-9022-41137bd9ddc2/images" + }, + "default-image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/0b47984d-5322-4d11-9022-41137bd9ddc2/default-image" + }, + "videos" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/0b47984d-5322-4d11-9022-41137bd9ddc2/videos" + }, + "cross-sells" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/0b47984d-5322-4d11-9022-41137bd9ddc2/cross-sells" + }, + "multiple-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/0b47984d-5322-4d11-9022-41137bd9ddc2/multiple-images" + }, + "external-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/0b47984d-5322-4d11-9022-41137bd9ddc2/external-images" + }, + "additional-descriptions" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/0b47984d-5322-4d11-9022-41137bd9ddc2/additional-descriptions" + } + } + }, { + "_id" : "d4aa7727-aaa5-43d4-80f4-0f51bc8a688e", + "lastModifiedAt" : "2024-08-19T06:35:43.277", + "sku" : "1018", + "salesPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 8.7, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 7.25, + "taxRate" : 0.2 + } + }, + "listPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 10.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.125, + "taxRate" : 0.2 + } + }, + "manufacturerPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.95833, + "taxRate" : 0.2 + } + }, + "tags" : [ "Sale", "Bestseller", "Red Wine" ], + "productIdentifiers" : [ { + "type" : "EAN", + "value" : "9780134308135" + } ], + "visible" : true, + "taxClass" : "REGULAR", + "shippingWeight" : { + "value" : 1175.0, + "displayUnit" : "GRAMS" + }, + "maxOrderQuantity" : 6, + "shippingDimension" : { + "length" : 1500, + "width" : 1000, + "height" : 2000 + }, + "refPrice" : { + "refQuantity" : 1, + "unit" : "LITER", + "quantity" : 0.75, + "price" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.6, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.6667, + "taxRate" : 0.2 + } + } + }, + "shippingPeriod" : { + "min" : 2, + "max" : 4, + "displayUnit" : "WEEKS" + }, + "pickupPeriod" : { + "min" : 1, + "max" : 2, + "displayUnit" : "WEEKS" + }, + "name" : "Team42 Product", + "description" : "Spain\nRioja Tempranillo", + "manufacturer" : "Grape Vineyard", + "essentialFeatures" : "Dry. 12% alcohol. Best vine variety.", + "variationAttributes" : [ ], + "customText" : null, + "productLabels" : [ { + "type" : "NEW", + "activeFrom" : "2024-08-13T11:31:30.211", + "activeUntil" : "2024-09-10T11:31:30.211" + } ], + "isVariationProduct" : false, + "_embedded" : { + "availability" : { + "availabilityState" : "IN_STOCK", + "availableStock" : null, + "stockThreshold" : null, + "purchasable" : true, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/d4aa7727-aaa5-43d4-80f4-0f51bc8a688e/availability" + } + } + } + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/d4aa7727-aaa5-43d4-80f4-0f51bc8a688e" + }, + "availability" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/d4aa7727-aaa5-43d4-80f4-0f51bc8a688e/availability" + }, + "attributes" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/d4aa7727-aaa5-43d4-80f4-0f51bc8a688e/attributes" + }, + "attachments" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/d4aa7727-aaa5-43d4-80f4-0f51bc8a688e/attachments" + }, + "images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/d4aa7727-aaa5-43d4-80f4-0f51bc8a688e/images" + }, + "default-image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/d4aa7727-aaa5-43d4-80f4-0f51bc8a688e/default-image" + }, + "videos" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/d4aa7727-aaa5-43d4-80f4-0f51bc8a688e/videos" + }, + "cross-sells" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/d4aa7727-aaa5-43d4-80f4-0f51bc8a688e/cross-sells" + }, + "multiple-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/d4aa7727-aaa5-43d4-80f4-0f51bc8a688e/multiple-images" + }, + "external-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/d4aa7727-aaa5-43d4-80f4-0f51bc8a688e/external-images" + }, + "additional-descriptions" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/d4aa7727-aaa5-43d4-80f4-0f51bc8a688e/additional-descriptions" + } + } + }, { + "_id" : "b9bf2184-ae5b-4b06-be1a-f4d1140496e3", + "lastModifiedAt" : "2024-08-19T06:35:43.694", + "sku" : "1019", + "salesPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 8.7, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 7.25, + "taxRate" : 0.2 + } + }, + "listPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 10.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.125, + "taxRate" : 0.2 + } + }, + "manufacturerPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.95833, + "taxRate" : 0.2 + } + }, + "tags" : [ "Sale", "Bestseller", "Red Wine" ], + "productIdentifiers" : [ { + "type" : "EAN", + "value" : "9780134308135" + } ], + "visible" : true, + "taxClass" : "REGULAR", + "shippingWeight" : { + "value" : 1175.0, + "displayUnit" : "GRAMS" + }, + "maxOrderQuantity" : 6, + "shippingDimension" : { + "length" : 1500, + "width" : 1000, + "height" : 2000 + }, + "refPrice" : { + "refQuantity" : 1, + "unit" : "LITER", + "quantity" : 0.75, + "price" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.6, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.6667, + "taxRate" : 0.2 + } + } + }, + "shippingPeriod" : { + "min" : 2, + "max" : 4, + "displayUnit" : "WEEKS" + }, + "pickupPeriod" : { + "min" : 1, + "max" : 2, + "displayUnit" : "WEEKS" + }, + "name" : "Team42 Product", + "description" : "Spain\nRioja Tempranillo", + "manufacturer" : "Grape Vineyard", + "essentialFeatures" : "Dry. 12% alcohol. Best vine variety.", + "variationAttributes" : [ ], + "customText" : null, + "productLabels" : [ { + "type" : "NEW", + "activeFrom" : "2024-08-13T11:31:30.211", + "activeUntil" : "2024-09-10T11:31:30.211" + } ], + "isVariationProduct" : false, + "_embedded" : { + "availability" : { + "availabilityState" : "IN_STOCK", + "availableStock" : null, + "stockThreshold" : null, + "purchasable" : true, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/b9bf2184-ae5b-4b06-be1a-f4d1140496e3/availability" + } + } + } + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/b9bf2184-ae5b-4b06-be1a-f4d1140496e3" + }, + "availability" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/b9bf2184-ae5b-4b06-be1a-f4d1140496e3/availability" + }, + "attributes" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/b9bf2184-ae5b-4b06-be1a-f4d1140496e3/attributes" + }, + "attachments" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/b9bf2184-ae5b-4b06-be1a-f4d1140496e3/attachments" + }, + "images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/b9bf2184-ae5b-4b06-be1a-f4d1140496e3/images" + }, + "default-image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/b9bf2184-ae5b-4b06-be1a-f4d1140496e3/default-image" + }, + "videos" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/b9bf2184-ae5b-4b06-be1a-f4d1140496e3/videos" + }, + "cross-sells" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/b9bf2184-ae5b-4b06-be1a-f4d1140496e3/cross-sells" + }, + "multiple-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/b9bf2184-ae5b-4b06-be1a-f4d1140496e3/multiple-images" + }, + "external-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/b9bf2184-ae5b-4b06-be1a-f4d1140496e3/external-images" + }, + "additional-descriptions" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/b9bf2184-ae5b-4b06-be1a-f4d1140496e3/additional-descriptions" + } + } + }, { + "_id" : "bf9665f8-0f16-449f-a6b3-4e6c4e44eb8a", + "lastModifiedAt" : "2024-08-19T06:36:45.318", + "sku" : "1020", + "salesPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 8.7, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 7.25, + "taxRate" : 0.2 + } + }, + "listPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 10.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.125, + "taxRate" : 0.2 + } + }, + "manufacturerPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.95833, + "taxRate" : 0.2 + } + }, + "tags" : [ "Sale", "Bestseller", "Red Wine" ], + "productIdentifiers" : [ { + "type" : "EAN", + "value" : "9780134308135" + } ], + "visible" : true, + "taxClass" : "REGULAR", + "shippingWeight" : { + "value" : 1175.0, + "displayUnit" : "GRAMS" + }, + "maxOrderQuantity" : 6, + "shippingDimension" : { + "length" : 1500, + "width" : 1000, + "height" : 2000 + }, + "refPrice" : { + "refQuantity" : 1, + "unit" : "LITER", + "quantity" : 0.75, + "price" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.6, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.6667, + "taxRate" : 0.2 + } + } + }, + "shippingPeriod" : { + "min" : 2, + "max" : 4, + "displayUnit" : "WEEKS" + }, + "pickupPeriod" : { + "min" : 1, + "max" : 2, + "displayUnit" : "WEEKS" + }, + "name" : "Team42 Product", + "description" : "Spain\nRioja Tempranillo", + "manufacturer" : "Grape Vineyard", + "essentialFeatures" : "Dry. 12% alcohol. Best vine variety.", + "variationAttributes" : [ ], + "customText" : null, + "productLabels" : [ { + "type" : "NEW", + "activeFrom" : "2024-08-13T11:31:30.211", + "activeUntil" : "2024-09-10T11:31:30.211" + } ], + "isVariationProduct" : false, + "_embedded" : { + "availability" : { + "availabilityState" : "IN_STOCK", + "availableStock" : null, + "stockThreshold" : null, + "purchasable" : true, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/bf9665f8-0f16-449f-a6b3-4e6c4e44eb8a/availability" + } + } + } + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/bf9665f8-0f16-449f-a6b3-4e6c4e44eb8a" + }, + "availability" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/bf9665f8-0f16-449f-a6b3-4e6c4e44eb8a/availability" + }, + "attributes" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/bf9665f8-0f16-449f-a6b3-4e6c4e44eb8a/attributes" + }, + "attachments" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/bf9665f8-0f16-449f-a6b3-4e6c4e44eb8a/attachments" + }, + "images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/bf9665f8-0f16-449f-a6b3-4e6c4e44eb8a/images" + }, + "default-image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/bf9665f8-0f16-449f-a6b3-4e6c4e44eb8a/default-image" + }, + "videos" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/bf9665f8-0f16-449f-a6b3-4e6c4e44eb8a/videos" + }, + "cross-sells" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/bf9665f8-0f16-449f-a6b3-4e6c4e44eb8a/cross-sells" + }, + "multiple-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/bf9665f8-0f16-449f-a6b3-4e6c4e44eb8a/multiple-images" + }, + "external-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/bf9665f8-0f16-449f-a6b3-4e6c4e44eb8a/external-images" + }, + "additional-descriptions" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/bf9665f8-0f16-449f-a6b3-4e6c4e44eb8a/additional-descriptions" + } + } + }, { + "_id" : "21cb741d-eb0c-4722-8622-a8b555d1fd03", + "lastModifiedAt" : "2024-08-19T06:36:45.749", + "sku" : "1021", + "salesPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 8.7, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 7.25, + "taxRate" : 0.2 + } + }, + "listPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 10.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.125, + "taxRate" : 0.2 + } + }, + "manufacturerPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.95833, + "taxRate" : 0.2 + } + }, + "tags" : [ "Sale", "Bestseller", "Red Wine" ], + "productIdentifiers" : [ { + "type" : "EAN", + "value" : "9780134308135" + } ], + "visible" : true, + "taxClass" : "REGULAR", + "shippingWeight" : { + "value" : 1175.0, + "displayUnit" : "GRAMS" + }, + "maxOrderQuantity" : 6, + "shippingDimension" : { + "length" : 1500, + "width" : 1000, + "height" : 2000 + }, + "refPrice" : { + "refQuantity" : 1, + "unit" : "LITER", + "quantity" : 0.75, + "price" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.6, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.6667, + "taxRate" : 0.2 + } + } + }, + "shippingPeriod" : { + "min" : 2, + "max" : 4, + "displayUnit" : "WEEKS" + }, + "pickupPeriod" : { + "min" : 1, + "max" : 2, + "displayUnit" : "WEEKS" + }, + "name" : "Team42 Product", + "description" : "Spain\nRioja Tempranillo", + "manufacturer" : "Grape Vineyard", + "essentialFeatures" : "Dry. 12% alcohol. Best vine variety.", + "variationAttributes" : [ ], + "customText" : null, + "productLabels" : [ { + "type" : "NEW", + "activeFrom" : "2024-08-13T11:31:30.211", + "activeUntil" : "2024-09-10T11:31:30.211" + } ], + "isVariationProduct" : false, + "_embedded" : { + "availability" : { + "availabilityState" : "IN_STOCK", + "availableStock" : null, + "stockThreshold" : null, + "purchasable" : true, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/21cb741d-eb0c-4722-8622-a8b555d1fd03/availability" + } + } + } + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/21cb741d-eb0c-4722-8622-a8b555d1fd03" + }, + "availability" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/21cb741d-eb0c-4722-8622-a8b555d1fd03/availability" + }, + "attributes" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/21cb741d-eb0c-4722-8622-a8b555d1fd03/attributes" + }, + "attachments" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/21cb741d-eb0c-4722-8622-a8b555d1fd03/attachments" + }, + "images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/21cb741d-eb0c-4722-8622-a8b555d1fd03/images" + }, + "default-image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/21cb741d-eb0c-4722-8622-a8b555d1fd03/default-image" + }, + "videos" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/21cb741d-eb0c-4722-8622-a8b555d1fd03/videos" + }, + "cross-sells" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/21cb741d-eb0c-4722-8622-a8b555d1fd03/cross-sells" + }, + "multiple-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/21cb741d-eb0c-4722-8622-a8b555d1fd03/multiple-images" + }, + "external-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/21cb741d-eb0c-4722-8622-a8b555d1fd03/external-images" + }, + "additional-descriptions" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/21cb741d-eb0c-4722-8622-a8b555d1fd03/additional-descriptions" + } + } + }, { + "_id" : "687ac2a5-91a9-4d7e-917d-614fabcbc023", + "lastModifiedAt" : "2024-08-19T06:37:32.536", + "sku" : "1022", + "salesPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 8.7, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 7.25, + "taxRate" : 0.2 + } + }, + "listPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 10.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.125, + "taxRate" : 0.2 + } + }, + "manufacturerPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.95833, + "taxRate" : 0.2 + } + }, + "tags" : [ "Sale", "Bestseller", "Red Wine" ], + "productIdentifiers" : [ { + "type" : "EAN", + "value" : "9780134308135" + } ], + "visible" : true, + "taxClass" : "REGULAR", + "shippingWeight" : { + "value" : 1175.0, + "displayUnit" : "GRAMS" + }, + "maxOrderQuantity" : 6, + "shippingDimension" : { + "length" : 1500, + "width" : 1000, + "height" : 2000 + }, + "refPrice" : { + "refQuantity" : 1, + "unit" : "LITER", + "quantity" : 0.75, + "price" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.6, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.6667, + "taxRate" : 0.2 + } + } + }, + "shippingPeriod" : { + "min" : 2, + "max" : 4, + "displayUnit" : "WEEKS" + }, + "pickupPeriod" : { + "min" : 1, + "max" : 2, + "displayUnit" : "WEEKS" + }, + "name" : "Team42 Product", + "description" : "Spain\nRioja Tempranillo", + "manufacturer" : "Grape Vineyard", + "essentialFeatures" : "Dry. 12% alcohol. Best vine variety.", + "variationAttributes" : [ ], + "customText" : null, + "productLabels" : [ { + "type" : "NEW", + "activeFrom" : "2024-08-13T11:31:30.211", + "activeUntil" : "2024-09-10T11:31:30.211" + } ], + "isVariationProduct" : false, + "_embedded" : { + "availability" : { + "availabilityState" : "IN_STOCK", + "availableStock" : null, + "stockThreshold" : null, + "purchasable" : true, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/687ac2a5-91a9-4d7e-917d-614fabcbc023/availability" + } + } + } + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/687ac2a5-91a9-4d7e-917d-614fabcbc023" + }, + "availability" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/687ac2a5-91a9-4d7e-917d-614fabcbc023/availability" + }, + "attributes" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/687ac2a5-91a9-4d7e-917d-614fabcbc023/attributes" + }, + "attachments" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/687ac2a5-91a9-4d7e-917d-614fabcbc023/attachments" + }, + "images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/687ac2a5-91a9-4d7e-917d-614fabcbc023/images" + }, + "default-image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/687ac2a5-91a9-4d7e-917d-614fabcbc023/default-image" + }, + "videos" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/687ac2a5-91a9-4d7e-917d-614fabcbc023/videos" + }, + "cross-sells" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/687ac2a5-91a9-4d7e-917d-614fabcbc023/cross-sells" + }, + "multiple-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/687ac2a5-91a9-4d7e-917d-614fabcbc023/multiple-images" + }, + "external-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/687ac2a5-91a9-4d7e-917d-614fabcbc023/external-images" + }, + "additional-descriptions" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/687ac2a5-91a9-4d7e-917d-614fabcbc023/additional-descriptions" + } + } + }, { + "_id" : "4312d633-0d56-4157-8b33-b587550cca1f", + "lastModifiedAt" : "2024-08-19T06:37:32.972", + "sku" : "1023", + "salesPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 8.7, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 7.25, + "taxRate" : 0.2 + } + }, + "listPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 10.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.125, + "taxRate" : 0.2 + } + }, + "manufacturerPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.95833, + "taxRate" : 0.2 + } + }, + "tags" : [ "Sale", "Bestseller", "Red Wine" ], + "productIdentifiers" : [ { + "type" : "EAN", + "value" : "9780134308135" + } ], + "visible" : true, + "taxClass" : "REGULAR", + "shippingWeight" : { + "value" : 1175.0, + "displayUnit" : "GRAMS" + }, + "maxOrderQuantity" : 6, + "shippingDimension" : { + "length" : 1500, + "width" : 1000, + "height" : 2000 + }, + "refPrice" : { + "refQuantity" : 1, + "unit" : "LITER", + "quantity" : 0.75, + "price" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.6, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.6667, + "taxRate" : 0.2 + } + } + }, + "shippingPeriod" : { + "min" : 2, + "max" : 4, + "displayUnit" : "WEEKS" + }, + "pickupPeriod" : { + "min" : 1, + "max" : 2, + "displayUnit" : "WEEKS" + }, + "name" : "Team42 Product", + "description" : "Spain\nRioja Tempranillo", + "manufacturer" : "Grape Vineyard", + "essentialFeatures" : "Dry. 12% alcohol. Best vine variety.", + "variationAttributes" : [ ], + "customText" : null, + "productLabels" : [ { + "type" : "NEW", + "activeFrom" : "2024-08-13T11:31:30.211", + "activeUntil" : "2024-09-10T11:31:30.211" + } ], + "isVariationProduct" : false, + "_embedded" : { + "availability" : { + "availabilityState" : "IN_STOCK", + "availableStock" : null, + "stockThreshold" : null, + "purchasable" : true, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4312d633-0d56-4157-8b33-b587550cca1f/availability" + } + } + } + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4312d633-0d56-4157-8b33-b587550cca1f" + }, + "availability" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4312d633-0d56-4157-8b33-b587550cca1f/availability" + }, + "attributes" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4312d633-0d56-4157-8b33-b587550cca1f/attributes" + }, + "attachments" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4312d633-0d56-4157-8b33-b587550cca1f/attachments" + }, + "images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4312d633-0d56-4157-8b33-b587550cca1f/images" + }, + "default-image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4312d633-0d56-4157-8b33-b587550cca1f/default-image" + }, + "videos" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4312d633-0d56-4157-8b33-b587550cca1f/videos" + }, + "cross-sells" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4312d633-0d56-4157-8b33-b587550cca1f/cross-sells" + }, + "multiple-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4312d633-0d56-4157-8b33-b587550cca1f/multiple-images" + }, + "external-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4312d633-0d56-4157-8b33-b587550cca1f/external-images" + }, + "additional-descriptions" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4312d633-0d56-4157-8b33-b587550cca1f/additional-descriptions" + } + } + }, { + "_id" : "88fd3c94-bdfe-48a1-bfe7-801ff40d9e0d", + "lastModifiedAt" : "2024-08-19T06:38:04.141", + "sku" : "1024", + "salesPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 8.7, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 7.25, + "taxRate" : 0.2 + } + }, + "listPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 10.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.125, + "taxRate" : 0.2 + } + }, + "manufacturerPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.95833, + "taxRate" : 0.2 + } + }, + "tags" : [ "Sale", "Bestseller", "Red Wine" ], + "productIdentifiers" : [ { + "type" : "EAN", + "value" : "9780134308135" + } ], + "visible" : true, + "taxClass" : "REGULAR", + "shippingWeight" : { + "value" : 1175.0, + "displayUnit" : "GRAMS" + }, + "maxOrderQuantity" : 6, + "shippingDimension" : { + "length" : 1500, + "width" : 1000, + "height" : 2000 + }, + "refPrice" : { + "refQuantity" : 1, + "unit" : "LITER", + "quantity" : 0.75, + "price" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.6, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.6667, + "taxRate" : 0.2 + } + } + }, + "shippingPeriod" : { + "min" : 2, + "max" : 4, + "displayUnit" : "WEEKS" + }, + "pickupPeriod" : { + "min" : 1, + "max" : 2, + "displayUnit" : "WEEKS" + }, + "name" : "Team42 Product", + "description" : "Spain\nRioja Tempranillo", + "manufacturer" : "Grape Vineyard", + "essentialFeatures" : "Dry. 12% alcohol. Best vine variety.", + "variationAttributes" : [ ], + "customText" : null, + "productLabels" : [ { + "type" : "NEW", + "activeFrom" : "2024-08-13T11:31:30.211", + "activeUntil" : "2024-09-10T11:31:30.211" + } ], + "isVariationProduct" : false, + "_embedded" : { + "availability" : { + "availabilityState" : "IN_STOCK", + "availableStock" : null, + "stockThreshold" : null, + "purchasable" : true, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/88fd3c94-bdfe-48a1-bfe7-801ff40d9e0d/availability" + } + } + } + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/88fd3c94-bdfe-48a1-bfe7-801ff40d9e0d" + }, + "availability" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/88fd3c94-bdfe-48a1-bfe7-801ff40d9e0d/availability" + }, + "attributes" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/88fd3c94-bdfe-48a1-bfe7-801ff40d9e0d/attributes" + }, + "attachments" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/88fd3c94-bdfe-48a1-bfe7-801ff40d9e0d/attachments" + }, + "images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/88fd3c94-bdfe-48a1-bfe7-801ff40d9e0d/images" + }, + "default-image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/88fd3c94-bdfe-48a1-bfe7-801ff40d9e0d/default-image" + }, + "videos" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/88fd3c94-bdfe-48a1-bfe7-801ff40d9e0d/videos" + }, + "cross-sells" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/88fd3c94-bdfe-48a1-bfe7-801ff40d9e0d/cross-sells" + }, + "multiple-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/88fd3c94-bdfe-48a1-bfe7-801ff40d9e0d/multiple-images" + }, + "external-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/88fd3c94-bdfe-48a1-bfe7-801ff40d9e0d/external-images" + }, + "additional-descriptions" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/88fd3c94-bdfe-48a1-bfe7-801ff40d9e0d/additional-descriptions" + } + } } ] }, "_links" : { + "first" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products?page=0&size=20" + }, "self" : { "href" : "https://team42-beyond-api.beyondshop.cloud/api/products?page=0&size=20" }, + "next" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products?page=1&size=20" + }, + "last" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products?page=1&size=20" + }, "search" : { "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/search" } }, "page" : { "size" : 20, - "totalElements" : 3, - "totalPages" : 1, + "totalElements" : 21, + "totalPages" : 2, "number" : 0 } } - recorded_at: Mon, 19 Aug 2024 06:13:43 GMT + recorded_at: Mon, 19 Aug 2024 06:40:46 GMT recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_ProductManagement_Product/with_product/_create/creates_a_new_product.yml b/spec/vcr_cassettes/BeyondApi_ProductManagement_Product/with_product/_create/creates_a_new_product.yml index f0e43ab..88ae9c2 100644 --- a/spec/vcr_cassettes/BeyondApi_ProductManagement_Product/with_product/_create/creates_a_new_product.yml +++ b/spec/vcr_cassettes/BeyondApi_ProductManagement_Product/with_product/_create/creates_a_new_product.yml @@ -23,7 +23,7 @@ http_interactions: message: OK headers: Date: - - Mon, 19 Aug 2024 06:13:43 GMT + - Mon, 19 Aug 2024 06:40:46 GMT Content-Type: - application/json;charset=utf-8 Transfer-Encoding: @@ -45,9 +45,9 @@ http_interactions: Server: - epages-beyond X-Request-Time: - - '0.085' + - '0.156' X-B3-Traceid: - - 106773ef766c850d4abdd663005975d6 + - 226eb06e8a88b8ba020d84ad6821fed5 X-Hello-Human: - Come work with us! https://developer.epages.com/devjobs/ body: @@ -59,10 +59,10 @@ http_interactions: "expires_in" : 3599, "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", "tenantId" : 8542, - "iat" : 1724048023, - "jti" : "no4BNV9le4jdYPwVubX5/joQQKI=" + "iat" : 1724049646, + "jti" : "ToaY1QbhYVnXdKVtbo9/zHGP1pY=" } - recorded_at: Mon, 19 Aug 2024 06:13:43 GMT + recorded_at: Mon, 19 Aug 2024 06:40:46 GMT - request: method: post uri: https://team42-beyond-api.beyondshop.cloud/api/products @@ -88,7 +88,7 @@ http_interactions: message: Created headers: Date: - - Mon, 19 Aug 2024 06:13:43 GMT + - Mon, 19 Aug 2024 06:40:47 GMT Content-Type: - application/json Transfer-Encoding: @@ -96,7 +96,7 @@ http_interactions: Connection: - keep-alive Location: - - https://team42-beyond-api.beyondshop.cloud/api/products/622de456-b829-4840-ae51-908c3c4c6e72 + - https://team42-beyond-api.beyondshop.cloud/api/products/0c3d27de-5b4d-4432-bf7b-caf7ff289d93 X-Content-Type-Options: - nosniff X-Xss-Protection: @@ -112,18 +112,18 @@ http_interactions: Server: - epages-beyond X-Request-Time: - - '0.167' + - '0.145' X-B3-Traceid: - - 53cf7e966ae413885a6038246feccac7 + - 29b58716c856411ff91c828f90cfecd2 X-Hello-Human: - Come work with us! https://developer.epages.com/devjobs/ body: encoding: UTF-8 string: |- { - "_id" : "622de456-b829-4840-ae51-908c3c4c6e72", - "lastModifiedAt" : "2024-08-19T06:13:43.611930663", - "sku" : "1008", + "_id" : "0c3d27de-5b4d-4432-bf7b-caf7ff289d93", + "lastModifiedAt" : "2024-08-19T06:40:47.012323725", + "sku" : "1026", "salesPrice" : { "taxModel" : "GROSS", "currency" : "GBP", @@ -220,46 +220,46 @@ http_interactions: "purchasable" : true, "_links" : { "self" : { - "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/622de456-b829-4840-ae51-908c3c4c6e72/availability" + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/0c3d27de-5b4d-4432-bf7b-caf7ff289d93/availability" } } } }, "_links" : { "self" : { - "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/622de456-b829-4840-ae51-908c3c4c6e72" + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/0c3d27de-5b4d-4432-bf7b-caf7ff289d93" }, "availability" : { - "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/622de456-b829-4840-ae51-908c3c4c6e72/availability" + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/0c3d27de-5b4d-4432-bf7b-caf7ff289d93/availability" }, "attributes" : { - "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/622de456-b829-4840-ae51-908c3c4c6e72/attributes" + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/0c3d27de-5b4d-4432-bf7b-caf7ff289d93/attributes" }, "attachments" : { - "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/622de456-b829-4840-ae51-908c3c4c6e72/attachments" + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/0c3d27de-5b4d-4432-bf7b-caf7ff289d93/attachments" }, "images" : { - "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/622de456-b829-4840-ae51-908c3c4c6e72/images" + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/0c3d27de-5b4d-4432-bf7b-caf7ff289d93/images" }, "default-image" : { - "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/622de456-b829-4840-ae51-908c3c4c6e72/default-image" + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/0c3d27de-5b4d-4432-bf7b-caf7ff289d93/default-image" }, "videos" : { - "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/622de456-b829-4840-ae51-908c3c4c6e72/videos" + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/0c3d27de-5b4d-4432-bf7b-caf7ff289d93/videos" }, "cross-sells" : { - "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/622de456-b829-4840-ae51-908c3c4c6e72/cross-sells" + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/0c3d27de-5b4d-4432-bf7b-caf7ff289d93/cross-sells" }, "multiple-images" : { - "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/622de456-b829-4840-ae51-908c3c4c6e72/multiple-images" + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/0c3d27de-5b4d-4432-bf7b-caf7ff289d93/multiple-images" }, "external-images" : { - "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/622de456-b829-4840-ae51-908c3c4c6e72/external-images" + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/0c3d27de-5b4d-4432-bf7b-caf7ff289d93/external-images" }, "additional-descriptions" : { - "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/622de456-b829-4840-ae51-908c3c4c6e72/additional-descriptions" + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/0c3d27de-5b4d-4432-bf7b-caf7ff289d93/additional-descriptions" } } } - recorded_at: Mon, 19 Aug 2024 06:13:43 GMT + recorded_at: Mon, 19 Aug 2024 06:40:46 GMT recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_ProductManagement_Product/with_product/_find/returns_a_product.yml b/spec/vcr_cassettes/BeyondApi_ProductManagement_Product/with_product/_find/returns_a_product.yml index 7cfd7ca..111c0d4 100644 --- a/spec/vcr_cassettes/BeyondApi_ProductManagement_Product/with_product/_find/returns_a_product.yml +++ b/spec/vcr_cassettes/BeyondApi_ProductManagement_Product/with_product/_find/returns_a_product.yml @@ -23,7 +23,7 @@ http_interactions: message: OK headers: Date: - - Mon, 19 Aug 2024 06:13:43 GMT + - Mon, 19 Aug 2024 06:40:47 GMT Content-Type: - application/json;charset=utf-8 Transfer-Encoding: @@ -45,9 +45,9 @@ http_interactions: Server: - epages-beyond X-Request-Time: - - '0.104' + - '0.087' X-B3-Traceid: - - fcc97b55c81bd4cabec510e5a30bd056 + - f7e13b884aa50e1d56de1244c68d8652 X-Hello-Human: - Come work with us! https://developer.epages.com/devjobs/ body: @@ -59,10 +59,10 @@ http_interactions: "expires_in" : 3599, "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", "tenantId" : 8542, - "iat" : 1724048023, - "jti" : "06B85BvxBJ2hdbx/0dtllDESTAw=" + "iat" : 1724049647, + "jti" : "Bm+dFIVaS5YT9k2JXpxVf0D0haE=" } - recorded_at: Mon, 19 Aug 2024 06:13:43 GMT + recorded_at: Mon, 19 Aug 2024 06:40:47 GMT - request: method: post uri: https://team42-beyond-api.beyondshop.cloud/api/products @@ -88,7 +88,7 @@ http_interactions: message: Created headers: Date: - - Mon, 19 Aug 2024 06:13:44 GMT + - Mon, 19 Aug 2024 06:40:47 GMT Content-Type: - application/json Transfer-Encoding: @@ -96,7 +96,7 @@ http_interactions: Connection: - keep-alive Location: - - https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c + - https://team42-beyond-api.beyondshop.cloud/api/products/532065c3-5d71-44a6-8b8d-764c798f3b95 X-Content-Type-Options: - nosniff X-Xss-Protection: @@ -112,18 +112,18 @@ http_interactions: Server: - epages-beyond X-Request-Time: - - '0.118' + - '0.129' X-B3-Traceid: - - 0a105ba76ed042b8991a26d55e9c9bd5 + - 5148ada46a37287265e528a0d4a794bc X-Hello-Human: - Come work with us! https://developer.epages.com/devjobs/ body: encoding: UTF-8 string: |- { - "_id" : "78c2e576-a3a2-4180-badc-02e9a5dbec1c", - "lastModifiedAt" : "2024-08-19T06:13:44.056298618", - "sku" : "1009", + "_id" : "532065c3-5d71-44a6-8b8d-764c798f3b95", + "lastModifiedAt" : "2024-08-19T06:40:47.429253718", + "sku" : "1027", "salesPrice" : { "taxModel" : "GROSS", "currency" : "GBP", @@ -220,51 +220,51 @@ http_interactions: "purchasable" : true, "_links" : { "self" : { - "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/availability" + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/532065c3-5d71-44a6-8b8d-764c798f3b95/availability" } } } }, "_links" : { "self" : { - "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c" + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/532065c3-5d71-44a6-8b8d-764c798f3b95" }, "availability" : { - "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/availability" + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/532065c3-5d71-44a6-8b8d-764c798f3b95/availability" }, "attributes" : { - "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/attributes" + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/532065c3-5d71-44a6-8b8d-764c798f3b95/attributes" }, "attachments" : { - "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/attachments" + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/532065c3-5d71-44a6-8b8d-764c798f3b95/attachments" }, "images" : { - "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/images" + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/532065c3-5d71-44a6-8b8d-764c798f3b95/images" }, "default-image" : { - "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/default-image" + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/532065c3-5d71-44a6-8b8d-764c798f3b95/default-image" }, "videos" : { - "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/videos" + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/532065c3-5d71-44a6-8b8d-764c798f3b95/videos" }, "cross-sells" : { - "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/cross-sells" + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/532065c3-5d71-44a6-8b8d-764c798f3b95/cross-sells" }, "multiple-images" : { - "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/multiple-images" + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/532065c3-5d71-44a6-8b8d-764c798f3b95/multiple-images" }, "external-images" : { - "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/external-images" + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/532065c3-5d71-44a6-8b8d-764c798f3b95/external-images" }, "additional-descriptions" : { - "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/additional-descriptions" + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/532065c3-5d71-44a6-8b8d-764c798f3b95/additional-descriptions" } } } - recorded_at: Mon, 19 Aug 2024 06:13:44 GMT + recorded_at: Mon, 19 Aug 2024 06:40:47 GMT - request: method: get - uri: https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c + uri: https://team42-beyond-api.beyondshop.cloud/api/products/532065c3-5d71-44a6-8b8d-764c798f3b95 body: encoding: US-ASCII string: '' @@ -285,7 +285,7 @@ http_interactions: message: OK headers: Date: - - Mon, 19 Aug 2024 06:13:44 GMT + - Mon, 19 Aug 2024 06:40:47 GMT Content-Type: - application/json Transfer-Encoding: @@ -307,18 +307,18 @@ http_interactions: Server: - epages-beyond X-Request-Time: - - '0.029' + - '0.035' X-B3-Traceid: - - cfefacb3c35ac7180bd7b5431781aec5 + - 7a1e8f0003d347ff5d78ddadbf098880 X-Hello-Human: - Come work with us! https://developer.epages.com/devjobs/ body: encoding: UTF-8 string: |- { - "_id" : "78c2e576-a3a2-4180-badc-02e9a5dbec1c", - "lastModifiedAt" : "2024-08-19T06:13:44.056", - "sku" : "1009", + "_id" : "532065c3-5d71-44a6-8b8d-764c798f3b95", + "lastModifiedAt" : "2024-08-19T06:40:47.429", + "sku" : "1027", "salesPrice" : { "taxModel" : "GROSS", "currency" : "GBP", @@ -415,46 +415,46 @@ http_interactions: "purchasable" : true, "_links" : { "self" : { - "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/availability" + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/532065c3-5d71-44a6-8b8d-764c798f3b95/availability" } } } }, "_links" : { "self" : { - "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c" + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/532065c3-5d71-44a6-8b8d-764c798f3b95" }, "availability" : { - "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/availability" + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/532065c3-5d71-44a6-8b8d-764c798f3b95/availability" }, "attributes" : { - "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/attributes" + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/532065c3-5d71-44a6-8b8d-764c798f3b95/attributes" }, "attachments" : { - "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/attachments" + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/532065c3-5d71-44a6-8b8d-764c798f3b95/attachments" }, "images" : { - "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/images" + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/532065c3-5d71-44a6-8b8d-764c798f3b95/images" }, "default-image" : { - "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/default-image" + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/532065c3-5d71-44a6-8b8d-764c798f3b95/default-image" }, "videos" : { - "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/videos" + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/532065c3-5d71-44a6-8b8d-764c798f3b95/videos" }, "cross-sells" : { - "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/cross-sells" + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/532065c3-5d71-44a6-8b8d-764c798f3b95/cross-sells" }, "multiple-images" : { - "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/multiple-images" + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/532065c3-5d71-44a6-8b8d-764c798f3b95/multiple-images" }, "external-images" : { - "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/external-images" + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/532065c3-5d71-44a6-8b8d-764c798f3b95/external-images" }, "additional-descriptions" : { - "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/additional-descriptions" + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/532065c3-5d71-44a6-8b8d-764c798f3b95/additional-descriptions" } } } - recorded_at: Mon, 19 Aug 2024 06:13:44 GMT + recorded_at: Mon, 19 Aug 2024 06:40:47 GMT recorded_with: VCR 6.2.0 From a5a7460f73b32b8c371695970b1d9b63a43575c7 Mon Sep 17 00:00:00 2001 From: k4th Date: Mon, 19 Aug 2024 09:26:10 +0200 Subject: [PATCH 5/9] Add tests --- .../services/storefront/script_tag_spec.rb | 38 +++ .../services/webhook/subscription_spec.rb | 46 ++++ spec/factories/category_data.rb | 2 +- spec/factories/webhook_data.rb | 8 + .../_all/returns_all_script_tags.yml | 136 ++++++++++ .../_create/creates_a_new_category.yml | 182 +++++++++++++ .../_destroy/deletes_a_script_tag.yml | 242 +++++++++++++++++ .../_find/returns_a_script_tag.yml | 182 +++++++++++++ .../returns_all_webhook_subscriptions.yml | 136 ++++++++++ .../creates_a_new_webhook_subscription.yml | 186 +++++++++++++ .../deletes_a_webhook_subscription.yml | 238 ++++++++++++++++ .../_find/returns_a_webhook_subscription.yml | 254 ++++++++++++++++++ 12 files changed, 1649 insertions(+), 1 deletion(-) create mode 100644 spec/beyond_api/services/storefront/script_tag_spec.rb create mode 100644 spec/beyond_api/services/webhook/subscription_spec.rb create mode 100644 spec/factories/webhook_data.rb create mode 100644 spec/vcr_cassettes/BeyondApi_Storefront_ScriptTag/_all/returns_all_script_tags.yml create mode 100644 spec/vcr_cassettes/BeyondApi_Storefront_ScriptTag/with_script_tag/_create/creates_a_new_category.yml create mode 100644 spec/vcr_cassettes/BeyondApi_Storefront_ScriptTag/with_script_tag/_destroy/deletes_a_script_tag.yml create mode 100644 spec/vcr_cassettes/BeyondApi_Storefront_ScriptTag/with_script_tag/_find/returns_a_script_tag.yml create mode 100644 spec/vcr_cassettes/BeyondApi_Webhook_Subscription/_all/returns_all_webhook_subscriptions.yml create mode 100644 spec/vcr_cassettes/BeyondApi_Webhook_Subscription/with_webhook_subscription/_create/creates_a_new_webhook_subscription.yml create mode 100644 spec/vcr_cassettes/BeyondApi_Webhook_Subscription/with_webhook_subscription/_destroy/deletes_a_webhook_subscription.yml create mode 100644 spec/vcr_cassettes/BeyondApi_Webhook_Subscription/with_webhook_subscription/_find/returns_a_webhook_subscription.yml diff --git a/spec/beyond_api/services/storefront/script_tag_spec.rb b/spec/beyond_api/services/storefront/script_tag_spec.rb new file mode 100644 index 0000000..81fbe0c --- /dev/null +++ b/spec/beyond_api/services/storefront/script_tag_spec.rb @@ -0,0 +1,38 @@ +RSpec.describe BeyondApi::Storefront::ScriptTag, vcr: true do + let(:client) { described_class.new(api_url: ENV["API_URL"], access_token: auth_client.client_credentials[:access_token]) } + + describe ".all" do + it "returns all script tags" do + response = client.all + + expect(response).not_to be nil + expect(response.dig(:embedded, :script_tags)).to be_kind_of(Array) + expect(response.dig(:page)).to be_kind_of(Hash) + end + end + + context "with script tag" do + before(:each) do + @script_tag = client.create("https://example.com/scripts/exampleScript.js") + end + + describe ".create" do + it "creates a new category" do + expect(@script_tag).not_to be nil + expect(@script_tag[:script_url]).to eq("https://example.com/scripts/exampleScript.js") + end + end + + describe ".destroy" do + it "deletes a script tag" do + response = client.destroy(@script_tag[:id]) + expect(response).to be {} + end + end + + after(:each) do + client.destroy(@script_tag[:id]) + rescue BeyondApi::Error + end + end +end diff --git a/spec/beyond_api/services/webhook/subscription_spec.rb b/spec/beyond_api/services/webhook/subscription_spec.rb new file mode 100644 index 0000000..9213b59 --- /dev/null +++ b/spec/beyond_api/services/webhook/subscription_spec.rb @@ -0,0 +1,46 @@ +RSpec.describe BeyondApi::Webhook::Subscription, vcr: true do + let(:client) { described_class.new(api_url: ENV["API_URL"], access_token: auth_client.client_credentials[:access_token]) } + + describe ".all" do + it "returns all webhook subscriptions" do + response = client.all + + expect(response).not_to be nil + expect(response.dig(:embedded, :subscriptions)).to be_kind_of(Array) + expect(response.dig(:page)).to be_kind_of(Hash) + end + end + + context "with webhook subscription" do + before(:each) do + @webhook_subscription = client.create(build(:webhook_data)) + end + + describe ".create" do + it "creates a new webhook subscription" do + expect(@webhook_subscription).not_to be nil + expect(@webhook_subscription[:callback_uri]).to eq("http://example.com/test") + expect(@webhook_subscription[:event_types]).to eq(["order.created", "product.created"]) + end + end + + describe ".find" do + it "returns a webhook subscription" do + response = client.find(@webhook_subscription[:id]) + expect(response[:callback_uri]).to eq("http://example.com/test") + end + end + + describe ".destroy" do + it "deletes a webhook subscription" do + response = client.destroy(@webhook_subscription[:id]) + expect(response).to be {} + end + end + + after(:each) do + client.destroy(@webhook_subscription[:id]) + rescue BeyondApi::Error + end + end +end diff --git a/spec/factories/category_data.rb b/spec/factories/category_data.rb index 116b674..8f28256 100644 --- a/spec/factories/category_data.rb +++ b/spec/factories/category_data.rb @@ -11,4 +11,4 @@ initialize_with { attributes } end -end \ No newline at end of file +end diff --git a/spec/factories/webhook_data.rb b/spec/factories/webhook_data.rb new file mode 100644 index 0000000..39b9c4c --- /dev/null +++ b/spec/factories/webhook_data.rb @@ -0,0 +1,8 @@ +FactoryBot.define do + factory :webhook_data, class: Hash do + callback_uri { "http://example.com/test" } + event_types { ["order.created", "product.created"] } + + initialize_with { attributes } + end +end diff --git a/spec/vcr_cassettes/BeyondApi_Storefront_ScriptTag/_all/returns_all_script_tags.yml b/spec/vcr_cassettes/BeyondApi_Storefront_ScriptTag/_all/returns_all_script_tags.yml new file mode 100644 index 0000000..ef99947 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Storefront_ScriptTag/_all/returns_all_script_tags.yml @@ -0,0 +1,136 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 07:16:55 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.088' + X-B3-Traceid: + - d8bb94fce645e11df41f02cdf798c48c + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1724051815, + "jti" : "tZ1d2LY1w2EHdOp6Fio2ID2v6sU=" + } + recorded_at: Mon, 19 Aug 2024 07:16:55 GMT +- request: + method: get + uri: https://team42-beyond-api.beyondshop.cloud/api/script-tags + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 07:16:55 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.019' + X-B3-Traceid: + - 4bb5130872df2dc70bef5c5eabcb7790 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_embedded" : { + "script-tags" : [ ] + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/script-tags?page=0&size=20" + } + }, + "page" : { + "size" : 20, + "totalElements" : 0, + "totalPages" : 0, + "number" : 0 + } + } + recorded_at: Mon, 19 Aug 2024 07:16:55 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Storefront_ScriptTag/with_script_tag/_create/creates_a_new_category.yml b/spec/vcr_cassettes/BeyondApi_Storefront_ScriptTag/with_script_tag/_create/creates_a_new_category.yml new file mode 100644 index 0000000..0adb11d --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Storefront_ScriptTag/with_script_tag/_create/creates_a_new_category.yml @@ -0,0 +1,182 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 07:16:55 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.084' + X-B3-Traceid: + - 0c97be1daa45232d28dd92b0f670a097 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1724051815, + "jti" : "oSMzgxORYBuMaGTwU6WxFQhB3PI=" + } + recorded_at: Mon, 19 Aug 2024 07:16:55 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/script-tags + body: + encoding: UTF-8 + string: '{"scriptUrl":"https://example.com/scripts/exampleScript.js"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Mon, 19 Aug 2024 07:16:55 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/script-tags/3bda8799-ed96-4f27-836a-4fb034e43a48 + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.074' + X-B3-Traceid: + - ca7443df2ac52d190d47ea8d7df1ffb4 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "3bda8799-ed96-4f27-836a-4fb034e43a48", + "categories" : [ ], + "scriptUrl" : "https://example.com/scripts/exampleScript.js", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/script-tags/3bda8799-ed96-4f27-836a-4fb034e43a48" + } + } + } + recorded_at: Mon, 19 Aug 2024 07:16:55 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/script-tags/3bda8799-ed96-4f27-836a-4fb034e43a48 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Mon, 19 Aug 2024 07:16:56 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.026' + X-B3-Traceid: + - d943e40a62bcba3951b1f008012de45d + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Mon, 19 Aug 2024 07:16:55 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Storefront_ScriptTag/with_script_tag/_destroy/deletes_a_script_tag.yml b/spec/vcr_cassettes/BeyondApi_Storefront_ScriptTag/with_script_tag/_destroy/deletes_a_script_tag.yml new file mode 100644 index 0000000..a4e4441 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Storefront_ScriptTag/with_script_tag/_destroy/deletes_a_script_tag.yml @@ -0,0 +1,242 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 07:16:56 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.089' + X-B3-Traceid: + - a593d0cdd236de07616aef78bf6a6655 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1724051816, + "jti" : "FU5e5c1fVeoVADYx6gMOUbbaE9g=" + } + recorded_at: Mon, 19 Aug 2024 07:16:56 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/script-tags + body: + encoding: UTF-8 + string: '{"scriptUrl":"https://example.com/scripts/exampleScript.js"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Mon, 19 Aug 2024 07:16:56 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/script-tags/c84ded08-d594-4124-a868-cf660c507e10 + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.037' + X-B3-Traceid: + - 4b85311b0c4bc77c83cbd4b03eaf43cc + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "c84ded08-d594-4124-a868-cf660c507e10", + "categories" : [ ], + "scriptUrl" : "https://example.com/scripts/exampleScript.js", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/script-tags/c84ded08-d594-4124-a868-cf660c507e10" + } + } + } + recorded_at: Mon, 19 Aug 2024 07:16:56 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/script-tags/c84ded08-d594-4124-a868-cf660c507e10 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Mon, 19 Aug 2024 07:16:56 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.049' + X-B3-Traceid: + - 7d438309bcb3899f073002e6bcaec3d9 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Mon, 19 Aug 2024 07:16:56 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/script-tags/c84ded08-d594-4124-a868-cf660c507e10 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 404 + message: Not Found + headers: + Date: + - Mon, 19 Aug 2024 07:16:57 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.027' + X-B3-Traceid: + - a3989af594a1f550cdfc565446fe21b9 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "errorId" : "script-tag.not-found", + "details" : { }, + "message" : "script-tag with id c84ded08-d594-4124-a868-cf660c507e10 could not be found", + "traceId" : "a3989af594a1f550cdfc565446fe21b9" + } + recorded_at: Mon, 19 Aug 2024 07:16:57 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Storefront_ScriptTag/with_script_tag/_find/returns_a_script_tag.yml b/spec/vcr_cassettes/BeyondApi_Storefront_ScriptTag/with_script_tag/_find/returns_a_script_tag.yml new file mode 100644 index 0000000..60b4c61 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Storefront_ScriptTag/with_script_tag/_find/returns_a_script_tag.yml @@ -0,0 +1,182 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 07:16:56 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.090' + X-B3-Traceid: + - 69f92027deeb0baa1b3cc91a4fc2b0a9 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1724051816, + "jti" : "fibGyoBMMp+/jt/tl0DI6Y3psV8=" + } + recorded_at: Mon, 19 Aug 2024 07:16:56 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/script-tags + body: + encoding: UTF-8 + string: '{"scriptUrl":"https://example.com/scripts/exampleScript.js"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Mon, 19 Aug 2024 07:16:56 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/script-tags/2d427037-5968-46e6-b32a-a59f189ebfb2 + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.030' + X-B3-Traceid: + - d76f1dd31353f4c98c74c418a4fe7fc5 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "2d427037-5968-46e6-b32a-a59f189ebfb2", + "categories" : [ ], + "scriptUrl" : "https://example.com/scripts/exampleScript.js", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/script-tags/2d427037-5968-46e6-b32a-a59f189ebfb2" + } + } + } + recorded_at: Mon, 19 Aug 2024 07:16:56 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/script-tags/2d427037-5968-46e6-b32a-a59f189ebfb2 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Mon, 19 Aug 2024 07:16:56 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.057' + X-B3-Traceid: + - 26a4d23f761f124c1408ca0ea977412a + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Mon, 19 Aug 2024 07:16:56 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Webhook_Subscription/_all/returns_all_webhook_subscriptions.yml b/spec/vcr_cassettes/BeyondApi_Webhook_Subscription/_all/returns_all_webhook_subscriptions.yml new file mode 100644 index 0000000..394f975 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Webhook_Subscription/_all/returns_all_webhook_subscriptions.yml @@ -0,0 +1,136 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 07:25:12 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.111' + X-B3-Traceid: + - e0b99fb5d7ea3fa4fee24a224568d657 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1724052312, + "jti" : "CtoBgVKfRCv3wpVQ9i1Wt0WOr3U=" + } + recorded_at: Mon, 19 Aug 2024 07:25:12 GMT +- request: + method: get + uri: https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 07:25:12 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.054' + X-B3-Traceid: + - 4671d01950bc1fa1eb36536e344c3231 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_embedded" : { + "subscriptions" : [ ] + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions" + } + }, + "page" : { + "size" : 20, + "totalElements" : 0, + "totalPages" : 0, + "number" : 0 + } + } + recorded_at: Mon, 19 Aug 2024 07:25:12 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Webhook_Subscription/with_webhook_subscription/_create/creates_a_new_webhook_subscription.yml b/spec/vcr_cassettes/BeyondApi_Webhook_Subscription/with_webhook_subscription/_create/creates_a_new_webhook_subscription.yml new file mode 100644 index 0000000..f004bef --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Webhook_Subscription/with_webhook_subscription/_create/creates_a_new_webhook_subscription.yml @@ -0,0 +1,186 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 07:25:12 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.096' + X-B3-Traceid: + - 29853db6da84b038e366c4c73a92e840 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1724052312, + "jti" : "dEZQvxoGOAVa9WMsx8d3qhjUrcI=" + } + recorded_at: Mon, 19 Aug 2024 07:25:12 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions + body: + encoding: UTF-8 + string: '{"callbackUri":"http://example.com/test","eventTypes":["order.created","product.created"]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Mon, 19 Aug 2024 07:25:12 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/2a3707d0-3cc1-462a-84c2-176c5e1cf689 + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.055' + X-B3-Traceid: + - a543aff3022f92da255ecbc32ba6f474 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "callbackUri" : "http://example.com/test", + "eventTypes" : [ "order.created", "product.created" ], + "active" : true, + "_id" : "2a3707d0-3cc1-462a-84c2-176c5e1cf689", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/2a3707d0-3cc1-462a-84c2-176c5e1cf689" + }, + "deactivate" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/2a3707d0-3cc1-462a-84c2-176c5e1cf689/deactivate" + } + } + } + recorded_at: Mon, 19 Aug 2024 07:25:12 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/2a3707d0-3cc1-462a-84c2-176c5e1cf689 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Mon, 19 Aug 2024 07:25:13 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.038' + X-B3-Traceid: + - fd40a1d4fc79789287c66b0ad0cc1fa2 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Mon, 19 Aug 2024 07:25:13 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Webhook_Subscription/with_webhook_subscription/_destroy/deletes_a_webhook_subscription.yml b/spec/vcr_cassettes/BeyondApi_Webhook_Subscription/with_webhook_subscription/_destroy/deletes_a_webhook_subscription.yml new file mode 100644 index 0000000..a76d87f --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Webhook_Subscription/with_webhook_subscription/_destroy/deletes_a_webhook_subscription.yml @@ -0,0 +1,238 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 07:25:13 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.101' + X-B3-Traceid: + - 4db8dbee6bd5eb98accdbc08e7882f9a + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1724052313, + "jti" : "2ArIrBGdwUsrtgORQ3UHj53FcCk=" + } + recorded_at: Mon, 19 Aug 2024 07:25:13 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions + body: + encoding: UTF-8 + string: '{"callbackUri":"http://example.com/test","eventTypes":["order.created","product.created"]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Mon, 19 Aug 2024 07:25:13 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/a6cbd477-e250-4aaf-85cc-5dc899573a6c + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.039' + X-B3-Traceid: + - a378220db8b2d3339b2fa689ffc28cc8 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "callbackUri" : "http://example.com/test", + "eventTypes" : [ "order.created", "product.created" ], + "active" : true, + "_id" : "a6cbd477-e250-4aaf-85cc-5dc899573a6c", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/a6cbd477-e250-4aaf-85cc-5dc899573a6c" + }, + "deactivate" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/a6cbd477-e250-4aaf-85cc-5dc899573a6c/deactivate" + } + } + } + recorded_at: Mon, 19 Aug 2024 07:25:13 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/a6cbd477-e250-4aaf-85cc-5dc899573a6c + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Mon, 19 Aug 2024 07:25:14 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.035' + X-B3-Traceid: + - f42e017c7d27b95cff64de4d173ad537 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Mon, 19 Aug 2024 07:25:14 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/a6cbd477-e250-4aaf-85cc-5dc899573a6c + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 404 + message: Not Found + headers: + Date: + - Mon, 19 Aug 2024 07:25:14 GMT + Content-Length: + - '0' + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.017' + X-B3-Traceid: + - e017a73d6b541d39e90ca41bf4fbca6c + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Mon, 19 Aug 2024 07:25:14 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Webhook_Subscription/with_webhook_subscription/_find/returns_a_webhook_subscription.yml b/spec/vcr_cassettes/BeyondApi_Webhook_Subscription/with_webhook_subscription/_find/returns_a_webhook_subscription.yml new file mode 100644 index 0000000..67948af --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Webhook_Subscription/with_webhook_subscription/_find/returns_a_webhook_subscription.yml @@ -0,0 +1,254 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 07:25:13 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.084' + X-B3-Traceid: + - c962e7ebc9678a42f7470be9c81b683b + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1724052313, + "jti" : "puBdyxl6qlmDmf+P8r/jL4V1F8c=" + } + recorded_at: Mon, 19 Aug 2024 07:25:13 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions + body: + encoding: UTF-8 + string: '{"callbackUri":"http://example.com/test","eventTypes":["order.created","product.created"]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Mon, 19 Aug 2024 07:25:13 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/50873c4d-97da-4cbb-b221-1b6da35dd1fd + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.033' + X-B3-Traceid: + - f87514392ebcf7dec97dd79d461f0a0e + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "callbackUri" : "http://example.com/test", + "eventTypes" : [ "order.created", "product.created" ], + "active" : true, + "_id" : "50873c4d-97da-4cbb-b221-1b6da35dd1fd", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/50873c4d-97da-4cbb-b221-1b6da35dd1fd" + }, + "deactivate" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/50873c4d-97da-4cbb-b221-1b6da35dd1fd/deactivate" + } + } + } + recorded_at: Mon, 19 Aug 2024 07:25:13 GMT +- request: + method: get + uri: https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/50873c4d-97da-4cbb-b221-1b6da35dd1fd + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 07:25:13 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.022' + X-B3-Traceid: + - d8a9409cf4a1a9da9ff09fc8669e2bc4 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "callbackUri" : "http://example.com/test", + "eventTypes" : [ "order.created", "product.created" ], + "active" : true, + "_id" : "50873c4d-97da-4cbb-b221-1b6da35dd1fd", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/50873c4d-97da-4cbb-b221-1b6da35dd1fd" + }, + "deactivate" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/50873c4d-97da-4cbb-b221-1b6da35dd1fd/deactivate" + } + } + } + recorded_at: Mon, 19 Aug 2024 07:25:13 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/50873c4d-97da-4cbb-b221-1b6da35dd1fd + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Mon, 19 Aug 2024 07:25:13 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.031' + X-B3-Traceid: + - bcf9b63acbf3b35ea7c6e4e7c89d2b8c + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Mon, 19 Aug 2024 07:25:13 GMT +recorded_with: VCR 6.2.0 From baab83dd6b03ce707e9e0c5d5b3ed395d1ad7837 Mon Sep 17 00:00:00 2001 From: k4th Date: Mon, 19 Aug 2024 09:38:33 +0200 Subject: [PATCH 6/9] Update tests --- spec/beyond_api/services/shop/address_spec.rb | 12 ++ spec/beyond_api/services/shop/shop_spec.rb | 11 ++ spec/beyond_api/utils_spec.rb | 2 +- .../_get/returns_the_shop_address.yml | 146 ++++++++++++++++ .../_get/returns_the_shop_details.yml | 160 ++++++++++++++++++ 5 files changed, 330 insertions(+), 1 deletion(-) create mode 100644 spec/beyond_api/services/shop/address_spec.rb create mode 100644 spec/beyond_api/services/shop/shop_spec.rb create mode 100644 spec/vcr_cassettes/BeyondApi_Shop_Address/_get/returns_the_shop_address.yml create mode 100644 spec/vcr_cassettes/BeyondApi_Shop_Shop/_get/returns_the_shop_details.yml diff --git a/spec/beyond_api/services/shop/address_spec.rb b/spec/beyond_api/services/shop/address_spec.rb new file mode 100644 index 0000000..4393096 --- /dev/null +++ b/spec/beyond_api/services/shop/address_spec.rb @@ -0,0 +1,12 @@ +RSpec.describe BeyondApi::Shop::Address, vcr: true do + let(:client) { described_class.new(api_url: ENV["API_URL"], access_token: auth_client.client_credentials[:access_token]) } + + describe ".get" do + it "returns the shop address" do + response = client.show + expect(response).not_to be nil + expect(response.keys).to include(:company, :first_name, :last_name, :email, + :phone, :street, :postal_code, :dependent_locality, :city, :state, :country) + end + end +end diff --git a/spec/beyond_api/services/shop/shop_spec.rb b/spec/beyond_api/services/shop/shop_spec.rb new file mode 100644 index 0000000..742f1a5 --- /dev/null +++ b/spec/beyond_api/services/shop/shop_spec.rb @@ -0,0 +1,11 @@ +RSpec.describe BeyondApi::Shop::Shop, vcr: true do + let(:client) { described_class.new(api_url: ENV["API_URL"], access_token: auth_client.client_credentials[:access_token]) } + + describe ".get" do + it "returns the shop details" do + response = client.show + expect(response).not_to be nil + expect(response.keys).to include(:name, :reseller_name, :primary_hostname, :default_locale) + end + end +end diff --git a/spec/beyond_api/utils_spec.rb b/spec/beyond_api/utils_spec.rb index d1c8d85..edc0d72 100644 --- a/spec/beyond_api/utils_spec.rb +++ b/spec/beyond_api/utils_spec.rb @@ -13,6 +13,6 @@ end it "parse snakecase to camelcase" do - expect("sales_price".camelize(false)).to eq "salesPrice" + expect("sales_price".camelize(:lower)).to eq "salesPrice" end end diff --git a/spec/vcr_cassettes/BeyondApi_Shop_Address/_get/returns_the_shop_address.yml b/spec/vcr_cassettes/BeyondApi_Shop_Address/_get/returns_the_shop_address.yml new file mode 100644 index 0000000..b672485 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Shop_Address/_get/returns_the_shop_address.yml @@ -0,0 +1,146 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 07:29:59 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.089' + X-B3-Traceid: + - da5289c9d5b4a4f03418f74baa9563e1 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1724052599, + "jti" : "+3Bi9GKMlZei8yQdrBRl8otJG9o=" + } + recorded_at: Mon, 19 Aug 2024 07:29:58 GMT +- request: + method: get + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/address + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 07:29:59 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.139' + X-B3-Traceid: + - 6c81891217360b02b1c94ad8e223efa4 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "company" : "Team42", + "firstName" : "Team42", + "lastName" : "Team42", + "email" : "k.salazar@epages.com", + "phone" : "Team42", + "fax" : null, + "street" : "Team42", + "street2" : null, + "postalCode" : "12345", + "dependentLocality" : null, + "city" : "Somewhere", + "state" : "", + "country" : "GB", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/address" + }, + "address" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/address" + }, + "owner" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop" + } + } + } + recorded_at: Mon, 19 Aug 2024 07:29:59 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Shop_Shop/_get/returns_the_shop_details.yml b/spec/vcr_cassettes/BeyondApi_Shop_Shop/_get/returns_the_shop_details.yml new file mode 100644 index 0000000..3a71722 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Shop_Shop/_get/returns_the_shop_details.yml @@ -0,0 +1,160 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 07:36:16 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.171' + X-B3-Traceid: + - 5d0474f38fa3cd44d8d2db510cc40b8a + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1724052976, + "jti" : "fP5GZ4flKaRAKWsK77zoPkasf58=" + } + recorded_at: Mon, 19 Aug 2024 07:36:16 GMT +- request: + method: get + uri: https://team42-beyond-api.beyondshop.cloud/api/shop + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 07:36:17 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.026' + X-B3-Traceid: + - 2ae749c42757058dbaa58127e4426c42 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "5227687a-aa6b-487c-9c2b-afccf1573cea", + "name" : "Team42 Beyond API", + "resellerName" : "epages", + "primaryHostname" : "team42-beyond-api.beyondshop.cloud", + "fallbackHostname" : "team42-beyond-api.beyondshop.cloud", + "tax" : { + "taxModel" : "GROSS", + "vatExempted" : false, + "country" : "GB", + "supportedTaxClasses" : [ "EXEMPT", "REDUCED", "REGULAR" ] + }, + "currencies" : [ "GBP" ], + "defaultCurrency" : "GBP", + "locales" : [ "en-GB" ], + "defaultLocale" : "en-GB", + "closedByMerchant" : true, + "emailConfirmed" : true, + "socialSharingEnabled" : true, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop" + }, + "shop" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop" + }, + "address" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/address" + }, + "images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/images" + }, + "legal" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/legal" + }, + "attributes" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/attributes" + } + } + } + recorded_at: Mon, 19 Aug 2024 07:36:16 GMT +recorded_with: VCR 6.2.0 From 4250ec3b3f52c5f92351a54670eb2fc6793f3c82 Mon Sep 17 00:00:00 2001 From: k4th Date: Mon, 19 Aug 2024 09:45:54 +0200 Subject: [PATCH 7/9] Update tests --- spec/beyond_api/services/authentication/signer_spec.rb | 2 +- spec/beyond_api/services/checkout/shipping_zone_spec.rb | 2 +- spec/beyond_api/services/product_management/category_spec.rb | 2 +- spec/beyond_api/services/product_management/image_spec.rb | 2 +- spec/beyond_api/services/product_management/product_spec.rb | 2 +- spec/beyond_api/services/shop/address_spec.rb | 2 +- spec/beyond_api/services/shop/shop_spec.rb | 2 +- spec/beyond_api/services/storefront/script_tag_spec.rb | 2 +- spec/beyond_api/services/webhook/subscription_spec.rb | 2 +- spec/spec_helper.rb | 4 ++++ 10 files changed, 13 insertions(+), 9 deletions(-) diff --git a/spec/beyond_api/services/authentication/signer_spec.rb b/spec/beyond_api/services/authentication/signer_spec.rb index de8bd76..02c0710 100644 --- a/spec/beyond_api/services/authentication/signer_spec.rb +++ b/spec/beyond_api/services/authentication/signer_spec.rb @@ -1,5 +1,5 @@ RSpec.describe BeyondApi::Authentication::Signer, vcr: true do - let(:client) { described_class.new(api_url: ENV["API_URL"], access_token: auth_client.client_credentials[:access_token]) } + let(:client) { described_class.new(api_url: ENV["API_URL"], access_token: beyond_access_token) } describe '#all' do it 'returns all signers' do diff --git a/spec/beyond_api/services/checkout/shipping_zone_spec.rb b/spec/beyond_api/services/checkout/shipping_zone_spec.rb index 1e58553..292ba2c 100644 --- a/spec/beyond_api/services/checkout/shipping_zone_spec.rb +++ b/spec/beyond_api/services/checkout/shipping_zone_spec.rb @@ -1,5 +1,5 @@ RSpec.describe BeyondApi::Checkout::ShippingZone, vcr: true do - let(:client) { described_class.new(api_url: ENV["API_URL"], access_token: auth_client.client_credentials[:access_token]) } + let(:client) { described_class.new(api_url: ENV["API_URL"], access_token: beyond_access_token) } describe ".all" do it "returns all shipping_zones" do diff --git a/spec/beyond_api/services/product_management/category_spec.rb b/spec/beyond_api/services/product_management/category_spec.rb index 01e048e..47e1564 100644 --- a/spec/beyond_api/services/product_management/category_spec.rb +++ b/spec/beyond_api/services/product_management/category_spec.rb @@ -1,5 +1,5 @@ RSpec.describe BeyondApi::ProductManagement::Category, vcr: true do - let(:client) { described_class.new(api_url: ENV["API_URL"], access_token: auth_client.client_credentials[:access_token]) } + let(:client) { described_class.new(api_url: ENV["API_URL"], access_token: beyond_access_token) } describe ".all" do it "returns all categories" do diff --git a/spec/beyond_api/services/product_management/image_spec.rb b/spec/beyond_api/services/product_management/image_spec.rb index 79c14f1..cb839e9 100644 --- a/spec/beyond_api/services/product_management/image_spec.rb +++ b/spec/beyond_api/services/product_management/image_spec.rb @@ -1,5 +1,5 @@ RSpec.describe BeyondApi::ProductManagement::Image, vcr: true do - let(:client) { described_class.new(api_url: ENV["API_URL"], access_token: auth_client.client_credentials[:access_token]) } + let(:client) { described_class.new(api_url: ENV["API_URL"], access_token: beyond_access_token) } describe ".all" do it "returns all images" do diff --git a/spec/beyond_api/services/product_management/product_spec.rb b/spec/beyond_api/services/product_management/product_spec.rb index d9b9b90..39bff0a 100644 --- a/spec/beyond_api/services/product_management/product_spec.rb +++ b/spec/beyond_api/services/product_management/product_spec.rb @@ -1,5 +1,5 @@ RSpec.describe BeyondApi::ProductManagement::Product, vcr: true do - let(:client) { described_class.new(api_url: ENV["API_URL"], access_token: auth_client.client_credentials[:access_token]) } + let(:client) { described_class.new(api_url: ENV["API_URL"], access_token: beyond_access_token) } describe ".all" do it "returns all products" do diff --git a/spec/beyond_api/services/shop/address_spec.rb b/spec/beyond_api/services/shop/address_spec.rb index 4393096..0f9e5f1 100644 --- a/spec/beyond_api/services/shop/address_spec.rb +++ b/spec/beyond_api/services/shop/address_spec.rb @@ -1,5 +1,5 @@ RSpec.describe BeyondApi::Shop::Address, vcr: true do - let(:client) { described_class.new(api_url: ENV["API_URL"], access_token: auth_client.client_credentials[:access_token]) } + let(:client) { described_class.new(api_url: ENV["API_URL"], access_token: beyond_access_token) } describe ".get" do it "returns the shop address" do diff --git a/spec/beyond_api/services/shop/shop_spec.rb b/spec/beyond_api/services/shop/shop_spec.rb index 742f1a5..35b1e11 100644 --- a/spec/beyond_api/services/shop/shop_spec.rb +++ b/spec/beyond_api/services/shop/shop_spec.rb @@ -1,5 +1,5 @@ RSpec.describe BeyondApi::Shop::Shop, vcr: true do - let(:client) { described_class.new(api_url: ENV["API_URL"], access_token: auth_client.client_credentials[:access_token]) } + let(:client) { described_class.new(api_url: ENV["API_URL"], access_token: beyond_access_token) } describe ".get" do it "returns the shop details" do diff --git a/spec/beyond_api/services/storefront/script_tag_spec.rb b/spec/beyond_api/services/storefront/script_tag_spec.rb index 81fbe0c..3cbd7f3 100644 --- a/spec/beyond_api/services/storefront/script_tag_spec.rb +++ b/spec/beyond_api/services/storefront/script_tag_spec.rb @@ -1,5 +1,5 @@ RSpec.describe BeyondApi::Storefront::ScriptTag, vcr: true do - let(:client) { described_class.new(api_url: ENV["API_URL"], access_token: auth_client.client_credentials[:access_token]) } + let(:client) { described_class.new(api_url: ENV["API_URL"], access_token: beyond_access_token) } describe ".all" do it "returns all script tags" do diff --git a/spec/beyond_api/services/webhook/subscription_spec.rb b/spec/beyond_api/services/webhook/subscription_spec.rb index 9213b59..e7d024c 100644 --- a/spec/beyond_api/services/webhook/subscription_spec.rb +++ b/spec/beyond_api/services/webhook/subscription_spec.rb @@ -1,5 +1,5 @@ RSpec.describe BeyondApi::Webhook::Subscription, vcr: true do - let(:client) { described_class.new(api_url: ENV["API_URL"], access_token: auth_client.client_credentials[:access_token]) } + let(:client) { described_class.new(api_url: ENV["API_URL"], access_token: beyond_access_token) } describe ".all" do it "returns all webhook subscriptions" do diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index c42004f..c58969a 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -39,3 +39,7 @@ def auth_client client_secret: ENV["CLIENT_SECRET"] ) end + +def beyond_access_token + auth_client.client_credentials[:access_token] +end From a555f4bc777e3fb6f32214d5a1a6f6640ff1fea8 Mon Sep 17 00:00:00 2001 From: citin Date: Mon, 19 Aug 2024 10:07:31 +0200 Subject: [PATCH 8/9] replace destroy by delete --- lib/beyond_api/services/authentication/signer.rb | 4 ++-- lib/beyond_api/services/product_management/category.rb | 4 ++-- lib/beyond_api/services/storefront/script_tag.rb | 4 ++-- lib/beyond_api/services/webhook/subscription.rb | 6 +++--- spec/beyond_api/services/authentication/signer_spec.rb | 6 +++--- .../beyond_api/services/product_management/category_spec.rb | 6 +++--- spec/beyond_api/services/storefront/script_tag_spec.rb | 6 +++--- spec/beyond_api/services/webhook/subscription_spec.rb | 6 +++--- 8 files changed, 21 insertions(+), 21 deletions(-) diff --git a/lib/beyond_api/services/authentication/signer.rb b/lib/beyond_api/services/authentication/signer.rb index 2e67b2d..8c7371f 100644 --- a/lib/beyond_api/services/authentication/signer.rb +++ b/lib/beyond_api/services/authentication/signer.rb @@ -9,8 +9,8 @@ def create post("signers") end - def destroy(id) - delete("signers/#{id}") + def delete(id) + super("signers/#{id}") # Concerns::Connection delete method end end end diff --git a/lib/beyond_api/services/product_management/category.rb b/lib/beyond_api/services/product_management/category.rb index 8e27ebe..e6926ce 100644 --- a/lib/beyond_api/services/product_management/category.rb +++ b/lib/beyond_api/services/product_management/category.rb @@ -17,8 +17,8 @@ def update(id, body) put("categories/#{id}", body) end - def destroy(id) - delete("categories/#{id}") + def delete(id) + super("categories/#{id}") # Concerns::Connection delete method end end end diff --git a/lib/beyond_api/services/storefront/script_tag.rb b/lib/beyond_api/services/storefront/script_tag.rb index 6c5eaed..17c5259 100644 --- a/lib/beyond_api/services/storefront/script_tag.rb +++ b/lib/beyond_api/services/storefront/script_tag.rb @@ -11,8 +11,8 @@ def create(script_url) post("script-tags", script_url:) end - def destroy(id) - delete("script-tags/#{id}") + def delete(id) + super("script-tags/#{id}") # Concerns::Connection delete method end end end diff --git a/lib/beyond_api/services/webhook/subscription.rb b/lib/beyond_api/services/webhook/subscription.rb index 349f80f..2cb4341 100644 --- a/lib/beyond_api/services/webhook/subscription.rb +++ b/lib/beyond_api/services/webhook/subscription.rb @@ -11,12 +11,12 @@ def create(body) def delete_all all.dig(:embedded, :subscriptions).each do |subscription| - destroy(subscription[:id]) + delete(subscription[:id]) end end - def destroy(id) - delete("webhook-subscriptions/#{id}") + def delete(id) + super("webhook-subscriptions/#{id}") # Concerns::Connection delete method end def find(id) diff --git a/spec/beyond_api/services/authentication/signer_spec.rb b/spec/beyond_api/services/authentication/signer_spec.rb index 02c0710..07fd084 100644 --- a/spec/beyond_api/services/authentication/signer_spec.rb +++ b/spec/beyond_api/services/authentication/signer_spec.rb @@ -20,11 +20,11 @@ end end - describe '#destroy' do + describe '#delete' do it 'deletes a signer' do - response = client.destroy(@signer[:id]) + response = client.delete(@signer[:id]) expect(response).to be {} end end end -end \ No newline at end of file +end diff --git a/spec/beyond_api/services/product_management/category_spec.rb b/spec/beyond_api/services/product_management/category_spec.rb index 47e1564..dd6f2c3 100644 --- a/spec/beyond_api/services/product_management/category_spec.rb +++ b/spec/beyond_api/services/product_management/category_spec.rb @@ -43,15 +43,15 @@ end end - describe ".destroy" do + describe ".delete" do it "deletes a category" do - response = client.destroy(@category[:id]) + response = client.delete(@category[:id]) expect(response).to be {} end end after(:each) do - client.destroy(@category[:id]) + client.delete(@category[:id]) rescue BeyondApi::Error end end diff --git a/spec/beyond_api/services/storefront/script_tag_spec.rb b/spec/beyond_api/services/storefront/script_tag_spec.rb index 3cbd7f3..89b0581 100644 --- a/spec/beyond_api/services/storefront/script_tag_spec.rb +++ b/spec/beyond_api/services/storefront/script_tag_spec.rb @@ -23,15 +23,15 @@ end end - describe ".destroy" do + describe ".delete" do it "deletes a script tag" do - response = client.destroy(@script_tag[:id]) + response = client.delete(@script_tag[:id]) expect(response).to be {} end end after(:each) do - client.destroy(@script_tag[:id]) + client.delete(@script_tag[:id]) rescue BeyondApi::Error end end diff --git a/spec/beyond_api/services/webhook/subscription_spec.rb b/spec/beyond_api/services/webhook/subscription_spec.rb index e7d024c..48d59f4 100644 --- a/spec/beyond_api/services/webhook/subscription_spec.rb +++ b/spec/beyond_api/services/webhook/subscription_spec.rb @@ -31,15 +31,15 @@ end end - describe ".destroy" do + describe ".delete" do it "deletes a webhook subscription" do - response = client.destroy(@webhook_subscription[:id]) + response = client.delete(@webhook_subscription[:id]) expect(response).to be {} end end after(:each) do - client.destroy(@webhook_subscription[:id]) + client.delete(@webhook_subscription[:id]) rescue BeyondApi::Error end end From 776c62d212dfb6a92d49a8fe107493d807b4a02b Mon Sep 17 00:00:00 2001 From: k4th Date: Mon, 19 Aug 2024 11:07:18 +0200 Subject: [PATCH 9/9] Add recordings --- .../with_signer/_delete/deletes_a_signer.yml | 185 +++++++++++++ .../_delete/deletes_a_category.yml | 247 ++++++++++++++++++ .../_delete/deletes_a_script_tag.yml | 242 +++++++++++++++++ .../deletes_a_webhook_subscription.yml | 238 +++++++++++++++++ 4 files changed, 912 insertions(+) create mode 100644 spec/vcr_cassettes/BeyondApi_Authentication_Signer/with_signer/_delete/deletes_a_signer.yml create mode 100644 spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_delete/deletes_a_category.yml create mode 100644 spec/vcr_cassettes/BeyondApi_Storefront_ScriptTag/with_script_tag/_delete/deletes_a_script_tag.yml create mode 100644 spec/vcr_cassettes/BeyondApi_Webhook_Subscription/with_webhook_subscription/_delete/deletes_a_webhook_subscription.yml diff --git a/spec/vcr_cassettes/BeyondApi_Authentication_Signer/with_signer/_delete/deletes_a_signer.yml b/spec/vcr_cassettes/BeyondApi_Authentication_Signer/with_signer/_delete/deletes_a_signer.yml new file mode 100644 index 0000000..dc2e937 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Authentication_Signer/with_signer/_delete/deletes_a_signer.yml @@ -0,0 +1,185 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 08:22:59 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.139' + X-B3-Traceid: + - 27d6f6696bed6e3f01e81ab3577000d5 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1724055779, + "jti" : "l7k8DMT7GM5WeH61G8VGwETkteM=" + } + recorded_at: Mon, 19 Aug 2024 08:22:59 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/signers + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 08:23:00 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.041' + X-B3-Traceid: + - 6e71c1fa205231a52c7a58429b64b89b + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "92cb69c7-a830-4312-9dae-ffcf6603bba7", + "sharedSecret" : "u3v38frnqt59vka22kqaumpgft", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/signers/92cb69c7-a830-4312-9dae-ffcf6603bba7" + } + } + } + recorded_at: Mon, 19 Aug 2024 08:23:00 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/signers/92cb69c7-a830-4312-9dae-ffcf6603bba7 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 08:23:00 GMT + Content-Length: + - '0' + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.043' + X-B3-Traceid: + - 34a99a554db99d028a1c47648840cf07 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Mon, 19 Aug 2024 08:23:00 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_delete/deletes_a_category.yml b/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_delete/deletes_a_category.yml new file mode 100644 index 0000000..22cb4c8 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_delete/deletes_a_category.yml @@ -0,0 +1,247 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 08:23:00 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.095' + X-B3-Traceid: + - 55b33c0580da9f9255ff6ffdb6f8af47 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1724055780, + "jti" : "bo9G/OG2JbjIQVLDljv+XfIwu/Q=" + } + recorded_at: Mon, 19 Aug 2024 08:23:00 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/categories + body: + encoding: UTF-8 + string: '{"name":"Team42 Category","type":"SMART","defaultSort":"HIGHEST_PRICE_FIRST"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Mon, 19 Aug 2024 08:23:00 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/categories/28171a9e-43d6-4786-9f1d-780152649363 + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.051' + X-B3-Traceid: + - a91a846530581b514551ae5ee861fdc4 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "28171a9e-43d6-4786-9f1d-780152649363", + "name" : "Team42 Category", + "type" : "SMART", + "defaultSort" : "HIGHEST_PRICE_FIRST", + "filters" : [ ], + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories/28171a9e-43d6-4786-9f1d-780152649363" + }, + "category" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories/28171a9e-43d6-4786-9f1d-780152649363" + } + } + } + recorded_at: Mon, 19 Aug 2024 08:23:00 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/categories/28171a9e-43d6-4786-9f1d-780152649363 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Mon, 19 Aug 2024 08:23:00 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.039' + X-B3-Traceid: + - fac194a82965a2f8226f3faa67af0b34 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Mon, 19 Aug 2024 08:23:00 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/categories/28171a9e-43d6-4786-9f1d-780152649363 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 404 + message: Not Found + headers: + Date: + - Mon, 19 Aug 2024 08:23:00 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.013' + X-B3-Traceid: + - 6ba81a6b755682d168eecfa9c913f84e + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "errorId" : "resource-not-found", + "details" : { }, + "message" : "No Category found for '28171a9e-43d6-4786-9f1d-780152649363'", + "traceId" : "6ba81a6b755682d168eecfa9c913f84e" + } + recorded_at: Mon, 19 Aug 2024 08:23:00 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Storefront_ScriptTag/with_script_tag/_delete/deletes_a_script_tag.yml b/spec/vcr_cassettes/BeyondApi_Storefront_ScriptTag/with_script_tag/_delete/deletes_a_script_tag.yml new file mode 100644 index 0000000..634ca55 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Storefront_ScriptTag/with_script_tag/_delete/deletes_a_script_tag.yml @@ -0,0 +1,242 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 08:23:01 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.097' + X-B3-Traceid: + - 2cd075d0bf0e39ff6109d213e139fb9e + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1724055781, + "jti" : "C6UJPHY9f5Dc8FU43LVeiN2zoWw=" + } + recorded_at: Mon, 19 Aug 2024 08:23:01 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/script-tags + body: + encoding: UTF-8 + string: '{"scriptUrl":"https://example.com/scripts/exampleScript.js"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Mon, 19 Aug 2024 08:23:01 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/script-tags/861516c1-32ce-4dfe-8bb7-f36d30194eed + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.096' + X-B3-Traceid: + - d1f65daa2ab4973f56910dfe9abd53c6 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "861516c1-32ce-4dfe-8bb7-f36d30194eed", + "categories" : [ ], + "scriptUrl" : "https://example.com/scripts/exampleScript.js", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/script-tags/861516c1-32ce-4dfe-8bb7-f36d30194eed" + } + } + } + recorded_at: Mon, 19 Aug 2024 08:23:01 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/script-tags/861516c1-32ce-4dfe-8bb7-f36d30194eed + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Mon, 19 Aug 2024 08:23:01 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.049' + X-B3-Traceid: + - a28101666148e32f48b4e2d4a98f4e39 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Mon, 19 Aug 2024 08:23:01 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/script-tags/861516c1-32ce-4dfe-8bb7-f36d30194eed + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 404 + message: Not Found + headers: + Date: + - Mon, 19 Aug 2024 08:23:01 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.023' + X-B3-Traceid: + - 4da97a350edaea722e1135e1570c732d + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "errorId" : "script-tag.not-found", + "details" : { }, + "message" : "script-tag with id 861516c1-32ce-4dfe-8bb7-f36d30194eed could not be found", + "traceId" : "4da97a350edaea722e1135e1570c732d" + } + recorded_at: Mon, 19 Aug 2024 08:23:01 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Webhook_Subscription/with_webhook_subscription/_delete/deletes_a_webhook_subscription.yml b/spec/vcr_cassettes/BeyondApi_Webhook_Subscription/with_webhook_subscription/_delete/deletes_a_webhook_subscription.yml new file mode 100644 index 0000000..53cbeb6 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Webhook_Subscription/with_webhook_subscription/_delete/deletes_a_webhook_subscription.yml @@ -0,0 +1,238 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 08:23:02 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.160' + X-B3-Traceid: + - 661b0474ff0beed08492404ba4b3246e + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1724055782, + "jti" : "etTNATIXyAYxSmeXKD6CSUrTCNs=" + } + recorded_at: Mon, 19 Aug 2024 08:23:02 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions + body: + encoding: UTF-8 + string: '{"callbackUri":"http://example.com/test","eventTypes":["order.created","product.created"]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Mon, 19 Aug 2024 08:23:02 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/ba3d5330-ed1d-440d-abce-7ad54c3f0d08 + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.054' + X-B3-Traceid: + - db202fddc69411adc9750a7a93eb1f36 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "callbackUri" : "http://example.com/test", + "eventTypes" : [ "product.created", "order.created" ], + "active" : true, + "_id" : "ba3d5330-ed1d-440d-abce-7ad54c3f0d08", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/ba3d5330-ed1d-440d-abce-7ad54c3f0d08" + }, + "deactivate" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/ba3d5330-ed1d-440d-abce-7ad54c3f0d08/deactivate" + } + } + } + recorded_at: Mon, 19 Aug 2024 08:23:02 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/ba3d5330-ed1d-440d-abce-7ad54c3f0d08 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Mon, 19 Aug 2024 08:23:02 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.044' + X-B3-Traceid: + - d0c2be1d708e5ef0cd3eb8dadf70b2c1 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Mon, 19 Aug 2024 08:23:02 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/ba3d5330-ed1d-440d-abce-7ad54c3f0d08 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 404 + message: Not Found + headers: + Date: + - Mon, 19 Aug 2024 08:23:02 GMT + Content-Length: + - '0' + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.019' + X-B3-Traceid: + - 455eabf287b14c709350c96903b48836 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Mon, 19 Aug 2024 08:23:02 GMT +recorded_with: VCR 6.2.0