2025-04-14 11:40:34 -04:00
|
|
|
class Valuation < ApplicationRecord
|
|
|
|
include Entryable
|
2025-07-10 18:40:38 -04:00
|
|
|
|
2025-07-15 11:42:41 -04:00
|
|
|
enum :kind, {
|
|
|
|
reconciliation: "reconciliation",
|
|
|
|
opening_anchor: "opening_anchor",
|
|
|
|
current_anchor: "current_anchor"
|
|
|
|
}, validate: true, default: "reconciliation"
|
|
|
|
|
2025-07-10 18:40:38 -04:00
|
|
|
class << self
|
|
|
|
def build_reconciliation_name(accountable_type)
|
|
|
|
Valuation::Name.new("reconciliation", accountable_type).to_s
|
|
|
|
end
|
|
|
|
|
|
|
|
def build_opening_anchor_name(accountable_type)
|
|
|
|
Valuation::Name.new("opening_anchor", accountable_type).to_s
|
|
|
|
end
|
|
|
|
|
|
|
|
def build_current_anchor_name(accountable_type)
|
|
|
|
Valuation::Name.new("current_anchor", accountable_type).to_s
|
|
|
|
end
|
|
|
|
end
|
2025-04-14 11:40:34 -04:00
|
|
|
end
|