PhoenixKitEcommerce.Shopify.ProductDiff.Change (PhoenixKitEcommerce v0.4.2)

Copy Markdown View Source

One local product's field-by-field diff against its matched Shopify product. changes only contains fields that actually differ, keyed by field atom, each holding %{current:, incoming:}. price_extreme? is true only when :price is in changes and the current/incoming ratio exceeds 3x.

base_locale is the locale diff/4 matched/compared this product against — carried on the struct (not re-derived later) so Shopify.Sync.apply_change/2 writes localized fields back into the SAME locale they were diffed against. Reading a fresh default at apply time would silently apply a change diffed in one locale into another.

Summary

Types

t()

@type t() :: %PhoenixKitEcommerce.Shopify.ProductDiff.Change{
  base_locale: String.t(),
  changes: %{required(atom()) => %{current: term(), incoming: term()}},
  handle: String.t(),
  price_extreme?: boolean(),
  product_uuid: String.t(),
  title: String.t() | nil
}