snf_core 0.1.2 → 0.2.0
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/models/snf_core/address.rb +6 -0
- data/app/models/snf_core/business.rb +11 -0
- data/app/models/snf_core/business_document.rb +12 -0
- data/app/models/snf_core/customer_group.rb +6 -0
- data/app/models/snf_core/group.rb +7 -0
- data/app/models/snf_core/product.rb +11 -0
- data/app/models/snf_core/store.rb +10 -0
- data/app/models/snf_core/store_inventory.rb +6 -0
- data/db/migrate/20250226080323_create_snf_core_businesses.rb +14 -0
- data/db/migrate/20250226102931_create_snf_core_business_documents.rb +14 -0
- data/db/migrate/20250226110217_create_snf_core_addresses.rb +14 -0
- data/db/migrate/20250226115215_create_snf_core_stores.rb +13 -0
- data/db/migrate/20250226181007_create_snf_core_products.rb +13 -0
- data/db/migrate/20250226190655_create_snf_core_store_inventories.rb +13 -0
- data/db/migrate/20250226192104_create_snf_core_groups.rb +10 -0
- data/db/migrate/20250226193938_create_snf_core_customer_groups.rb +13 -0
- data/lib/snf_core/engine.rb +2 -0
- data/lib/snf_core/version.rb +1 -1
- metadata +18 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 122d529289ccf8b90e6254c1f8aed2c1171fe41fdbf94c40ba2c64d026693586
|
4
|
+
data.tar.gz: d6543e1461630e153501892f2209b34d5960332f0aaaace71d837a32a4f8f923
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec7bef961a04963418783f211a3c8c3658c517de69e9ad00412be8b9e0e7c6073420c3ce54ffac1ff38f2ad6546a3aca9e5b649579abbb712601a6cb1cea27c5
|
7
|
+
data.tar.gz: 55a71a7e898c8965fb50df6c10ec2c88409585ed1cc0e9049d89e32cc263d84cb545f98e540eb391c8c7f5d9e2c813c5114bd4ebf4c5ab2d6d6624b515426784
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module SnfCore
|
2
|
+
class Business < ApplicationRecord
|
3
|
+
belongs_to :user
|
4
|
+
|
5
|
+
validates :business_name, :tin_number, :business_type, :verification_status, presence: true
|
6
|
+
validates :tin_number, uniqueness: true
|
7
|
+
|
8
|
+
enum :business_type, { retailer: 0, wholesaler: 1 }
|
9
|
+
enum :verification_status, { pending: 0, approved: 1, rejected: 2 }
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module SnfCore
|
2
|
+
class BusinessDocument < ApplicationRecord
|
3
|
+
belongs_to :business
|
4
|
+
belongs_to :verified_by, class_name: "SnfCore::User", optional: true
|
5
|
+
|
6
|
+
enum :document_type, { business_license: 0, representative_id: 1 }
|
7
|
+
|
8
|
+
has_one_attached :document
|
9
|
+
|
10
|
+
validates :document_type, :uploaded_at, :document, presence: true
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class CreateSnfCoreBusinesses < ActiveRecord::Migration[8.0]
|
2
|
+
def change
|
3
|
+
create_table :snf_core_businesses do |t|
|
4
|
+
t.references :user, null: false, foreign_key: { to_table: :snf_core_users }
|
5
|
+
t.string :business_name, null: false
|
6
|
+
t.string :tin_number, null: false
|
7
|
+
t.integer :business_type, null: false
|
8
|
+
t.datetime :verified_at
|
9
|
+
t.integer :verification_status, null: false
|
10
|
+
|
11
|
+
t.timestamps
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class CreateSnfCoreBusinessDocuments < ActiveRecord::Migration[8.0]
|
2
|
+
def change
|
3
|
+
create_table :snf_core_business_documents do |t|
|
4
|
+
t.references :business, null: false, foreign_key: { to_table: :snf_core_businesses }
|
5
|
+
t.integer :document_type, null: false
|
6
|
+
t.datetime :verified_at
|
7
|
+
t.references :verified_by, foreign_key: { to_table: :snf_core_users }, null: true
|
8
|
+
t.datetime :uploaded_at
|
9
|
+
t.boolean :is_verified, null: false, default: false
|
10
|
+
|
11
|
+
t.timestamps
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class CreateSnfCoreAddresses < ActiveRecord::Migration[8.0]
|
2
|
+
def change
|
3
|
+
create_table :snf_core_addresses do |t|
|
4
|
+
t.string :address_type, null: false
|
5
|
+
t.string :city, null: false
|
6
|
+
t.string :sub_city, null: false
|
7
|
+
t.string :woreda
|
8
|
+
t.decimal :latitude, null: false
|
9
|
+
t.decimal :longitude, null: false
|
10
|
+
|
11
|
+
t.timestamps
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
class CreateSnfCoreStores < ActiveRecord::Migration[8.0]
|
2
|
+
def change
|
3
|
+
create_table :snf_core_stores do |t|
|
4
|
+
t.string :name, null: false
|
5
|
+
t.string :email
|
6
|
+
t.integer :operational_status, null: false, default: 1
|
7
|
+
t.references :business, null: false, foreign_key: { to_table: :snf_core_businesses }
|
8
|
+
t.references :address, null: false, foreign_key: { to_table: :snf_core_addresses }
|
9
|
+
|
10
|
+
t.timestamps
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
class CreateSnfCoreProducts < ActiveRecord::Migration[8.0]
|
2
|
+
def change
|
3
|
+
create_table :snf_core_products do |t|
|
4
|
+
t.string :sku, null: false
|
5
|
+
t.string :name, null: false
|
6
|
+
t.string :description
|
7
|
+
t.references :category, null: false, foreign_key: { to_table: :snf_core_categories }
|
8
|
+
t.float :base_price
|
9
|
+
|
10
|
+
t.timestamps
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
class CreateSnfCoreStoreInventories < ActiveRecord::Migration[8.0]
|
2
|
+
def change
|
3
|
+
create_table :snf_core_store_inventories do |t|
|
4
|
+
t.string :stock_quantity
|
5
|
+
t.float :reorder_level
|
6
|
+
t.datetime :last_restocked_at
|
7
|
+
t.references :store, null: false, foreign_key: { to_table: :snf_core_stores }
|
8
|
+
t.references :product, null: false, foreign_key: { to_table: :snf_core_products }
|
9
|
+
|
10
|
+
t.timestamps
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
class CreateSnfCoreGroups < ActiveRecord::Migration[8.0]
|
2
|
+
def change
|
3
|
+
create_table :snf_core_groups do |t|
|
4
|
+
t.string :name, null: false
|
5
|
+
t.references :business, null: false, foreign_key: { to_table: :snf_core_businesses }
|
6
|
+
|
7
|
+
t.timestamps
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
class CreateSnfCoreCustomerGroups < ActiveRecord::Migration[8.0]
|
2
|
+
def change
|
3
|
+
create_table :snf_core_customer_groups do |t|
|
4
|
+
t.string :discount_code
|
5
|
+
t.datetime :expire_date
|
6
|
+
t.boolean :is_used
|
7
|
+
t.references :group, null: false, foreign_key: { to_table: :snf_core_groups }
|
8
|
+
t.references :customer, null: false, foreign_key: { to_table: :snf_core_users }
|
9
|
+
|
10
|
+
t.timestamps
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
data/lib/snf_core/engine.rb
CHANGED
data/lib/snf_core/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: snf_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Asrat
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-02-
|
10
|
+
date: 2025-02-27 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: active_model_serializers
|
@@ -288,12 +288,28 @@ files:
|
|
288
288
|
- app/controllers/snf_core/application_controller.rb
|
289
289
|
- app/jobs/snf_core/application_job.rb
|
290
290
|
- app/mailers/snf_core/application_mailer.rb
|
291
|
+
- app/models/snf_core/address.rb
|
291
292
|
- app/models/snf_core/application_record.rb
|
293
|
+
- app/models/snf_core/business.rb
|
294
|
+
- app/models/snf_core/business_document.rb
|
292
295
|
- app/models/snf_core/category.rb
|
296
|
+
- app/models/snf_core/customer_group.rb
|
297
|
+
- app/models/snf_core/group.rb
|
298
|
+
- app/models/snf_core/product.rb
|
299
|
+
- app/models/snf_core/store.rb
|
300
|
+
- app/models/snf_core/store_inventory.rb
|
293
301
|
- app/models/snf_core/user.rb
|
294
302
|
- config/routes.rb
|
295
303
|
- db/migrate/20250226042622_create_snf_core_users.rb
|
296
304
|
- db/migrate/20250226064444_create_snf_core_categories.rb
|
305
|
+
- db/migrate/20250226080323_create_snf_core_businesses.rb
|
306
|
+
- db/migrate/20250226102931_create_snf_core_business_documents.rb
|
307
|
+
- db/migrate/20250226110217_create_snf_core_addresses.rb
|
308
|
+
- db/migrate/20250226115215_create_snf_core_stores.rb
|
309
|
+
- db/migrate/20250226181007_create_snf_core_products.rb
|
310
|
+
- db/migrate/20250226190655_create_snf_core_store_inventories.rb
|
311
|
+
- db/migrate/20250226192104_create_snf_core_groups.rb
|
312
|
+
- db/migrate/20250226193938_create_snf_core_customer_groups.rb
|
297
313
|
- lib/snf_core.rb
|
298
314
|
- lib/snf_core/engine.rb
|
299
315
|
- lib/snf_core/version.rb
|