dscf-banking 0.1.2 → 0.1.12
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/MIT-LICENSE +0 -0
- data/README.md +0 -0
- data/Rakefile +0 -0
- data/app/controllers/dscf/banking/accounts_controller.rb +0 -0
- data/app/controllers/dscf/banking/application_controller.rb +0 -0
- data/app/controllers/dscf/banking/applications_controller.rb +0 -0
- data/app/controllers/dscf/banking/interest_configurations_controller.rb +0 -0
- data/app/controllers/dscf/banking/interest_rate_tiers_controller.rb +0 -0
- data/app/controllers/dscf/banking/interest_rate_types_controller.rb +0 -0
- data/app/controllers/dscf/banking/product_approvals_controller.rb +0 -0
- data/app/controllers/dscf/banking/product_categories_controller.rb +0 -0
- data/app/controllers/dscf/banking/virtual_account_products_controller.rb +0 -0
- data/app/jobs/dscf/banking/application_job.rb +0 -0
- data/app/mailers/dscf/banking/application_mailer.rb +0 -0
- data/app/models/concerns/dscf/banking/auditable.rb +0 -0
- data/app/models/dscf/banking/account.rb +2 -24
- data/app/models/dscf/banking/application.rb +0 -0
- data/app/models/dscf/banking/application_record.rb +0 -0
- data/app/models/dscf/banking/interest_configuration.rb +0 -0
- data/app/models/dscf/banking/interest_rate_tier.rb +0 -0
- data/app/models/dscf/banking/interest_rate_type.rb +0 -0
- data/app/models/dscf/banking/product_approval.rb +0 -0
- data/app/models/dscf/banking/product_audit_log.rb +0 -0
- data/app/models/dscf/banking/product_category.rb +0 -0
- data/app/models/dscf/banking/virtual_account_product.rb +0 -0
- data/app/serializers/dscf/banking/account_serializer.rb +0 -0
- data/app/serializers/dscf/banking/application_serializer.rb +0 -0
- data/app/serializers/dscf/banking/interest_configuration_serializer.rb +0 -0
- data/app/serializers/dscf/banking/interest_rate_tier_serializer.rb +0 -0
- data/app/serializers/dscf/banking/interest_rate_type_serializer.rb +0 -0
- data/app/serializers/dscf/banking/product_approval_serializer.rb +0 -0
- data/app/serializers/dscf/banking/product_category_serializer.rb +0 -0
- data/app/serializers/dscf/banking/virtual_account_product_serializer.rb +0 -0
- data/app/services/dscf/banking/account_creation_service.rb +0 -0
- data/config/routes.rb +0 -14
- data/db/migrate/20250830211002_create_dscf_banking_product_categories.rb +0 -0
- data/db/migrate/20250830211027_create_dscf_banking_interest_rate_types.rb +0 -0
- data/db/migrate/20250831063605_add_code_and_remove_fields_from_interest_rate_types.rb +0 -0
- data/db/migrate/20250831064917_create_dscf_banking_virtual_account_products.rb +0 -0
- data/db/migrate/20250831072627_create_dscf_banking_interest_configurations.rb +0 -0
- data/db/migrate/20250831080745_create_dscf_banking_interest_rate_tiers.rb +0 -0
- data/db/migrate/20250831082356_create_dscf_banking_product_approvals.rb +0 -0
- data/db/migrate/20250831083907_create_dscf_banking_product_audit_logs.rb +0 -0
- data/db/migrate/20250831084706_allow_null_virtual_account_product_id_in_product_audit_logs.rb +0 -0
- data/db/migrate/20250912193134_create_dscf_banking_applications.rb +0 -0
- data/db/migrate/20250912203527_create_dscf_banking_accounts.rb +0 -0
- data/lib/dscf/banking/engine.rb +0 -0
- data/lib/dscf/banking/version.rb +1 -1
- data/lib/dscf/banking.rb +0 -0
- data/lib/tasks/dscf/banking_tasks.rake +0 -0
- data/spec/factories/dscf/banking/accounts.rb +0 -28
- data/spec/factories/dscf/banking/applications.rb +5 -6
- data/spec/factories/dscf/banking/interest_configurations.rb +0 -0
- data/spec/factories/dscf/banking/interest_rate_tiers.rb +0 -0
- data/spec/factories/dscf/banking/interest_rate_types.rb +0 -0
- data/spec/factories/dscf/banking/product_approvals.rb +0 -0
- data/spec/factories/dscf/banking/product_audit_logs.rb +0 -0
- data/spec/factories/dscf/banking/product_categories.rb +0 -0
- data/spec/factories/dscf/banking/virtual_account_products.rb +0 -0
- metadata +2 -19
- data/app/controllers/dscf/banking/transaction_types_controller.rb +0 -27
- data/app/controllers/dscf/banking/transactions_controller.rb +0 -275
- data/app/models/dscf/banking/transaction.rb +0 -68
- data/app/models/dscf/banking/transaction_type.rb +0 -20
- data/app/serializers/dscf/banking/transaction_serializer.rb +0 -19
- data/app/serializers/dscf/banking/transaction_type_serializer.rb +0 -9
- data/app/services/dscf/banking/base_transaction_service.rb +0 -99
- data/app/services/dscf/banking/deposit_service.rb +0 -97
- data/app/services/dscf/banking/transfer_service.rb +0 -78
- data/app/services/dscf/banking/withdrawal_service.rb +0 -100
- data/db/migrate/20250919084147_add_account_type_to_accounts.rb +0 -6
- data/db/migrate/20250919084927_make_account_associations_optional.rb +0 -6
- data/db/migrate/20250919182831_create_dscf_banking_transaction_types.rb +0 -14
- data/db/migrate/20250919184220_create_dscf_banking_transactions.rb +0 -21
- data/db/seeds.rb +0 -125
- data/spec/factories/dscf/banking/transaction_types.rb +0 -56
- data/spec/factories/dscf/banking/transactions.rb +0 -52
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0a18bbdf6cbc7d9686c18ee99a8bce779e501210894a6518e1f111f350592a5d
|
4
|
+
data.tar.gz: 2f65b9bd050c1a61ff5b6e45687f34ed1edcb8f6fb79eff1d124625baca58b13
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33b71cb30dcd71b6fbcb435c58509f82ce9c6f450cbf5d7de29309731e86462f808385084d90745f84f962de0e6169c865feccab3fb203fe4d476488ff2d26c8
|
7
|
+
data.tar.gz: 4341ddcaf03f9e40d28eb600c948e0ef8f1d85bebb860f8464d1f03267473b10963b169799b19d0153aec4b8d6441c7934666987f3991e1872b3b6ab725b7f2a
|
data/MIT-LICENSE
CHANGED
File without changes
|
data/README.md
CHANGED
File without changes
|
data/Rakefile
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Dscf::Banking
|
2
2
|
class Account < ApplicationRecord
|
3
|
-
belongs_to :virtual_account_product
|
4
|
-
belongs_to :application
|
3
|
+
belongs_to :virtual_account_product
|
4
|
+
belongs_to :application
|
5
5
|
|
6
6
|
enum :status, {
|
7
7
|
draft: 0,
|
@@ -17,16 +17,12 @@ module Dscf::Banking
|
|
17
17
|
validates :currency, presence: true
|
18
18
|
validates :current_balance, :available_balance, :minimum_balance,
|
19
19
|
numericality: { greater_than_or_equal_to: 0 }
|
20
|
-
validates :system_account, inclusion: { in: [ true, false ] }
|
21
|
-
validate :system_account_associations
|
22
20
|
|
23
21
|
before_validation :generate_account_number, on: :create
|
24
22
|
before_validation :set_defaults, on: :create
|
25
23
|
|
26
24
|
scope :active_accounts, -> { where(active: true, status: :active) }
|
27
25
|
scope :by_currency, ->(currency) { where(currency: currency) }
|
28
|
-
scope :customer_accounts, -> { where(system_account: false) }
|
29
|
-
scope :system_accounts, -> { where(system_account: true) }
|
30
26
|
|
31
27
|
def sufficient_funds_for_withdrawal?(amount)
|
32
28
|
available_balance - amount >= minimum_balance
|
@@ -88,23 +84,5 @@ module Dscf::Banking
|
|
88
84
|
self.minimum_balance ||= 0
|
89
85
|
self.name ||= "Account Holder"
|
90
86
|
end
|
91
|
-
|
92
|
-
def system_account_associations
|
93
|
-
if system_account?
|
94
|
-
if virtual_account_product.present?
|
95
|
-
errors.add(:virtual_account_product, "must be blank for system accounts")
|
96
|
-
end
|
97
|
-
if application.present?
|
98
|
-
errors.add(:application, "must be blank for system accounts")
|
99
|
-
end
|
100
|
-
else
|
101
|
-
unless virtual_account_product.present?
|
102
|
-
errors.add(:virtual_account_product, "must be present for customer accounts")
|
103
|
-
end
|
104
|
-
unless application.present?
|
105
|
-
errors.add(:application, "must be present for customer accounts")
|
106
|
-
end
|
107
|
-
end
|
108
|
-
end
|
109
87
|
end
|
110
88
|
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/config/routes.rb
CHANGED
@@ -22,18 +22,4 @@ Dscf::Banking::Engine.routes.draw do
|
|
22
22
|
post :reject
|
23
23
|
end
|
24
24
|
end
|
25
|
-
|
26
|
-
resources :transaction_types
|
27
|
-
|
28
|
-
resources :transactions do
|
29
|
-
collection do
|
30
|
-
post :transfer
|
31
|
-
post :deposit
|
32
|
-
post :withdrawal
|
33
|
-
end
|
34
|
-
member do
|
35
|
-
post :cancel
|
36
|
-
get :details
|
37
|
-
end
|
38
|
-
end
|
39
25
|
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/db/migrate/20250831084706_allow_null_virtual_account_product_id_in_product_audit_logs.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
data/lib/dscf/banking/engine.rb
CHANGED
File without changes
|
data/lib/dscf/banking/version.rb
CHANGED
data/lib/dscf/banking.rb
CHANGED
File without changes
|
File without changes
|
@@ -10,7 +10,6 @@ FactoryBot.define do
|
|
10
10
|
minimum_balance { 0 }
|
11
11
|
status { :draft }
|
12
12
|
active { true }
|
13
|
-
system_account { false }
|
14
13
|
account_properties { {} }
|
15
14
|
|
16
15
|
trait :active do
|
@@ -33,33 +32,6 @@ FactoryBot.define do
|
|
33
32
|
available_balance { 1000 }
|
34
33
|
minimum_balance { 100 }
|
35
34
|
end
|
36
|
-
|
37
|
-
trait :system_account do
|
38
|
-
system_account { true }
|
39
|
-
virtual_account_product { nil }
|
40
|
-
application { nil }
|
41
|
-
end
|
42
|
-
|
43
|
-
trait :settlement_account do
|
44
|
-
system_account { true }
|
45
|
-
name { "Core Banking Settlement Account" }
|
46
|
-
virtual_account_product { nil }
|
47
|
-
application { nil }
|
48
|
-
end
|
49
|
-
|
50
|
-
trait :interest_expense_account do
|
51
|
-
system_account { true }
|
52
|
-
name { "Interest Expense Account" }
|
53
|
-
virtual_account_product { nil }
|
54
|
-
application { nil }
|
55
|
-
end
|
56
|
-
|
57
|
-
trait :tax_liability_account do
|
58
|
-
system_account { true }
|
59
|
-
name { "Interest Tax Payable Account" }
|
60
|
-
virtual_account_product { nil }
|
61
|
-
application { nil }
|
62
|
-
end
|
63
35
|
end
|
64
36
|
|
65
37
|
# Alias for shared spec compatibility
|
@@ -4,7 +4,6 @@ FactoryBot.define do
|
|
4
4
|
association :virtual_account_product
|
5
5
|
applicant_type { :individual }
|
6
6
|
status { :draft }
|
7
|
-
sequence(:application_number) { |n| "IND#{Date.current.strftime('%Y%m%d')}#{n.to_s.rjust(4, '0')}" }
|
8
7
|
|
9
8
|
form_data do
|
10
9
|
{
|
@@ -24,7 +23,7 @@ FactoryBot.define do
|
|
24
23
|
|
25
24
|
trait :business do
|
26
25
|
applicant_type { :business }
|
27
|
-
|
26
|
+
application_type { :current }
|
28
27
|
form_data do
|
29
28
|
{
|
30
29
|
business_name: Faker::Company.name,
|
@@ -45,21 +44,21 @@ FactoryBot.define do
|
|
45
44
|
trait :under_review do
|
46
45
|
status { :under_review }
|
47
46
|
submitted_at { 2.days.ago }
|
48
|
-
association :assigned_kyc_officer, factory: :user
|
47
|
+
association :assigned_kyc_officer, factory: [ :user, :dscf_core ]
|
49
48
|
end
|
50
49
|
|
51
50
|
trait :approved do
|
52
51
|
status { :approved }
|
53
52
|
submitted_at { 3.days.ago }
|
54
|
-
association :assigned_kyc_officer, factory: :user
|
55
|
-
association :assigned_branch_manager, factory: :user
|
53
|
+
association :assigned_kyc_officer, factory: [ :user, :dscf_core ]
|
54
|
+
association :assigned_branch_manager, factory: [ :user, :dscf_core ]
|
56
55
|
end
|
57
56
|
|
58
57
|
trait :rejected do
|
59
58
|
status { :rejected }
|
60
59
|
submitted_at { 3.days.ago }
|
61
60
|
rejection_reason { "Incomplete documentation" }
|
62
|
-
association :assigned_kyc_officer, factory: :user
|
61
|
+
association :assigned_kyc_officer, factory: [ :user, :dscf_core ]
|
63
62
|
end
|
64
63
|
end
|
65
64
|
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dscf-banking
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eyosiyas Mekbib
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-09-
|
10
|
+
date: 2025-09-15 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: rails
|
@@ -447,8 +447,6 @@ files:
|
|
447
447
|
- app/controllers/dscf/banking/interest_rate_types_controller.rb
|
448
448
|
- app/controllers/dscf/banking/product_approvals_controller.rb
|
449
449
|
- app/controllers/dscf/banking/product_categories_controller.rb
|
450
|
-
- app/controllers/dscf/banking/transaction_types_controller.rb
|
451
|
-
- app/controllers/dscf/banking/transactions_controller.rb
|
452
450
|
- app/controllers/dscf/banking/virtual_account_products_controller.rb
|
453
451
|
- app/jobs/dscf/banking/application_job.rb
|
454
452
|
- app/mailers/dscf/banking/application_mailer.rb
|
@@ -462,8 +460,6 @@ files:
|
|
462
460
|
- app/models/dscf/banking/product_approval.rb
|
463
461
|
- app/models/dscf/banking/product_audit_log.rb
|
464
462
|
- app/models/dscf/banking/product_category.rb
|
465
|
-
- app/models/dscf/banking/transaction.rb
|
466
|
-
- app/models/dscf/banking/transaction_type.rb
|
467
463
|
- app/models/dscf/banking/virtual_account_product.rb
|
468
464
|
- app/serializers/dscf/banking/account_serializer.rb
|
469
465
|
- app/serializers/dscf/banking/application_serializer.rb
|
@@ -472,14 +468,8 @@ files:
|
|
472
468
|
- app/serializers/dscf/banking/interest_rate_type_serializer.rb
|
473
469
|
- app/serializers/dscf/banking/product_approval_serializer.rb
|
474
470
|
- app/serializers/dscf/banking/product_category_serializer.rb
|
475
|
-
- app/serializers/dscf/banking/transaction_serializer.rb
|
476
|
-
- app/serializers/dscf/banking/transaction_type_serializer.rb
|
477
471
|
- app/serializers/dscf/banking/virtual_account_product_serializer.rb
|
478
472
|
- app/services/dscf/banking/account_creation_service.rb
|
479
|
-
- app/services/dscf/banking/base_transaction_service.rb
|
480
|
-
- app/services/dscf/banking/deposit_service.rb
|
481
|
-
- app/services/dscf/banking/transfer_service.rb
|
482
|
-
- app/services/dscf/banking/withdrawal_service.rb
|
483
473
|
- config/routes.rb
|
484
474
|
- db/migrate/20250830211002_create_dscf_banking_product_categories.rb
|
485
475
|
- db/migrate/20250830211027_create_dscf_banking_interest_rate_types.rb
|
@@ -492,11 +482,6 @@ files:
|
|
492
482
|
- db/migrate/20250831084706_allow_null_virtual_account_product_id_in_product_audit_logs.rb
|
493
483
|
- db/migrate/20250912193134_create_dscf_banking_applications.rb
|
494
484
|
- db/migrate/20250912203527_create_dscf_banking_accounts.rb
|
495
|
-
- db/migrate/20250919084147_add_account_type_to_accounts.rb
|
496
|
-
- db/migrate/20250919084927_make_account_associations_optional.rb
|
497
|
-
- db/migrate/20250919182831_create_dscf_banking_transaction_types.rb
|
498
|
-
- db/migrate/20250919184220_create_dscf_banking_transactions.rb
|
499
|
-
- db/seeds.rb
|
500
485
|
- lib/dscf/banking.rb
|
501
486
|
- lib/dscf/banking/engine.rb
|
502
487
|
- lib/dscf/banking/version.rb
|
@@ -509,8 +494,6 @@ files:
|
|
509
494
|
- spec/factories/dscf/banking/product_approvals.rb
|
510
495
|
- spec/factories/dscf/banking/product_audit_logs.rb
|
511
496
|
- spec/factories/dscf/banking/product_categories.rb
|
512
|
-
- spec/factories/dscf/banking/transaction_types.rb
|
513
|
-
- spec/factories/dscf/banking/transactions.rb
|
514
497
|
- spec/factories/dscf/banking/virtual_account_products.rb
|
515
498
|
homepage: https://mksaddis.com/
|
516
499
|
licenses: []
|
@@ -1,27 +0,0 @@
|
|
1
|
-
module Dscf::Banking
|
2
|
-
class TransactionTypesController < ApplicationController
|
3
|
-
include Dscf::Core::Common
|
4
|
-
|
5
|
-
private
|
6
|
-
|
7
|
-
def model_params
|
8
|
-
params.require(:payload).permit(
|
9
|
-
:code,
|
10
|
-
:name,
|
11
|
-
:description
|
12
|
-
)
|
13
|
-
end
|
14
|
-
|
15
|
-
def eager_loaded_associations
|
16
|
-
[]
|
17
|
-
end
|
18
|
-
|
19
|
-
def allowed_order_columns
|
20
|
-
%w[id code name created_at updated_at]
|
21
|
-
end
|
22
|
-
|
23
|
-
def default_serializer_includes
|
24
|
-
{}
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|