class PhotographerPaymentAmount < InvoicingRecord
  include Hashable

  belongs_to :photographer_payment, optional: true

  def computed_hash_string
    Digest::SHA2.new(256).hexdigest [
      previous_hash_string,
      photographer_payment_id,
      vat_rate,
      vat,
      total_ht,
      created_at&.utc&.strftime('%Y-%m-%d %H:%M:%S')
    ].join('/')
  end
end
