dscf-credit 0.4.55 → 0.4.56
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/db/seeds.rb +31 -0
- data/lib/dscf/credit/version.rb +1 -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: 4bcd4921c638c87e3e338d719bd993f8bc85cdd6bb79dd4f851ae22af6a51b35
|
|
4
|
+
data.tar.gz: 04caed6c06626e1994fd53f3d9344fc1ddf1573a9fa2a424f6d006700a81eedb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 70283c3783f0e65ca4f1855db5f019cf21b68ec5a6d80426ff84b7a38639c15ebcf1ecc04af3df0847d0def9f0675ccaf7d6dfdbbe44b948e362bf029c9a099f
|
|
7
|
+
data.tar.gz: 7dda7607f319c8e7a30786c77940d3d10c2505138e8dbe59b5dbd973ae9eb51d2a477402668f590812415431f4faa56d511af624ed3f3de9b970467e2d8faafc
|
data/db/seeds.rb
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
puts "Starting minimal DSCF Credit seed..."
|
|
2
2
|
|
|
3
|
+
puts "Seeding business types..."
|
|
4
|
+
if defined?(Dscf::Core::BusinessType)
|
|
5
|
+
wholesaler = Dscf::Core::BusinessType.find_or_create_by(name: 'wholesaler')
|
|
6
|
+
puts "✓ Business types created/found"
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
|
|
3
10
|
puts "Registering dscf_credit permissions..."
|
|
4
11
|
if defined?(Dscf::Core::PermissionRegistry)
|
|
5
12
|
Dscf::Core::PermissionRegistry.register("dscf_credit") do
|
|
@@ -83,5 +90,29 @@ bunna_bank = Dscf::Credit::Bank.find_or_create_by!(registration_number: 'BUN001'
|
|
|
83
90
|
bank.status = 'active'
|
|
84
91
|
end
|
|
85
92
|
|
|
93
|
+
bunna_head_office = Dscf::Credit::BankBranch.find_or_create_by(bank: bunna_bank, branch_name: 'Head Office') do |branch|
|
|
94
|
+
branch.branch_code = 'BUN-HO-001'
|
|
95
|
+
branch.branch_address = 'Churchill Avenue, Addis Ababa'
|
|
96
|
+
branch.city = 'Addis Ababa'
|
|
97
|
+
branch.country = 'Ethiopia'
|
|
98
|
+
branch.contact_email = 'headoffice@bunnabank.com'
|
|
99
|
+
branch.contact_phone = '+251115510001'
|
|
100
|
+
branch.status = 'active'
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
if defined?(Dscf::Core::Business) && defined?(Dscf::Core::BusinessType)
|
|
104
|
+
business1 = Dscf::Core::Business.find_or_create_by(
|
|
105
|
+
user_id: admin_user.id,
|
|
106
|
+
business_type_id: wholesaler.id
|
|
107
|
+
) do |business|
|
|
108
|
+
business.name = 'Individual Trading Business'
|
|
109
|
+
business.description = 'Individual business for trading services'
|
|
110
|
+
business.contact_email = admin_user.email
|
|
111
|
+
business.contact_phone = admin_user.phone
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
puts "✓ Businesses created/found"
|
|
115
|
+
end
|
|
116
|
+
|
|
86
117
|
puts "✓ Bank created/found: #{bunna_bank.name}"
|
|
87
118
|
puts "Minimal seed completed successfully."
|
data/lib/dscf/credit/version.rb
CHANGED