internetee-registry/app/interactions/actions/invoice_cancel.rb
2022-07-12 15:47:25 +03:00

15 lines
261 B
Ruby

module Actions
class InvoiceCancel
attr_reader :invoice
def initialize(invoice)
@invoice = invoice
end
def call
return false unless @invoice.can_be_cancelled?
@invoice.update(cancelled_at: Time.zone.now)
end
end
end