# frozen_string_literal: true require 'time' require 'credit_gateway/base_model' module CreditGateway class BankConnection < BaseModel attributes :connection_id, :provider_id, :status, :creation_date_time, :status_update_date_time def self.build(json:) super.tap do |record| if record.creation_date_time record.creation_date_time = Time.parse(record.creation_date_time) end if record.status_update_date_time record.status_update_date_time = Time.parse(record.status_update_date_time) end end end end end