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-4.10.1 app/models/spree/reimbursement/reimbursement_type_validator.rb
spree_core-4.10.0 app/models/spree/reimbursement/reimbursement_type_validator.rb
spree_core-4.9.0 app/models/spree/reimbursement/reimbursement_type_validator.rb
spree_core-4.8.3 app/models/spree/reimbursement/reimbursement_type_validator.rb
spree_core-4.8.2 app/models/spree/reimbursement/reimbursement_type_validator.rb
spree_core-4.7.3 app/models/spree/reimbursement/reimbursement_type_validator.rb
spree_core-4.6.6 app/models/spree/reimbursement/reimbursement_type_validator.rb
spree_core-4.5.5 app/models/spree/reimbursement/reimbursement_type_validator.rb
spree_core-4.0.9 app/models/spree/reimbursement/reimbursement_type_validator.rb
spree_core-4.1.15 app/models/spree/reimbursement/reimbursement_type_validator.rb
spree_core-4.2.7 app/models/spree/reimbursement/reimbursement_type_validator.rb
spree_core-4.3.3 app/models/spree/reimbursement/reimbursement_type_validator.rb
spree_core-4.4.1 app/models/spree/reimbursement/reimbursement_type_validator.rb
spree_core-4.5.4 app/models/spree/reimbursement/reimbursement_type_validator.rb
spree_core-4.6.5 app/models/spree/reimbursement/reimbursement_type_validator.rb
spree_core-4.7.2 app/models/spree/reimbursement/reimbursement_type_validator.rb
spree_core-4.7.1 app/models/spree/reimbursement/reimbursement_type_validator.rb
spree_core-4.6.4 app/models/spree/reimbursement/reimbursement_type_validator.rb
spree_core-4.7.0 app/models/spree/reimbursement/reimbursement_type_validator.rb
spree_core-4.6.3 app/models/spree/reimbursement/reimbursement_type_validator.rb