mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-08 22:56:06 +00:00
21 lines
482 B
Ruby
21 lines
482 B
Ruby
module Api
|
|
module Admin
|
|
# Used by admin subscription form
|
|
# Searches for a ship and bill addresses for the customer
|
|
# where they are not already explicitly set
|
|
class SubscriptionCustomerSerializer < CustomerSerializer
|
|
def bill_address
|
|
finder.bill_address
|
|
end
|
|
|
|
def ship_address
|
|
finder.ship_address
|
|
end
|
|
|
|
def finder
|
|
@finder ||= OpenFoodNetwork::AddressFinder.new(object, object.email)
|
|
end
|
|
end
|
|
end
|
|
end
|