Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Added `prefix_id` for all Spree models, fixed type generation

Damian Legawiec1cce85eb0522
diff --git a/api/app/controllers/concerns/spree/api/v3/resource_serializer.rb b/api/app/controllers/concerns/spree/api/v3/resource_serializer.rb
index 402983ca67..d21f115eeb 100644
--- a/api/app/controllers/concerns/spree/api/v3/resource_serializer.rb
+++ b/api/app/controllers/concerns/spree/api/v3/resource_serializer.rb
@@ -28,11 +28,12 @@ module Spree
end
# Parse include parameter into list
- # Supports: ?include=variants,images or ?include=variants.images
+ # Supports: ?include=variants,images or ?includes=variants,images
def include_list
- return [] unless params[:include].present?
+ include_param = params[:include].presence || params[:includes].presence
+ return [] unless include_param
- params[:include].to_s.split(',').map(&:strip)
+ include_param.to_s.split(',').map(&:strip)
end
end
end
diff --git a/api/app/controllers/spree/api/v3/resource_controller.rb b/api/app/controllers/spree/api/v3/resource_controller.rb
index e879b8e392..63d125b4b6 100644
--- a/api/app/controllers/spree/api/v3/resource_controller.rb
+++ b/api/app/controllers/spree/api/v3/resource_controller.rb
@@ -77,14 +77,9 @@ module Spree
end
end
- # Finds a single resource within scope
- # Supports FriendlyId and standard ActiveRecord find
+ # Finds a single resource within scope using prefixed ID
def find_resource
- if model_class.try(:friendly)
- scope.friendly.find(params[:id])
- else
- scope.find(params[:id])
- end
+ scope.find_by_prefix_id!(params[:id])
end
# Authorize resource with CanCanCan
diff --git a/api/app/controllers/spree/api/v3/store/products_controller.rb b/api/app/controllers/spree/api/v3/store/products_controller.rb
index e5a66ae82e..64295ba4cf 100644
--- a/api/app/controllers/spree/api/v3/store/products_controller.rb
+++ b/api/app/controllers/spree/api/v3/store/products_controller.rb
@@ -20,7 +20,7 @@ module Spree
def scope_includes
[
master: [:prices, { stock_items: :stock_location }],
- variants: [:prices, {option_values: :option_type }, { stock_items: :stock_location }]
+ variants: [:prices, { option_values: :option_type }, { stock_items: :stock_location }]
]
end
end
diff --git a/api/app/serializers/spree/api/v3/address_serializer.rb b/api/app/serializers/spree/api/v3/address_serializer.rb
index 831789e71c..52e6905667 100644
--- a/api/app/serializers/spree/api/v3/address_serializer.rb
+++ b/api/app/serializers/spree/api/v3/address_serializer.rb
@@ -2,11 +2,14 @@ module Spree
module Api
module V3
class AddressSerializer < BaseSerializer
- typelize_from Spree::Address
- typelize full_name: :string, state_text: 'string | null',
+ typelize firstname: 'string | null', lastname: 'string | null', full_name: :string,
+ address1: 'string | null', address2: 'string | null',
+ city: 'string | null', zipcode: 'string | null', phone: 'string | null',
+ company: 'string | null', state_id: 'string | null',
+ state_text: 'string | null', country_id: :string,
country_iso: :string, country_name: :string
- attributes :id, :firstname, :lastname, :full_name, :address1, :address2,
+ attributes :firstname, :lastname, :full_name, :address1, :address2,
:city, :zipcode, :phone, :company, :state_id,
:state_text, :country_id, :country_iso, :country_name
end
diff --git a/api/app/serializers/spree/api/v3/admin/order_serializer.rb b/api/app/serializers/spree/api/v3/admin/order_serializer.rb
index e61f3fab75..a8e36ce103 100644
--- a/api/app/serializers/spree/api/v3/admin/order_serializer.rb
+++ b/api/app/serializers/spree/api/v3/admin/order_serializer.rb
@@ -5,9 +5,12 @@ module Spree
# Admin API Order Serializer
# Full order data including admin-only fields
class OrderSerializer < V3::OrderSerializer
- typelize_from Spree::Order
- typelize canceler_id: 'string | null', created_by_id: 'string | null',
+ typelize channel: 'string | null', last_ip_address: 'string | null',
+ considered_risky: :boolean, confirmation_delivered: :boolean,
+ store_owner_notification_delivered: :boolean,
+ internal_note: 'string | null', approver_id: 'string | null',
+ canceler_id: 'string | null', created_by_id: 'string | null',
public_metadata: 'Record<string, unknown> | null',
private_metadata: 'Record<string, unknown> | null',
canceled_at: 'string | null', approved_at: 'string | null'
diff --git a/api/app/serializers/spree/api/v3/admin/product_serializer.rb b/api/app/serializers/spree/api/v3/admin/product_serializer.rb
index 68133da81f..9132ee4d77 100644
--- a/api/app/serializers/spree/api/v3/admin/product_serializer.rb
+++ b/api/app/serializers/spree/api/v3/admin/product_serializer.rb
@@ -6,10 +6,10 @@ module Spree
# Full product data including admin-only fields
# Extends the store serializer with additional attributes
class ProductSerializer < V3::ProductSerializer
- typelize_from Spree::Product
# Additional type hints for admin-only computed attributes
- typelize cost_price: 'number | null', cost_currency: 'string | null',
+ typelize status: :string, make_active_at: 'string | null', discontinue_on: 'string | null',
+ cost_price: 'number | null', cost_currency: 'string | null',
public_metadata: 'Record<string, unknown> | null',
private_metadata: 'Record<string, unknown> | null',
deleted_at: 'string | null'
diff --git a/api/app/serializers/spree/api/v3/admin/user_serializer.rb b/api/app/serializers/spree/api/v3/admin/user_serializer.rb
index 464c45f14c..4ae3188ba1 100644
--- a/api/app/serializers/spree/api/v3/admin/user_serializer.rb
+++ b/api/app/serializers/spree/api/v3/admin/user_serializer.rb
@@ -5,7 +5,13 @@ module Spree
# Admin API User Serializer
# Full user data including admin-only fields
class UserSerializer < V3::UserSerializer
- # Note: Using Spree.user_class dynamically, typelize_from not applicable here
+ typelize phone: 'string | null', login: 'string | null',
+ accepts_email_marketing: :boolean,
+ last_sign_in_at: 'string | null', current_sign_in_at: 'string | null',
+ sign_in_count: :number, failed_attempts: :number,
+ last_sign_in_ip: 'string | null', current_sign_in_ip: 'string | null',
+ public_metadata: 'Record<string, unknown> | null',
+ private_metadata: 'Record<string, unknown> | null'
# Admin-only attributes
attributes :phone, :login, :accepts_email_marketing,
diff --git a/api/app/serializers/spree/api/v3/admin/variant_serializer.rb b/api/app/serializers/spree/api/v3/admin/variant_serializer.rb
index 88371795d5..f55094b340 100644
--- a/api/app/serializers/spree/api/v3/admin/variant_serializer.rb
+++ b/api/app/serializers/spree/api/v3/admin/variant_serializer.rb
@@ -5,10 +5,10 @@ module Spree
# Admin API Variant Serializer
# Full variant data including admin-only fields
class VariantSerializer < V3::VariantSerializer
- typelize_from Spree::Variant
# Additional type hints for admin-only attributes
- typelize cost_price: 'number | null', cost_currency: 'string | null',
+ typelize position: :number, tax_category_id: 'string | null',
+ cost_price: 'number | null', cost_currency: 'string | null',
total_on_hand: 'number | null',
public_metadata: 'Record<string, unknown> | null',
private_metadata: 'Record<string, unknown> | null',
diff --git a/api/app/serializers/spree/api/v3/base_serializer.rb b/api/app/serializers/spree/api/v3/base_serializer.rb
index d50c1b2a32..e644067bde 100644
--- a/api/app/serializers/spree/api/v3/base_serializer.rb
+++ b/api/app/serializers/spree/api/v3/base_serializer.rb
@@ -5,6 +5,15 @@ module Spree
include Alba::Resource
include Typelizer::DSL
+ # Common type hints for fields present in most serializers
+ typelize id: :string, created_at: :string, updated_at: :string
+
+ # Use prefixed IDs (Stripe-style) for all API v3 serializers
+ # e.g., prod_abc123, var_xyz789, or_def456
+ attribute :id do |object|
+ object.prefix_id
+ end
+
# Context accessors
def current_store
params[:store]
diff --git a/api/app/serializers/spree/api/v3/country_serializer.rb b/api/app/serializers/spree/api/v3/country_serializer.rb
index 43303cbf07..dcd46e8a64 100644
--- a/api/app/serializers/spree/api/v3/country_serializer.rb
+++ b/api/app/serializers/spree/api/v3/country_serializer.rb
@@ -2,9 +2,10 @@ module Spree
module Api
module V3
class CountrySerializer < BaseSerializer
- typelize_from Spree::Country
+ typelize iso: :string, iso3: :string, iso_name: :string, name: :string,
+ states_required: :boolean, zipcode_required: :boolean
- attributes :id, :iso, :iso3, :iso_name, :name, :states_required, :zipcode_required
+ attributes :iso, :iso3, :iso_name, :name, :states_required, :zipcode_required
many :states,
resource: Spree.api.state_serializer,
diff --git a/api/app/serializers/spree/api/v3/digital_link_serializer.rb b/api/app/serializers/spree/api/v3/digital_link_serializer.rb
index 24036d33e6..cb6bcf202f 100644
--- a/api/app/serializers/spree/api/v3/digital_link_serializer.rb
+++ b/api/app/serializers/spree/api/v3/digital_link_serializer.rb
@@ -2,11 +2,10 @@ module Spree
module Api
module V3
class DigitalLinkSerializer < BaseSerializer
- typelize_from Spree::DigitalLink
- typelize authorizable: :boolean, expired: :boolean, access_limit_exceeded: :boolean,
- filename: :string, content_type: :string
+ typelize access_counter: :number, filename: :string, content_type: :string,
+ authorizable: :boolean, expired: :boolean, access_limit_exceeded: :boolean
- attributes :id, :access_counter, :filename, :content_type,
+ attributes :access_counter, :filename, :content_type,
created_at: :iso8601, updated_at: :iso8601
attribute :authorizable do |digital_link|
diff --git a/api/app/serializers/spree/api/v3/image_serializer.rb b/api/app/serializers/spree/api/v3/image_serializer.rb
index 7ea948cd4c..0373af4c1f 100644
--- a/api/app/serializers/spree/api/v3/image_serializer.rb
+++ b/api/app/serializers/spree/api/v3/image_serializer.rb
@@ -2,12 +2,17 @@ module Spree
module Api
module V3
class ImageSerializer < BaseSerializer
- typelize_from Spree::Image
- typelize original_url: 'string | null', mini_url: 'string | null',
+ typelize position: :number, alt: 'string | null', viewable_type: :string, viewable_id: :string,
+ original_url: 'string | null', mini_url: 'string | null',
small_url: 'string | null', medium_url: 'string | null',
- large_url: 'string | null', xlarge_url: 'string | null'
+ large_url: 'string | null', xlarge_url: 'string | null',
+ og_image_url: 'string | null'
- attributes :id, :position, :alt, :viewable_type, :viewable_id,
+ attribute :viewable_id do |image|
+ image.viewable&.prefix_id
+ end
+
+ attributes :position, :alt, :viewable_type,
created_at: :iso8601, updated_at: :iso8601
attribute :original_url do |image|
diff --git a/api/app/serializers/spree/api/v3/line_item_serializer.rb b/api/app/serializers/spree/api/v3/line_item_serializer.rb
index c96b6e1bf5..1635cef0ba 100644
--- a/api/app/serializers/spree/api/v3/line_item_serializer.rb
+++ b/api/app/serializers/spree/api/v3/line_item_serializer.rb
@@ -2,15 +2,21 @@ module Spree
module Api
module V3
class LineItemSerializer < BaseSerializer
- typelize_from Spree::LineItem
- typelize name: :string, slug: :string, options_text: :string,
- display_price: :string, display_total: :string,
- display_adjustment_total: :string, display_additional_tax_total: :string,
- display_included_tax_total: :string, display_promo_total: :string,
- display_pre_tax_amount: :string, display_discounted_amount: :string,
- display_compare_at_amount: 'string | null'
+ typelize variant_id: :string, quantity: :number, name: :string, slug: :string, options_text: :string,
+ price: :number, display_price: :string, total: :number, display_total: :string,
+ adjustment_total: :number, display_adjustment_total: :string,
+ additional_tax_total: :number, display_additional_tax_total: :string,
+ included_tax_total: :number, display_included_tax_total: :string,
+ promo_total: :number, display_promo_total: :string,
+ pre_tax_amount: :number, display_pre_tax_amount: :string,
+ discounted_amount: :number, display_discounted_amount: :string,
+ compare_at_amount: 'number | null', display_compare_at_amount: 'string | null'
- attributes :id, :variant_id, :quantity, :name, :slug, :options_text,
+ attribute :variant_id do |line_item|
+ line_item.variant&.prefix_id
+ end
+
+ attributes :quantity, :name, :slug, :options_text,
:price, :display_price, :total, :display_total,
:adjustment_total, :display_adjustment_total,
:additional_tax_total, :display_additional_tax_total,
diff --git a/api/app/serializers/spree/api/v3/option_type_serializer.rb b/api/app/serializers/spree/api/v3/option_type_serializer.rb
index 13fd9c11ec..4c1409ebfd 100644
--- a/api/app/serializers/spree/api/v3/option_type_serializer.rb
+++ b/api/app/serializers/spree/api/v3/option_type_serializer.rb
@@ -2,9 +2,9 @@ module Spree
module Api
module V3
class OptionTypeSerializer < BaseSerializer
- typelize_from Spree::OptionType
+ typelize name: :string, presentation: :string, position: :number
- attributes :id, :name, :presentation, :position
+ attributes :name, :presentation, :position
end
end
end
diff --git a/api/app/serializers/spree/api/v3/option_value_serializer.rb b/api/app/serializers/spree/api/v3/option_value_serializer.rb
index 7d6caee3aa..35fbb19f7c 100644
--- a/api/app/serializers/spree/api/v3/option_value_serializer.rb
+++ b/api/app/serializers/spree/api/v3/option_value_serializer.rb
@@ -2,10 +2,14 @@ module Spree
module Api
module V3
class OptionValueSerializer < BaseSerializer
- typelize_from Spree::OptionValue
- typelize option_type_name: :string, option_type_presentation: :string
+ typelize name: :string, presentation: :string, position: :number, option_type_id: :string,
+ option_type_name: :string, option_type_presentation: :string
- attributes :id, :name, :presentation, :position, :option_type_id
+ attribute :option_type_id do |option_value|
+ option_value.option_type&.prefix_id
+ end
+
+ attributes :name, :presentation, :position
attribute :option_type_name do |option_value|
option_value.option_type.name
diff --git a/api/app/serializers/spree/api/v3/order_promotion_serializer.rb b/api/app/serializers/spree/api/v3/order_promotion_serializer.rb
index aebafd58a9..2b4ab96a59 100644
--- a/api/app/serializers/spree/api/v3/order_promotion_serializer.rb
+++ b/api/app/serializers/spree/api/v3/order_promotion_serializer.rb
@@ -2,9 +2,14 @@ module Spree
module Api
module V3
class OrderPromotionSerializer < BaseSerializer
- typelize_from Spree::OrderPromotion
+ typelize name: :string, description: 'string | null', code: 'string | null',
+ amount: :number, display_amount: :string, promotion_id: :string
- attributes :id, :name, :description, :code, :amount, :display_amount, :promotion_id
+ attribute :promotion_id do |order_promotion|
+ order_promotion.promotion&.prefix_id
+ end
+
+ attributes :name, :description, :code, :amount, :display_amount
end
end
end
diff --git a/api/app/serializers/spree/api/v3/order_serializer.rb b/api/app/serializers/spree/api/v3/order_serializer.rb
index 38efa003d6..f5fff4cf76 100644
--- a/api/app/serializers/spree/api/v3/order_serializer.rb
+++ b/api/app/serializers/spree/api/v3/order_serializer.rb
@@ -4,9 +4,19 @@ module Spree
# Store API Order Serializer
# Customer-facing order data
class OrderSerializer < BaseSerializer
- typelize_from Spree::Order
-
- attributes :id, :number, :state, :token, :email, :special_instructions,
+ typelize number: :string, state: :string, token: :string, email: 'string | null',
+ special_instructions: 'string | null', currency: :string, item_count: :number,
+ shipment_state: 'string | null', payment_state: 'string | null',
+ item_total: :number, display_item_total: :string,
+ ship_total: :number, display_ship_total: :string,
+ adjustment_total: :number, display_adjustment_total: :string,
+ promo_total: :number, display_promo_total: :string,
+ tax_total: :number, display_tax_total: :string,
+ included_tax_total: :number, display_included_tax_total: :string,
+ additional_tax_total: :number, display_additional_tax_total: :string,
+ total: :number, display_total: :string, completed_at: 'string | null'
+
+ attributes :number, :state, :token, :email, :special_instructions,
:currency, :item_count, :shipment_state, :payment_state,
:item_total, :display_item_total, :ship_total, :display_ship_total,
:adjustment_total, :display_adjustment_total, :promo_total, :display_promo_total,
diff --git a/api/app/serializers/spree/api/v3/payment_method_serializer.rb b/api/app/serializers/spree/api/v3/payment_method_serializer.rb
index 4231541c06..0746f65e4c 100644
--- a/api/app/serializers/spree/api/v3/payment_method_serializer.rb
+++ b/api/app/serializers/spree/api/v3/payment_method_serializer.rb
@@ -2,9 +2,9 @@ module Spree
module Api
module V3
class PaymentMethodSerializer < BaseSerializer
- typelize_from Spree::PaymentMethod
+ typelize name: :string, description: 'string | null', type: :string
- attributes :id, :name, :description, :type
+ attributes :name, :description, :type
end
end
end
diff --git a/api/app/serializers/spree/api/v3/payment_serializer.rb b/api/app/serializers/spree/api/v3/payment_serializer.rb
index ede9160888..c31b7cd1fe 100644
--- a/api/app/serializers/spree/api/v3/payment_serializer.rb
+++ b/api/app/serializers/spree/api/v3/payment_serializer.rb
@@ -2,9 +2,14 @@ module Spree
module Api
module V3
class PaymentSerializer < BaseSerializer
- typelize_from Spree::Payment
+ typelize state: :string, payment_method_id: :string, response_code: 'string | null',
+ number: :string, amount: :number, display_amount: :string
- attributes :id, :state, :payment_method_id, :response_code, :number, :amount, :display_amount,
+ attribute :payment_method_id do |payment|
+ payment.payment_method&.prefix_id
+ end
+
+ attributes :state, :response_code, :number, :amount, :display_amount,
created_at: :iso8601, updated_at: :iso8601
one :payment_method, resource: Spree.api.payment_method_serializer
diff --git a/api/app/serializers/spree/api/v3/product_serializer.rb b/api/app/serializers/spree/api/v3/product_serializer.rb
index b6b1a159fc..1bd67b02e6 100644
--- a/api/app/serializers/spree/api/v3/product_serializer.rb
+++ b/api/app/serializers/spree/api/v3/product_serializer.rb
@@ -4,17 +4,19 @@ module Spree
# Store API Product Serializer
# Customer-facing product data with limited fields
class ProductSerializer < BaseSerializer
- typelize_from Spree::Product
-
- # Type hints for computed/delegated attributes
- typelize sku: 'string | null', barcode: 'string | null',
+ typelize name: :string, description: 'string | null', slug: :string,
+ sku: 'string | null', barcode: 'string | null',
+ meta_description: 'string | null', meta_keywords: 'string | null',
+ variant_count: :number,
+ available_on: 'string | null',
purchasable: :boolean, in_stock: :boolean, backorderable: :boolean, available: :boolean,
price: 'number | null', price_in_cents: 'number | null', display_price: 'string | null',
compare_at_price: 'number | null', compare_at_price_in_cents: 'number | null',
display_compare_at_price: 'string | null', tags: 'string[]'
- attributes :id, :name, :description, :slug, :sku, :barcode,
+ attributes :name, :description, :slug, :sku, :barcode,
:meta_description, :meta_keywords,
+ :variant_count,
available_on: :iso8601, created_at: :iso8601, updated_at: :iso8601
attribute :purchasable do |product|
diff --git a/api/app/serializers/spree/api/v3/shipment_serializer.rb b/api/app/serializers/spree/api/v3/shipment_serializer.rb
index f7cc50304d..2acf38a829 100644
--- a/api/app/serializers/spree/api/v3/shipment_serializer.rb
+++ b/api/app/serializers/spree/api/v3/shipment_serializer.rb
@@ -2,9 +2,16 @@ module Spree
module Api
module V3
class ShipmentSerializer < BaseSerializer
- typelize_from Spree::Shipment
+ typelize number: :string, state: :string, tracking: 'string | null',
+ tracking_url: 'string | null', shipped_at: 'string | null',
+ cost: :number, display_cost: :string,
+ adjustment_total: :number, display_adjustment_total: :string,
+ additional_tax_total: :number, display_additional_tax_total: :string,
+ promo_total: :number, display_promo_total: :string,
+ included_tax_total: :number, display_included_tax_total: :string,
+ total: :number, display_total: :string
- attributes :id, :number, :state, :tracking, :tracking_url, :shipped_at,
+ attributes :number, :state, :tracking, :tracking_url, :shipped_at,
:cost, :display_cost, :adjustment_total, :display_adjustment_total,
:additional_tax_total, :display_additional_tax_total, :promo_total, :display_promo_total,
:included_tax_total, :display_included_tax_total, :total, :display_total,
diff --git a/api/app/serializers/spree/api/v3/shipping_method_serializer.rb b/api/app/serializers/spree/api/v3/shipping_method_serializer.rb
index 0a22ec26b7..7802f428c1 100644
--- a/api/app/serializers/spree/api/v3/shipping_method_serializer.rb
+++ b/api/app/serializers/spree/api/v3/shipping_method_serializer.rb
@@ -2,9 +2,9 @@ module Spree
module Api
module V3
class ShippingMethodSerializer < BaseSerializer
- typelize_from Spree::ShippingMethod
+ typelize name: :string, code: 'string | null'
- attributes :id, :name, :code
+ attributes :name, :code
end
end
end
diff --git a/api/app/serializers/spree/api/v3/shipping_rate_serializer.rb b/api/app/serializers/spree/api/v3/shipping_rate_serializer.rb
index 05fa7e8fc7..2d6c570ba0 100644
--- a/api/app/serializers/spree/api/v3/shipping_rate_serializer.rb
+++ b/api/app/serializers/spree/api/v3/shipping_rate_serializer.rb
@@ -2,10 +2,14 @@ module Spree
module Api
module V3
class ShippingRateSerializer < BaseSerializer
- typelize_from Spree::ShippingRate
- typelize cost: :number, display_cost: :string
+ typelize name: :string, selected: :boolean, shipping_method_id: :string,
+ cost: :number, display_cost: :string
- attributes :id, :name, :selected, :shipping_method_id
+ attribute :shipping_method_id do |shipping_rate|
+ shipping_rate.shipping_method&.prefix_id
+ end
+
+ attributes :name, :selected
attribute :cost do |shipping_rate|
shipping_rate.cost.to_f
diff --git a/api/app/serializers/spree/api/v3/state_serializer.rb b/api/app/serializers/spree/api/v3/state_serializer.rb
index a33563884c..fbeb00a224 100644
--- a/api/app/serializers/spree/api/v3/state_serializer.rb
+++ b/api/app/serializers/spree/api/v3/state_serializer.rb
@@ -2,9 +2,13 @@ module Spree
module Api
module V3
class StateSerializer < BaseSerializer
- typelize_from Spree::State
+ typelize name: :string, abbr: :string, country_id: :string
- attributes :id, :name, :abbr, :country_id
+ attribute :country_id do |state|
+ state.country&.prefix_id
+ end
+
+ attributes :name, :abbr
end
end
end
diff --git a/api/app/serializers/spree/api/v3/stock_location_serializer.rb b/api/app/serializers/spree/api/v3/stock_location_serializer.rb
index 7dedf3d99b..fee69d18d9 100644
--- a/api/app/serializers/spree/api/v3/stock_location_serializer.rb
+++ b/api/app/serializers/spree/api/v3/stock_location_serializer.rb
@@ -2,9 +2,20 @@ module Spree
module Api
module V3
class StockLocationSerializer < BaseSerializer
- typelize_from Spree::StockLocation
+ typelize name: :string, address1: 'string | null', city: 'string | null',
+ zipcode: 'string | null', country_id: 'string | null',
+ country_iso: 'string | null', country_name: 'string | null',
+ state_id: 'string | null', state_text: 'string | null'
- attributes :id, :name, :address1, :city, :zipcode, :country_id, :country_iso, :country_name, :state_id, :state_text
+ attribute :country_id do |stock_location|
+ stock_location.country&.prefix_id
+ end
+
+ attribute :state_id do |stock_location|
+ stock_location.state&.prefix_id
+ end
+
+ attributes :name, :address1, :city, :zipcode, :country_iso, :country_name, :state_text
end
end
end
diff --git a/api/app/serializers/spree/api/v3/store_serializer.rb b/api/app/serializers/spree/api/v3/store_serializer.rb
index 8b15e75bcb..4274a7fefe 100644
--- a/api/app/serializers/spree/api/v3/store_serializer.rb
+++ b/api/app/serializers/spree/api/v3/store_serializer.rb
@@ -2,12 +2,16 @@ module Spree
module Api
module V3
class StoreSerializer < BaseSerializer
- typelize_from Spree::Store
- typelize supported_currencies: 'string[]', favicon_image_url: 'string | null',
+ typelize name: :string, url: :string, meta_description: 'string | null',
+ meta_keywords: 'string | null', seo_title: 'string | null',
+ default_currency: :string, code: :string, default: :boolean,
+ facebook: 'string | null', twitter: 'string | null', instagram: 'string | null',
+ customer_support_email: 'string | null', default_locale: :string,
+ supported_currencies: 'string[]', favicon_image_url: 'string | null',
logo_image_url: 'string | null', social_image_url: 'string | null',
supported_locales: 'string[]'
- attributes :id, :name, :url, :meta_description, :meta_keywords, :seo_title,
+ attributes :name, :url, :meta_description, :meta_keywords, :seo_title,
:default_currency, :code, :default, :facebook, :twitter,
:instagram, :customer_support_email, :default_locale,
created_at: :iso8601, updated_at: :iso8601
diff --git a/api/app/serializers/spree/api/v3/taxon_serializer.rb b/api/app/serializers/spree/api/v3/taxon_serializer.rb
index 11a274af87..9a3669e88c 100644
--- a/api/app/serializers/spree/api/v3/taxon_serializer.rb
+++ b/api/app/serializers/spree/api/v3/taxon_serializer.rb
@@ -2,12 +2,15 @@ module Spree
module Api
module V3
class TaxonSerializer < BaseSerializer
- typelize_from Spree::Taxon
- typelize description: :string, description_html: :string,
+ typelize name: :string, permalink: :string, position: :number,
+ lft: :number, rgt: :number, depth: :number,
+ meta_title: 'string | null', meta_description: 'string | null', meta_keywords: 'string | null',
+ parent_id: 'string | null', taxonomy_id: :string, children_count: :number,
+ description: :string, description_html: :string,
image_url: 'string | null', square_image_url: 'string | null',
is_root: :boolean, is_child: :boolean, is_leaf: :boolean
- attributes :id, :name, :permalink, :position, :lft, :rgt, :depth,
+ attributes :name, :permalink, :position, :lft, :rgt, :depth,
:meta_title, :meta_description, :meta_keywords,
:parent_id, :taxonomy_id, :children_count,
created_at: :iso8601, updated_at: :iso8601
diff --git a/api/app/serializers/spree/api/v3/taxonomy_serializer.rb b/api/app/serializers/spree/api/v3/taxonomy_serializer.rb
index c067b03380..7c5fa3da21 100644
--- a/api/app/serializers/spree/api/v3/taxonomy_serializer.rb
+++ b/api/app/serializers/spree/api/v3/taxonomy_serializer.rb
@@ -2,9 +2,9 @@ module Spree
module Api
module V3
class TaxonomySerializer < BaseSerializer
- typelize_from Spree::Taxonomy
+ typelize name: :string, position: :number
- attributes :id, :name, :position,
+ attributes :name, :position,
created_at: :iso8601, updated_at: :iso8601
# Conditional associations
diff --git a/api/app/serializers/spree/api/v3/user_serializer.rb b/api/app/serializers/spree/api/v3/user_serializer.rb
index 52107d9352..23869ffdbd 100644
--- a/api/app/serializers/spree/api/v3/user_serializer.rb
+++ b/api/app/serializers/spree/api/v3/user_serializer.rb
@@ -4,9 +4,9 @@ module Spree
# Store API User Serializer
# Customer-facing user data
class UserSerializer < BaseSerializer
- # Note: Using Spree.user_class dynamically, typelize_from not applicable here
+ typelize email: :string, first_name: 'string | null', last_name: 'string | null'
- attributes :id, :email, :first_name, :last_name,
+ attributes :email, :first_name, :last_name,
created_at: :iso8601, updated_at: :iso8601
many :addresses, resource: Spree.api.address_serializer
diff --git a/api/app/serializers/spree/api/v3/variant_serializer.rb b/api/app/serializers/spree/api/v3/variant_serializer.rb
index f9300d4f3b..b3447c7450 100644
--- a/api/app/serializers/spree/api/v3/variant_serializer.rb
+++ b/api/app/serializers/spree/api/v3/variant_serializer.rb
@@ -4,14 +4,19 @@ module Spree
# Store API Variant Serializer
# Customer-facing variant data with limited fields
class VariantSerializer < BaseSerializer
- typelize_from Spree::Variant
- typelize purchasable: :boolean, in_stock: :boolean, backorderable: :boolean,
+ typelize product_id: :string, sku: 'string | null', barcode: 'string | null',
+ is_master: :boolean, options_text: :string, track_inventory: :boolean, image_count: :number,
+ purchasable: :boolean, in_stock: :boolean, backorderable: :boolean,
weight: 'number | null', height: 'number | null', width: 'number | null', depth: 'number | null',
price: 'number | null', price_in_cents: 'number | null', display_price: 'string | null',
compare_at_price: 'number | null', display_compare_at_price: 'string | null'
- attributes :id, :product_id, :sku, :barcode, :is_master, :options_text, :track_inventory, :image_count,
+ attribute :product_id do |variant|
+ variant.product&.prefix_id
+ end
+
+ attributes :sku, :barcode, :is_master, :options_text, :track_inventory, :image_count,
created_at: :iso8601, updated_at: :iso8601
attribute :purchasable do |variant|
diff --git a/api/app/serializers/spree/api/v3/wished_item_serializer.rb b/api/app/serializers/spree/api/v3/wished_item_serializer.rb
index 000d3282b9..b52c8f97f9 100644
--- a/api/app/serializers/spree/api/v3/wished_item_serializer.rb
+++ b/api/app/serializers/spree/api/v3/wished_item_serializer.rb
@@ -2,9 +2,17 @@ module Spree
module Api
module V3
class WishedItemSerializer < BaseSerializer
- typelize_from Spree::WishedItem
+ typelize variant_id: :string, wishlist_id: :string, quantity: :number
- attributes :id, :variant_id, :wishlist_id, :quantity,
+ attribute :variant_id do |wished_item|
+ wished_item.variant&.prefix_id
+ end
+
+ attribute :wishlist_id do |wished_item|
+ wished_item.wishlist&.prefix_id
+ end
+
+ attributes :quantity,
created_at: :iso8601, updated_at: :iso8601
one :variant, resource: Spree.api.variant_serializer
diff --git a/api/app/serializers/spree/api/v3/wishlist_serializer.rb b/api/app/serializers/spree/api/v3/wishlist_serializer.rb
index 697412c84d..730129bc75 100644
--- a/api/app/serializers/spree/api/v3/wishlist_serializer.rb
+++ b/api/app/serializers/spree/api/v3/wishlist_serializer.rb
@@ -2,10 +2,9 @@ module Spree
module Api
module V3
class WishlistSerializer < BaseSerializer
- typelize_from Spree::Wishlist
- typelize is_default: :boolean, is_private: :boolean
+ typelize name: :string, token: :string, is_default: :boolean, is_private: :boolean
- attributes :id, :name, :token,
+ attributes :name, :token,
created_at: :iso8601, updated_at: :iso8601
attribute :is_default do |wishlist|
diff --git a/api/config/initializers/typelizer.rb b/api/config/initializers/typelizer.rb
new file mode 100644
index 0000000000..7f3bb1de8f
--- /dev/null
+++ b/api/config/initializers/typelizer.rb
@@ -0,0 +1,19 @@
+Typelizer.configure do |config|
+ api_root = Spree::Api::Engine.root
+
+ config.dirs = [
+ api_root.join('app/serializers/spree/api/v3'),
+ api_root.join('app/serializers/spree/api/v3/admin')
+ ]
+ config.output_dir = api_root.join('../sdk/src/types/generated')
+ config.comments = true
+
+ # Type names: StoreProduct, AdminProduct, etc.
+ config.serializer_name_mapper = ->(serializer) {
+ name = serializer.name.to_s
+ .sub(/\ASpree::Api::V3::Admin::/, 'Admin')
+ .sub(/\ASpree::Api::V3::/, 'Store')
+ .sub(/Serializer\z/, '')
+ name
+ }
+end
diff --git a/api/lib/spree/api/engine.rb b/api/lib/spree/api/engine.rb
index d5cd763803..b58af3e1d8 100644
--- a/api/lib/spree/api/engine.rb
+++ b/api/lib/spree/api/engine.rb
@@ -19,32 +19,6 @@ module Spree
Migrations.new(config, engine_name).check unless Rails.env.test?
end
- # Configure typelizer for TypeScript type generation
- # Runs after typelizer.configure so we can override defaults
- initializer 'spree.api.typelizer', after: 'typelizer.configure' do
- next unless defined?(Typelizer)
-
- api_root = Spree::Api::Engine.root
-
- Typelizer.configure do |config|
- config.dirs = [
- api_root.join('app/serializers/spree/api/v3'),
- api_root.join('app/serializers/spree/api/v3/admin')
- ]
- config.output_dir = api_root.join('../sdk/src/types/generated')
- config.comments = true
-
- # Type names: StoreProduct, AdminProduct, etc.
- config.serializer_name_mapper = ->(serializer) {
- name = serializer.name.to_s
- .sub(/\ASpree::Api::V3::Admin::/, 'Admin')
- .sub(/\ASpree::Api::V3::/, 'Store')
- .sub(/Serializer\z/, '')
- name
- }
- end
- end
-
# Add API event subscribers
config.after_initialize do
Spree.subscribers << Spree::WebhookEventSubscriber
diff --git a/api/spec/serializers/spree/api/v3/product_serializer_spec.rb b/api/spec/serializers/spree/api/v3/product_serializer_spec.rb
index 5dfd7c7a9b..be980c1c08 100644
--- a/api/spec/serializers/spree/api/v3/product_serializer_spec.rb
+++ b/api/spec/serializers/spree/api/v3/product_serializer_spec.rb
@@ -10,7 +10,7 @@ RSpec.describe Spree::Api::V3::ProductSerializer do
it 'includes standard attributes' do
expect(subject).to include(
- 'id' => product.id,
+ 'id' => product.prefix_id,
'name' => product.name,
'slug' => product.slug
)
@@ -40,7 +40,7 @@ RSpec.describe Spree::Api::V3::Admin::ProductSerializer do
it 'includes standard attributes' do
expect(subject).to include(
- 'id' => product.id,
+ 'id' => product.prefix_id,
'name' => product.name,
'slug' => product.slug
)
diff --git a/api/spec/serializers/spree/api/v3/variant_serializer_spec.rb b/api/spec/serializers/spree/api/v3/variant_serializer_spec.rb
index 54b4ea77fe..6bcb3c64df 100644
--- a/api/spec/serializers/spree/api/v3/variant_serializer_spec.rb
+++ b/api/spec/serializers/spree/api/v3/variant_serializer_spec.rb
@@ -11,9 +11,9 @@ RSpec.describe Spree::Api::V3::VariantSerializer do
it 'includes standard attributes' do
expect(subject).to include(
- 'id' => variant.id,
+ 'id' => variant.prefix_id,
'sku' => variant.sku,
- 'product_id' => product.id
+ 'product_id' => product.prefix_id
)
end
@@ -43,9 +43,9 @@ RSpec.describe Spree::Api::V3::Admin::VariantSerializer do
it 'includes standard attributes' do
expect(subject).to include(
- 'id' => variant.id,
+ 'id' => variant.prefix_id,
'sku' => variant.sku,
- 'product_id' => product.id
+ 'product_id' => product.prefix_id
)
end
diff --git a/core/app/models/concerns/spree/prefixed_id.rb b/core/app/models/concerns/spree/prefixed_id.rb
new file mode 100644
index 0000000000..5cf4f54f99
--- /dev/null
+++ b/core/app/models/concerns/spree/prefixed_id.rb
@@ -0,0 +1,63 @@
+# frozen_string_literal: true
+
+module Spree
+ # Adds Stripe-style prefixed IDs to Spree models
+ # e.g., prod_abc123, order_xyz789, var_def456
+ #
+ # Usage in models:
+ # class Product < Spree.base_class
+ # has_prefix_id :prod
+ # end
+ #
+ # This stores a prefix_id column in the database (e.g., "prod_abc123")
+ # that can be used as the primary identifier in API v3.
+ #
+ # The prefix_id is auto-generated on record creation and is immutable.
+ module PrefixedId
+ extend ActiveSupport::Concern
+
+ ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'.freeze
+ ID_LENGTH = 24
+
+ included do
+ class_attribute :_prefix_id_prefix, instance_writer: false
+ end
+
+ # Clear prefix_id when duplicating records so a new one is generated
+ def initialize_dup(other)
+ super
+ self.prefix_id = nil if respond_to?(:prefix_id=)
+ end
+
+ class_methods do
+ def has_prefix_id(prefix)
+ self._prefix_id_prefix = prefix.to_s
+
+ before_create :generate_prefix_id, if: -> { prefix_id.blank? }
+
+ validates :prefix_id, uniqueness: true, allow_nil: true
+
+ # Class method to find by prefix_id
+ scope :find_by_prefix_id, ->(id) { find_by(prefix_id: id) }
+ end
+
+ def find_by_prefix_id!(id)
+ find_by!(prefix_id: id)
+ end
+
+ def prefix_id_prefix
+ _prefix_id_prefix
+ end
+ end
+
+ def generate_prefix_id
+ self.prefix_id = "#{self.class._prefix_id_prefix}_#{random_id}"
+ end
+
+ private
+
+ def random_id
+ Array.new(ID_LENGTH) { ALPHABET[SecureRandom.random_number(ALPHABET.length)] }.join
+ end
+ end
+end
diff --git a/core/app/models/concerns/spree/user_methods.rb b/core/app/models/concerns/spree/user_methods.rb
index 4982b6e8dd..a6bd5a6626 100644
--- a/core/app/models/concerns/spree/user_methods.rb
+++ b/core/app/models/concerns/spree/user_methods.rb
@@ -12,6 +12,8 @@ module Spree
include Spree::Publishable
included do
+ has_prefix_id :cus # Stripe: cus_
+
# Enable lifecycle events for user models
publishes_lifecycle_events
diff --git a/core/app/models/spree/address.rb b/core/app/models/spree/address.rb
index f735d57d2e..297cd7cca3 100644
--- a/core/app/models/spree/address.rb
+++ b/core/app/models/spree/address.rb
@@ -1,5 +1,7 @@
module Spree
class Address < Spree.base_class
+ has_prefix_id :addr # Spree-specific: address
+
require 'validates_zipcode'
include Spree::Metafields
diff --git a/core/app/models/spree/adjustment.rb b/core/app/models/spree/adjustment.rb
index 2ef36ca365..ad70503a86 100644
--- a/core/app/models/spree/adjustment.rb
+++ b/core/app/models/spree/adjustment.rb
@@ -22,6 +22,8 @@
# it might be reinstated.
module Spree
class Adjustment < Spree.base_class
+ has_prefix_id :adj # Spree-specific: adjustment
+
with_options polymorphic: true do
belongs_to :adjustable, touch: true
belongs_to :source
diff --git a/core/app/models/spree/api_key.rb b/core/app/models/spree/api_key.rb
index 676f378837..3252795aaf 100644
--- a/core/app/models/spree/api_key.rb
+++ b/core/app/models/spree/api_key.rb
@@ -1,5 +1,7 @@
module Spree
class ApiKey < Spree.base_class
+ has_prefix_id :key # Spree-specific: api key
+
KEY_TYPES = %w[publishable secret].freeze
PREFIXES = { 'publishable' => 'pk_', 'secret' => 'sk_' }.freeze
TOKEN_LENGTH = 24
diff --git a/core/app/models/spree/asset.rb b/core/app/models/spree/asset.rb
index 78179b2987..3bf97179dc 100644
--- a/core/app/models/spree/asset.rb
+++ b/core/app/models/spree/asset.rb
@@ -1,5 +1,7 @@
module Spree
class Asset < Spree.base_class
+ has_prefix_id :asset # Stripe: file_
+
include Support::ActiveStorage
include Spree::Metafields
include Spree::Metadata
diff --git a/core/app/models/spree/base.rb b/core/app/models/spree/base.rb
index 28b85a587f..416a02a033 100644
--- a/core/app/models/spree/base.rb
+++ b/core/app/models/spree/base.rb
@@ -4,6 +4,7 @@ class Spree::Base < ApplicationRecord
include Spree::TranslatableResourceScopes
include Spree::IntegrationsConcern
include Spree::Publishable
+ include Spree::PrefixedId
after_initialize do
if has_attribute?(:preferences) && !preferences.nil?
@@ -61,7 +62,7 @@ class Spree::Base < ApplicationRecord
end
def self.json_api_permitted_attributes
- skipped_attributes = %w[id]
+ skipped_attributes = %w[id prefix_id]
if included_modules.include?(CollectiveIdea::Acts::NestedSet::Model)
skipped_attributes.push('lft', 'rgt', 'depth')
diff --git a/core/app/models/spree/calculator.rb b/core/app/models/spree/calculator.rb
index 2fe1bcbd21..e7144602fe 100644
--- a/core/app/models/spree/calculator.rb
+++ b/core/app/models/spree/calculator.rb
@@ -1,5 +1,7 @@
module Spree
class Calculator < Spree.base_class
+ has_prefix_id :calc
+
acts_as_paranoid
belongs_to :calculable, polymorphic: true, optional: true, inverse_of: :calculator, touch: true
diff --git a/core/app/models/spree/country.rb b/core/app/models/spree/country.rb
index f5d7941479..2c66019c36 100644
--- a/core/app/models/spree/country.rb
+++ b/core/app/models/spree/country.rb
@@ -1,5 +1,7 @@
module Spree
class Country < Spree.base_class
+ has_prefix_id :ctry # Spree-specific: country
+
has_many :addresses, dependent: :restrict_with_error
has_many :states,
-> { order name: :asc },
diff --git a/core/app/models/spree/coupon_code.rb b/core/app/models/spree/coupon_code.rb
index b861bba964..76f0999da5 100644
--- a/core/app/models/spree/coupon_code.rb
+++ b/core/app/models/spree/coupon_code.rb
@@ -1,5 +1,7 @@
module Spree
class CouponCode < Spree.base_class
+ has_prefix_id :coupon
+
include Spree::Security::CouponCodes if defined?(Spree::Security::CouponCodes)
enum :state, %i(unused used)
diff --git a/core/app/models/spree/credit_card.rb b/core/app/models/spree/credit_card.rb
index b881ccd3ab..83c68cc1e2 100644
--- a/core/app/models/spree/credit_card.rb
+++ b/core/app/models/spree/credit_card.rb
@@ -1,5 +1,7 @@
module Spree
class CreditCard < Spree.base_class
+ has_prefix_id :card # Stripe: card_
+
include ActiveMerchant::Billing::CreditCardMethods
include Spree::Metafields
include Spree::Metadata
diff --git a/core/app/models/spree/custom_domain.rb b/core/app/models/spree/custom_domain.rb
index 28619509c7..28c113390d 100644
--- a/core/app/models/spree/custom_domain.rb
+++ b/core/app/models/spree/custom_domain.rb
@@ -1,5 +1,7 @@
module Spree
class CustomDomain < Spree::Base
+ has_prefix_id :domain
+
include Spree::SingleStoreResource
include Spree::Metafields
include Spree::Metadata
diff --git a/core/app/models/spree/customer_group.rb b/core/app/models/spree/customer_group.rb
index 8206eb3300..00e855e52a 100644
--- a/core/app/models/spree/customer_group.rb
+++ b/core/app/models/spree/customer_group.rb
@@ -1,5 +1,7 @@
module Spree
class CustomerGroup < Spree.base_class
+ has_prefix_id :cg
+
acts_as_paranoid
#
diff --git a/core/app/models/spree/customer_return.rb b/core/app/models/spree/customer_return.rb
index 77d9f40460..342b452085 100644
--- a/core/app/models/spree/customer_return.rb
+++ b/core/app/models/spree/customer_return.rb
@@ -1,5 +1,7 @@
module Spree
class CustomerReturn < Spree.base_class
+ has_prefix_id :cr
+
include Spree::Core::NumberGenerator.new(prefix: 'CR', length: 9)
include Spree::NumberIdentifier
include Spree::Metafields
diff --git a/core/app/models/spree/data_feed.rb b/core/app/models/spree/data_feed.rb
index 4491da4051..db1a7c2ab1 100644
--- a/core/app/models/spree/data_feed.rb
+++ b/core/app/models/spree/data_feed.rb
@@ -1,5 +1,7 @@
module Spree
class DataFeed < Spree.base_class
+ has_prefix_id :df
+
belongs_to :store, class_name: 'Spree::Store', foreign_key: 'store_id'
scope :for_store, ->(store) { where(store: store) }
diff --git a/core/app/models/spree/digital.rb b/core/app/models/spree/digital.rb
index 5041c14440..25e754e77a 100644
--- a/core/app/models/spree/digital.rb
+++ b/core/app/models/spree/digital.rb
@@ -1,5 +1,7 @@
module Spree
class Digital < Spree.base_class
+ has_prefix_id :dig
+
publishes_lifecycle_events
belongs_to :variant
diff --git a/core/app/models/spree/digital_link.rb b/core/app/models/spree/digital_link.rb
index b994d9ee16..da001e29b5 100644
--- a/core/app/models/spree/digital_link.rb
+++ b/core/app/models/spree/digital_link.rb
@@ -1,5 +1,7 @@
module Spree
class DigitalLink < Spree.base_class
+ has_prefix_id :dl # Spree-specific: digital link
+
publishes_lifecycle_events
if Rails::VERSION::STRING >= '7.1.0'
diff --git a/core/app/models/spree/export.rb b/core/app/models/spree/export.rb
index 04c7f790f6..8f2e7c5af3 100644
--- a/core/app/models/spree/export.rb
+++ b/core/app/models/spree/export.rb
@@ -2,6 +2,8 @@ require 'csv'
module Spree
class Export < Spree.base_class
+ has_prefix_id :exp
+
SUPPORTED_FILE_FORMATS = %i[csv].freeze
include Spree::SingleStoreResource
diff --git a/core/app/models/spree/gateway_customer.rb b/core/app/models/spree/gateway_customer.rb
index 5c42f23f80..f5d79b6c72 100644
--- a/core/app/models/spree/gateway_customer.rb
+++ b/core/app/models/spree/gateway_customer.rb
@@ -1,5 +1,7 @@
module Spree
class GatewayCustomer < Spree.base_class
+ has_prefix_id :gcus
+
belongs_to :payment_method, class_name: 'Spree::PaymentMethod'
belongs_to :user, class_name: Spree.user_class.to_s
diff --git a/core/app/models/spree/gift_card.rb b/core/app/models/spree/gift_card.rb
index f65c6bfcba..7618d43786 100644
--- a/core/app/models/spree/gift_card.rb
+++ b/core/app/models/spree/gift_card.rb
@@ -1,5 +1,7 @@
module Spree
class GiftCard < Spree.base_class
+ has_prefix_id :gc
+
extend DisplayMoney
include Spree::SingleStoreResource
include Spree::Metafields
diff --git a/core/app/models/spree/gift_card_batch.rb b/core/app/models/spree/gift_card_batch.rb
index ffe146cf44..1bbab536f8 100644
--- a/core/app/models/spree/gift_card_batch.rb
+++ b/core/app/models/spree/gift_card_batch.rb
@@ -1,5 +1,7 @@
module Spree
class GiftCardBatch < Spree.base_class
+ has_prefix_id :gcb
+
extend DisplayMoney
include Spree::SingleStoreResource
diff --git a/core/app/models/spree/import.rb b/core/app/models/spree/import.rb
index dfee95a2e5..264f2c68d2 100644
--- a/core/app/models/spree/import.rb
+++ b/core/app/models/spree/import.rb
@@ -2,6 +2,8 @@ require 'csv'
module Spree
class Import < Spree.base_class
+ has_prefix_id :imp
+
include Spree::NumberIdentifier
include Spree::NumberAsParam
diff --git a/core/app/models/spree/import_mapping.rb b/core/app/models/spree/import_mapping.rb
index 36cea06a64..3a7baca6c1 100644
--- a/core/app/models/spree/import_mapping.rb
+++ b/core/app/models/spree/import_mapping.rb
@@ -1,5 +1,7 @@
module Spree
class ImportMapping < Spree.base_class
+ has_prefix_id :immap
+
#
# Associations
#
diff --git a/core/app/models/spree/import_row.rb b/core/app/models/spree/import_row.rb
index f06612d470..65784485ac 100644
--- a/core/app/models/spree/import_row.rb
+++ b/core/app/models/spree/import_row.rb
@@ -1,5 +1,7 @@
module Spree
class ImportRow < Spree.base_class
+ has_prefix_id :imrow
+
# Set event prefix for ImportRow
self.event_prefix = 'import_row'
diff --git a/core/app/models/spree/integration.rb b/core/app/models/spree/integration.rb
index 5f8034203c..91f538e106 100644
--- a/core/app/models/spree/integration.rb
+++ b/core/app/models/spree/integration.rb
@@ -1,5 +1,7 @@
module Spree
class Integration < Spree.base_class
+ has_prefix_id :int
+
include Spree::SingleStoreResource
#
diff --git a/core/app/models/spree/inventory_unit.rb b/core/app/models/spree/inventory_unit.rb
index 91fc9053cd..85f300e5f5 100644
--- a/core/app/models/spree/inventory_unit.rb
+++ b/core/app/models/spree/inventory_unit.rb
@@ -1,5 +1,7 @@
module Spree
class InventoryUnit < Spree.base_class
+ has_prefix_id :iu
+
extend Spree::DisplayMoney
with_options inverse_of: :inventory_units do
diff --git a/core/app/models/spree/invitation.rb b/core/app/models/spree/invitation.rb
index 33b7cc1e31..6312e7a63b 100644
--- a/core/app/models/spree/invitation.rb
+++ b/core/app/models/spree/invitation.rb
@@ -1,5 +1,7 @@
module Spree
class Invitation < Spree.base_class
+ has_prefix_id :inv
+
has_secure_token
acts_as_paranoid
diff --git a/core/app/models/spree/line_item.rb b/core/app/models/spree/line_item.rb
index 1b141881ac..b2844aedbb 100644
--- a/core/app/models/spree/line_item.rb
+++ b/core/app/models/spree/line_item.rb
@@ -1,5 +1,7 @@
module Spree
class LineItem < Spree.base_class
+ has_prefix_id :li # Spree-specific: line item
+
include Spree::Metafields
include Spree::Metadata
diff --git a/core/app/models/spree/log_entry.rb b/core/app/models/spree/log_entry.rb
index ab41db7c8b..675834f84a 100644
--- a/core/app/models/spree/log_entry.rb
+++ b/core/app/models/spree/log_entry.rb
@@ -1,5 +1,7 @@
module Spree
class LogEntry < Spree.base_class
+ has_prefix_id :log
+
if defined?(Spree::Security::LogEntries)
include Spree::Security::LogEntries
end
diff --git a/core/app/models/spree/metafield.rb b/core/app/models/spree/metafield.rb
index c906d2f981..8fcfffc0ef 100644
--- a/core/app/models/spree/metafield.rb
+++ b/core/app/models/spree/metafield.rb
@@ -1,5 +1,7 @@
module Spree
class Metafield < Spree.base_class
+ has_prefix_id :mf
+
#
# Associations
#
diff --git a/core/app/models/spree/metafield_definition.rb b/core/app/models/spree/metafield_definition.rb
index aa9be38483..7c7a1c1694 100644
--- a/core/app/models/spree/metafield_definition.rb
+++ b/core/app/models/spree/metafield_definition.rb
@@ -1,5 +1,7 @@
module Spree
class MetafieldDefinition < Spree.base_class
+ has_prefix_id :mfdef
+
include Spree::DisplayOn
DISPLAY = [:both, :back_end]
diff --git a/core/app/models/spree/newsletter_subscriber.rb b/core/app/models/spree/newsletter_subscriber.rb
index fb124d1ba0..bae1cc0573 100644
--- a/core/app/models/spree/newsletter_subscriber.rb
+++ b/core/app/models/spree/newsletter_subscriber.rb
@@ -2,6 +2,8 @@ require_dependency 'spree/newsletter_subscriber/emails'
module Spree
class NewsletterSubscriber < Spree.base_class
+ has_prefix_id :sub
+
include Spree::NewsletterSubscriber::Emails
include Spree::Metafields
diff --git a/core/app/models/spree/option_type.rb b/core/app/models/spree/option_type.rb
index 8b75d550e1..d682f01932 100644
--- a/core/app/models/spree/option_type.rb
+++ b/core/app/models/spree/option_type.rb
@@ -1,5 +1,7 @@
module Spree
class OptionType < Spree.base_class
+ has_prefix_id :opt # Spree-specific: option type
+
COLOR_NAMES = %w[color colour].freeze
include Spree::ParameterizableName
diff --git a/core/app/models/spree/option_value.rb b/core/app/models/spree/option_value.rb
index 70bc80af31..810dacd88d 100644
--- a/core/app/models/spree/option_value.rb
+++ b/core/app/models/spree/option_value.rb
@@ -1,5 +1,7 @@
module Spree
class OptionValue < Spree.base_class
+ has_prefix_id :optval # Spree-specific: option value
+
include Spree::ParameterizableName
include Spree::Metafields
include Spree::Metadata
diff --git a/core/app/models/spree/order.rb b/core/app/models/spree/order.rb
index 5bbd4f2312..eeb3372e86 100644
--- a/core/app/models/spree/order.rb
+++ b/core/app/models/spree/order.rb
@@ -8,6 +8,8 @@ require_dependency 'spree/order/gift_card'
module Spree
class Order < Spree.base_class
+ has_prefix_id :or # Stripe: or_
+
PAYMENT_STATES = %w(balance_due credit_owed failed paid void)
SHIPMENT_STATES = %w(backorder canceled partial pending ready shipped)
LINE_ITEM_REMOVABLE_STATES = %w(cart address delivery payment confirm resumed)
diff --git a/core/app/models/spree/payment.rb b/core/app/models/spree/payment.rb
index b30358e036..90c5200b41 100644
--- a/core/app/models/spree/payment.rb
+++ b/core/app/models/spree/payment.rb
@@ -2,6 +2,8 @@ require_dependency 'spree/payment/processing'
module Spree
class Payment < Spree.base_class
+ has_prefix_id :py # Stripe: py_
+
include Spree::Core::NumberGenerator.new(prefix: 'P', letters: true, length: 7)
include Spree::NumberIdentifier
include Spree::NumberAsParam
diff --git a/core/app/models/spree/payment_capture_event.rb b/core/app/models/spree/payment_capture_event.rb
index b315c0e2f7..e237da2294 100644
--- a/core/app/models/spree/payment_capture_event.rb
+++ b/core/app/models/spree/payment_capture_event.rb
@@ -1,5 +1,7 @@
module Spree
class PaymentCaptureEvent < Spree.base_class
+ has_prefix_id :pce
+
belongs_to :payment, class_name: 'Spree::Payment'
def display_amount
diff --git a/core/app/models/spree/payment_method.rb b/core/app/models/spree/payment_method.rb
index 1a05bbf596..610c21c7fe 100644
--- a/core/app/models/spree/payment_method.rb
+++ b/core/app/models/spree/payment_method.rb
@@ -1,5 +1,7 @@
module Spree
class PaymentMethod < Spree.base_class
+ has_prefix_id :pm # Stripe: pm_
+
acts_as_paranoid
acts_as_list
diff --git a/core/app/models/spree/payment_source.rb b/core/app/models/spree/payment_source.rb
index a4aa0f79fb..0860acbcfe 100644
--- a/core/app/models/spree/payment_source.rb
+++ b/core/app/models/spree/payment_source.rb
@@ -1,6 +1,8 @@
# This model is used to store payment sources for non-credit card payments, eg wallet, account, etc.
module Spree
class PaymentSource < Spree.base_class
+ has_prefix_id :ps
+
include Spree::Metafields
include Spree::Metadata
include Spree::PaymentSourceConcern
diff --git a/core/app/models/spree/policy.rb b/core/app/models/spree/policy.rb
index 8e56c441d7..b42236cffb 100644
--- a/core/app/models/spree/policy.rb
+++ b/core/app/models/spree/policy.rb
@@ -1,5 +1,7 @@
module Spree
class Policy < Spree.base_class
+ has_prefix_id :pol
+
extend FriendlyId
include Spree::TranslatableResource
diff --git a/core/app/models/spree/post.rb b/core/app/models/spree/post.rb
index 7d854f3762..b9d38db038 100644
--- a/core/app/models/spree/post.rb
+++ b/core/app/models/spree/post.rb
@@ -1,5 +1,7 @@
module Spree
class Post < Spree.base_class
+ has_prefix_id :post
+
include Spree::SingleStoreResource
include Spree::Metafields
extend FriendlyId
diff --git a/core/app/models/spree/post_category.rb b/core/app/models/spree/post_category.rb
index c53a196142..ae1e4a9133 100644
--- a/core/app/models/spree/post_category.rb
+++ b/core/app/models/spree/post_category.rb
@@ -1,5 +1,7 @@
module Spree
class PostCategory < Spree.base_class
+ has_prefix_id :pcat
+
include Spree::SingleStoreResource
include Spree::Metafields
extend FriendlyId
diff --git a/core/app/models/spree/price.rb b/core/app/models/spree/price.rb
index 2e0c330c1b..8bba9b1085 100644
--- a/core/app/models/spree/price.rb
+++ b/core/app/models/spree/price.rb
@@ -1,5 +1,7 @@
module Spree
class Price < Spree.base_class
+ has_prefix_id :price
+
include Spree::VatPriceCalculation
publishes_lifecycle_events
diff --git a/core/app/models/spree/price_list.rb b/core/app/models/spree/price_list.rb
index 9a21d4dce3..55f665cb9d 100644
--- a/core/app/models/spree/price_list.rb
+++ b/core/app/models/spree/price_list.rb
@@ -1,5 +1,7 @@
module Spree
class PriceList < Spree.base_class
+ has_prefix_id :pl
+
acts_as_paranoid
acts_as_list scope: :store_id
diff --git a/core/app/models/spree/price_rule.rb b/core/app/models/spree/price_rule.rb
index 23cf9dc744..f3cab5a544 100644
--- a/core/app/models/spree/price_rule.rb
+++ b/core/app/models/spree/price_rule.rb
@@ -1,5 +1,7 @@
module Spree
class PriceRule < Spree.base_class
+ has_prefix_id :prule
+
belongs_to :price_list, class_name: 'Spree::PriceList', touch: true
validates :type, :price_list,presence: true
diff --git a/core/app/models/spree/product.rb b/core/app/models/spree/product.rb
index d771203bbe..c3a0372d5e 100644
--- a/core/app/models/spree/product.rb
+++ b/core/app/models/spree/product.rb
@@ -20,6 +20,8 @@
module Spree
class Product < Spree.base_class
+ has_prefix_id :prod # Stripe: prod_
+
acts_as_paranoid
acts_as_taggable_on :tags, :labels
normalizes :name, with: ->(value) { value&.to_s&.squish&.presence }
diff --git a/core/app/models/spree/promotion.rb b/core/app/models/spree/promotion.rb
index 1d29486959..06b34d49e8 100644
--- a/core/app/models/spree/promotion.rb
+++ b/core/app/models/spree/promotion.rb
@@ -1,5 +1,7 @@
module Spree
class Promotion < Spree.base_class
+ has_prefix_id :promo # Spree-specific: promotion
+
include Spree::MultiStoreResource
include Spree::Metafields
include Spree::Metadata
diff --git a/core/app/models/spree/promotion_action.rb b/core/app/models/spree/promotion_action.rb
index 16c3fb6b1b..1a9dfc8023 100644
--- a/core/app/models/spree/promotion_action.rb
+++ b/core/app/models/spree/promotion_action.rb
@@ -2,6 +2,8 @@
# PromotionActions perform the necessary tasks when a promotion is activated by an event and determined to be eligible.
module Spree
class PromotionAction < Spree.base_class
+ has_prefix_id :pact
+
acts_as_paranoid
belongs_to :promotion, class_name: 'Spree::Promotion', touch: true
diff --git a/core/app/models/spree/promotion_category.rb b/core/app/models/spree/promotion_category.rb
index 66ca2c2de3..a2e0bb67af 100644
--- a/core/app/models/spree/promotion_category.rb
+++ b/core/app/models/spree/promotion_category.rb
@@ -1,5 +1,7 @@
module Spree
class PromotionCategory < Spree.base_class
+ has_prefix_id :procat
+
validates :name, presence: true
has_many :promotions
end
diff --git a/core/app/models/spree/promotion_rule.rb b/core/app/models/spree/promotion_rule.rb
index 56a798e79b..f2473532e9 100644
--- a/core/app/models/spree/promotion_rule.rb
+++ b/core/app/models/spree/promotion_rule.rb
@@ -1,6 +1,8 @@
# Base class for all promotion rules
module Spree
class PromotionRule < Spree.base_class
+ has_prefix_id :prorule
+
belongs_to :promotion, class_name: 'Spree::Promotion', inverse_of: :promotion_rules, touch: true
delegate :stores, to: :promotion
diff --git a/core/app/models/spree/prototype.rb b/core/app/models/spree/prototype.rb
index 5b38f61305..336ad4b65e 100644
--- a/core/app/models/spree/prototype.rb
+++ b/core/app/models/spree/prototype.rb
@@ -1,5 +1,7 @@
module Spree
class Prototype < Spree.base_class
+ has_prefix_id :proto
+
include Spree::Metadata
has_many :property_prototypes, class_name: 'Spree::PropertyPrototype'
diff --git a/core/app/models/spree/refund.rb b/core/app/models/spree/refund.rb
index 5f40bdc9d5..6ddd871444 100644
--- a/core/app/models/spree/refund.rb
+++ b/core/app/models/spree/refund.rb
@@ -1,5 +1,7 @@
module Spree
class Refund < Spree.base_class
+ has_prefix_id :re # Stripe: re_
+
include Spree::Metafields
include Spree::Metadata
if defined?(Spree::Security::Refunds)
diff --git a/core/app/models/spree/refund_reason.rb b/core/app/models/spree/refund_reason.rb
index 2ec087a7b7..3f1d4f281f 100644
--- a/core/app/models/spree/refund_reason.rb
+++ b/core/app/models/spree/refund_reason.rb
@@ -1,5 +1,7 @@
module Spree
class RefundReason < Spree.base_class
+ has_prefix_id :rr
+
include Spree::NamedType
RETURN_PROCESSING_REASON = 'Return processing'
diff --git a/core/app/models/spree/reimbursement.rb b/core/app/models/spree/reimbursement.rb
index 2e5fb4db95..571f1abe98 100644
--- a/core/app/models/spree/reimbursement.rb
+++ b/core/app/models/spree/reimbursement.rb
@@ -1,5 +1,7 @@
module Spree
class Reimbursement < Spree.base_class
+ has_prefix_id :reimb
+
include Spree::Core::NumberGenerator.new(prefix: 'RI', length: 9)
include Spree::NumberIdentifier
include Spree::Reimbursement::Emails
diff --git a/core/app/models/spree/reimbursement/credit.rb b/core/app/models/spree/reimbursement/credit.rb
index c1509dde42..bf9cc5ab5f 100644
--- a/core/app/models/spree/reimbursement/credit.rb
+++ b/core/app/models/spree/reimbursement/credit.rb
@@ -1,5 +1,7 @@
module Spree
class Reimbursement::Credit < Spree.base_class
+ has_prefix_id :rcred
+
class_attribute :default_creditable_class
self.default_creditable_class = nil
diff --git a/core/app/models/spree/reimbursement_type.rb b/core/app/models/spree/reimbursement_type.rb
index 76be373ae5..10b63a924e 100644
--- a/core/app/models/spree/reimbursement_type.rb
+++ b/core/app/models/spree/reimbursement_type.rb
@@ -1,5 +1,7 @@
module Spree
class ReimbursementType < Spree.base_class
+ has_prefix_id :rtype
+
include Spree::NamedType
KINDS = %w(Spree::ReimbursementType::Credit
diff --git a/core/app/models/spree/report.rb b/core/app/models/spree/report.rb
index fa648e1436..0563e6a201 100644
--- a/core/app/models/spree/report.rb
+++ b/core/app/models/spree/report.rb
@@ -1,5 +1,7 @@
module Spree
class Report < Spree.base_class
+ has_prefix_id :rep
+
include Spree::SingleStoreResource
include Spree::VendorConcern if defined?(Spree::VendorConcern)
diff --git a/core/app/models/spree/return_authorization.rb b/core/app/models/spree/return_authorization.rb
index 718637ad9b..d69e5982c9 100644
--- a/core/app/models/spree/return_authorization.rb
+++ b/core/app/models/spree/return_authorization.rb
@@ -1,5 +1,7 @@
module Spree
class ReturnAuthorization < Spree.base_class
+ has_prefix_id :ra
+
include Spree::Core::NumberGenerator.new(prefix: 'RA', length: 9)
include Spree::NumberIdentifier
diff --git a/core/app/models/spree/return_authorization_reason.rb b/core/app/models/spree/return_authorization_reason.rb
index d5496401a2..4e613ccd70 100644
--- a/core/app/models/spree/return_authorization_reason.rb
+++ b/core/app/models/spree/return_authorization_reason.rb
@@ -1,5 +1,7 @@
module Spree
class ReturnAuthorizationReason < Spree.base_class
+ has_prefix_id :rar
+
include Spree::NamedType
has_many :return_authorizations, dependent: :restrict_with_error
diff --git a/core/app/models/spree/return_item.rb b/core/app/models/spree/return_item.rb
index 49f34d8710..85dd03f316 100644
--- a/core/app/models/spree/return_item.rb
+++ b/core/app/models/spree/return_item.rb
@@ -1,5 +1,7 @@
module Spree
class ReturnItem < Spree.base_class
+ has_prefix_id :ri
+
COMPLETED_RECEPTION_STATUSES = %w(received given_to_customer)
class_attribute :return_eligibility_validator
diff --git a/core/app/models/spree/role.rb b/core/app/models/spree/role.rb
index c252b81aa8..21c7d2b728 100644
--- a/core/app/models/spree/role.rb
+++ b/core/app/models/spree/role.rb
@@ -1,5 +1,7 @@
module Spree
class Role < Spree.base_class
+ has_prefix_id :role
+
include Spree::UniqueName
ADMIN_ROLE = 'admin'
diff --git a/core/app/models/spree/shipment.rb b/core/app/models/spree/shipment.rb
index 20b2612ded..fc030fc856 100644
--- a/core/app/models/spree/shipment.rb
+++ b/core/app/models/spree/shipment.rb
@@ -2,6 +2,8 @@ require 'ostruct'
module Spree
class Shipment < Spree.base_class
+ has_prefix_id :ship # Spree-specific: shipment
+
include Spree::Core::NumberGenerator.new(prefix: 'H', length: 11)
include Spree::NumberIdentifier
include Spree::NumberAsParam
diff --git a/core/app/models/spree/shipping_category.rb b/core/app/models/spree/shipping_category.rb
index e2e314b6e7..217f936575 100644
--- a/core/app/models/spree/shipping_category.rb
+++ b/core/app/models/spree/shipping_category.rb
@@ -1,5 +1,7 @@
module Spree
class ShippingCategory < Spree.base_class
+ has_prefix_id :scat
+
DIGITAL_NAME = 'Digital'
include Spree::UniqueName
diff --git a/core/app/models/spree/shipping_method.rb b/core/app/models/spree/shipping_method.rb
index 317a04554e..31c33dfe73 100644
--- a/core/app/models/spree/shipping_method.rb
+++ b/core/app/models/spree/shipping_method.rb
@@ -1,5 +1,7 @@
module Spree
class ShippingMethod < Spree.base_class
+ has_prefix_id :shpm # Spree-specific: shipping method
+
acts_as_paranoid
include Spree::CalculatedAdjustments
include Spree::Metafields
diff --git a/core/app/models/spree/shipping_method_category.rb b/core/app/models/spree/shipping_method_category.rb
index cdd4c75619..d657910145 100644
--- a/core/app/models/spree/shipping_method_category.rb
+++ b/core/app/models/spree/shipping_method_category.rb
@@ -1,5 +1,7 @@
module Spree
class ShippingMethodCategory < Spree.base_class
+ has_prefix_id :smcat
+
belongs_to :shipping_method, class_name: 'Spree::ShippingMethod'
belongs_to :shipping_category, class_name: 'Spree::ShippingCategory', inverse_of: :shipping_method_categories
end
diff --git a/core/app/models/spree/shipping_rate.rb b/core/app/models/spree/shipping_rate.rb
index 944bd5dd50..c8c8785910 100644
--- a/core/app/models/spree/shipping_rate.rb
+++ b/core/app/models/spree/shipping_rate.rb
@@ -1,5 +1,7 @@
module Spree
class ShippingRate < Spree.base_class
+ has_prefix_id :shpr # Spree-specific: shipping rate
+
belongs_to :shipment, class_name: 'Spree::Shipment'
belongs_to :tax_rate, -> { with_deleted }, class_name: 'Spree::TaxRate'
belongs_to :shipping_method, -> { with_deleted }, class_name: 'Spree::ShippingMethod', inverse_of: :shipping_rates
diff --git a/core/app/models/spree/state.rb b/core/app/models/spree/state.rb
index 979645fbfd..62174fd7e8 100644
--- a/core/app/models/spree/state.rb
+++ b/core/app/models/spree/state.rb
@@ -1,5 +1,7 @@
module Spree
class State < Spree.base_class
+ has_prefix_id :state # Spree-specific: state/province
+
belongs_to :country, class_name: 'Spree::Country'
has_many :addresses, dependent: :restrict_with_error
diff --git a/core/app/models/spree/state_change.rb b/core/app/models/spree/state_change.rb
index 4c74052f94..a73f831308 100644
--- a/core/app/models/spree/state_change.rb
+++ b/core/app/models/spree/state_change.rb
@@ -1,5 +1,7 @@
module Spree
class StateChange < Spree.base_class
+ has_prefix_id :sc
+
belongs_to :user, class_name: "::#{Spree.user_class}", optional: true
belongs_to :stateful, polymorphic: true
diff --git a/core/app/models/spree/stock_item.rb b/core/app/models/spree/stock_item.rb
index 257d76c2cd..6df57dc51c 100644
--- a/core/app/models/spree/stock_item.rb
+++ b/core/app/models/spree/stock_item.rb
@@ -1,5 +1,7 @@
module Spree
class StockItem < Spree.base_class
+ has_prefix_id :si
+
acts_as_paranoid
include Spree::Metafields
diff --git a/core/app/models/spree/stock_location.rb b/core/app/models/spree/stock_location.rb
index 2af2c89623..d8c70aa61c 100644
--- a/core/app/models/spree/stock_location.rb
+++ b/core/app/models/spree/stock_location.rb
@@ -1,5 +1,7 @@
module Spree
class StockLocation < Spree.base_class
+ has_prefix_id :sloc # Spree-specific: stock location
+
include Spree::UniqueName
if defined?(Spree::Security::StockLocations)
include Spree::Security::StockLocations
diff --git a/core/app/models/spree/stock_movement.rb b/core/app/models/spree/stock_movement.rb
index 83078a880d..d6163ba85d 100644
--- a/core/app/models/spree/stock_movement.rb
+++ b/core/app/models/spree/stock_movement.rb
@@ -1,5 +1,7 @@
module Spree
class StockMovement < Spree.base_class
+ has_prefix_id :sm
+
QUANTITY_LIMITS = {
max: 2**31 - 1,
min: -2**31
diff --git a/core/app/models/spree/stock_transfer.rb b/core/app/models/spree/stock_transfer.rb
index 37694d8790..4ec5148e79 100644
--- a/core/app/models/spree/stock_transfer.rb
+++ b/core/app/models/spree/stock_transfer.rb
@@ -1,5 +1,7 @@
module Spree
class StockTransfer < Spree.base_class
+ has_prefix_id :st
+
include Spree::Core::NumberGenerator.new(prefix: 'T')
include Spree::NumberIdentifier
include Spree::NumberAsParam
diff --git a/core/app/models/spree/store.rb b/core/app/models/spree/store.rb
index 40d03bda6d..1860a25aa0 100644
--- a/core/app/models/spree/store.rb
+++ b/core/app/models/spree/store.rb
@@ -2,6 +2,8 @@ require 'uri'
module Spree
class Store < Spree.base_class
+ has_prefix_id :store # Spree-specific: store
+
RESERVED_CODES = %w(
admin default app api www cdn files assets checkout account auth login user
)
diff --git a/core/app/models/spree/store_credit.rb b/core/app/models/spree/store_credit.rb
index 1038841ebd..5febf9a411 100644
--- a/core/app/models/spree/store_credit.rb
+++ b/core/app/models/spree/store_credit.rb
@@ -1,5 +1,7 @@
module Spree
class StoreCredit < Spree.base_class
+ has_prefix_id :scred
+
include Spree::SingleStoreResource
include Spree::Metafields
include Spree::Metadata
diff --git a/core/app/models/spree/store_credit_category.rb b/core/app/models/spree/store_credit_category.rb
index b55c890df6..9ac7bfd32f 100644
--- a/core/app/models/spree/store_credit_category.rb
+++ b/core/app/models/spree/store_credit_category.rb
@@ -1,5 +1,7 @@
module Spree
class StoreCreditCategory < Spree.base_class
+ has_prefix_id :sccat
+
validates :name, presence: true
before_destroy :validate_not_used
diff --git a/core/app/models/spree/store_credit_event.rb b/core/app/models/spree/store_credit_event.rb
index f8631b29eb..61645a717d 100644
--- a/core/app/models/spree/store_credit_event.rb
+++ b/core/app/models/spree/store_credit_event.rb
@@ -1,5 +1,7 @@
module Spree
class StoreCreditEvent < Spree.base_class
+ has_prefix_id :scevt
+
acts_as_paranoid
#
diff --git a/core/app/models/spree/store_credit_type.rb b/core/app/models/spree/store_credit_type.rb
index 20df14571e..1806091f13 100644
--- a/core/app/models/spree/store_credit_type.rb
+++ b/core/app/models/spree/store_credit_type.rb
@@ -1,5 +1,7 @@
module Spree
class StoreCreditType < Spree.base_class
+ has_prefix_id :sctype
+
DEFAULT_TYPE_NAME = 'Expiring'.freeze
has_many :store_credits, class_name: 'Spree::StoreCredit', foreign_key: 'type_id'
diff --git a/core/app/models/spree/store_product.rb b/core/app/models/spree/store_product.rb
index b10365e53a..4f4d0b5675 100644
--- a/core/app/models/spree/store_product.rb
+++ b/core/app/models/spree/store_product.rb
@@ -1,5 +1,7 @@
module Spree
class StoreProduct < Spree.base_class
+ has_prefix_id :sp
+
self.table_name = 'spree_products_stores'
belongs_to :store, class_name: 'Spree::Store', touch: true
diff --git a/core/app/models/spree/tax_category.rb b/core/app/models/spree/tax_category.rb
index 5dbceb871e..d423dfd86e 100644
--- a/core/app/models/spree/tax_category.rb
+++ b/core/app/models/spree/tax_category.rb
@@ -1,5 +1,7 @@
module Spree
class TaxCategory < Spree.base_class
+ has_prefix_id :taxcat
+
acts_as_paranoid
validates :name, presence: true, uniqueness: { case_sensitive: false, scope: spree_base_uniqueness_scope + [:deleted_at] }
diff --git a/core/app/models/spree/tax_rate.rb b/core/app/models/spree/tax_rate.rb
index 3816190349..f735dd44fe 100644
--- a/core/app/models/spree/tax_rate.rb
+++ b/core/app/models/spree/tax_rate.rb
@@ -1,5 +1,7 @@
module Spree
class TaxRate < Spree.base_class
+ has_prefix_id :tax
+
acts_as_paranoid
include Spree::CalculatedAdjustments
diff --git a/core/app/models/spree/taxon.rb b/core/app/models/spree/taxon.rb
index ae0fa3df92..f8862f4d28 100644
--- a/core/app/models/spree/taxon.rb
+++ b/core/app/models/spree/taxon.rb
@@ -2,6 +2,8 @@ require 'stringex'
module Spree
class Taxon < Spree.base_class
+ has_prefix_id :txn # Spree-specific: taxon
+
RULES_MATCH_POLICIES = %w[all any].freeze
SORT_ORDERS = %w[
manual
diff --git a/core/app/models/spree/taxon_rule.rb b/core/app/models/spree/taxon_rule.rb
index 9de60b28da..7d4d3c3a3c 100644
--- a/core/app/models/spree/taxon_rule.rb
+++ b/core/app/models/spree/taxon_rule.rb
@@ -1,5 +1,7 @@
module Spree
class TaxonRule < Spree.base_class
+ has_prefix_id :txrule
+
MATCH_POLICIES = %w[
is_equal_to
is_not_equal_to
diff --git a/core/app/models/spree/taxonomy.rb b/core/app/models/spree/taxonomy.rb
index 8746d08f8a..076423d8c3 100644
--- a/core/app/models/spree/taxonomy.rb
+++ b/core/app/models/spree/taxonomy.rb
@@ -1,5 +1,7 @@
module Spree
class Taxonomy < Spree.base_class
+ has_prefix_id :txnmy # Spree-specific: taxonomy
+
include Spree::TranslatableResource
include Spree::Metafields
include Spree::Metadata
diff --git a/core/app/models/spree/user_identity.rb b/core/app/models/spree/user_identity.rb
index eac4263ed1..b679446590 100644
--- a/core/app/models/spree/user_identity.rb
+++ b/core/app/models/spree/user_identity.rb
@@ -1,5 +1,7 @@
module Spree
class UserIdentity < Spree::Base
+ has_prefix_id :uid
+
belongs_to :user, polymorphic: true, optional: false
validates :provider, presence: true
diff --git a/core/app/models/spree/variant.rb b/core/app/models/spree/variant.rb
index 134b82e586..99f8c6fa3f 100644
--- a/core/app/models/spree/variant.rb
+++ b/core/app/models/spree/variant.rb
@@ -1,5 +1,7 @@
module Spree
class Variant < Spree.base_class
+ has_prefix_id :var # Spree-specific: variant
+
acts_as_paranoid
acts_as_list scope: :product
diff --git a/core/app/models/spree/webhook_delivery.rb b/core/app/models/spree/webhook_delivery.rb
index f3b0973d80..0455f083fc 100644
--- a/core/app/models/spree/webhook_delivery.rb
+++ b/core/app/models/spree/webhook_delivery.rb
@@ -2,6 +2,8 @@
module Spree
class WebhookDelivery < Spree.base_class
+ has_prefix_id :whd
+
belongs_to :webhook_endpoint, class_name: 'Spree::WebhookEndpoint'
delegate :url, to: :webhook_endpoint
diff --git a/core/app/models/spree/webhook_endpoint.rb b/core/app/models/spree/webhook_endpoint.rb
index b477940884..c00e0d4ee7 100644
--- a/core/app/models/spree/webhook_endpoint.rb
+++ b/core/app/models/spree/webhook_endpoint.rb
@@ -2,6 +2,8 @@
module Spree
class WebhookEndpoint < Spree.base_class
+ has_prefix_id :whe # Stripe: we_
+
acts_as_paranoid
include Spree::SingleStoreResource
diff --git a/core/app/models/spree/wished_item.rb b/core/app/models/spree/wished_item.rb
index 01814e1626..40fa45f2c3 100644
--- a/core/app/models/spree/wished_item.rb
+++ b/core/app/models/spree/wished_item.rb
@@ -1,5 +1,7 @@
module Spree
class WishedItem < Spree.base_class
+ has_prefix_id :wi # Spree-specific: wished item
+
extend DisplayMoney
money_methods :total, :price
diff --git a/core/app/models/spree/wishlist.rb b/core/app/models/spree/wishlist.rb
index 63ac90516f..886ccebc51 100644
--- a/core/app/models/spree/wishlist.rb
+++ b/core/app/models/spree/wishlist.rb
@@ -1,5 +1,7 @@
module Spree
class Wishlist < Spree.base_class
+ has_prefix_id :wl # Spree-specific: wishlist
+
include Spree::SingleStoreResource
publishes_lifecycle_events
diff --git a/core/app/models/spree/zone.rb b/core/app/models/spree/zone.rb
index 092ce1c264..238cf1c423 100644
--- a/core/app/models/spree/zone.rb
+++ b/core/app/models/spree/zone.rb
@@ -1,5 +1,7 @@
module Spree
class Zone < Spree.base_class
+ has_prefix_id :zone
+
include Spree::UniqueName
with_options dependent: :destroy, inverse_of: :zone do
diff --git a/core/db/migrate/20260124000000_add_prefix_id_to_spree_tables.rb b/core/db/migrate/20260124000000_add_prefix_id_to_spree_tables.rb
new file mode 100644
index 0000000000..b4f43a3861
--- /dev/null
+++ b/core/db/migrate/20260124000000_add_prefix_id_to_spree_tables.rb
@@ -0,0 +1,106 @@
+# frozen_string_literal: true
+
+class AddPrefixIdToSpreeTables < ActiveRecord::Migration[7.2]
+ def change
+ # Tables that need prefix_id for API v3
+ tables = %i[
+ spree_addresses
+ spree_adjustments
+ spree_api_keys
+ spree_assets
+ spree_calculators
+ spree_countries
+ spree_coupon_codes
+ spree_credit_cards
+ spree_custom_domains
+ spree_customer_groups
+ spree_customer_returns
+ spree_data_feeds
+ spree_digital_links
+ spree_digitals
+ spree_exports
+ spree_gateway_customers
+ spree_gift_card_batches
+ spree_gift_cards
+ spree_import_mappings
+ spree_import_rows
+ spree_imports
+ spree_integrations
+ spree_inventory_units
+ spree_invitations
+ spree_line_items
+ spree_log_entries
+ spree_metafield_definitions
+ spree_metafields
+ spree_newsletter_subscribers
+ spree_option_types
+ spree_option_values
+ spree_orders
+ spree_payment_capture_events
+ spree_payment_methods
+ spree_payment_sources
+ spree_payments
+ spree_policies
+ spree_post_categories
+ spree_posts
+ spree_price_lists
+ spree_price_rules
+ spree_prices
+ spree_products
+ spree_products_stores
+ spree_promotion_actions
+ spree_promotion_categories
+ spree_promotion_rules
+ spree_promotions
+ spree_prototypes
+ spree_refund_reasons
+ spree_refunds
+ spree_reimbursement_credits
+ spree_reimbursement_types
+ spree_reimbursements
+ spree_reports
+ spree_return_authorization_reasons
+ spree_return_authorizations
+ spree_return_items
+ spree_roles
+ spree_shipments
+ spree_shipping_categories
+ spree_shipping_method_categories
+ spree_shipping_methods
+ spree_shipping_rates
+ spree_state_changes
+ spree_states
+ spree_stock_items
+ spree_stock_locations
+ spree_stock_movements
+ spree_stock_transfers
+ spree_store_credit_categories
+ spree_store_credit_events
+ spree_store_credit_types
+ spree_store_credits
+ spree_stores
+ spree_tax_categories
+ spree_tax_rates
+ spree_taxon_rules
+ spree_taxons
+ spree_taxonomies
+ spree_user_identities
+ spree_variants
+ spree_webhook_deliveries
+ spree_webhook_endpoints
+ spree_wished_items
+ spree_wishlists
+ spree_zones
+ ]
+
+ tables.each do |table|
+ add_column table, :prefix_id, :string unless column_exists?(table, :prefix_id)
+ add_index table, :prefix_id, unique: true unless index_exists?(table, :prefix_id)
+ end
+
+ [Spree.user_class, Spree.admin_user_class].compact.each do |user_class|
+ add_column user_class.table_name, :prefix_id, :string unless column_exists?(user_class.table_name, :prefix_id)
+ add_index user_class.table_name, :prefix_id, unique: true unless index_exists?(user_class.table_name, :prefix_id)
+ end
+ end
+end
diff --git a/core/lib/tasks/prefix_ids.rake b/core/lib/tasks/prefix_ids.rake
new file mode 100644
index 0000000000..ed591103c7
--- /dev/null
+++ b/core/lib/tasks/prefix_ids.rake
@@ -0,0 +1,121 @@
+# frozen_string_literal: true
+
+namespace :spree do
+ namespace :prefix_ids do
+ desc 'Backfill prefix_id for all existing records'
+ task backfill: :environment do
+ models = [
+ Spree::Address,
+ Spree::Adjustment,
+ Spree::ApiKey,
+ Spree::Asset,
+ Spree::Calculator,
+ Spree::Country,
+ Spree::CouponCode,
+ Spree::CreditCard,
+ Spree::CustomDomain,
+ Spree::CustomerGroup,
+ Spree::CustomerReturn,
+ Spree::DataFeed,
+ Spree::Digital,
+ Spree::DigitalLink,
+ Spree::Export,
+ Spree::GatewayCustomer,
+ Spree::GiftCard,
+ Spree::GiftCardBatch,
+ Spree::Import,
+ Spree::ImportMapping,
+ Spree::ImportRow,
+ Spree::Integration,
+ Spree::InventoryUnit,
+ Spree::Invitation,
+ Spree::LineItem,
+ Spree::LogEntry,
+ Spree::Metafield,
+ Spree::MetafieldDefinition,
+ Spree::NewsletterSubscriber,
+ Spree::OptionType,
+ Spree::OptionValue,
+ Spree::Order,
+ Spree::Payment,
+ Spree::PaymentCaptureEvent,
+ Spree::PaymentMethod,
+ Spree::PaymentSource,
+ Spree::Policy,
+ Spree::Post,
+ Spree::PostCategory,
+ Spree::Price,
+ Spree::PriceList,
+ Spree::PriceRule,
+ Spree::Product,
+ Spree::Promotion,
+ Spree::PromotionAction,
+ Spree::PromotionCategory,
+ Spree::PromotionRule,
+ Spree::Prototype,
+ Spree::Refund,
+ Spree::RefundReason,
+ Spree::Reimbursement,
+ Spree::Reimbursement::Credit,
+ Spree::ReimbursementType,
+ Spree::Report,
+ Spree::ReturnAuthorization,
+ Spree::ReturnAuthorizationReason,
+ Spree::ReturnItem,
+ Spree::Role,
+ Spree::Shipment,
+ Spree::ShippingCategory,
+ Spree::ShippingMethod,
+ Spree::ShippingMethodCategory,
+ Spree::ShippingRate,
+ Spree::State,
+ Spree::StateChange,
+ Spree::StockItem,
+ Spree::StockLocation,
+ Spree::StockMovement,
+ Spree::StockTransfer,
+ Spree::Store,
+ Spree::StoreCredit,
+ Spree::StoreCreditCategory,
+ Spree::StoreCreditEvent,
+ Spree::StoreCreditType,
+ Spree::StoreProduct,
+ Spree::TaxCategory,
+ Spree::TaxRate,
+ Spree::Taxon,
+ Spree::TaxonRule,
+ Spree::Taxonomy,
+ Spree::UserIdentity,
+ Spree::Variant,
+ Spree::WebhookDelivery,
+ Spree::WebhookEndpoint,
+ Spree::WishedItem,
+ Spree::Wishlist,
+ Spree::Zone
+ ]
+
+ # Add user classes if they exist
+ models << Spree.user_class if Spree.user_class.present?
+ models << Spree.admin_user_class if Spree.admin_user_class.present? && Spree.admin_user_class != Spree.user_class
+
+ models.each do |model|
+ next unless model.table_exists?
+ next unless model.column_names.include?('prefix_id')
+ next unless model.respond_to?(:_prefix_id_prefix) && model._prefix_id_prefix.present?
+
+ puts "Backfilling #{model.name}..."
+ count = 0
+
+ model.unscoped.where(prefix_id: nil).find_each do |record|
+ record.generate_prefix_id
+ record.update_column(:prefix_id, record.prefix_id)
+ count += 1
+ end
+
+ puts " Updated #{count} records"
+ end
+
+ puts 'Done!'
+ end
+ end
+end
diff --git a/core/spec/models/spree/promotion_handler/promotion_duplicator_spec.rb b/core/spec/models/spree/promotion_handler/promotion_duplicator_spec.rb
index cf4a21bf83..1b3fe18911 100644
--- a/core/spec/models/spree/promotion_handler/promotion_duplicator_spec.rb
+++ b/core/spec/models/spree/promotion_handler/promotion_duplicator_spec.rb
@@ -30,7 +30,7 @@ describe Spree::PromotionHandler::PromotionDuplicator do
let!(:new_promotion) { subject.duplicate }
context 'model fields' do
- let(:excluded_fields) { ['code', 'name', 'path', 'id', 'created_at', 'updated_at', 'deleted_at'] }
+ let(:excluded_fields) { ['code', 'name', 'path', 'id', 'prefix_id', 'created_at', 'updated_at', 'deleted_at'] }
it 'returns a duplicate of a promotion with the path, name and code fields changed' do
expect("New #{promotion.name}").to eq new_promotion.name
@@ -46,7 +46,7 @@ describe Spree::PromotionHandler::PromotionDuplicator do
end
context 'model associations - rules' do
- let(:excluded_fields) { ['promotion_id', 'id', 'created_at', 'updated_at', 'deleted_at'] }
+ let(:excluded_fields) { ['promotion_id', 'id', 'prefix_id', 'created_at', 'updated_at', 'deleted_at'] }
it 'copies all promotion rules' do
expect(promotion.promotion_rules.size).to eq new_promotion.promotion_rules.size
@@ -67,7 +67,7 @@ describe Spree::PromotionHandler::PromotionDuplicator do
end
context 'model associations - actions' do
- let(:excluded_fields) { ['promotion_id', 'id', 'created_at', 'updated_at', 'deleted_at'] }
+ let(:excluded_fields) { ['promotion_id', 'id', 'prefix_id', 'created_at', 'updated_at', 'deleted_at'] }
it 'copies all promotion actions' do
expect(promotion.promotion_actions.size).to eq new_promotion.promotion_actions.size
@@ -92,7 +92,7 @@ describe Spree::PromotionHandler::PromotionDuplicator do
end
context "model associations - action's calculator" do
- let(:excluded_fields) { ['calculable_id', 'id', 'created_at', 'updated_at', 'deleted_at'] }
+ let(:excluded_fields) { ['calculable_id', 'id', 'prefix_id', 'created_at', 'updated_at', 'deleted_at'] }
it "copies promotion action's calculator" do
new_calc = new_promotion.promotion_actions.first.calculator
diff --git a/sdk/src/types/generated/AdminOrder.ts b/sdk/src/types/generated/AdminOrder.ts
index 8e34663863..6902872228 100644
--- a/sdk/src/types/generated/AdminOrder.ts
+++ b/sdk/src/types/generated/AdminOrder.ts
@@ -1,35 +1,35 @@
-// Typelizer digest 621a20e3696634fea2bb3bd289cd9aa6
+// Typelizer digest f30445d0211bc3258c9241884f88b62b
//
// DO NOT MODIFY: This file was automatically generated by Typelizer.
import type {StoreOrderPromotion, StoreLineItem, StoreShipment, StorePayment, StoreAddress, StorePaymentMethod, AdminUser} from '@/types'
type AdminOrder = {
- id: number;
- number: string | null;
- state: string | null;
- token: string | null;
+ id: string;
+ number: string;
+ state: string;
+ token: string;
email: string | null;
special_instructions: string | null;
- currency: string | null;
- item_count: number | null;
+ currency: string;
+ item_count: number;
shipment_state: string | null;
payment_state: string | null;
item_total: number;
- display_item_total: unknown;
- ship_total: unknown;
- display_ship_total: unknown;
+ display_item_total: string;
+ ship_total: number;
+ display_ship_total: string;
adjustment_total: number;
- display_adjustment_total: unknown;
- promo_total: number | null;
- display_promo_total: unknown;
- tax_total: unknown;
- display_tax_total: unknown;
+ display_adjustment_total: string;
+ promo_total: number;
+ display_promo_total: string;
+ tax_total: number;
+ display_tax_total: string;
included_tax_total: number;
- display_included_tax_total: unknown;
- additional_tax_total: number | null;
- display_additional_tax_total: unknown;
+ display_included_tax_total: string;
+ additional_tax_total: number;
+ display_additional_tax_total: string;
total: number;
- display_total: unknown;
+ display_total: string;
completed_at: string | null;
created_at: string;
updated_at: string;
@@ -37,23 +37,23 @@ type AdminOrder = {
line_items?: Array<StoreLineItem>;
shipments?: Array<StoreShipment>;
payments?: Array<StorePayment>;
- bill_address?: StoreAddress | null;
- ship_address?: StoreAddress | null;
+ bill_address?: StoreAddress;
+ ship_address?: StoreAddress;
payment_methods: Array<StorePaymentMethod>;
channel: string | null;
last_ip_address: string | null;
- considered_risky: boolean | null;
- confirmation_delivered: boolean | null;
- store_owner_notification_delivered: boolean | null;
+ considered_risky: boolean;
+ confirmation_delivered: boolean;
+ store_owner_notification_delivered: boolean;
internal_note: string | null;
- approver_id: number | null;
+ approver_id: string | null;
canceled_at: string | null;
approved_at: string | null;
canceler_id: string | null;
created_by_id: string | null;
public_metadata: Record<string, unknown> | null;
private_metadata: Record<string, unknown> | null;
- user?: AdminUser | null;
+ user?: AdminUser;
}
export default AdminOrder;
diff --git a/sdk/src/types/generated/AdminProduct.ts b/sdk/src/types/generated/AdminProduct.ts
index b257e123e1..d8dabb25a9 100644
--- a/sdk/src/types/generated/AdminProduct.ts
+++ b/sdk/src/types/generated/AdminProduct.ts
@@ -1,17 +1,18 @@
-// Typelizer digest 2353883ed6b1ae57431c11322b93fbfb
+// Typelizer digest d1869ac8ccecc4e6575182e071808db3
//
// DO NOT MODIFY: This file was automatically generated by Typelizer.
import type {StoreImage, AdminVariant, StoreOptionType, StoreTaxon} from '@/types'
type AdminProduct = {
- id: number;
+ id: string;
name: string;
description: string | null;
- slug: string | null;
+ slug: string;
sku: string | null;
barcode: string | null;
meta_description: string | null;
meta_keywords: string | null;
+ variant_count: number;
available_on: string | null;
created_at: string;
updated_at: string;
@@ -29,7 +30,7 @@ type AdminProduct = {
images?: Array<StoreImage>;
variants?: Array<AdminVariant>;
default_variant?: AdminVariant;
- master_variant?: AdminVariant | null;
+ master_variant?: AdminVariant;
option_types?: Array<StoreOptionType>;
taxons?: Array<StoreTaxon>;
status: string;
diff --git a/sdk/src/types/generated/AdminUser.ts b/sdk/src/types/generated/AdminUser.ts
index 46db557b2f..789c983ae1 100644
--- a/sdk/src/types/generated/AdminUser.ts
+++ b/sdk/src/types/generated/AdminUser.ts
@@ -1,29 +1,29 @@
-// Typelizer digest 8a9222e05a9be35155c50bdf77359390
+// Typelizer digest 45b2065890d31084dd6db895aca5a45b
//
// DO NOT MODIFY: This file was automatically generated by Typelizer.
import type {StoreAddress, AdminOrder} from '@/types'
type AdminUser = {
- id: unknown;
- email: unknown;
- first_name: unknown;
- last_name: unknown;
- created_at: unknown;
- updated_at: unknown;
+ id: string;
+ email: string;
+ first_name: string | null;
+ last_name: string | null;
+ created_at: string;
+ updated_at: string;
addresses: Array<StoreAddress>;
default_billing_address: StoreAddress;
default_shipping_address: StoreAddress;
- phone: unknown;
- login: unknown;
- accepts_email_marketing: unknown;
- last_sign_in_at: unknown;
- current_sign_in_at: unknown;
- sign_in_count: unknown;
- failed_attempts: unknown;
- last_sign_in_ip: unknown;
- current_sign_in_ip: unknown;
- public_metadata: unknown;
- private_metadata: unknown;
+ phone: string | null;
+ login: string | null;
+ accepts_email_marketing: boolean;
+ last_sign_in_at: string | null;
+ current_sign_in_at: string | null;
+ sign_in_count: number;
+ failed_attempts: number;
+ last_sign_in_ip: string | null;
+ current_sign_in_ip: string | null;
+ public_metadata: Record<string, unknown> | null;
+ private_metadata: Record<string, unknown> | null;
orders?: Array<AdminOrder>;
}
diff --git a/sdk/src/types/generated/AdminVariant.ts b/sdk/src/types/generated/AdminVariant.ts
index 424e255184..5d0c745888 100644
--- a/sdk/src/types/generated/AdminVariant.ts
+++ b/sdk/src/types/generated/AdminVariant.ts
@@ -1,16 +1,16 @@
-// Typelizer digest 4f90352bab2f3a649de4441bdd2c8c76
+// Typelizer digest 67425fd7258d11ce999e717dbbecade2
//
// DO NOT MODIFY: This file was automatically generated by Typelizer.
import type {StoreImage, StoreOptionValue} from '@/types'
type AdminVariant = {
- id: number;
- product_id: number | null;
- sku: string;
+ id: string;
+ product_id: string;
+ sku: string | null;
barcode: string | null;
- is_master: boolean | null;
- options_text: unknown;
- track_inventory: boolean | null;
+ is_master: boolean;
+ options_text: string;
+ track_inventory: boolean;
image_count: number;
created_at: string;
updated_at: string;
@@ -28,8 +28,8 @@ type AdminVariant = {
display_compare_at_price: string | null;
images?: Array<StoreImage>;
option_values: Array<StoreOptionValue>;
- position: number | null;
- tax_category_id: number | null;
+ position: number;
+ tax_category_id: string | null;
deleted_at: string | null;
cost_price: number | null;
cost_currency: string | null;
diff --git a/sdk/src/types/generated/StoreAddress.ts b/sdk/src/types/generated/StoreAddress.ts
index 2044129d9f..cbee65965d 100644
--- a/sdk/src/types/generated/StoreAddress.ts
+++ b/sdk/src/types/generated/StoreAddress.ts
@@ -1,9 +1,9 @@
-// Typelizer digest 8a9651c9a48de75043e54145a1c721f9
+// Typelizer digest 0e22a1587ad253d9ece62f2afd4bd161
//
// DO NOT MODIFY: This file was automatically generated by Typelizer.
type StoreAddress = {
- id: number;
+ id: string;
firstname: string | null;
lastname: string | null;
full_name: string;
@@ -13,9 +13,9 @@ type StoreAddress = {
zipcode: string | null;
phone: string | null;
company: string | null;
- state_id: number | null;
+ state_id: string | null;
state_text: string | null;
- country_id: number | null;
+ country_id: string;
country_iso: string;
country_name: string;
}
diff --git a/sdk/src/types/generated/StoreBase.ts b/sdk/src/types/generated/StoreBase.ts
new file mode 100644
index 0000000000..73dd5a279e
--- /dev/null
+++ b/sdk/src/types/generated/StoreBase.ts
@@ -0,0 +1,9 @@
+// Typelizer digest bb1fe3680f3f16fd57cff850d9b31bb9
+//
+// DO NOT MODIFY: This file was automatically generated by Typelizer.
+
+type StoreBase = {
+ id: string;
+}
+
+export default StoreBase;
diff --git a/sdk/src/types/generated/StoreCountry.ts b/sdk/src/types/generated/StoreCountry.ts
index 27c37b2208..ef17043cc5 100644
--- a/sdk/src/types/generated/StoreCountry.ts
+++ b/sdk/src/types/generated/StoreCountry.ts
@@ -1,16 +1,16 @@
-// Typelizer digest 4ffcbab8736f41bc51ebb9763f8710d0
+// Typelizer digest b88be993a45c6f05cf6a7c8b296a0b29
//
// DO NOT MODIFY: This file was automatically generated by Typelizer.
import type {StoreState} from '@/types'
type StoreCountry = {
- id: number;
+ id: string;
iso: string;
iso3: string;
- iso_name: string | null;
- name: string | null;
- states_required: boolean | null;
- zipcode_required: boolean | null;
+ iso_name: string;
+ name: string;
+ states_required: boolean;
+ zipcode_required: boolean;
states?: Array<StoreState>;
}
diff --git a/sdk/src/types/generated/StoreDigitalLink.ts b/sdk/src/types/generated/StoreDigitalLink.ts
index 8c4df16ba3..9d80556a2d 100644
--- a/sdk/src/types/generated/StoreDigitalLink.ts
+++ b/sdk/src/types/generated/StoreDigitalLink.ts
@@ -1,10 +1,10 @@
-// Typelizer digest 9bcffa0652882af352a11b41b2e962c4
+// Typelizer digest 340f8aefbf4a0714e16dadfaadfab91d
//
// DO NOT MODIFY: This file was automatically generated by Typelizer.
type StoreDigitalLink = {
- id: number;
- access_counter: number | null;
+ id: string;
+ access_counter: number;
filename: string;
content_type: string;
created_at: string;
diff --git a/sdk/src/types/generated/StoreImage.ts b/sdk/src/types/generated/StoreImage.ts
index be7a88d6c9..43148bc947 100644
--- a/sdk/src/types/generated/StoreImage.ts
+++ b/sdk/src/types/generated/StoreImage.ts
@@ -1,22 +1,22 @@
-// Typelizer digest 1125c6e391a9246fe138f57f9017ed48
+// Typelizer digest 723eca8fe19e4196495798ca1d52795c
//
// DO NOT MODIFY: This file was automatically generated by Typelizer.
type StoreImage = {
- id: number;
- position: number | null;
+ id: string;
+ viewable_id: string;
+ position: number;
alt: string | null;
- viewable_type: string | null;
- viewable_id: number | null;
- created_at: string | null;
- updated_at: string | null;
+ viewable_type: string;
+ created_at: string;
+ updated_at: string;
original_url: string | null;
mini_url: string | null;
small_url: string | null;
medium_url: string | null;
large_url: string | null;
xlarge_url: string | null;
- og_image_url: unknown;
+ og_image_url: string | null;
}
export default StoreImage;
diff --git a/sdk/src/types/generated/StoreLineItem.ts b/sdk/src/types/generated/StoreLineItem.ts
index a762764a7c..dd56eb5c67 100644
--- a/sdk/src/types/generated/StoreLineItem.ts
+++ b/sdk/src/types/generated/StoreLineItem.ts
@@ -1,32 +1,32 @@
-// Typelizer digest b63c3ed2d43275e55e468d0491c4379b
+// Typelizer digest b3608247c683989cf434e620b17b4894
//
// DO NOT MODIFY: This file was automatically generated by Typelizer.
import type {StoreImage, StoreOptionValue} from '@/types'
type StoreLineItem = {
- id: number;
- variant_id: number | null;
+ id: string;
+ variant_id: string;
quantity: number;
name: string;
slug: string;
options_text: string;
price: number;
display_price: string;
- total: unknown;
+ total: number;
display_total: string;
- adjustment_total: number | null;
+ adjustment_total: number;
display_adjustment_total: string;
- additional_tax_total: number | null;
+ additional_tax_total: number;
display_additional_tax_total: string;
included_tax_total: number;
display_included_tax_total: string;
- promo_total: number | null;
+ promo_total: number;
display_promo_total: string;
pre_tax_amount: number;
display_pre_tax_amount: string;
- discounted_amount: unknown;
+ discounted_amount: number;
display_discounted_amount: string;
- compare_at_amount: unknown;
+ compare_at_amount: number | null;
display_compare_at_amount: string | null;
created_at: string;
updated_at: string;
diff --git a/sdk/src/types/generated/StoreOptionType.ts b/sdk/src/types/generated/StoreOptionType.ts
index 244ae4117e..b4e1c7b927 100644
--- a/sdk/src/types/generated/StoreOptionType.ts
+++ b/sdk/src/types/generated/StoreOptionType.ts
@@ -1,11 +1,11 @@
-// Typelizer digest 014cbc83094a11d92d60ee02c63c3265
+// Typelizer digest 38e9f8bc13ef6e0ad7bd850c2ba62c27
//
// DO NOT MODIFY: This file was automatically generated by Typelizer.
type StoreOptionType = {
- id: number;
- name: string | null;
- presentation: string | null;
+ id: string;
+ name: string;
+ presentation: string;
position: number;
}
diff --git a/sdk/src/types/generated/StoreOptionValue.ts b/sdk/src/types/generated/StoreOptionValue.ts
index 9576033062..04b4b8f380 100644
--- a/sdk/src/types/generated/StoreOptionValue.ts
+++ b/sdk/src/types/generated/StoreOptionValue.ts
@@ -1,13 +1,13 @@
-// Typelizer digest f4b6aedb3ac38232ddffac53f31ca465
+// Typelizer digest 56dec5bcb730d3fb414febb5685dff58
//
// DO NOT MODIFY: This file was automatically generated by Typelizer.
type StoreOptionValue = {
- id: number;
- name: string | null;
- presentation: string | null;
- position: number | null;
- option_type_id: number | null;
+ id: string;
+ option_type_id: string;
+ name: string;
+ presentation: string;
+ position: number;
option_type_name: string;
option_type_presentation: string;
}
diff --git a/sdk/src/types/generated/StoreOrder.ts b/sdk/src/types/generated/StoreOrder.ts
index 93f6549374..38af0732a6 100644
--- a/sdk/src/types/generated/StoreOrder.ts
+++ b/sdk/src/types/generated/StoreOrder.ts
@@ -1,35 +1,35 @@
-// Typelizer digest 066e8fc1880547facdf45127b5c76748
+// Typelizer digest 793fa9bb41e04b63e300247ac068d0b1
//
// DO NOT MODIFY: This file was automatically generated by Typelizer.
import type {StoreOrderPromotion, StoreLineItem, StoreShipment, StorePayment, StoreAddress, StorePaymentMethod} from '@/types'
type StoreOrder = {
- id: number;
- number: string | null;
- state: string | null;
- token: string | null;
+ id: string;
+ number: string;
+ state: string;
+ token: string;
email: string | null;
special_instructions: string | null;
- currency: string | null;
- item_count: number | null;
+ currency: string;
+ item_count: number;
shipment_state: string | null;
payment_state: string | null;
item_total: number;
- display_item_total: unknown;
- ship_total: unknown;
- display_ship_total: unknown;
+ display_item_total: string;
+ ship_total: number;
+ display_ship_total: string;
adjustment_total: number;
- display_adjustment_total: unknown;
- promo_total: number | null;
- display_promo_total: unknown;
- tax_total: unknown;
- display_tax_total: unknown;
+ display_adjustment_total: string;
+ promo_total: number;
+ display_promo_total: string;
+ tax_total: number;
+ display_tax_total: string;
included_tax_total: number;
- display_included_tax_total: unknown;
- additional_tax_total: number | null;
- display_additional_tax_total: unknown;
+ display_included_tax_total: string;
+ additional_tax_total: number;
+ display_additional_tax_total: string;
total: number;
- display_total: unknown;
+ display_total: string;
completed_at: string | null;
created_at: string;
updated_at: string;
@@ -37,8 +37,8 @@ type StoreOrder = {
line_items?: Array<StoreLineItem>;
shipments?: Array<StoreShipment>;
payments?: Array<StorePayment>;
- bill_address?: StoreAddress | null;
- ship_address?: StoreAddress | null;
+ bill_address?: StoreAddress;
+ ship_address?: StoreAddress;
payment_methods: Array<StorePaymentMethod>;
}
diff --git a/sdk/src/types/generated/StoreOrderPromotion.ts b/sdk/src/types/generated/StoreOrderPromotion.ts
index 9eade4a580..c8dc72b15b 100644
--- a/sdk/src/types/generated/StoreOrderPromotion.ts
+++ b/sdk/src/types/generated/StoreOrderPromotion.ts
@@ -1,15 +1,15 @@
-// Typelizer digest 03063d4d8aecd511f71957b143225aca
+// Typelizer digest a208eaf1ac4c16e670c392c3dae4e68c
//
// DO NOT MODIFY: This file was automatically generated by Typelizer.
type StoreOrderPromotion = {
- id: number;
- name: unknown;
- description: unknown;
- code: unknown;
- amount: unknown;
- display_amount: unknown;
- promotion_id: number | null;
+ id: string;
+ promotion_id: string;
+ name: string;
+ description: string | null;
+ code: string | null;
+ amount: number;
+ display_amount: string;
}
export default StoreOrderPromotion;
diff --git a/sdk/src/types/generated/StorePayment.ts b/sdk/src/types/generated/StorePayment.ts
index 92fd626448..4d457881c7 100644
--- a/sdk/src/types/generated/StorePayment.ts
+++ b/sdk/src/types/generated/StorePayment.ts
@@ -1,19 +1,19 @@
-// Typelizer digest 50e13b21b497d9c22d5174d4c0592b57
+// Typelizer digest a3bd4e8ed4dd75213fb847f02138979e
//
// DO NOT MODIFY: This file was automatically generated by Typelizer.
import type {StorePaymentMethod} from '@/types'
type StorePayment = {
- id: number;
- state: string | null;
- payment_method_id: number | null;
+ id: string;
+ payment_method_id: string;
+ state: string;
response_code: string | null;
- number: string | null;
+ number: string;
amount: number;
- display_amount: unknown;
+ display_amount: string;
created_at: string;
updated_at: string;
- payment_method: StorePaymentMethod | null;
+ payment_method: StorePaymentMethod;
}
export default StorePayment;
diff --git a/sdk/src/types/generated/StorePaymentMethod.ts b/sdk/src/types/generated/StorePaymentMethod.ts
index d7afcc74c8..ce77537010 100644
--- a/sdk/src/types/generated/StorePaymentMethod.ts
+++ b/sdk/src/types/generated/StorePaymentMethod.ts
@@ -1,12 +1,12 @@
-// Typelizer digest 139253df0b2e440e1c5541efba80a608
+// Typelizer digest 43dd8a30560bdc20d9cf25fb3cc9d770
//
// DO NOT MODIFY: This file was automatically generated by Typelizer.
type StorePaymentMethod = {
- id: number;
- name: string | null;
+ id: string;
+ name: string;
description: string | null;
- type: string | null;
+ type: string;
}
export default StorePaymentMethod;
diff --git a/sdk/src/types/generated/StoreProduct.ts b/sdk/src/types/generated/StoreProduct.ts
index f978411c14..0479059ebf 100644
--- a/sdk/src/types/generated/StoreProduct.ts
+++ b/sdk/src/types/generated/StoreProduct.ts
@@ -1,17 +1,18 @@
-// Typelizer digest 3bc94f86c634548d607f612aba9c4c60
+// Typelizer digest 3630374e7e7ec3c06750a7fd436c8c2c
//
// DO NOT MODIFY: This file was automatically generated by Typelizer.
import type {StoreImage, StoreVariant, StoreOptionType, StoreTaxon} from '@/types'
type StoreProduct = {
- id: number;
+ id: string;
name: string;
description: string | null;
- slug: string | null;
+ slug: string;
sku: string | null;
barcode: string | null;
meta_description: string | null;
meta_keywords: string | null;
+ variant_count: number;
available_on: string | null;
created_at: string;
updated_at: string;
@@ -29,7 +30,7 @@ type StoreProduct = {
images?: Array<StoreImage>;
variants?: Array<StoreVariant>;
default_variant?: StoreVariant;
- master_variant?: StoreVariant | null;
+ master_variant?: StoreVariant;
option_types?: Array<StoreOptionType>;
taxons?: Array<StoreTaxon>;
}
diff --git a/sdk/src/types/generated/StoreShipment.ts b/sdk/src/types/generated/StoreShipment.ts
index b9e16a8c4e..c21b195446 100644
--- a/sdk/src/types/generated/StoreShipment.ts
+++ b/sdk/src/types/generated/StoreShipment.ts
@@ -1,31 +1,31 @@
-// Typelizer digest 9f2de87cb55c8937f6daee4f425400eb
+// Typelizer digest 4963e975ebaaec9528495f04ea8970e3
//
// DO NOT MODIFY: This file was automatically generated by Typelizer.
import type {StoreShippingMethod, StoreStockLocation, StoreShippingRate} from '@/types'
type StoreShipment = {
- id: number;
- number: string | null;
- state: string | null;
+ id: string;
+ number: string;
+ state: string;
tracking: string | null;
- tracking_url: unknown;
+ tracking_url: string | null;
shipped_at: string | null;
- cost: number | null;
- display_cost: unknown;
- adjustment_total: number | null;
- display_adjustment_total: unknown;
- additional_tax_total: number | null;
- display_additional_tax_total: unknown;
- promo_total: number | null;
- display_promo_total: unknown;
+ cost: number;
+ display_cost: string;
+ adjustment_total: number;
+ display_adjustment_total: string;
+ additional_tax_total: number;
+ display_additional_tax_total: string;
+ promo_total: number;
+ display_promo_total: string;
included_tax_total: number;
- display_included_tax_total: unknown;
- total: unknown;
- display_total: unknown;
+ display_included_tax_total: string;
+ total: number;
+ display_total: string;
created_at: string;
updated_at: string;
shipping_method: StoreShippingMethod;
- stock_location: StoreStockLocation | null;
+ stock_location: StoreStockLocation;
shipping_rates: Array<StoreShippingRate>;
}
diff --git a/sdk/src/types/generated/StoreShippingMethod.ts b/sdk/src/types/generated/StoreShippingMethod.ts
index feef329eea..b7f7486573 100644
--- a/sdk/src/types/generated/StoreShippingMethod.ts
+++ b/sdk/src/types/generated/StoreShippingMethod.ts
@@ -1,10 +1,10 @@
-// Typelizer digest ec108b36bb57d69f6b351bc1302132ce
+// Typelizer digest f08fad7e36ce1e3f27e752ecaca15f16
//
// DO NOT MODIFY: This file was automatically generated by Typelizer.
type StoreShippingMethod = {
- id: number;
- name: string | null;
+ id: string;
+ name: string;
code: string | null;
}
diff --git a/sdk/src/types/generated/StoreShippingRate.ts b/sdk/src/types/generated/StoreShippingRate.ts
index b3bae54634..fa0342e522 100644
--- a/sdk/src/types/generated/StoreShippingRate.ts
+++ b/sdk/src/types/generated/StoreShippingRate.ts
@@ -1,16 +1,16 @@
-// Typelizer digest fe022c44850889b384383066067e8f9c
+// Typelizer digest 3cdf7933166457107dde098e2cd03789
//
// DO NOT MODIFY: This file was automatically generated by Typelizer.
import type {StoreShippingMethod} from '@/types'
type StoreShippingRate = {
- id: number;
- name: unknown;
- selected: boolean | null;
- shipping_method_id: number | null;
+ id: string;
+ shipping_method_id: string;
+ name: string;
+ selected: boolean;
cost: number;
display_cost: string;
- shipping_method: StoreShippingMethod | null;
+ shipping_method: StoreShippingMethod;
}
export default StoreShippingRate;
diff --git a/sdk/src/types/generated/StoreState.ts b/sdk/src/types/generated/StoreState.ts
index df6b54621f..220d13d9e7 100644
--- a/sdk/src/types/generated/StoreState.ts
+++ b/sdk/src/types/generated/StoreState.ts
@@ -1,12 +1,12 @@
-// Typelizer digest 38c61d5de29759fd1f5d4b7f0a575577
+// Typelizer digest 246896ce6b43b425b06dae6c29915075
//
// DO NOT MODIFY: This file was automatically generated by Typelizer.
type StoreState = {
- id: number;
- name: string | null;
- abbr: string | null;
- country_id: number | null;
+ id: string;
+ country_id: string;
+ name: string;
+ abbr: string;
}
export default StoreState;
diff --git a/sdk/src/types/generated/StoreStockLocation.ts b/sdk/src/types/generated/StoreStockLocation.ts
index e65d3570ce..819257b976 100644
--- a/sdk/src/types/generated/StoreStockLocation.ts
+++ b/sdk/src/types/generated/StoreStockLocation.ts
@@ -1,18 +1,18 @@
-// Typelizer digest a84a2cf41d8de60b7d04c36f6bce0ed4
+// Typelizer digest 4fb8ec178063634ed5f86f709232d848
//
// DO NOT MODIFY: This file was automatically generated by Typelizer.
type StoreStockLocation = {
- id: number;
- name: string | null;
+ id: string;
+ country_id: string | null;
+ state_id: string | null;
+ name: string;
address1: string | null;
city: string | null;
zipcode: string | null;
- country_id: number | null;
- country_iso: unknown;
- country_name: unknown;
- state_id: number | null;
- state_text: unknown;
+ country_iso: string | null;
+ country_name: string | null;
+ state_text: string | null;
}
export default StoreStockLocation;
diff --git a/sdk/src/types/generated/StoreStore.ts b/sdk/src/types/generated/StoreStore.ts
index 962549ca1d..e95ddd49d4 100644
--- a/sdk/src/types/generated/StoreStore.ts
+++ b/sdk/src/types/generated/StoreStore.ts
@@ -1,23 +1,23 @@
-// Typelizer digest 1d5491d5dd4ac78353d2cd2340fc415e
+// Typelizer digest 606b4642ea4b931e163e9a1da19bffd0
//
// DO NOT MODIFY: This file was automatically generated by Typelizer.
import type {StorePaymentMethod} from '@/types'
type StoreStore = {
- id: number;
- name: string | null;
- url: string | null;
+ id: string;
+ name: string;
+ url: string;
meta_description: string | null;
meta_keywords: string | null;
seo_title: string | null;
- default_currency: string | null;
- code: string | null;
+ default_currency: string;
+ code: string;
default: boolean;
facebook: string | null;
twitter: string | null;
instagram: string | null;
customer_support_email: string | null;
- default_locale: string | null;
+ default_locale: string;
created_at: string;
updated_at: string;
supported_currencies: Array<string>;
diff --git a/sdk/src/types/generated/StoreTaxon.ts b/sdk/src/types/generated/StoreTaxon.ts
index 407adddb18..ad664fe131 100644
--- a/sdk/src/types/generated/StoreTaxon.ts
+++ b/sdk/src/types/generated/StoreTaxon.ts
@@ -1,20 +1,20 @@
-// Typelizer digest aaf256cb7181023f5658edc824e7efb9
+// Typelizer digest ebb971f33eb14e681530040edf3d3b00
//
// DO NOT MODIFY: This file was automatically generated by Typelizer.
type StoreTaxon = {
- id: number;
+ id: string;
name: string;
- permalink: string | null;
- position: number | null;
- lft: number | null;
- rgt: number | null;
- depth: number | null;
+ permalink: string;
+ position: number;
+ lft: number;
+ rgt: number;
+ depth: number;
meta_title: string | null;
meta_description: string | null;
meta_keywords: string | null;
- parent_id: number | null;
- taxonomy_id: number | null;
+ parent_id: string | null;
+ taxonomy_id: string;
children_count: number;
created_at: string;
updated_at: string;
@@ -25,7 +25,7 @@ type StoreTaxon = {
is_root: boolean;
is_child: boolean;
is_leaf: boolean;
- parent?: StoreTaxon | null;
+ parent?: StoreTaxon;
children?: Array<StoreTaxon>;
}
diff --git a/sdk/src/types/generated/StoreTaxonomy.ts b/sdk/src/types/generated/StoreTaxonomy.ts
index 3eb79039e2..0551fab493 100644
--- a/sdk/src/types/generated/StoreTaxonomy.ts
+++ b/sdk/src/types/generated/StoreTaxonomy.ts
@@ -1,15 +1,15 @@
-// Typelizer digest 588c93c9b3d7a73e4ac241fd398ad048
+// Typelizer digest 1d8ea2f312e9a0961b71005a76a4ed19
//
// DO NOT MODIFY: This file was automatically generated by Typelizer.
import type {StoreTaxon} from '@/types'
type StoreTaxonomy = {
- id: number;
+ id: string;
name: string;
- position: number | null;
+ position: number;
created_at: string;
updated_at: string;
- root?: StoreTaxon | null;
+ root?: StoreTaxon;
taxons?: Array<StoreTaxon>;
}
diff --git a/sdk/src/types/generated/StoreUser.ts b/sdk/src/types/generated/StoreUser.ts
index 11d0669019..7d357caff8 100644
--- a/sdk/src/types/generated/StoreUser.ts
+++ b/sdk/src/types/generated/StoreUser.ts
@@ -1,15 +1,15 @@
-// Typelizer digest 5dda441c7b46d75d2b1075db3c3dba2a
+// Typelizer digest de2c7b44ee4c33a530b66ef90739c0fb
//
// DO NOT MODIFY: This file was automatically generated by Typelizer.
import type {StoreAddress} from '@/types'
type StoreUser = {
- id: unknown;
- email: unknown;
- first_name: unknown;
- last_name: unknown;
- created_at: unknown;
- updated_at: unknown;
+ id: string;
+ email: string;
+ first_name: string | null;
+ last_name: string | null;
+ created_at: string;
+ updated_at: string;
addresses: Array<StoreAddress>;
default_billing_address: StoreAddress;
default_shipping_address: StoreAddress;
diff --git a/sdk/src/types/generated/StoreVariant.ts b/sdk/src/types/generated/StoreVariant.ts
index cce6e16579..3f2506a316 100644
--- a/sdk/src/types/generated/StoreVariant.ts
+++ b/sdk/src/types/generated/StoreVariant.ts
@@ -1,16 +1,16 @@
-// Typelizer digest b0a9c50180282eca412133e9281f7e76
+// Typelizer digest 2e439a3855b32bf1c380a1ac7d0e989d
//
// DO NOT MODIFY: This file was automatically generated by Typelizer.
import type {StoreImage, StoreOptionValue} from '@/types'
type StoreVariant = {
- id: number;
- product_id: number | null;
- sku: string;
+ id: string;
+ product_id: string;
+ sku: string | null;
barcode: string | null;
- is_master: boolean | null;
- options_text: unknown;
- track_inventory: boolean | null;
+ is_master: boolean;
+ options_text: string;
+ track_inventory: boolean;
image_count: number;
created_at: string;
updated_at: string;
diff --git a/sdk/src/types/generated/StoreWishedItem.ts b/sdk/src/types/generated/StoreWishedItem.ts
index 32806a738a..4b9159237e 100644
--- a/sdk/src/types/generated/StoreWishedItem.ts
+++ b/sdk/src/types/generated/StoreWishedItem.ts
@@ -1,16 +1,16 @@
-// Typelizer digest 806f54742b2039394d020336196084d8
+// Typelizer digest cff10cc02ae9c88198edd6c5fc1f50c9
//
// DO NOT MODIFY: This file was automatically generated by Typelizer.
import type {StoreVariant} from '@/types'
type StoreWishedItem = {
- id: number;
- variant_id: number | null;
- wishlist_id: number | null;
+ id: string;
+ variant_id: string;
+ wishlist_id: string;
quantity: number;
created_at: string;
updated_at: string;
- variant: StoreVariant | null;
+ variant: StoreVariant;
}
export default StoreWishedItem;
diff --git a/sdk/src/types/generated/StoreWishlist.ts b/sdk/src/types/generated/StoreWishlist.ts
index 6281f4a696..8438441851 100644
--- a/sdk/src/types/generated/StoreWishlist.ts
+++ b/sdk/src/types/generated/StoreWishlist.ts
@@ -1,11 +1,11 @@
-// Typelizer digest 3af45a2f9591ccc2be4e92d41c4bcc5b
+// Typelizer digest f817031c935fbe758f58a815052660c3
//
// DO NOT MODIFY: This file was automatically generated by Typelizer.
import type {StoreWishedItem} from '@/types'
type StoreWishlist = {
- id: number;
- name: string | null;
+ id: string;
+ name: string;
token: string;
created_at: string;
updated_at: string;
diff --git a/sdk/src/types/generated/index.ts b/sdk/src/types/generated/index.ts
index deb7115dba..3598032b19 100644
--- a/sdk/src/types/generated/index.ts
+++ b/sdk/src/types/generated/index.ts
@@ -1,4 +1,4 @@
-// Typelizer digest eaede6c2b9fe19042800b59c03ac5e8c
+// Typelizer digest 8289e02566ea7af68d23ddf2763c3009
//
// DO NOT MODIFY: This file was automatically generated by Typelizer.
export type { default as StoreAddress } from './StoreAddress'
@@ -6,6 +6,7 @@ export type { default as AdminOrder } from './AdminOrder'
export type { default as AdminProduct } from './AdminProduct'
export type { default as AdminUser } from './AdminUser'
export type { default as AdminVariant } from './AdminVariant'
+export type { default as StoreBase } from './StoreBase'
export type { default as StoreCountry } from './StoreCountry'
export type { default as StoreDigitalLink } from './StoreDigitalLink'
export type { default as StoreImage } from './StoreImage'