Sha256: 209128164cb35fc10967d47f1effa243244b76497a9ef40ad24e822ed572097d

Contents?: true

Size: 504 Bytes

Versions: 261

Compression:

Stored size: 504 Bytes

Contents

module Spree
  module Reimbursement::ReimbursementTypeValidator
    def valid_preferred_reimbursement_type?(return_item)
      preferred_type = return_item.preferred_reimbursement_type.class

      !past_reimbursable_time_period?(return_item) ||
        preferred_type == expired_reimbursement_type
    end

    def past_reimbursable_time_period?(return_item)
      shipped_at = return_item.inventory_unit.shipment.shipped_at
      shipped_at && shipped_at < refund_time_constraint.ago
    end
  end
end

Version data entries

261 entries across 261 versions & 2 rubygems

Version Path
spree_core-2.4.1 app/models/spree/reimbursement/reimbursement_type_validator.rb