new else new end end end @discount discount_service @discount.call(@order) @discount_service .current_store_event . . CheckoutController ApplicationController create discount_service # ... # ... Settings :anniversary AnniversaryDiscountService DiscountService
end end class def end end class < def = end end (amount, ); (order); @discount discount_service Order add_discount GeneralDiscountService call CheckoutController ApplicationController create reason:
end end class def end end (entity) notify . notify.assign_attributes(entity.to_h) notify.save! (entity) .upsert(entity.to_h) NotifyRepository save NotifyRepository save NotifyConnection NotifierAPI