add slack notifications

This commit is contained in:
João Geonizeli
2021-08-17 10:04:24 -03:00
parent 559b239c02
commit 0b7cdeb236
9 changed files with 68 additions and 10 deletions

View File

@@ -25,6 +25,7 @@
#
class SellCryptoOrder < ApplicationRecord
include Processable
include Notifiable
belongs_to :user
belongs_to :currency
@@ -33,4 +34,14 @@ class SellCryptoOrder < ApplicationRecord
validates :paid_amount, presence: true, numericality: { greater_than: 0 }
validates :received_amount_cents, presence: true, if: :completed?
private
def notification_message
"
💸 New sell crypto order! 💸\n
user: #{user.email} \n
amount: #{paid_amount} #{currency.name}
"
end
end