jishan_fast_track_gem 0.1.1 → 0.1.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 94abdba02e71101120a0432aa9dc649dd54c5ec399b85b4106cd031ee3f85c75
4
- data.tar.gz: d1db1790cb291e19b2f538428443ab5f753c26d8fdcccd47a7879ad7f5a68e80
3
+ metadata.gz: ee0aad6009287e6502978084ad2395c671e5771a645ec00039a331ec5961dbe5
4
+ data.tar.gz: 06404456ed2982e69966fef96fbb9497949be7d7015ece4741a32b9f68a72322
5
5
  SHA512:
6
- metadata.gz: 455d9473704e265662c69d533e61a210ad43be80b757eca149eee47fac0f264e2ca7bbd72cb670752082c4ecf148bc9db8ed6b9b0208f3109b177a8de2e7dedb
7
- data.tar.gz: fcf2ee18ebbe7f877bec56394a12e7d6226883eb4a5df89e68167c690311d56a1d62dfe8608f9e541904c1d98f5e3df9a6ad53e90cf7b41d7f5e94ff179b63b3
6
+ metadata.gz: 46d436f51013667c4e5a15ba3931d55a396087d0c960ddb567ab85440c3698cb3e7fac2b15f2e6ca0e18fe1ed7e7cce1102d7c93a5e7b131a1e4c60250887eac
7
+ data.tar.gz: d1b22e571c773e26151a653c2d7617130869efccf32040ba5dd4dcf0ab55a0a21072d0a452926db6512a48c3ea1a9a958ac2bbb1af601f6fb270aa6c3cd96de9
data/Gemfile.lock CHANGED
@@ -1,14 +1,36 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- jishan_fast_track_gem (0.1.0)
4
+ jishan_fast_track_gem (0.1.1)
5
5
  colorize (~> 0.8.1)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
+ addressable (2.7.0)
11
+ public_suffix (>= 2.0.2, < 5.0)
10
12
  colorize (0.8.1)
13
+ domain_name (0.5.20190701)
14
+ unf (>= 0.0.5, < 1.0.0)
15
+ ffi (1.12.2)
16
+ ffi-compiler (1.0.1)
17
+ ffi (>= 1.0.0)
18
+ rake
19
+ http (4.3.0)
20
+ addressable (~> 2.3)
21
+ http-cookie (~> 1.0)
22
+ http-form_data (~> 2.2)
23
+ http-parser (~> 1.2.0)
24
+ http-cookie (1.0.3)
25
+ domain_name (~> 0.5)
26
+ http-form_data (2.3.0)
27
+ http-parser (1.2.1)
28
+ ffi-compiler (>= 1.0, < 2.0)
29
+ public_suffix (4.0.3)
11
30
  rake (12.3.3)
31
+ unf (0.1.4)
32
+ unf_ext
33
+ unf_ext (0.0.7.6)
12
34
 
13
35
  PLATFORMS
14
36
  ruby
@@ -0,0 +1,33 @@
1
+ URL,NAME
2
+ www.autonomousenergy.com,Autonomous Energy
3
+ www.bradfordsolar.com.au,CSR Bradford
4
+ www.citytosurfsolar.com.au,City to Surf Solar
5
+ www.cherryenergysolutions.com.au,Cherry Energy Solutions
6
+ www.cleanenergysolar.com.au,Clean Energy Solar
7
+ www.cleanearthservices.com.au,Clean Earth Services
8
+ energis.com.au,Energis
9
+ www.energymatters.com.au,Energy Matters
10
+ www.energyreductions.com.au,Energy Reductions
11
+ www.enervest.com.au,Enervest
12
+ www.envirogroup.com.au,EnviroGroup
13
+ envirolinkau.com.au,Envirolink
14
+ www.epho.com.au,epho
15
+ www.evergen.com.au,Evergen
16
+ www.gippslandsolar.com.au,Gippsland Solar
17
+ www.infiniteenergy.com.au,Infinite Energy
18
+ www.au.issworld.com,ISS
19
+ www.keppelprince.com,Keppel Prince
20
+ www.lakessolar.com.au,Lakes Solar
21
+ www.lecaustralia.com.au,LECA
22
+ www.metrosolar.com.au,Metro Solar
23
+ ngelectrical.com.au,Next Generation Electrical
24
+ nu-tility.com,nu-tility
25
+ www.offgridenergy.com.au,Off Grid Energy Australia
26
+ www.photonenergy.com.au,Photon Energy
27
+ www.solarhub.net.au,Solar Hub
28
+ www.solgen.com.au,Solgen Energy Group
29
+ www.sunedison.com.au,SunEdison
30
+ www.sunergysolar.com.au,Sunergy
31
+ www.suntrix.com.au,SunTrix
32
+ www.totalsolarsolutions.com.au,Total Solar Solutions
33
+ www.unitedsolarenergy.com.au,United Solar Energy
@@ -0,0 +1,80 @@
1
+ require 'uri'
2
+ require 'csv'
3
+
4
+
5
+ class Solar_panel_rebate_egilibility_check
6
+ def initialize(name)
7
+ @name = name
8
+ end
9
+
10
+ def ower_of_the_property
11
+ puts "Are you the property owner and the current occupier?"
12
+ puts "1. yes"
13
+ puts "2. no"
14
+ answer = gets.chomp.to_i
15
+ if answer == 1
16
+ puts "check the next question."
17
+ received_solar_rebate_before
18
+ elsif answer == 2
19
+ puts "sorry, your are not eligible."
20
+ else
21
+ puts "no valid input."
22
+ end
23
+ end
24
+
25
+ def received_solar_rebate_before
26
+ puts "Have you received solar panel rebate before?"
27
+ puts "1. yes"
28
+ puts "2. no"
29
+ answer = gets.chomp.to_i
30
+ if answer == 1
31
+ puts "sorry, your are not eligible."
32
+ elsif answer == 2
33
+ puts "check the next question."
34
+ existed_solar_panel
35
+ else
36
+ puts "no valid input."
37
+ end
38
+ end
39
+ def existed_solar_panel
40
+ puts "Do you have an existed solar panel?"
41
+ puts "1. yes"
42
+ puts "2. no"
43
+ answer = gets.chomp.to_i
44
+ if answer == 1
45
+ puts "sorry, your are not eligible."
46
+ elsif answer == 2
47
+ puts "check the next question."
48
+ combined_houshold_income
49
+ else
50
+ puts "no valid input."
51
+ end
52
+ end
53
+ def combined_houshold_income
54
+ puts "Is your household income below $180,000aud ?"
55
+ puts "1. yes"
56
+ puts "2. no"
57
+ answer = gets.chomp.to_i
58
+ if answer == 1
59
+ puts "check the next question."
60
+ property_value
61
+ elsif answer == 2
62
+ puts "sorry, your are not eligible."
63
+ else
64
+ puts "no valid input."
65
+ end
66
+ end
67
+ def property_value
68
+ puts "Is your property value more than $3 millions ?"
69
+ puts "1. yes"
70
+ puts "2. no"
71
+ answer = gets.chomp.to_i
72
+ if answer == 1
73
+ puts "sorry, your are not eligible."
74
+ elsif answer == 2
75
+ puts "congrats! You are eligible for this rebate!"
76
+ else
77
+ puts "no valid input."
78
+ end
79
+ end
80
+ end
@@ -0,0 +1,85 @@
1
+ require 'uri'
2
+ require 'csv'
3
+
4
+
5
+
6
+ class Provided_files_check
7
+ def initialize(name)
8
+ @name = name
9
+ end
10
+ def income_proof
11
+ puts "provide the proof of income document URL (only .pdf or .doc): "
12
+ url = gets.chomp
13
+ if url =~ URI::regexp
14
+ puts "valid file URL."
15
+ else
16
+ puts "not valid file URL."
17
+ end
18
+
19
+ file_type = File.extname(URI.parse(url).path)
20
+ if file_type == ".pdf" || file_type == ".doc"
21
+ puts "file upload succeeded."
22
+ two_forms_of_identity
23
+ else
24
+ puts "upload failed. please provide valid URL to .pdf or .doc ."
25
+ end
26
+ end
27
+
28
+ def two_forms_of_identity
29
+ file_arr = []
30
+ loop do
31
+ puts "provide identity documents' URL (only .pdf or .doc): "
32
+ url = gets.chomp
33
+ if url =~ URI::regexp
34
+ puts "valid file URL."
35
+ else
36
+ puts "not valid file URL."
37
+ end
38
+
39
+ file_type = File.extname(URI.parse(url).path)
40
+ if file_type == ".pdf" || file_type == ".doc"
41
+ file_arr << file_type
42
+ puts "file upload succeeded."
43
+ else
44
+ puts "upload failed. please provide valid URL to .pdf or .doc ."
45
+ end
46
+ break if file_arr.size == 2
47
+ end
48
+ retailer_quote
49
+ end
50
+
51
+ def retailer_quote
52
+ puts "Provide the eligible quote URL (only .pdf or .doc): "
53
+ url = gets.chomp
54
+ file_type = File.extname(URI.parse(url).path)
55
+
56
+ if url =~ URI::regexp
57
+ puts "valid file URL."
58
+ else
59
+ puts "not valid file URL."
60
+ end
61
+
62
+ if file_type == ".pdf" || file_type == ".doc"
63
+ puts "file upload succeeded."
64
+ eligible_quote(url)
65
+ else
66
+ puts "upload failed. please provide valid URL to .pdf or .doc ."
67
+ end
68
+ end
69
+ def eligible_quote(url)
70
+ retailer = URI.parse(url).host
71
+ csv_text = File.read('cec_approved_retailers.csv')
72
+ csv = CSV.parse(csv_text, headers: true)
73
+
74
+ result = csv.find do |web|
75
+ web_address = web.to_hash
76
+ retailer == web_address['URL']
77
+ end
78
+
79
+ if result != nil
80
+ puts "Eligible retailer."
81
+ else
82
+ puts "Not Eligible retailer."
83
+ end
84
+ end
85
+ end
@@ -1,3 +1,3 @@
1
1
  module JishanFastTrackGem
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -1,5 +1,45 @@
1
- require "jishan_fast_track_gem/version"
1
+ # require "jishan_fast_track_gem/version"
2
+ require_relative 'rebate_calculator'
3
+ require_relative 'files_check'
4
+ require_relative 'eligibility_check'
5
+ require_relative 'manage_lists'
6
+
7
+
8
+ # ruby = Solar_panel_rebate_egilibility_check.new("Ruby")
9
+ # ruby.ower_of_the_property
10
+
11
+ john_files = Provided_files_check.new("john_files")
12
+ # john_files.income_proof
13
+ john_rebate = Rebate_calculator.new("john_rebate")
14
+ # john_rebate.stc_postcode_rating(3000)
15
+ # john_rebate.stc_calculator(5, 5)
16
+ # p john_rebate.rebate
17
+
18
+
19
+
20
+ # john_files.retailer_quote
21
+ # peta_files= Provided_files_check.new("peta_files")
22
+ # peta_files.retailer_quote
23
+
24
+
25
+ # a_list = Manage_list.new("a_list")
26
+ # a_list.add_to_eligible_list("John")
27
+ # a_list.add_to_eligible_list("Peta")
28
+ # a_list.add_to_eligible_list("Peta")
29
+ # a_list.remove_applicant("John")
30
+
31
+
32
+ # p Manage_list.display_processing_number
33
+ # p a_list.eligible_list
34
+
35
+ # john_rebate = Rebate_calculator.new("John_rebate")
36
+ # john_rebate.stc_postcode_rating(3163)
37
+ # john_rebate.stc_calculator(3, 15)
38
+ # p john_rebate.rebate
39
+
40
+
41
+
42
+
43
+
2
44
 
3
- puts "hello World"
4
45
 
5
- #first file you have written should be here.
@@ -0,0 +1,21 @@
1
+
2
+ class Manage_list
3
+ attr_reader :eligible_list
4
+ @@processing_number = 0
5
+ def initialize(list_name)
6
+ @list_name = list_name
7
+ @eligible_list = []
8
+ end
9
+ def self.display_processing_number
10
+ @@processing_number
11
+ end
12
+ def remove_applicant(name)
13
+ @eligible_list.delete(name)
14
+ @@processing_number -= 1
15
+ end
16
+
17
+ def add_to_eligible_list(name)
18
+ @eligible_list << name
19
+ @@processing_number += 1
20
+ end
21
+ end
@@ -0,0 +1,28 @@
1
+
2
+
3
+ class Rebate_calculator
4
+ def initialize(name)
5
+ @name = name
6
+ @stc_rating = 0
7
+ @stc = 0
8
+ end
9
+ def stc_postcode_rating(postcode)
10
+ csv_text = File.read('stc_rating.csv')
11
+ csv = CSV.parse(csv_text, headers: true)
12
+ result = csv.find do |num|
13
+ stc_table = num.to_hash
14
+ postcode >= stc_table['Postcode from'].to_i && postcode <= stc_table['Postcode to'].to_i
15
+ end
16
+ @stc_rating = result['Rating'].to_f
17
+ end
18
+
19
+ def stc_calculator(kw, deeming_year)
20
+ @stc = kw * @stc_rating * deeming_year
21
+ end
22
+
23
+ def rebate
24
+ stc_value = 37.5
25
+ rebate_amount = @stc * stc_value
26
+ rebate_amount > 1888 ? 1888 : rebate_amount.truncate(2)
27
+ end
28
+ end
@@ -0,0 +1,138 @@
1
+ Item,Postcode from,Postcode to,Zone,Rating
2
+ 1,0,799,3,1.382
3
+ 2,800,853,2,1.536
4
+ 3,854,854,3,1.382
5
+ 4,855,861,2,1.536
6
+ 5,862,862,3,1.382
7
+ 6,863,869,2,1.536
8
+ 7,870,879,1,1.622
9
+ 8,880,885,3,1.382
10
+ 9,886,1000,2,1.536
11
+ 10,1001,2355,3,1.382
12
+ 11,2356,2357,2,1.536
13
+ 12,2358,2384,3,1.382
14
+ 13,2385,2389,2,1.536
15
+ 14,2390,2395,3,1.382
16
+ 15,2396,2397,2,1.536
17
+ 16,2398,2399,3,1.382
18
+ 17,2400,2400,2,1.536
19
+ 18,2401,2404,3,1.382
20
+ 19,2405,2407,2,1.536
21
+ 20,2408,2544,3,1.382
22
+ 21,2545,2554,4,1.185
23
+ 22,2555,2627,3,1.382
24
+ 23,2628,2628,4,1.185
25
+ 24,2629,2629,3,1.382
26
+ 25,2630,2639,4,1.185
27
+ 26,2640,2816,3,1.382
28
+ 27,2817,2817,2,1.536
29
+ 28,2818,2820,3,1.382
30
+ 29,2821,2829,2,1.536
31
+ 30,2830,2830,3,1.382
32
+ 31,2831,2841,2,1.536
33
+ 32,2842,2872,3,1.382
34
+ 33,2873,2873,2,1.536
35
+ 34,2874,2877,3,1.382
36
+ 35,2878,2889,2,1.536
37
+ 36,2890,2999,3,1.382
38
+ 37,3000,3035,4,1.185
39
+ 38,3036,3038,3,1.382
40
+ 39,3039,3044,4,1.185
41
+ 40,3045,3045,3,1.382
42
+ 41,3046,3046,4,1.185
43
+ 42,3047,3049,3,1.382
44
+ 43,3050,3058,4,1.185
45
+ 44,3059,3059,3,1.382
46
+ 45,3060,3060,4,1.185
47
+ 46,3061,3064,3,1.382
48
+ 47,3065,3074,4,1.185
49
+ 48,3075,3076,3,1.382
50
+ 49,3077,3098,4,1.185
51
+ 50,3099,3099,3,1.382
52
+ 51,3100,3292,4,1.185
53
+ 52,3293,3302,3,1.382
54
+ 53,3303,3308,4,1.185
55
+ 54,3309,3319,3,1.382
56
+ 55,3320,3333,4,1.185
57
+ 56,3334,3337,3,1.382
58
+ 57,3338,3339,4,1.185
59
+ 58,3340,3758,3,1.382
60
+ 59,3759,3760,4,1.185
61
+ 60,3761,3764,3,1.382
62
+ 61,3765,3999,4,1.185
63
+ 62,4000,4416,3,1.382
64
+ 63,4417,4417,2,1.536
65
+ 64,4418,4427,3,1.382
66
+ 65,4428,4473,2,1.536
67
+ 66,4474,4476,1,1.622
68
+ 67,4477,4478,2,1.536
69
+ 68,4479,4485,1,1.622
70
+ 69,4486,4491,2,1.536
71
+ 70,4492,4492,1,1.622
72
+ 71,4493,4493,2,1.536
73
+ 72,4494,4494,3,1.382
74
+ 73,4495,4497,2,1.536
75
+ 74,4498,4719,3,1.382
76
+ 75,4720,4722,2,1.536
77
+ 76,4723,4723,3,1.382
78
+ 77,4724,4734,2,1.536
79
+ 78,4735,4736,1,1.622
80
+ 79,4737,4822,3,1.382
81
+ 80,4823,4823,2,1.536
82
+ 81,4824,4824,3,1.382
83
+ 82,4825,4827,2,1.536
84
+ 83,4828,4828,3,1.382
85
+ 84,4829,4829,1,1.622
86
+ 85,4830,5431,3,1.382
87
+ 86,5432,5450,2,1.536
88
+ 87,5451,5654,3,1.382
89
+ 88,5655,5669,2,1.536
90
+ 89,5670,5679,3,1.382
91
+ 90,5680,5699,2,1.536
92
+ 91,5700,5709,3,1.382
93
+ 92,5710,5722,2,1.536
94
+ 93,5723,5724,1,1.622
95
+ 94,5725,5730,2,1.536
96
+ 95,5731,5731,1,1.622
97
+ 96,5732,5732,2,1.536
98
+ 97,5733,5799,1,1.622
99
+ 98,5800,6043,3,1.382
100
+ 99,6044,6044,2,1.536
101
+ 100,6045,6256,3,1.382
102
+ 101,6257,6270,4,1.185
103
+ 102,6271,6316,3,1.382
104
+ 103,6317,6349,4,1.185
105
+ 104,6350,6353,3,1.382
106
+ 105,6354,6356,4,1.185
107
+ 106,6357,6394,3,1.382
108
+ 107,6395,6400,4,1.185
109
+ 108,6401,6430,3,1.382
110
+ 109,6431,6431,2,1.536
111
+ 110,6432,6433,3,1.382
112
+ 111,6434,6440,2,1.536
113
+ 112,6441,6441,1,1.622
114
+ 113,6442,6444,3,1.382
115
+ 114,6445,6459,4,1.185
116
+ 115,6460,6467,3,1.382
117
+ 116,6468,6469,2,1.536
118
+ 117,6470,6471,3,1.382
119
+ 118,6472,6472,2,1.536
120
+ 119,6473,6506,3,1.382
121
+ 120,6507,6508,2,1.536
122
+ 121,6509,6509,3,1.382
123
+ 122,6510,6536,2,1.536
124
+ 123,6537,6537,1,1.622
125
+ 124,6538,6555,2,1.536
126
+ 125,6556,6573,3,1.382
127
+ 126,6574,6602,2,1.536
128
+ 127,6603,6607,3,1.382
129
+ 128,6608,6641,2,1.536
130
+ 129,6642,6724,1,1.622
131
+ 130,6725,6750,2,1.536
132
+ 131,6751,6764,1,1.622
133
+ 132,6765,6765,2,1.536
134
+ 133,6766,6797,1,1.622
135
+ 134,6798,6799,2,1.536
136
+ 135,6800,6999,3,1.382
137
+ 136,7000,8999,4,1.185
138
+ 137,9000,9999,3,1.382
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jishan_fast_track_gem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jishan_Lu
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-03-10 00:00:00.000000000 Z
11
+ date: 2020-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize
@@ -41,8 +41,14 @@ files:
41
41
  - bin/console
42
42
  - bin/setup
43
43
  - jishan_fast_track_gem.gemspec
44
+ - lib/cec_approved_retailers.csv
45
+ - lib/eligibility_check.rb
46
+ - lib/files_check.rb
44
47
  - lib/jishan_fast_track_gem.rb
45
48
  - lib/jishan_fast_track_gem/version.rb
49
+ - lib/manage_lists.rb
50
+ - lib/rebate_calculator.rb
51
+ - lib/stc_rating.csv
46
52
  homepage: https://github.com/jishan33/JJ
47
53
  licenses:
48
54
  - MIT