flex_commerce_api 0.6.57

Sign up to get free protection for your applications and to get access to all the features.
Files changed (170) hide show
  1. checksums.yaml +7 -0
  2. data/.env.example +6 -0
  3. data/.gitignore +14 -0
  4. data/.rspec +4 -0
  5. data/.rubocop.yml +1065 -0
  6. data/.ruby-gemset +1 -0
  7. data/.ruby-version +1 -0
  8. data/.travis.yml +3 -0
  9. data/Gemfile +4 -0
  10. data/LICENSE.txt +21 -0
  11. data/README.md +56 -0
  12. data/Rakefile +1 -0
  13. data/app/models/address.rb +41 -0
  14. data/app/models/asset_file.rb +26 -0
  15. data/app/models/asset_folder.rb +14 -0
  16. data/app/models/bundle.rb +20 -0
  17. data/app/models/bundle_group.rb +15 -0
  18. data/app/models/cart.rb +136 -0
  19. data/app/models/category.rb +70 -0
  20. data/app/models/category_tree.rb +11 -0
  21. data/app/models/component.rb +8 -0
  22. data/app/models/container_coupon.rb +12 -0
  23. data/app/models/country.rb +11 -0
  24. data/app/models/coupon.rb +18 -0
  25. data/app/models/customer_account.rb +96 -0
  26. data/app/models/customer_account_authentication.rb +5 -0
  27. data/app/models/customer_segment.rb +6 -0
  28. data/app/models/customer_segment_member.rb +6 -0
  29. data/app/models/data_attribute.rb +6 -0
  30. data/app/models/data_store_record.rb +9 -0
  31. data/app/models/data_store_type.rb +9 -0
  32. data/app/models/discount_summary.rb +12 -0
  33. data/app/models/email.rb +5 -0
  34. data/app/models/ewis_opt_in.rb +8 -0
  35. data/app/models/external_url.rb +6 -0
  36. data/app/models/free_shipping_promotion.rb +12 -0
  37. data/app/models/import.rb +6 -0
  38. data/app/models/import_entry.rb +6 -0
  39. data/app/models/line_item.rb +34 -0
  40. data/app/models/line_item_discount.rb +7 -0
  41. data/app/models/markdown_price.rb +11 -0
  42. data/app/models/menu.rb +36 -0
  43. data/app/models/menu_item.rb +7 -0
  44. data/app/models/menu_item_item.rb +5 -0
  45. data/app/models/note.rb +18 -0
  46. data/app/models/order.rb +38 -0
  47. data/app/models/password_recovery.rb +20 -0
  48. data/app/models/payment_address_verification.rb +13 -0
  49. data/app/models/payment_process.rb +13 -0
  50. data/app/models/payment_provider.rb +15 -0
  51. data/app/models/payment_transaction.rb +13 -0
  52. data/app/models/product.rb +99 -0
  53. data/app/models/product_asset_file.rb +12 -0
  54. data/app/models/promotion.rb +19 -0
  55. data/app/models/promotion_qualifying_product_exclusion.rb +8 -0
  56. data/app/models/redirect.rb +14 -0
  57. data/app/models/refund.rb +14 -0
  58. data/app/models/remote_address.rb +22 -0
  59. data/app/models/remote_line_item.rb +11 -0
  60. data/app/models/remote_order.rb +15 -0
  61. data/app/models/remote_shipping_method.rb +12 -0
  62. data/app/models/report.rb +18 -0
  63. data/app/models/report_invocation.rb +18 -0
  64. data/app/models/retail_store.rb +18 -0
  65. data/app/models/role.rb +6 -0
  66. data/app/models/search_suggestion.rb +17 -0
  67. data/app/models/section.rb +9 -0
  68. data/app/models/session.rb +8 -0
  69. data/app/models/shipping_method.rb +26 -0
  70. data/app/models/slug.rb +19 -0
  71. data/app/models/static_page.rb +60 -0
  72. data/app/models/static_page_folder.rb +8 -0
  73. data/app/models/stock_level.rb +21 -0
  74. data/app/models/tax_code.rb +6 -0
  75. data/app/models/taxonomy.rb +5 -0
  76. data/app/models/template.rb +9 -0
  77. data/app/models/template_component.rb +11 -0
  78. data/app/models/template_definition.rb +12 -0
  79. data/app/models/template_section.rb +12 -0
  80. data/app/models/user.rb +8 -0
  81. data/app/models/user_profile.rb +6 -0
  82. data/app/models/v2/create_order.rb +10 -0
  83. data/app/models/v2/deallocate_order.rb +10 -0
  84. data/app/models/v2/line_item.rb +9 -0
  85. data/app/models/v2/order.rb +9 -0
  86. data/app/models/v2/unallocate_order.rb +10 -0
  87. data/app/models/variant.rb +18 -0
  88. data/app/models/webhook.rb +17 -0
  89. data/app/services/param_to_shql.rb +72 -0
  90. data/app/services/surrogate_keys.rb +44 -0
  91. data/bin/console +14 -0
  92. data/bin/setup +7 -0
  93. data/config/locales/payments.en.yml +3 -0
  94. data/flex-commerce-api.gemspec +41 -0
  95. data/lib/flex_commerce.rb +95 -0
  96. data/lib/flex_commerce_api.rb +21 -0
  97. data/lib/flex_commerce_api/api_base.rb +11 -0
  98. data/lib/flex_commerce_api/base_resource.rb +250 -0
  99. data/lib/flex_commerce_api/config.rb +55 -0
  100. data/lib/flex_commerce_api/error/access_denied.rb +6 -0
  101. data/lib/flex_commerce_api/error/bad_request.rb +10 -0
  102. data/lib/flex_commerce_api/error/base.rb +12 -0
  103. data/lib/flex_commerce_api/error/client_error.rb +7 -0
  104. data/lib/flex_commerce_api/error/connection_error.rb +6 -0
  105. data/lib/flex_commerce_api/error/internal_server.rb +37 -0
  106. data/lib/flex_commerce_api/error/not_found.rb +13 -0
  107. data/lib/flex_commerce_api/error/record_invalid.rb +16 -0
  108. data/lib/flex_commerce_api/error/unexpected_status.rb +7 -0
  109. data/lib/flex_commerce_api/errors.rb +13 -0
  110. data/lib/flex_commerce_api/json_api_client_extension/builder.rb +28 -0
  111. data/lib/flex_commerce_api/json_api_client_extension/capture_surrogate_keys_middleware.rb +16 -0
  112. data/lib/flex_commerce_api/json_api_client_extension/flexible_connection.rb +59 -0
  113. data/lib/flex_commerce_api/json_api_client_extension/has_many_association_proxy.rb +60 -0
  114. data/lib/flex_commerce_api/json_api_client_extension/included_data.rb +27 -0
  115. data/lib/flex_commerce_api/json_api_client_extension/json_format_middleware.rb +20 -0
  116. data/lib/flex_commerce_api/json_api_client_extension/logging_middleware.rb +24 -0
  117. data/lib/flex_commerce_api/json_api_client_extension/paginator.rb +26 -0
  118. data/lib/flex_commerce_api/json_api_client_extension/parse_json.rb +23 -0
  119. data/lib/flex_commerce_api/json_api_client_extension/parsers/parser.rb +16 -0
  120. data/lib/flex_commerce_api/json_api_client_extension/previewed_request_middleware.rb +17 -0
  121. data/lib/flex_commerce_api/json_api_client_extension/remote_builder.rb +29 -0
  122. data/lib/flex_commerce_api/json_api_client_extension/requestor.rb +42 -0
  123. data/lib/flex_commerce_api/json_api_client_extension/save_request_body_middleware.rb +20 -0
  124. data/lib/flex_commerce_api/json_api_client_extension/status_middleware.rb +40 -0
  125. data/lib/flex_commerce_api/v2/api_base.rb +13 -0
  126. data/lib/flex_commerce_api/version.rb +3 -0
  127. data/lib/json_erb.rb +9 -0
  128. data/lib/json_struct.rb +73 -0
  129. data/lib/patches.rb +4 -0
  130. data/lib/patches/json_api_client/resource.rb +50 -0
  131. data/lib/paypal_express.rb +3 -0
  132. data/lib/paypal_express/additional_info.rb +45 -0
  133. data/lib/paypal_express/api.rb +86 -0
  134. data/lib/paypal_express/auth.rb +83 -0
  135. data/lib/paypal_express/cart_shipping_method.rb +38 -0
  136. data/lib/paypal_express/exception/access_denied.rb +10 -0
  137. data/lib/paypal_express/exception/connection_error.rb +10 -0
  138. data/lib/paypal_express/exception/not_authorized.rb +10 -0
  139. data/lib/paypal_express/exception/transaction.rb +15 -0
  140. data/lib/paypal_express/generate_summary.rb +118 -0
  141. data/lib/paypal_express/process/paypal_params.rb +123 -0
  142. data/lib/paypal_express/process/response_parser.rb +146 -0
  143. data/lib/paypal_express/setup.rb +94 -0
  144. data/lib/paypal_express/shipping_methods_for_cart.rb +46 -0
  145. data/lib/retry.rb +20 -0
  146. data/schemas/jsonapi/schema.json +370 -0
  147. data/schemas/shift/v1/documents/collection/address.json +45 -0
  148. data/schemas/shift/v1/documents/collection/asset_file.json +43 -0
  149. data/schemas/shift/v1/documents/collection/asset_folder.json +43 -0
  150. data/schemas/shift/v1/documents/collection/customer_account.json +50 -0
  151. data/schemas/shift/v1/documents/collection/markdown_price.json +43 -0
  152. data/schemas/shift/v1/documents/collection/product.json +43 -0
  153. data/schemas/shift/v1/documents/collection/variant.json +43 -0
  154. data/schemas/shift/v1/documents/member/address.json +39 -0
  155. data/schemas/shift/v1/documents/member/asset_file.json +37 -0
  156. data/schemas/shift/v1/documents/member/asset_folder.json +39 -0
  157. data/schemas/shift/v1/documents/member/customer_account.json +44 -0
  158. data/schemas/shift/v1/documents/member/markdown_price.json +37 -0
  159. data/schemas/shift/v1/documents/member/product.json +39 -0
  160. data/schemas/shift/v1/documents/member/variant.json +46 -0
  161. data/schemas/shift/v1/resources/address.json +130 -0
  162. data/schemas/shift/v1/resources/asset_file.json +146 -0
  163. data/schemas/shift/v1/resources/asset_folder.json +188 -0
  164. data/schemas/shift/v1/resources/customer_account.json +339 -0
  165. data/schemas/shift/v1/resources/markdown_price.json +52 -0
  166. data/schemas/shift/v1/resources/product.json +230 -0
  167. data/schemas/shift/v1/resources/variant.json +298 -0
  168. data/tasks/json_schema.thor +275 -0
  169. data/todo.md +8 -0
  170. metadata +470 -0
@@ -0,0 +1,13 @@
1
+ require "flex_commerce_api/api_base"
2
+ module FlexCommerce
3
+ #
4
+ # A flex commerce payment address verification model
5
+ #
6
+ # This model provides access to the flex commerce address verification service
7
+ #
8
+ #
9
+ #
10
+ class PaymentAddressVerification < FlexCommerceApi::ApiBase
11
+
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ require "flex_commerce_api/api_base"
2
+ module FlexCommerce
3
+ #
4
+ # A flex commerce PaymentProcess model
5
+ #
6
+ # This model provides access to the flex commerce "process order" resource
7
+ #
8
+ #
9
+ #
10
+ class PaymentProcess < FlexCommerceApi::ApiBase
11
+
12
+ end
13
+ end
@@ -0,0 +1,15 @@
1
+ require "flex_commerce_api/api_base"
2
+ module FlexCommerce
3
+ #
4
+ # A flex commerce PaymentProvider model
5
+ #
6
+ # This model provides access to the flex commerce PaymentProvider which is used to
7
+ # define a payment gateway and provide instructions to the front end application
8
+ # on how to set up the gateway in a browser (i.e. redirect to paypal etc..)
9
+ #
10
+ #
11
+ #
12
+ class PaymentProvider < FlexCommerceApi::ApiBase
13
+
14
+ end
15
+ end
@@ -0,0 +1,13 @@
1
+ require "flex_commerce_api/api_base"
2
+ module FlexCommerce
3
+ #
4
+ # A flex commerce Order Transaction model
5
+ #
6
+ # This model provides access to the flex commerce order transaction
7
+ #
8
+ #
9
+ #
10
+ class PaymentTransaction < FlexCommerceApi::ApiBase
11
+
12
+ end
13
+ end
@@ -0,0 +1,99 @@
1
+ require "flex_commerce_api/api_base"
2
+ module FlexCommerce
3
+ #
4
+ # A flex commerce Product model
5
+ #
6
+ # This model provides access to the flex commerce products.
7
+ # As managing the products is the job of the administration panel, this
8
+ # model is read only.
9
+ #
10
+ # It is used much like an active record model.
11
+ #
12
+ # Examples:
13
+ #
14
+ #
15
+ #
16
+ # # Fetching all products
17
+ #
18
+ # FlexCommerce::Product.all #fetches all products(actually the first page in case there are thousands)
19
+ #
20
+ # # Pagination
21
+ #
22
+ # FlexCommerce::Product.paginate(page:2).all # Fetches page 2 of products.
23
+ # The page size is predefined on the server side
24
+ #
25
+ # # Finding products
26
+ #
27
+ # FlexCommerce::Product.find("my-product-slug") # Finds the product with this unique id
28
+ #
29
+ # # Finding nested variants of the product
30
+ #
31
+ # FlexCommerce::Product.find("my-product-slug").variants
32
+ #
33
+ #
34
+ class Product < FlexCommerceApi::ApiBase
35
+ # @method find
36
+ # @param [String] spec
37
+ # Finds a product
38
+ # @return [FlexCommerce::Product] product The product
39
+ # @raise [FlexCommerceApi::Error::NotFound] If not found
40
+
41
+ # @method all
42
+ # Returns all products
43
+ # @return [FlexCommerce::Product[]] An array of products or an empty array
44
+
45
+ # @method paginate
46
+ # Paginates the list of products by a preset page size
47
+ # @param [Hash] options The options to paginate with
48
+ # @param options [Numeric|String] :page The page to fetch
49
+
50
+ # @method variants
51
+ # Provides a list of associated variants
52
+ # @return [FlexCommerce::Variant[]]
53
+
54
+ # @TODO Document other popular methods that we will support
55
+
56
+ has_many :variants, class_name: "::FlexCommerce::Variant"
57
+ has_many :asset_files, class_name: "::FlexCommerce::AssetFile"
58
+ has_many :bundles, class_name: "::FlexCommerce::Bundle"
59
+ has_many :bundle_group, class_name: "::FlexCommerce::BundleGroup"
60
+ has_many :slugs, class_name: "::FlexCommerce::Slug"
61
+ has_one :template_definition, class_name: "::FlexCommerce::TemplateDefinition"
62
+ has_one :template, class_name: "::FlexCommerce::Template"
63
+
64
+ # TODO Decide where sku really comes from - its in the variant but not at product level like in matalan direct appears to be
65
+ def sku
66
+ reference
67
+ end
68
+ self.query_builder = ::FlexCommerceApi::JsonApiClientExtension::Builder
69
+ class << self
70
+ def_delegators :_new_scope, :temp_search
71
+ def path(params, *args)
72
+ if params[:filter] && params[:filter].key?(:category_id) && params[:filter].key?(:category_tree_id)
73
+ category_tree_id = params[:filter].delete(:category_tree_id)
74
+ category_id = params[:filter].delete(:category_id)
75
+ params.delete(:filter) if params[:filter].empty?
76
+ "category_trees/#{category_tree_id}/categories/#{category_id}/products"
77
+ else
78
+ super
79
+ end
80
+ end
81
+ end
82
+
83
+ def current_max_price
84
+ variants.map(&:current_price).max
85
+ end
86
+
87
+ def current_min_price
88
+ variants.map(&:current_price).min
89
+ end
90
+
91
+ # Relationship accessors
92
+ def add_asset_files(asset_files)
93
+ self.class.requestor.custom("relationships/asset_files", {request_method: :post}, {id: id, data: asset_files.map(&:as_relation)})
94
+ end
95
+
96
+
97
+ # End of relationship accessors
98
+ end
99
+ end
@@ -0,0 +1,12 @@
1
+ require "flex_commerce_api/api_base"
2
+ module FlexCommerce
3
+ #
4
+ # A flex commerce Product asset file model
5
+ #
6
+ # This model provides access to the flex commerce product asset files.
7
+ #
8
+ #
9
+ class ProductAssetFile < FlexCommerceApi::ApiBase
10
+ belongs_to :product, class_name: "FlexCommerce::Product"
11
+ end
12
+ end
@@ -0,0 +1,19 @@
1
+ require "flex_commerce_api/api_base"
2
+ module FlexCommerce
3
+ #
4
+ # A flex commerce Promotion model
5
+ #
6
+ # This model provides access to the flex commerce promotion
7
+ #
8
+ class Promotion < FlexCommerceApi::ApiBase
9
+ # This adds the ability to call archive method on Promotion
10
+ #
11
+ # @usage FlexCommerce::Promotion.find(<id>).archive
12
+ custom_endpoint :archive, on: :member, request_method: :patch
13
+
14
+ # This adds the ability to call unarchive method on Promotion
15
+ #
16
+ # @usage FlexCommerce::Promotion.find(<id>).unarchive
17
+ custom_endpoint :unarchive, on: :member, request_method: :patch
18
+ end
19
+ end
@@ -0,0 +1,8 @@
1
+ require "flex_commerce_api/api_base"
2
+ module FlexCommerce
3
+ #
4
+ # A flex commerce PromotionQualifyingProductExclusion model
5
+ #
6
+ class PromotionQualifyingProductExclusion < FlexCommerceApi::ApiBase
7
+ end
8
+ end
@@ -0,0 +1,14 @@
1
+ require "flex_commerce_api/api_base"
2
+ module FlexCommerce
3
+ #
4
+ # A flex commerce Redirect model
5
+ #
6
+ # This model provides access to the flex commerce redirect
7
+ #
8
+ class Redirect < FlexCommerceApi::ApiBase
9
+
10
+ def self.find_by_path(source_path: )
11
+ where(source_path: source_path).first
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,14 @@
1
+ require "flex_commerce_api/api_base"
2
+ module FlexCommerce
3
+ #
4
+ # A flex commerce Refund model
5
+ #
6
+ # This model provides access to the flex commerce refund
7
+ #
8
+ #
9
+ #
10
+ class Refund < FlexCommerceApi::ApiBase
11
+ belongs_to :order
12
+
13
+ end
14
+ end
@@ -0,0 +1,22 @@
1
+ require "flex_commerce_api/api_base"
2
+ module FlexCommerce
3
+ #
4
+ # A flex commerce RemoteAddress model
5
+ #
6
+ # This model provides access to the flex commerce remote addresses
7
+ #
8
+ # It is used much like an active record model.
9
+ #
10
+ # Examples:
11
+ #
12
+ #
13
+ #
14
+ # # Fetching all addresses for a customer account
15
+ #
16
+ # customer_account.addresses.all #fetches all addresses(actually the first page in case there are thousands)
17
+ #
18
+ #
19
+ class RemoteAddress < FlexCommerceApi::ApiBase
20
+
21
+ end
22
+ end
@@ -0,0 +1,11 @@
1
+ require "flex_commerce_api/api_base"
2
+ module FlexCommerce
3
+ #
4
+ # A flex commerce RemoteLineItem model
5
+ #
6
+ # This model provides access to the flex commerce remote order's line_items.
7
+ #
8
+ class RemoteLineItem < FlexCommerceApi::ApiBase
9
+
10
+ end
11
+ end
@@ -0,0 +1,15 @@
1
+ require "flex_commerce_api/api_base"
2
+
3
+ module FlexCommerce
4
+ #
5
+ # A flex commerce Order model
6
+ #
7
+ # This model provides access to the flex commerce remote order
8
+ #
9
+ #
10
+ #
11
+ class RemoteOrder < FlexCommerceApi::ApiBase
12
+
13
+ end
14
+
15
+ end
@@ -0,0 +1,12 @@
1
+ require "flex_commerce_api/api_base"
2
+ module FlexCommerce
3
+ #
4
+ # A flex commerce RemoteShippingMethod model
5
+ #
6
+ #
7
+ #
8
+ class RemoteShippingMethod < FlexCommerceApi::ApiBase
9
+
10
+
11
+ end
12
+ end
@@ -0,0 +1,18 @@
1
+ require "flex_commerce_api/api_base"
2
+ module FlexCommerce
3
+ #
4
+ # A flex commerce Report model
5
+ #
6
+ # This model provides access to the Shift Reports feature.
7
+ #
8
+ # It is used much like an active record model.
9
+ #
10
+ # Examples:
11
+ #
12
+ # # Fetch all reports, paginated
13
+ # FlexCommerce::Report.all
14
+ #
15
+ class Report < FlexCommerceApi::ApiBase
16
+ has_many :invocations, class_name: "::FlexCommerce::ReportInvocation"
17
+ end
18
+ end
@@ -0,0 +1,18 @@
1
+ require "flex_commerce_api/api_base"
2
+ module FlexCommerce
3
+ #
4
+ # A flex commerce Report Invocation model
5
+ #
6
+ # This model provides access to the Shift Report Invocations feature.
7
+ #
8
+ # It is used much like an active record model.
9
+ #
10
+ # Examples:
11
+ #
12
+ # # List the invocations of the first report
13
+ # FlexCommerce::Report.first.invocations
14
+ #
15
+ class ReportInvocation < FlexCommerceApi::ApiBase
16
+ has_one :report, class_name: "::FlexCommerce::Report"
17
+ end
18
+ end
@@ -0,0 +1,18 @@
1
+ require "flex_commerce_api/api_base"
2
+ module FlexCommerce
3
+ #
4
+ # A flex commerce RetailStore model
5
+ #
6
+ # This model provides access to the Shift Retail Stores feature.
7
+ #
8
+ # It is used much like an active record model.
9
+ #
10
+ # Examples:
11
+ #
12
+ # # Fetch all retail stores
13
+ # FlexCommerce::RetailStore.all
14
+ #
15
+ class RetailStore < FlexCommerceApi::ApiBase
16
+ has_many :slugs, class_name: "::FlexCommerce::Slug"
17
+ end
18
+ end
@@ -0,0 +1,6 @@
1
+ require "flex_commerce_api/api_base"
2
+
3
+ module FlexCommerce
4
+ class Role < FlexCommerceApi::ApiBase
5
+ end
6
+ end
@@ -0,0 +1,17 @@
1
+ require "flex_commerce_api/api_base"
2
+ module FlexCommerce
3
+ #
4
+ # A flex commerce SearchSuggestion model
5
+ #
6
+ # This model provides access to the Shift Suggestive Search feature.
7
+ #
8
+ # It is used much like an active record model.
9
+ #
10
+ # Examples:
11
+ #
12
+ # # Fetch words matching the suggestion 'sh'
13
+ # FlexCommerce::SearchSuggestion.where(q: “sh”).all
14
+ #
15
+ class SearchSuggestion < FlexCommerceApi::ApiBase
16
+ end
17
+ end
@@ -0,0 +1,9 @@
1
+ require "flex_commerce_api/api_base"
2
+ module FlexCommerce
3
+ #
4
+ # A flex commerce section
5
+ #
6
+ class Section < FlexCommerceApi::ApiBase
7
+ has_many :components, class_name: "::FlexCommerce::Component"
8
+ end
9
+ end
@@ -0,0 +1,8 @@
1
+ require "flex_commerce_api/api_base"
2
+
3
+ module FlexCommerce
4
+ class Session < FlexCommerceApi::ApiBase
5
+ has_one :role, class_name: "::FlexCommerce::Role"
6
+ has_one :user_profile, class_name: "::FlexCommerce::UserProfile"
7
+ end
8
+ end
@@ -0,0 +1,26 @@
1
+ require "flex_commerce_api/api_base"
2
+ module FlexCommerce
3
+ #
4
+ # A flex commerce OrderShippingMethod model
5
+ #
6
+ # This model provides access to the flex commerce order shipping methods
7
+ #
8
+ # It is used much like an active record model.
9
+ #
10
+ # Examples:
11
+ #
12
+ #
13
+ #
14
+ # # Fetching all order shipping methods for a customer account
15
+ #
16
+ # FlexCommerce::ShippingMethod.all #fetches all order shipping methods(actually the first page in case there are thousands)
17
+ #
18
+ #
19
+ class ShippingMethod < FlexCommerceApi::ApiBase
20
+
21
+ # @method all
22
+ # Returns all order shipping methods
23
+ # @return [FlexCommerce::OrderShippingMethod[]] An array of order shipping methods or an empty array
24
+
25
+ end
26
+ end
@@ -0,0 +1,19 @@
1
+ require "flex_commerce_api/api_base"
2
+
3
+ module FlexCommerce
4
+ #
5
+ # A flex commerce Slug model
6
+ #
7
+ # This model provides access to flex commerce slugs
8
+ #
9
+ # It is used much like an active record model.
10
+ #
11
+ # Examples:
12
+ #
13
+ # # Fetching a slug
14
+ # FlexCommerce::Slug.find(computed_slug:'some-computed-slug')
15
+ #
16
+ class Slug < FlexCommerceApi::ApiBase
17
+ has_one :resource
18
+ end
19
+ end