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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b0c5dd9f86381fa5a9881c4ff42d64ce9769d47702af8bd4ea3ea448afa402b2
4
- data.tar.gz: fed2e5bb4a5b9577a2c8738f1f17668ba0a042d4ad902c6246cee1b67d215673
3
+ metadata.gz: 79299c565b95d752a61eb45769bba9294e6a284f1a8476e78a34c583257306cb
4
+ data.tar.gz: 82e9ad70c8f0d8484b4537d4a8313511fc2ecda0c77d5007e4550f1be0688a20
5
5
  SHA512:
6
- metadata.gz: 5ed58866255c8c02096178d9b0dccc9d776600898c2cc075355a53315766ab1f803bf6f8d81a69bad24b8030c964288c4e1d61251784d00809c89a1a0cb1bbb6
7
- data.tar.gz: f8be33122c9402d9a16c7269ff9b980c45a2dcaad00f7c94005542581f7bf07b44c7b486b217e83fe91267010e093d7a6c491fa6664723d5feccf1e5dc8d3b47
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
@@ -4,6 +4,7 @@ module Bscf
4
4
  has_secure_password
5
5
 
6
6
  has_one :user_profile
7
+ has_one :user_role
7
8
  has_many :user_roles
8
9
  has_many :roles, through: :user_roles
9
10
 
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Bscf
2
2
  module Core
3
- VERSION = "0.2.3"
3
+ VERSION = "0.2.5"
4
4
  end
5
5
  end
data/lib/bscf/core.rb CHANGED
@@ -1,5 +1,9 @@
1
1
  require "bscf/core/version"
2
2
  require "bscf/core/engine"
3
+ require "jwt"
4
+ require "active_model_serializers"
5
+ require "ancestry"
6
+ require "ransack"
3
7
 
4
8
  module Bscf
5
9
  module Core
@@ -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.3
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-29 00:00:00.000000000 Z
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