diff --git a/bin/find_bad_customers b/bin/find_bad_customers new file mode 100644 index 0000000000000000000000000000000000000000..3e552b3ecce00b8b028d86b905be5b3332364af1 --- /dev/null +++ b/bin/find_bad_customers @@ -0,0 +1,23 @@ +#!/usr/bin/ruby +# frozen_string_literal: true + +require "redis" +redis = Redis.new + +raise "GIVE ME FILE" unless ARGV[0] + +PORTING_NUMBERS = File.read(ARGV[0]).split("\n") + +redis.scan_each(match: "catapult_jid-*", count: 1000) do |key| + tel = key[13..-1] + next if PORTING_NUMBERS.include? tel + + jid = redis.get(key) + next if jid.start_with?("customer_") + + other_tel = redis.lindex("catapult_cred-#{jid}", -1) + next unless other_tel + next unless tel == other_tel + + puts jid +end