Spree Fulfillment Item Model (spree/fulfillment_item.rb)

spree · spree/core/app/models/spree/fulfillment_item.rb · ruby · BSD-3-Clause
pos, payments, lang:ruby, fw:rails, tag:fulfillment

Manages order fulfillment items, variants, backorders, and returns within the Spree e-commerce engine. Reuse when handling inventory fulfillment logic.

# Source: https://github.com/spree/spree | License: BSD-3-Clause | Copyright 2024-present, Vendo Sp. z o.o., Vendo Connect Inc
# Provided via justclaw.it.com; keep this notice with the code.
module Spree
  class FulfillmentItem < Spree.base_class
    has_prefix_id :fi

    extend Spree::DisplayMoney

    with_options inverse_of: :fulfillment_items do
      belongs_to :variant, -> { with_deleted }, class_name: 'Spree::Variant'
      # Optional because cart-phase items have no order yet — their owner is
      # reached through the fulfillment; order_id arrives at completion.
      belongs_to :order, class_name: 'Spree::Order', optional: true
      belongs_to :fulfillment, class_name: 'Spree::Fulfillment', touch: true, optional: true
      has_many :return_line_items, class_name: 'Spree::Retu

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key