dscf-credit 0.1.3 → 0.1.4
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/app/controllers/dscf/credit/facilitators_controller.rb +2 -1
- data/app/controllers/dscf/credit/users_controller.rb +18 -0
- data/app/services/dscf/credit/facilitator_approval_service.rb +3 -4
- data/config/locales/en.yml +12 -0
- data/config/routes.rb +0 -2
- data/lib/dscf/credit/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0c02d9169a31706be543d781e69d56a1d0bda57524ccde6c016acfe75ac42ecf
|
4
|
+
data.tar.gz: 55258ca56dd7e93305b82002bfc591946d0f48f5b06469ac5fa5507e100c3e37
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57e3868b428a74c8b9b0cbf10d2b4126f28e0ebf0fdef328a82b4827fc9d06627a1e89709b54a6a361ab888e679f42d903a826ad98da6863cea871ce69c415b6
|
7
|
+
data.tar.gz: 7c77eaf42cfe6e0c28e3465834a52a7c410460f35fb3cd443e9b211bac50a671ecab24ad4dac1d1efa5e49987d3e3a7e43a4ddd557d8bd6f545953ac33d89b3b
|
@@ -16,7 +16,7 @@ module Dscf::Credit
|
|
16
16
|
|
17
17
|
def approve
|
18
18
|
begin
|
19
|
-
FacilitatorApprovalService.new(@facilitator, current_user).approve
|
19
|
+
FacilitatorApprovalService.new(@facilitator, current_user).approve
|
20
20
|
render_success(data: @facilitator)
|
21
21
|
rescue StandardError => e
|
22
22
|
render_error(errors: e.message)
|
@@ -83,6 +83,7 @@ module Dscf::Credit
|
|
83
83
|
:user_id,
|
84
84
|
:bank_id,
|
85
85
|
:kyc_status,
|
86
|
+
:total_limit,
|
86
87
|
:kyc_review_date,
|
87
88
|
:additional_info,
|
88
89
|
:review_feedback
|
@@ -25,6 +25,24 @@ module Dscf::Credit
|
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
|
+
def show
|
29
|
+
super do
|
30
|
+
has_retailer_business = @obj.businesses.any? do |business|
|
31
|
+
business.business_type&.name&.downcase == "retailer"
|
32
|
+
end
|
33
|
+
|
34
|
+
unless has_retailer_business
|
35
|
+
return render_error(
|
36
|
+
"errors.access_denied",
|
37
|
+
errors: "User does not have retailer business type",
|
38
|
+
status: :forbidden
|
39
|
+
)
|
40
|
+
end
|
41
|
+
|
42
|
+
@obj
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
28
46
|
private
|
29
47
|
|
30
48
|
def model_params
|
@@ -7,12 +7,11 @@ module Dscf::Credit
|
|
7
7
|
@approver = approver
|
8
8
|
end
|
9
9
|
|
10
|
-
def approve
|
10
|
+
def approve
|
11
11
|
ActiveRecord::Base.transaction do
|
12
12
|
facilitator.update!(
|
13
13
|
kyc_status: "approved",
|
14
|
-
|
15
|
-
total_limit: total_limit
|
14
|
+
kyc_reviewed_by: approver
|
16
15
|
)
|
17
16
|
|
18
17
|
token = generate_additional_info_token
|
@@ -33,7 +32,7 @@ module Dscf::Credit
|
|
33
32
|
ActiveRecord::Base.transaction do
|
34
33
|
facilitator.update!(
|
35
34
|
kyc_status: "rejected",
|
36
|
-
|
35
|
+
kyc_reviewed_by: approver,
|
37
36
|
review_feedback: review_feedback
|
38
37
|
)
|
39
38
|
|
data/config/locales/en.yml
CHANGED
@@ -276,6 +276,18 @@ en:
|
|
276
276
|
eligible_credit_lines: "Failed to retrieve eligible credit lines"
|
277
277
|
destroy: "Failed to delete payment request"
|
278
278
|
|
279
|
+
user:
|
280
|
+
success:
|
281
|
+
index: "Users retrieved successfully"
|
282
|
+
show: "User details retrieved successfully"
|
283
|
+
create: "User created successfully"
|
284
|
+
update: "User updated successfully"
|
285
|
+
errors:
|
286
|
+
index: "Failed to retrieve Users"
|
287
|
+
show: "Failed to retrieve User details"
|
288
|
+
create: "Failed to create User"
|
289
|
+
update: "Failed to update User"
|
290
|
+
|
279
291
|
# Global messages
|
280
292
|
operations:
|
281
293
|
success:
|
data/config/routes.rb
CHANGED
@@ -14,8 +14,6 @@ Dscf::Credit::Engine.routes.draw do
|
|
14
14
|
member do
|
15
15
|
patch "approve", to: "facilitators#approve"
|
16
16
|
patch "reject", to: "facilitators#reject"
|
17
|
-
patch "request_modification", to: "facilitators#request_modification"
|
18
|
-
patch "set_limit", to: "facilitators#set_limit"
|
19
17
|
end
|
20
18
|
end
|
21
19
|
|
data/lib/dscf/credit/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dscf-credit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adoniyas
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-09-
|
10
|
+
date: 2025-09-21 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: dscf-core
|