1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-01 12:24:28 +01:00
fab-manager/app/models/payment_schedule_item.rb

27 lines
643 B
Ruby
Raw Normal View History

# frozen_string_literal: true
# Represents a due date and the associated amount for a PaymentSchedule
class PaymentScheduleItem < ApplicationRecord
belongs_to :payment_schedule
belongs_to :invoice
after_create :chain_record
def chain_record
self.footprint = compute_footprint
save!
FootprintDebug.create!(
footprint: footprint,
data: FootprintService.footprint_data(PaymentScheduleItem, self),
klass: PaymentScheduleItem.name
)
end
def check_footprint
footprint == compute_footprint
end
def compute_footprint
FootprintService.compute_footprint(PaymentScheduleItem, self)
end
end