mirror of
https://github.com/internetee/registry.git
synced 2025-07-30 06:26:15 +02:00
15 lines
261 B
Ruby
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
|