jishan_fast_track_gem 0.1.14 → 0.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +1 -3
- data/lib/eligibility_check.rb +24 -11
- data/lib/files_check.rb +22 -5
- data/lib/jishan_fast_track_gem/version.rb +1 -1
- data/lib/jishan_fast_track_gem.rb +5 -3
- data/lib/rebate_calculator.rb +14 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b2cad18214303ea2d8d295fb3722892ba30d4c46e5b1568ae53e5314ce9e8520
|
4
|
+
data.tar.gz: f5130bc86312f938dd7f0ee09128b18f116f93bac9724a3e271ffdea56599144
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57811c443a45d199e44d515f3fb6895e27d001e770e5b2821629481eb88cb4512ea45b2d2e4d11540e5320e264be2faf84be1bb504b8ef93c98cf38df058ba90
|
7
|
+
data.tar.gz: 3c30c22ed90806a6aa9155f19c01653c02cffffd4201cf850e26df6087212a73b8630dcc68b2839a1810ce2cb11c64d83a5858be237868e6d41e795eca9ec729
|
data/Gemfile
CHANGED
data/lib/eligibility_check.rb
CHANGED
@@ -9,10 +9,17 @@ class Eligibility_check
|
|
9
9
|
@name = name
|
10
10
|
@answers =[]
|
11
11
|
end
|
12
|
-
|
12
|
+
|
13
|
+
def instruction
|
14
|
+
puts "Hello, this is a solar panel rebate eligibility check process, please follow the questions and them with a valid input 1 is yes and 2 is no. Simply type 1 or 2 will be sufficient. Although you respond with any other inputs, this program will guide you through the whole process. if you wish to leave the process type 3 as your response.".colorize(:blue)
|
15
|
+
puts "---"*20
|
16
|
+
ower_of_the_property
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
13
20
|
def ower_of_the_property
|
14
21
|
puts "Are you the property owner and the current occupier?".colorize(:light_blue)
|
15
|
-
|
22
|
+
user_input_options
|
16
23
|
answer = gets.chomp.to_i
|
17
24
|
return ower_of_the_property unless answer_check(answer)
|
18
25
|
received_solar_rebate_before
|
@@ -20,7 +27,7 @@ class Eligibility_check
|
|
20
27
|
|
21
28
|
def received_solar_rebate_before
|
22
29
|
puts "Is this your first apply for solar panel rebate?".colorize(:light_blue)
|
23
|
-
|
30
|
+
user_input_options
|
24
31
|
answer = gets.chomp.to_i
|
25
32
|
return received_solar_rebate_before unless answer_check(answer)
|
26
33
|
existed_solar_panel
|
@@ -28,7 +35,7 @@ class Eligibility_check
|
|
28
35
|
|
29
36
|
def existed_solar_panel
|
30
37
|
puts "Is this your first solar panel installation?".colorize(:light_blue)
|
31
|
-
|
38
|
+
user_input_options
|
32
39
|
|
33
40
|
answer = gets.chomp.to_i
|
34
41
|
return existed_solar_panel unless answer_check(answer)
|
@@ -37,7 +44,7 @@ class Eligibility_check
|
|
37
44
|
|
38
45
|
def combined_houshold_income
|
39
46
|
puts "Is your household income below $180,000aud?".colorize(:light_blue)
|
40
|
-
|
47
|
+
user_input_options
|
41
48
|
answer = gets.chomp.to_i
|
42
49
|
return combined_houshold_income unless answer_check(answer)
|
43
50
|
property_value
|
@@ -45,7 +52,7 @@ class Eligibility_check
|
|
45
52
|
|
46
53
|
def property_value
|
47
54
|
puts "Is your property value less than $3 millions?" .colorize(:light_blue)
|
48
|
-
|
55
|
+
user_input_options
|
49
56
|
answer = gets.chomp.to_i
|
50
57
|
return property_value unless answer_check(answer)
|
51
58
|
eligibility_response
|
@@ -55,26 +62,32 @@ class Eligibility_check
|
|
55
62
|
if @answers.size == 0
|
56
63
|
puts "Congrats! You are eligible for solar panel rebate #{Emoji.find_by_alias("clap").raw} #{Emoji.find_by_alias("clap").raw} #{Emoji.find_by_alias("clap").raw}".colorize(:red)
|
57
64
|
else
|
58
|
-
puts "Sorry, you are not eligible for solar panel rebate."
|
65
|
+
puts "Sorry, you are not eligible for solar panel rebate program."
|
59
66
|
end
|
60
67
|
end
|
61
68
|
|
62
69
|
def answer_check(answer)
|
63
70
|
while answer != 1 || answer != 2
|
64
|
-
if answer == 1
|
65
|
-
puts "Please read the next line #{Emoji.find_by_alias("point_right").raw}.".colorize(:
|
71
|
+
if answer == 1
|
72
|
+
puts "Please read the next line #{Emoji.find_by_alias("point_right").raw}.".colorize(:light_yellow)
|
66
73
|
puts " "
|
67
74
|
return true
|
68
75
|
elsif answer == 2
|
69
|
-
puts "Please read the next line #{Emoji.find_by_alias("point_right").raw}."
|
76
|
+
puts "Please read the next line #{Emoji.find_by_alias("point_right").raw}.".colorize(:light_yellow)
|
70
77
|
puts " "
|
71
78
|
@answers << answer
|
72
79
|
return true
|
80
|
+
elsif answer == 3
|
81
|
+
exit
|
73
82
|
else
|
74
|
-
puts "It is no a valid input."
|
83
|
+
puts "It is no a valid input. Please type 1. yes or 2. no."
|
75
84
|
puts " "
|
76
85
|
return false
|
77
86
|
end
|
78
87
|
end
|
79
88
|
end
|
89
|
+
def user_input_options
|
90
|
+
puts "1. Yes 2. No ".colorize(:light_blue)
|
91
|
+
puts "if you wish to leave this eligibility check process, type 3".colorize(:green)
|
92
|
+
end
|
80
93
|
end
|
data/lib/files_check.rb
CHANGED
@@ -4,13 +4,22 @@ require "colorize"
|
|
4
4
|
require "table_print"
|
5
5
|
|
6
6
|
class Files_check
|
7
|
+
attr_reader :file_list
|
7
8
|
def initialize(name)
|
8
9
|
@name = name
|
10
|
+
@file_list = []
|
9
11
|
end
|
10
12
|
|
13
|
+
def instruction
|
14
|
+
puts "Hello, this is a files check process. It will check whether your URL is valid or not first. If it is valid, it will further check whether is a supported file type. The supported file types for this process are .pdf and .doc. Although you provide unsupported files or not valid file, it will ask you to provide the valid and supported file types document again. If you wish to leave the process, simply type 3 to respond.".colorize(:blue)
|
15
|
+
puts "--" *30
|
16
|
+
income_proof
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
11
20
|
def income_proof
|
12
21
|
puts "provide the proof of income document URL (only .pdf or .doc): ".colorize(:light_blue)
|
13
|
-
|
22
|
+
leave_request
|
14
23
|
|
15
24
|
url = gets.chomp
|
16
25
|
return income_proof unless valid_file_check(url)
|
@@ -22,7 +31,8 @@ class Files_check
|
|
22
31
|
file_arr = []
|
23
32
|
loop do
|
24
33
|
puts "provide identity documents' URL in total two (only .pdf or .doc): ".colorize(:light_blue)
|
25
|
-
|
34
|
+
leave_request
|
35
|
+
|
26
36
|
url = gets.chomp
|
27
37
|
return two_forms_of_identity unless valid_file_check(url)
|
28
38
|
return two_forms_of_identity unless file_type_check(url)
|
@@ -36,7 +46,7 @@ class Files_check
|
|
36
46
|
|
37
47
|
def retailer_quote
|
38
48
|
puts "Provide the eligible quote URL (only .pdf or .doc): ".colorize(:light_blue)
|
39
|
-
|
49
|
+
leave_request
|
40
50
|
|
41
51
|
url = gets.chomp
|
42
52
|
file_type = File.extname(URI.parse(url).path)
|
@@ -56,7 +66,7 @@ class Files_check
|
|
56
66
|
end
|
57
67
|
|
58
68
|
if result != nil
|
59
|
-
puts "Eligible retailer.".colorize(:red)
|
69
|
+
puts "Eligible retailer. Congrats all the required URL has been uploaded".colorize(:red)
|
60
70
|
else
|
61
71
|
puts "Not Eligible retailer. Please check the provided list of CEC approved retailers below, wish to hear back from you soon.".colorize(:light_yellow)
|
62
72
|
tp csv.map { |row| row.to_hash }, { :NAME => { display_name: "Company Name" } }, { :URL => { width: 35 } }
|
@@ -68,7 +78,7 @@ class Files_check
|
|
68
78
|
if url =~ URI::regexp
|
69
79
|
puts "It's a valid URL."
|
70
80
|
return true
|
71
|
-
elsif url == "
|
81
|
+
elsif url == "3"
|
72
82
|
exit
|
73
83
|
else
|
74
84
|
puts "It's not a valid file URL.".colorize(:light_yellow)
|
@@ -82,12 +92,19 @@ class Files_check
|
|
82
92
|
file_type = File.extname(URI.parse(url).path)
|
83
93
|
if file_type == ".pdf" || file_type == ".doc"
|
84
94
|
puts "File upload succeeded.".colorize(:red)
|
95
|
+
puts " "
|
96
|
+
@file_list << url
|
85
97
|
return true
|
86
98
|
else
|
87
99
|
puts "Upload failed, please provide .pdf or .doc document.".colorize(:light_yellow)
|
100
|
+
puts " "
|
88
101
|
return false
|
89
102
|
end
|
90
103
|
break if file_type == ".pdf" || file_type == ".doc"
|
91
104
|
end
|
92
105
|
end
|
106
|
+
|
107
|
+
def leave_request
|
108
|
+
puts "if you wish to leave this file check process, type 3 ".colorize(:green)
|
109
|
+
end
|
93
110
|
end
|
@@ -8,9 +8,11 @@ require_relative 'manage_list'
|
|
8
8
|
# Help file includes *comprehensive* instructions which *accurately* describe: steps to install the application; dependencies required by the application; system/hardware requirements; features of the application.
|
9
9
|
|
10
10
|
john = Eligibility_check.new("John")
|
11
|
-
# john.
|
11
|
+
# john.instruction
|
12
12
|
john_files = Files_check.new("John Files")
|
13
|
-
# john_files.
|
13
|
+
# john_files.instruction
|
14
|
+
|
15
|
+
|
14
16
|
|
15
17
|
# list_zone_1 = Manage_list.new
|
16
18
|
# list_zone_2 = Manage_list.new
|
@@ -28,7 +30,7 @@ john_files = Files_check.new("John Files")
|
|
28
30
|
# p Manage_list.display_processing_number
|
29
31
|
|
30
32
|
john_rebate = Rebate_calculator.new
|
31
|
-
john_rebate.
|
33
|
+
john_rebate.instruction
|
32
34
|
|
33
35
|
|
34
36
|
|
data/lib/rebate_calculator.rb
CHANGED
@@ -11,10 +11,23 @@ class Rebate_calculator
|
|
11
11
|
@stc = 0
|
12
12
|
end
|
13
13
|
|
14
|
+
def instruction
|
15
|
+
puts "Hello, this is a rebate calculator. If you don't have the following information with you, this calculator can not evaluate the accurate rebate amount for you. The required information is the postcode, kilowatt and solar panel lifetime. Note. if your response is not in numbers, the rebate amount will always be zero. Also please make sure the provided postcode is accurate. Thank you.".colorize(:light_blue)
|
16
|
+
ask_parameters
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
14
20
|
def ask_parameters
|
21
|
+
loop do
|
15
22
|
puts "what is your postcode?"
|
16
23
|
postcode = gets.chomp.to_i
|
17
|
-
|
24
|
+
if postcode > 9999
|
25
|
+
puts "It's not a valid postcode, please type a valid postcode.".colorize(:light_yellow)
|
26
|
+
end
|
27
|
+
break if postcode < 9999
|
28
|
+
@postcode = postcode
|
29
|
+
end
|
30
|
+
|
18
31
|
puts "How many kilowatt is your future solar panel?"
|
19
32
|
kw = gets.chomp.to_i
|
20
33
|
@kw = kw
|