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-3.4.6 app/models/spree/reimbursement/reimbursement_type_validator.rb
spree_core-3.7.10 app/models/spree/reimbursement/reimbursement_type_validator.rb
spree_core-4.0.3 app/models/spree/reimbursement/reimbursement_type_validator.rb
spree_core-3.7.9 app/models/spree/reimbursement/reimbursement_type_validator.rb
spree_core-4.0.2 app/models/spree/reimbursement/reimbursement_type_validator.rb
spree_core-3.7.8 app/models/spree/reimbursement/reimbursement_type_validator.rb
spree_core-4.0.1 app/models/spree/reimbursement/reimbursement_type_validator.rb
spree_core-3.7.7 app/models/spree/reimbursement/reimbursement_type_validator.rb
spree_core-4.0.0 app/models/spree/reimbursement/reimbursement_type_validator.rb
spree_core-4.0.0.rc3 app/models/spree/reimbursement/reimbursement_type_validator.rb
spree_core-3.7.6 app/models/spree/reimbursement/reimbursement_type_validator.rb
spree_core-3.7.5 app/models/spree/reimbursement/reimbursement_type_validator.rb
spree_core-4.0.0.rc2 app/models/spree/reimbursement/reimbursement_type_validator.rb
spree_core-4.0.0.rc1 app/models/spree/reimbursement/reimbursement_type_validator.rb
spree_core-4.0.0.beta app/models/spree/reimbursement/reimbursement_type_validator.rb
solidus_core-2.5.2 app/models/spree/reimbursement/reimbursement_type_validator.rb
spree_core-3.7.4 app/models/spree/reimbursement/reimbursement_type_validator.rb
spree_core-3.7.3 app/models/spree/reimbursement/reimbursement_type_validator.rb
spree_core-3.7.2 app/models/spree/reimbursement/reimbursement_type_validator.rb
spree_core-3.7.1 app/models/spree/reimbursement/reimbursement_type_validator.rb