mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-14 23:47:48 +00:00
16 lines
420 B
Ruby
16 lines
420 B
Ruby
class Api::Admin::StandingLineItemSerializer < ActiveModel::Serializer
|
|
attributes :id, :variant_id, :quantity, :description, :price_estimate
|
|
|
|
def description
|
|
"#{object.variant.product.name} - #{object.variant.full_name}"
|
|
end
|
|
|
|
def price_estimate
|
|
if options[:fee_calculator]
|
|
(object.variant.price + options[:fee_calculator].indexed_fees_for(object.variant)).to_f
|
|
else
|
|
"?"
|
|
end
|
|
end
|
|
end
|