musoni_ruby 0.0.02 → 0.0.03
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +13 -5
- data/lib/musoni_ruby/endpoints/_endpoint.rb +1 -1
- data/lib/musoni_ruby/endpoints/loan.rb +11 -2
- data/lib/musoni_ruby/endpoints/savings_account.rb +8 -7
- data/lib/musoni_ruby/endpoints/transaction.rb +35 -0
- data/lib/musoni_ruby/fetch.rb +10 -4
- data/lib/musoni_ruby/support/fake_musoni/accounttransfers/.keep +0 -0
- data/lib/musoni_ruby/support/fake_musoni.rb +1 -0
- data/lib/musoni_ruby/support/test_helper.rb +147 -131
- data/lib/musoni_ruby/version.rb +1 -1
- data/lib/musoni_ruby.rb +1 -0
- metadata +40 -38
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
ZDYyM2IzYzM3MDZkNDQ0YzNmZTM0MWIyY2U5ZDU0MTg1NGVmYWYzZQ==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
ZmMxZTk1ZDAxNTI2MjgzYmM4NjM4ZTg4YzkyNDhjMmRkYzI0Nzg3Mw==
|
5
7
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
MGExZDI1ZGQzNDUxYTE3ZmRhN2M3Mzg4MmQxNTE5YzJhNDVjNzAzMzJjZjQw
|
10
|
+
NzViYjdkM2I0ZDlhMDA2YTkyOTRjNGY2YmVjODljNzcxNzI5MWQ2NjMzZmQz
|
11
|
+
MWM5ZDhmMWRmZTk0OTYwNGRkZjdhMTFhYzJkM2RmZTQ3M2I1M2Y=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
YTg0NmM1NDk2NzQyZGFkNjIzYWM5YzJjMzgwZDllMmJjMGE4NzI2MmI2ZWM0
|
14
|
+
OTViNzMwNjk5OTM4Y2JkY2Q0ZjdmMTQwZmYxYWQ3YmZmZjc0OTgyNDExYWNi
|
15
|
+
MTNkMjgxYTBkYjZkNzlhNDVmOTEwZTRmN2EzZWM1NmQ1MjVlY2I=
|
@@ -40,7 +40,7 @@ module Musoni
|
|
40
40
|
|
41
41
|
end
|
42
42
|
|
43
|
-
# Use this methon in the association reader method
|
43
|
+
# Use this methon in the association reader method with the same name
|
44
44
|
def find_all(offset:1,limit:100, **options)
|
45
45
|
# gets caller methods as association
|
46
46
|
association = caller_locations(1,1)[0].label
|
@@ -31,7 +31,7 @@ module Musoni
|
|
31
31
|
# # Musoni::Loan.find(loan.id, fetch:false).activate(activation)
|
32
32
|
%w{approve}.each do |m|
|
33
33
|
define_method m do |options={}|
|
34
|
-
options[:"#{m}dOnDate"] ||= Time.now
|
34
|
+
options[:"#{m}dOnDate"] ||= Time.now
|
35
35
|
url = "/loans/#{self.id}?command=#{m}"
|
36
36
|
response = Musoni::Fetch.post(url,options)
|
37
37
|
new(options.merge!(id:response.loanId ,response:response)) rescue response
|
@@ -42,7 +42,7 @@ module Musoni
|
|
42
42
|
# # Musoni::Loan.find(loan.id, fetch:false).disburse(disbursement)
|
43
43
|
%w{disburse}.each do |m|
|
44
44
|
define_method m do |options={}|
|
45
|
-
options[:actualDisbursementDate] ||= Time.now
|
45
|
+
options[:actualDisbursementDate] ||= Time.now
|
46
46
|
url = "/loans/#{self.id}?command=#{m}"
|
47
47
|
response = Musoni::Fetch.post(url,options)
|
48
48
|
new(options.merge!(id:response.loanId ,response:response)) rescue response
|
@@ -57,6 +57,15 @@ module Musoni
|
|
57
57
|
self.response = response
|
58
58
|
end
|
59
59
|
|
60
|
+
# loan.allocate(account: account, amount:100)
|
61
|
+
# loan.allocate(client_id: clientId, account_id: savingsId, amount:100)
|
62
|
+
def allocate(options={})
|
63
|
+
options = {guarantorTypeId: 1, entityId: options[:client_id], savingsId: options[:account_id], amount: options[:amount], locale: "en_GB"}
|
64
|
+
url = "/loans/#{self.id}/guarantors"
|
65
|
+
response = Musoni::Fetch.post(url,options)
|
66
|
+
self.response = response
|
67
|
+
end
|
68
|
+
|
60
69
|
|
61
70
|
# # Musoni::Loan.find(26, fetch:false).transactions(offset:1,limit:100)
|
62
71
|
# def transactions(offset:1,limit:100)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Musoni
|
2
2
|
class SavingsAccount < Musoni::Endpoint
|
3
|
-
attr_writer :transactions, :
|
3
|
+
attr_writer :transactions, :onholdtransactions
|
4
4
|
|
5
5
|
class << self
|
6
6
|
|
@@ -31,7 +31,7 @@ module Musoni
|
|
31
31
|
# # account.activate(date)
|
32
32
|
%w{approve activate}.each do |m|
|
33
33
|
define_method m do |options={}|
|
34
|
-
options[:"#{m}dOnDate"] ||= Time.now
|
34
|
+
options[:"#{m}dOnDate"] ||= Time.now
|
35
35
|
url = "/savingsaccounts/#{self.id}?command=#{m}"
|
36
36
|
response = Musoni::Fetch.post(url,options)
|
37
37
|
new(options.merge!(id:response.savingsId ,response:response)) rescue response
|
@@ -42,12 +42,13 @@ module Musoni
|
|
42
42
|
# # account.activate(date)
|
43
43
|
%w{deposit withdrawal}.each do |m|
|
44
44
|
define_method m do |options={}|
|
45
|
-
options[:transactionDate] ||= Time.now
|
45
|
+
options[:transactionDate] ||= Time.now
|
46
46
|
url = "/savingsaccounts/#{self.id}/transactions?command=#{m}"
|
47
47
|
response = Musoni::Fetch.post(url,options)
|
48
48
|
new(options.merge!(id:response.savingsId ,response:response)) rescue response
|
49
49
|
end
|
50
50
|
end
|
51
|
+
|
51
52
|
|
52
53
|
# # savingsaccount.update(name:new_name)
|
53
54
|
# def update(options)
|
@@ -57,10 +58,10 @@ module Musoni
|
|
57
58
|
# end
|
58
59
|
|
59
60
|
|
60
|
-
#
|
61
|
-
|
62
|
-
|
63
|
-
|
61
|
+
# Musoni::SavingsAccount.find(26, fetch:false).onholdtransactions(offset:1,limit:100)
|
62
|
+
def onholdtransactions(offset:1,limit:100)
|
63
|
+
find_all(offset:offset,limit:limit)
|
64
|
+
end
|
64
65
|
|
65
66
|
# # Musoni::SavingsAccount.find(26, fetch:false).payable_items(offset:1,limit:100)
|
66
67
|
# def payable_items(offset:1,limit:100)
|
@@ -0,0 +1,35 @@
|
|
1
|
+
module Musoni
|
2
|
+
class Transaction < Musoni::Endpoint
|
3
|
+
# attr_writer :accounts, :payable_items
|
4
|
+
|
5
|
+
class << self
|
6
|
+
|
7
|
+
def transfer_options(options)
|
8
|
+
# TODO Have actual object as inputs like account1 and account2
|
9
|
+
options.merge!(options[:to] || {}).merge!(options[:from] || {})
|
10
|
+
options[:transferAmount] ||= options[:amount]
|
11
|
+
options[:transferDescription] ||= options[:description]
|
12
|
+
[:to,:from,:amount,:description].each { |k| options.delete k }
|
13
|
+
options
|
14
|
+
end
|
15
|
+
|
16
|
+
# move to own endpoint
|
17
|
+
# from_account = {fromOfficeId: 1,fromClientId: 1,fromAccountType: 2,fromAccountId: 1}
|
18
|
+
# to_account = {toOfficeId: 1,toClientId: 1,toAccountType: 1,toAccountId: 9}
|
19
|
+
# Musoni::SavingsAccount.transfer(from_account.merge!(to_account).merge!({transferAmount:100,transferDescription:"transfering"})
|
20
|
+
def transfer(options={})
|
21
|
+
options = transfer_options(options)
|
22
|
+
url = "/accounttransfers"
|
23
|
+
options[:transferDate] = Time.now
|
24
|
+
response = Musoni::Fetch.post(url,options)
|
25
|
+
new(options.merge!(id:response.resourceId ,response:response)) rescue response
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
protected
|
30
|
+
|
31
|
+
def after_initialize
|
32
|
+
# @endpoint = 'savingsaccounts'
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
data/lib/musoni_ruby/fetch.rb
CHANGED
@@ -15,7 +15,7 @@ module Musoni
|
|
15
15
|
%w(get put post delete).each do |m|
|
16
16
|
define_method m do |path, options={}, &block|
|
17
17
|
# body = date_parameters(options).merge!(options)
|
18
|
-
options = {body:
|
18
|
+
options = {body: options.merge!(date_parameters(options)).to_json}
|
19
19
|
|
20
20
|
res = perform_request Net::HTTP::Put, path, options, &block if m == 'put'
|
21
21
|
res = perform_request Net::HTTP::Get, path, options, &block if m == 'get'
|
@@ -40,9 +40,15 @@ module Musoni
|
|
40
40
|
end
|
41
41
|
|
42
42
|
def date_parameters(options)
|
43
|
-
|
44
|
-
if
|
45
|
-
|
43
|
+
date_params = options.select{|k,v| k.to_s.match(/Date/) or %w{Time Date DateTime}.include?(v.class.name)}
|
44
|
+
if date_params.any?
|
45
|
+
date_params.each do |k,v|
|
46
|
+
date_params[k] = v.strftime("%d-%m-%Y") if %w{Time Date DateTime}.include?(v.class.name)
|
47
|
+
end
|
48
|
+
date_locale ={}
|
49
|
+
date_locale[:dateFormat] ||= "dd-MM-yyyy"
|
50
|
+
date_locale[:locale] ||= "en_GB"
|
51
|
+
date_params.merge!(date_locale)
|
46
52
|
else
|
47
53
|
{}
|
48
54
|
end
|
File without changes
|
@@ -1,63 +1,83 @@
|
|
1
1
|
module Musoni::TestHelper
|
2
|
-
def create_musoni_client
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
:externalId=>rand(100000),
|
9
|
-
:mobileNo=>"07234#{rand(10000)}",
|
10
|
-
:submittedOnDate=>"11-05-2015",
|
11
|
-
:active=>"true",
|
12
|
-
:activationDate=> Time.now.strftime("%d-%m-%Y")
|
13
|
-
}
|
14
|
-
@@musoni_client ||= Musoni::Client.create(client_attributes)
|
2
|
+
def create_musoni_client(n= :first)
|
3
|
+
@@musoni_client ||={}
|
4
|
+
@@musoni_client[:third] ||= Musoni::Client.create(client_attributes) #if n == :third
|
5
|
+
@@musoni_client[:second] ||= Musoni::Client.create(client_attributes) #if n == :second
|
6
|
+
@@musoni_client[:first] ||= Musoni::Client.create(client_attributes) #if n == :first
|
7
|
+
@@musoni_client[n]
|
15
8
|
end
|
16
9
|
|
17
|
-
def
|
18
|
-
|
19
|
-
:
|
20
|
-
:
|
21
|
-
:
|
22
|
-
:
|
23
|
-
:
|
24
|
-
:
|
25
|
-
:
|
26
|
-
:
|
27
|
-
:
|
28
|
-
:
|
29
|
-
:repaymentFrequencyType=>"2",
|
30
|
-
:transactionProcessingStrategyId=>"1",
|
31
|
-
:interestRatePerPeriod=>"5",
|
32
|
-
:expectedDisbursementDate=>"13-05-2015",
|
33
|
-
:amortizationType=>"1",
|
34
|
-
:interestType=>"1",
|
35
|
-
:interestCalculationPeriodType=>"1",
|
36
|
-
:inArrearsTolerance=>"0",
|
37
|
-
:interestChargedFromDate=>"13-05-2015",
|
38
|
-
:repaymentsStartingFromDate=>"13-06-2015",
|
39
|
-
:charges=>[],
|
40
|
-
:loanType=>"individual",
|
41
|
-
:linkAccountId=>"",
|
42
|
-
:graceOnPrincipalPayment=>"0",
|
43
|
-
:graceOnInterestCharged=>"0",
|
44
|
-
:graceOnInterestPayment=>"0",
|
45
|
-
:fundId=>"1",
|
46
|
-
:createStandingInstructionAtDisbursement=>false
|
10
|
+
def client_attributes
|
11
|
+
{
|
12
|
+
officeId: "2",
|
13
|
+
firstname: Faker::Name.first_name,
|
14
|
+
staffId: "1",
|
15
|
+
lastname: Faker::Name.last_name,
|
16
|
+
middlename: Faker::Name.first_name,
|
17
|
+
externalId: rand(100000),
|
18
|
+
mobileNo: "07234#{rand(10000)}",
|
19
|
+
submittedOnDate: Time.now,
|
20
|
+
active: "true",
|
21
|
+
activationDate: Time.now
|
47
22
|
}
|
48
|
-
@@musoni_loan ||= Musoni::Loan.create(loan_options)
|
49
23
|
end
|
50
24
|
|
51
|
-
def create_musoni_savings_account
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
25
|
+
def create_musoni_savings_account(n= :first)
|
26
|
+
@@musoni_savings_account ||={}
|
27
|
+
@@musoni_savings_account[:third] ||= Musoni::SavingsAccount.create(account_attributes(:third)) #if n == :third
|
28
|
+
@@musoni_savings_account[:second] ||= Musoni::SavingsAccount.create(account_attributes(:second)) #if n == :second
|
29
|
+
@@musoni_savings_account[:first] ||= Musoni::SavingsAccount.create(account_attributes(:first)) #if n == :first
|
30
|
+
@@musoni_savings_account[n]
|
31
|
+
end
|
32
|
+
|
33
|
+
def account_attributes(n= :first)
|
34
|
+
client = create_musoni_client(n)
|
35
|
+
{
|
36
|
+
clientId: client.id,
|
37
|
+
productId: "1",
|
38
|
+
submittedOnDate: Time.now,
|
39
|
+
fieldOfficerId: "1",
|
40
|
+
charges: [],
|
41
|
+
allowOverdraft: false
|
59
42
|
}
|
60
|
-
|
43
|
+
end
|
44
|
+
|
45
|
+
def create_musoni_loan
|
46
|
+
client = create_musoni_client
|
47
|
+
now = Time.now
|
48
|
+
tomorrow = (Time.now + 86400)
|
49
|
+
loan_options = {
|
50
|
+
submittedOnDate: now,
|
51
|
+
clientId: client.id,
|
52
|
+
productId: "1",
|
53
|
+
loanOfficerId: "1",
|
54
|
+
loanPurposeId: "1" , #### category []
|
55
|
+
principal: "10000", ###
|
56
|
+
loanTermFrequency: "1", ###
|
57
|
+
loanTermFrequencyType: "2",# weekly [1,2,3]>[Daily, weekly, monthly]
|
58
|
+
numberOfRepayments: "1", ###
|
59
|
+
repaymentEvery: "1",
|
60
|
+
repaymentFrequencyType: "2",
|
61
|
+
transactionProcessingStrategyId: "1",
|
62
|
+
interestRatePerPeriod: '5', ###
|
63
|
+
expectedDisbursementDate: now, ###
|
64
|
+
amortizationType: "1", #?? Equal payments. what else is there
|
65
|
+
interestType: "1",
|
66
|
+
interestCalculationPeriodType: "1",
|
67
|
+
inArrearsTolerance: "0",
|
68
|
+
interestChargedFromDate: now, # Interest is fixed?
|
69
|
+
repaymentsStartingFromDate: tomorrow,
|
70
|
+
charges: [], # Might put here charges
|
71
|
+
loanType: "individual", #Default
|
72
|
+
linkAccountId: "",
|
73
|
+
graceOnPrincipalPayment: "0",
|
74
|
+
graceOnInterestCharged: "0",
|
75
|
+
graceOnInterestPayment: "0",
|
76
|
+
fundId: "1",
|
77
|
+
createStandingInstructionAtDisbursement: false
|
78
|
+
}
|
79
|
+
|
80
|
+
@@musoni_loan ||= Musoni::Loan.create(loan_options)
|
61
81
|
end
|
62
82
|
|
63
83
|
[
|
@@ -71,86 +91,35 @@ module Musoni::TestHelper
|
|
71
91
|
def create_client_datatable
|
72
92
|
client = create_musoni_client
|
73
93
|
datatable_attributes = {
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
:locale=>"en_GB"
|
81
|
-
}
|
94
|
+
email: Faker::Internet.email,
|
95
|
+
Client_Type: %w(Borrower Lender).sample,
|
96
|
+
dateFormat: "DD-MM-YYYY",
|
97
|
+
locale: "en_GB"
|
98
|
+
}
|
99
|
+
|
82
100
|
@@musoni_client_datatable ||= Musoni::Datatable.create(:ml_client_details,client.id,datatable_attributes)
|
83
101
|
end
|
84
102
|
|
85
103
|
def create_borrower_datatable
|
86
104
|
client = create_musoni_client
|
87
|
-
|
88
|
-
:town=>"Nairobi",
|
89
|
-
:address=>"Waiyaki Way",
|
90
|
-
:MaritalStatus_cv_maritalStatus=>"Single",
|
91
|
-
:dateOfBirth=>"01-01-1900",
|
92
|
-
:state=>"state",
|
93
|
-
:E_mail_address=> Faker::Internet.email,
|
94
|
-
:Password=> Faker::Internet.password,
|
95
|
-
:Sector=>"Sector1",
|
96
|
-
:occupation=>"Something",
|
97
|
-
:children_present=>"yes",
|
98
|
-
:household_size=>"10",
|
99
|
-
:dependants_no=>"5",
|
100
|
-
:household_assets=>"None",
|
101
|
-
:monthly_expense_food=>"100",
|
102
|
-
:monthly_expense_housing=>"500",
|
103
|
-
:monthly_expense_school=>"150",
|
104
|
-
:monthly_expense_medical=>"200",
|
105
|
-
:monthly_expense_tranport=>"230",
|
106
|
-
:monthly_expense_health=>"320",
|
107
|
-
:business_ownership=>"Yes",
|
108
|
-
:business_experience=>"10",
|
109
|
-
:book_keeping=>"yes",
|
110
|
-
:monthly_reorder_level=>"10",
|
111
|
-
:current_inventory_level=>"10",
|
112
|
-
:active_savings_devices=>"m-shwari,something else,3rd option",
|
113
|
-
:savings_emergency=>"1001",
|
114
|
-
:savings_school=>"1001",
|
115
|
-
:savings_asset=>"100",
|
116
|
-
:savings_entertainment=>"200",
|
117
|
-
:savings_medical=>"400",
|
118
|
-
:savings_business=>"500",
|
119
|
-
:savings_other=>"100",
|
120
|
-
:credit_limit_mshwari=>"100000000",
|
121
|
-
:saving_frequency=>"None",
|
122
|
-
:remittance_amount=>"1000",
|
123
|
-
:remittance_location=>"Yaya",
|
124
|
-
:remittance_frequency=>"daily",
|
125
|
-
:mobile_use=>"yes",
|
126
|
-
:last_mmoney_out=>"today",
|
127
|
-
:last_mmoney_in=>"yesterday",
|
128
|
-
:phones_owned=>"10",
|
129
|
-
:language_use=>"English,Dutch",
|
130
|
-
:data_mpesa=>"Mledger BLOB",
|
131
|
-
:income_weekly=>10000,
|
132
|
-
:survey_id=>123,
|
133
|
-
:dateFormat=>"dd-MM-yyyy",
|
134
|
-
:locale=>"en_GB"
|
135
|
-
}
|
136
|
-
@@musoni_borrower_datatable ||= Musoni::Datatable.create(:cct_Borrower_Details,client.id,datatable_attributes)
|
105
|
+
@@musoni_borrower_datatable ||= Musoni::Datatable.create(:cct_Borrower_Details,client.id,borrower_data)
|
137
106
|
end
|
138
107
|
|
139
108
|
def create_transunion_datatable
|
140
109
|
client = create_musoni_client
|
141
110
|
datatable_attributes = {
|
142
|
-
:
|
143
|
-
:
|
144
|
-
:
|
145
|
-
:
|
146
|
-
:
|
147
|
-
:
|
148
|
-
:
|
149
|
-
:
|
150
|
-
:
|
151
|
-
:
|
152
|
-
:
|
153
|
-
:
|
111
|
+
Credit_History: "24",
|
112
|
+
NPA_Accounts: "1",
|
113
|
+
NPA_Closed_Accounts: "1",
|
114
|
+
NPA_Open_Accounts: "0",
|
115
|
+
PA_Accounts: "11",
|
116
|
+
PA_Closed_Accounts: "10",
|
117
|
+
PA_Open_Accounts: "1",
|
118
|
+
Response_Statuscode: "300",
|
119
|
+
dateFormat: "dd-MM-yyyy",
|
120
|
+
locale: "en_GB",
|
121
|
+
submittedon_date: Time.now,
|
122
|
+
submittedon_userid: 1
|
154
123
|
}
|
155
124
|
@@musoni_transunion_datatable ||= Musoni::Datatable.create(:cct_TransUnion,client.id,datatable_attributes)
|
156
125
|
end
|
@@ -158,16 +127,63 @@ module Musoni::TestHelper
|
|
158
127
|
def create_firstaccess_datatable
|
159
128
|
client = create_musoni_client
|
160
129
|
datatable_attributes = {
|
161
|
-
:
|
162
|
-
:
|
163
|
-
:
|
164
|
-
:
|
165
|
-
:
|
166
|
-
:
|
167
|
-
:
|
168
|
-
:
|
130
|
+
Status: "Approved",
|
131
|
+
Risk_Bucket: "Very Low",
|
132
|
+
Loan_Size: "10000",
|
133
|
+
Interest_Rate: "10.05",
|
134
|
+
dateFormat: "dd-MM-yyyy",
|
135
|
+
locale: "en_GB",
|
136
|
+
submittedon_date: Time.now,
|
137
|
+
submittedon_userid: 1
|
169
138
|
}
|
170
139
|
@@musoni_firstaccess_datatable ||= Musoni::Datatable.create(:cct_First_Access_Score,client.id,datatable_attributes)
|
171
140
|
end
|
172
141
|
|
142
|
+
def borrower_data
|
143
|
+
{
|
144
|
+
gender: "Male",
|
145
|
+
birthdate: "19-08-2009",
|
146
|
+
marital_status: "Married",
|
147
|
+
has_children: "Yes",
|
148
|
+
household_size: 1,
|
149
|
+
dependants_no: 4,
|
150
|
+
language_use: "Kiswahili",
|
151
|
+
occupation: "Market Vendor",
|
152
|
+
mobile_use: "Ignore",
|
153
|
+
phones_owned: 2,
|
154
|
+
active_savings_devices: "Commercial Bank",
|
155
|
+
savings_emergency: 900,
|
156
|
+
savings_school: 2200,
|
157
|
+
savings_asset: 9500,
|
158
|
+
savings_entertainment: 3100,
|
159
|
+
savings_medical: 2100,
|
160
|
+
savings_business: 2400,
|
161
|
+
savings_other: 6200,
|
162
|
+
credit_limit_mshwari: 1700,
|
163
|
+
saving_frequency: "Weekly",
|
164
|
+
remittance_amount: 4900,
|
165
|
+
remittance_location: "Armenia",
|
166
|
+
remittance_frequency: "Other",
|
167
|
+
income_weekly: 2700,
|
168
|
+
household_assets: '["Television or computer", "Clock/Watch"]',
|
169
|
+
monthly_expense_food: 7800,
|
170
|
+
monthly_expense_housing: 7000,
|
171
|
+
monthly_expense_school: 5400,
|
172
|
+
monthly_expense_medical: 900,
|
173
|
+
monthly_expense_health: 5100,
|
174
|
+
monthly_expense_tranport: 6200,
|
175
|
+
manages_business: "Yes",
|
176
|
+
biz_experience: 4900,
|
177
|
+
ledger_book: 6000,
|
178
|
+
stock_spend: 900,
|
179
|
+
stock_value: 8400,
|
180
|
+
last_mmoney_out: "1,000-5,000",
|
181
|
+
last_mmoney_in: "100-500",
|
182
|
+
data_mpesa: "234,343",
|
183
|
+
survey_id: 123,
|
184
|
+
dateFormat: "DD-MM-YYYY",
|
185
|
+
locale: "en_GB"
|
186
|
+
}
|
187
|
+
end
|
188
|
+
|
173
189
|
end
|
data/lib/musoni_ruby/version.rb
CHANGED
data/lib/musoni_ruby.rb
CHANGED
metadata
CHANGED
@@ -1,223 +1,223 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: musoni_ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.03
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kariuki Gathitu
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.9'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.9'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '10.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '10.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: guard
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ~>
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '2.12'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '2.12'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: minitest
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ~>
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '5.6'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ~>
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '5.6'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: guard-minitest
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ~>
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '2.4'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ~>
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '2.4'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: minitest-reporters
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - ~>
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '1.0'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - ~>
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '1.0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: pry
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- -
|
101
|
+
- - ~>
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: '0.10'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- -
|
108
|
+
- - ~>
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0.10'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: pry-nav
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- -
|
115
|
+
- - ~>
|
116
116
|
- !ruby/object:Gem::Version
|
117
117
|
version: '0.2'
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
|
-
- -
|
122
|
+
- - ~>
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0.2'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: pry-alias
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
|
-
- -
|
129
|
+
- - ~>
|
130
130
|
- !ruby/object:Gem::Version
|
131
131
|
version: '0.0'
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
|
-
- -
|
136
|
+
- - ~>
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0.0'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: coveralls
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
|
-
- -
|
143
|
+
- - ~>
|
144
144
|
- !ruby/object:Gem::Version
|
145
145
|
version: '0.8'
|
146
146
|
type: :development
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
|
-
- -
|
150
|
+
- - ~>
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '0.8'
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: webmock
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
156
156
|
requirements:
|
157
|
-
- -
|
157
|
+
- - ~>
|
158
158
|
- !ruby/object:Gem::Version
|
159
159
|
version: '1.21'
|
160
160
|
type: :development
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
|
-
- -
|
164
|
+
- - ~>
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: '1.21'
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
168
|
name: sinatra
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|
170
170
|
requirements:
|
171
|
-
- -
|
171
|
+
- - ~>
|
172
172
|
- !ruby/object:Gem::Version
|
173
173
|
version: '1.4'
|
174
174
|
type: :development
|
175
175
|
prerelease: false
|
176
176
|
version_requirements: !ruby/object:Gem::Requirement
|
177
177
|
requirements:
|
178
|
-
- -
|
178
|
+
- - ~>
|
179
179
|
- !ruby/object:Gem::Version
|
180
180
|
version: '1.4'
|
181
181
|
- !ruby/object:Gem::Dependency
|
182
182
|
name: faker
|
183
183
|
requirement: !ruby/object:Gem::Requirement
|
184
184
|
requirements:
|
185
|
-
- -
|
185
|
+
- - ~>
|
186
186
|
- !ruby/object:Gem::Version
|
187
187
|
version: '1.4'
|
188
188
|
type: :development
|
189
189
|
prerelease: false
|
190
190
|
version_requirements: !ruby/object:Gem::Requirement
|
191
191
|
requirements:
|
192
|
-
- -
|
192
|
+
- - ~>
|
193
193
|
- !ruby/object:Gem::Version
|
194
194
|
version: '1.4'
|
195
195
|
- !ruby/object:Gem::Dependency
|
196
196
|
name: httparty
|
197
197
|
requirement: !ruby/object:Gem::Requirement
|
198
198
|
requirements:
|
199
|
-
- -
|
199
|
+
- - ~>
|
200
200
|
- !ruby/object:Gem::Version
|
201
201
|
version: '0.13'
|
202
202
|
type: :runtime
|
203
203
|
prerelease: false
|
204
204
|
version_requirements: !ruby/object:Gem::Requirement
|
205
205
|
requirements:
|
206
|
-
- -
|
206
|
+
- - ~>
|
207
207
|
- !ruby/object:Gem::Version
|
208
208
|
version: '0.13'
|
209
209
|
- !ruby/object:Gem::Dependency
|
210
210
|
name: hashie
|
211
211
|
requirement: !ruby/object:Gem::Requirement
|
212
212
|
requirements:
|
213
|
-
- -
|
213
|
+
- - ~>
|
214
214
|
- !ruby/object:Gem::Version
|
215
215
|
version: '3.4'
|
216
216
|
type: :runtime
|
217
217
|
prerelease: false
|
218
218
|
version_requirements: !ruby/object:Gem::Requirement
|
219
219
|
requirements:
|
220
|
-
- -
|
220
|
+
- - ~>
|
221
221
|
- !ruby/object:Gem::Version
|
222
222
|
version: '3.4'
|
223
223
|
description: Railsesque may to integrate with Musoni systems
|
@@ -227,9 +227,9 @@ executables: []
|
|
227
227
|
extensions: []
|
228
228
|
extra_rdoc_files: []
|
229
229
|
files:
|
230
|
-
-
|
231
|
-
-
|
232
|
-
-
|
230
|
+
- .coveralls.yml
|
231
|
+
- .gitignore
|
232
|
+
- .travis.yml
|
233
233
|
- CODE_OF_CONDUCT.md
|
234
234
|
- Gemfile
|
235
235
|
- Guardfile
|
@@ -247,8 +247,10 @@ files:
|
|
247
247
|
- lib/musoni_ruby/endpoints/loan.rb
|
248
248
|
- lib/musoni_ruby/endpoints/run_report.rb
|
249
249
|
- lib/musoni_ruby/endpoints/savings_account.rb
|
250
|
+
- lib/musoni_ruby/endpoints/transaction.rb
|
250
251
|
- lib/musoni_ruby/fetch.rb
|
251
252
|
- lib/musoni_ruby/support/fake_musoni.rb
|
253
|
+
- lib/musoni_ruby/support/fake_musoni/accounttransfers/.keep
|
252
254
|
- lib/musoni_ruby/support/fake_musoni/authentication/.keep
|
253
255
|
- lib/musoni_ruby/support/fake_musoni/clients/.keep
|
254
256
|
- lib/musoni_ruby/support/fake_musoni/datatables/.keep
|
@@ -268,17 +270,17 @@ require_paths:
|
|
268
270
|
- lib
|
269
271
|
required_ruby_version: !ruby/object:Gem::Requirement
|
270
272
|
requirements:
|
271
|
-
- -
|
273
|
+
- - ~>
|
272
274
|
- !ruby/object:Gem::Version
|
273
275
|
version: '2.0'
|
274
276
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
275
277
|
requirements:
|
276
|
-
- -
|
278
|
+
- - ! '>='
|
277
279
|
- !ruby/object:Gem::Version
|
278
280
|
version: '0'
|
279
281
|
requirements: []
|
280
282
|
rubyforge_project:
|
281
|
-
rubygems_version: 2.
|
283
|
+
rubygems_version: 2.2.2
|
282
284
|
signing_key:
|
283
285
|
specification_version: 4
|
284
286
|
summary: Ruby Client for interfacing with Musoni systems API
|