1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-11-29 10:24:20 +01:00
fab-manager/app/models/payment_document.rb
Sylvain d942d46632 WIP: migration to object[]
TODO: fix running tests, fix front-end
2021-05-28 17:34:20 +02:00

29 lines
634 B
Ruby

# frozen_string_literal: true
# SuperClass for models that provides legal PDF documents concerning sales
class PaymentDocument < Footprintable
self.abstract_class = true
def generate_reference(date = DateTime.current)
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)
self.wallet_amount = amount
self.wallet_transaction_id = transaction_id
end
def post_save(arg); end
def render_resource; end
end