bscf-core 0.2.3 → 0.2.5
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/bscf/core/marketplace_listing.rb +14 -0
- data/app/models/bscf/core/user.rb +1 -0
- data/db/migrate/20250331113323_create_bscf_core_marketplace_listings.rb +16 -0
- data/lib/bscf/core/version.rb +1 -1
- data/lib/bscf/core.rb +4 -0
- data/spec/factories/bscf/core/marketplace_listings.rb +12 -0
- metadata +6 -3
- /data/db/migrate/{20250326081052_create_bscf_core_addresses.rb → 20250326080052_create_bscf_core_addresses.rb} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 79299c565b95d752a61eb45769bba9294e6a284f1a8476e78a34c583257306cb
|
4
|
+
data.tar.gz: 82e9ad70c8f0d8484b4537d4a8313511fc2ecda0c77d5007e4550f1be0688a20
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6674ad3f059ef2afaa9befa0b4bb6005475f93a826ddcf4189383a5d8bfbfda87fda04b15833965044d2eeb10485e06fe3e531480de2ccdfc33c7fb9aaf2516
|
7
|
+
data.tar.gz: 23e05ad117d361ea39fbfbf5626e837921223efe9c7fdf52e3eba8ea4cc289962736a8670ba18da7325a244f70878b3a3bde5d66158166dc6c4ebe631706c0f7
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module Bscf
|
2
|
+
module Core
|
3
|
+
class MarketplaceListing < ApplicationRecord
|
4
|
+
belongs_to :user
|
5
|
+
belongs_to :address
|
6
|
+
|
7
|
+
validates :listing_type, :status, :is_active, presence: true
|
8
|
+
|
9
|
+
enum :listing_type, { buy: 0, sell: 1 }
|
10
|
+
enum :status, { open: 0, partially_matched: 1, matched: 2, completed: 3, cancelled: 4 }
|
11
|
+
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class CreateBscfCoreMarketplaceListings < ActiveRecord::Migration[8.0]
|
2
|
+
def change
|
3
|
+
create_table :bscf_core_marketplace_listings do |t|
|
4
|
+
t.references :user, null: false, foreign_key: {to_table: :bscf_core_users}
|
5
|
+
t.integer :listing_type, null: false
|
6
|
+
t.integer :status, null: false
|
7
|
+
t.boolean :allow_partial_match, null: false, default: false
|
8
|
+
t.datetime :preferred_delivery_date
|
9
|
+
t.datetime :expires_at
|
10
|
+
t.boolean :is_active, default: true
|
11
|
+
t.references :address, null: false, foreign_key: {to_table: :bscf_core_addresses}
|
12
|
+
|
13
|
+
t.timestamps
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
data/lib/bscf/core/version.rb
CHANGED
data/lib/bscf/core.rb
CHANGED
@@ -0,0 +1,12 @@
|
|
1
|
+
FactoryBot.define do
|
2
|
+
factory :marketplace_listing, class: 'Bscf::Core::MarketplaceListing' do
|
3
|
+
user
|
4
|
+
listing_type { 1 }
|
5
|
+
allow_partial_match { false }
|
6
|
+
preferred_delivery_date { DateTime.now.advance(days: 7) }
|
7
|
+
expires_at { DateTime.now.advance(days: 5) }
|
8
|
+
is_active { true }
|
9
|
+
status { 1 }
|
10
|
+
address
|
11
|
+
end
|
12
|
+
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bscf-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Asrat
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-03-
|
10
|
+
date: 2025-03-31 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: active_model_serializers
|
@@ -290,6 +290,7 @@ files:
|
|
290
290
|
- app/models/bscf/core/application_record.rb
|
291
291
|
- app/models/bscf/core/business.rb
|
292
292
|
- app/models/bscf/core/category.rb
|
293
|
+
- app/models/bscf/core/marketplace_listing.rb
|
293
294
|
- app/models/bscf/core/order.rb
|
294
295
|
- app/models/bscf/core/order_item.rb
|
295
296
|
- app/models/bscf/core/product.rb
|
@@ -308,8 +309,8 @@ files:
|
|
308
309
|
- config/routes.rb
|
309
310
|
- db/migrate/20250326065606_create_bscf_core_users.rb
|
310
311
|
- db/migrate/20250326075111_create_bscf_core_roles.rb
|
312
|
+
- db/migrate/20250326080052_create_bscf_core_addresses.rb
|
311
313
|
- db/migrate/20250326080646_create_bscf_core_user_profiles.rb
|
312
|
-
- db/migrate/20250326081052_create_bscf_core_addresses.rb
|
313
314
|
- db/migrate/20250326084233_create_bscf_core_user_roles.rb
|
314
315
|
- db/migrate/20250326085741_create_bscf_core_virtual_accounts.rb
|
315
316
|
- db/migrate/20250326103305_create_bscf_core_categories.rb
|
@@ -322,6 +323,7 @@ files:
|
|
322
323
|
- db/migrate/20250327044020_create_bscf_core_quotation_items.rb
|
323
324
|
- db/migrate/20250327102217_create_bscf_core_orders.rb
|
324
325
|
- db/migrate/20250327112412_create_bscf_core_order_items.rb
|
326
|
+
- db/migrate/20250331113323_create_bscf_core_marketplace_listings.rb
|
325
327
|
- lib/bscf/core.rb
|
326
328
|
- lib/bscf/core/engine.rb
|
327
329
|
- lib/bscf/core/version.rb
|
@@ -330,6 +332,7 @@ files:
|
|
330
332
|
- spec/factories/bscf/core/addresses.rb
|
331
333
|
- spec/factories/bscf/core/businesses.rb
|
332
334
|
- spec/factories/bscf/core/categories.rb
|
335
|
+
- spec/factories/bscf/core/marketplace_listings.rb
|
333
336
|
- spec/factories/bscf/core/order_items.rb
|
334
337
|
- spec/factories/bscf/core/orders.rb
|
335
338
|
- spec/factories/bscf/core/products.rb
|
File without changes
|