mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-29 21:17:17 +00:00
16 lines
523 B
Ruby
16 lines
523 B
Ruby
class Api::Admin::StandingOrderSerializer < ActiveModel::Serializer
|
|
attributes :id, :shop_id, :customer_id, :schedule_id, :payment_method_id, :shipping_method_id, :begins_at, :ends_at
|
|
|
|
has_many :standing_line_items, serializer: Api::Admin::StandingLineItemSerializer
|
|
has_one :bill_address, serializer: Api::AddressSerializer
|
|
has_one :ship_address, serializer: Api::AddressSerializer
|
|
|
|
def begins_at
|
|
object.begins_at.andand.strftime('%F')
|
|
end
|
|
|
|
def ends_at
|
|
object.ends_at.andand.strftime('%F')
|
|
end
|
|
end
|