2020-12-22 14:43:08 +01:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
# SuperClass for models that provides legal PDF documents concerning sales
|
|
|
|
class PaymentDocument < Footprintable
|
|
|
|
self.abstract_class = true
|
|
|
|
|
2023-02-14 13:10:58 +01:00
|
|
|
def generate_reference(date = Time.current)
|
2020-12-22 14:43:08 +01:00
|
|
|
self.reference = PaymentDocumentService.generate_reference(self, date: date)
|
|
|
|
end
|
|
|
|
|
|
|
|
def update_reference
|
|
|
|
generate_reference
|
|
|
|
save
|
|
|
|
end
|
|
|
|
|
|
|
|
def add_environment
|
|
|
|
self.environment = Rails.env
|
|
|
|
end
|
|
|
|
|
|
|
|
def set_wallet_transaction(amount, transaction_id)
|
2020-12-29 18:55:00 +01:00
|
|
|
self.wallet_amount = amount
|
|
|
|
self.wallet_transaction_id = transaction_id
|
2020-12-22 14:43:08 +01:00
|
|
|
end
|
2020-12-29 18:55:00 +01:00
|
|
|
|
2021-10-15 17:31:01 +02:00
|
|
|
def post_save(*args); end
|
2021-05-28 17:34:20 +02:00
|
|
|
|
|
|
|
def render_resource; end
|
2020-12-22 14:43:08 +01:00
|
|
|
end
|