snf_core 0.2.1 → 0.2.2

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: b148e772bedfc2369e9eb125c9e752f3f7519cb1ac47e5c365416e45fe549796
4
- data.tar.gz: 1bbb2accd13bc2f00ae5f4b6e55061ea54d47f563a99811c2594be72f4efb4c7
3
+ metadata.gz: 107c2b4bcb53bb8c967d74d387c25cbb51b25fa6dec1f37c30d9ccee1d81eee9
4
+ data.tar.gz: 7263a0d543014d4e588ba7b876f872bbdb0b5c2b506d8fd3981a9eabd42f1fd4
5
5
  SHA512:
6
- metadata.gz: 06a09af28f6ea76d7e2ccdf0ec82b620e0108fae243b399d734400cd37ff76f81acb7b44c64445dc4fa8988109fe8fc2a8203ccd90bd404d9e0e2d1a44b8ca3d
7
- data.tar.gz: e2650005be78578265bbbaaea8690d68efd8f1f87f63defef03554dbb36d95b79dd129b7c86897d95deac52250095d2ed95d0a24f545916797c50084db77d602
6
+ metadata.gz: c823bad5b8a31a97018a7a76bbc111300ac7883baa72aafd7f61ea2edf318c6f8c04ff561ed206cfafb870ef0efcb37103de9b911422aa379941caf95d372d13
7
+ data.tar.gz: 7ac8229fa5264eb80f1f60c61da558d0f769329422b6b494061df772ddff3344071eef5bd11ff498d64393681be27e6399c04a2d5cbd4d6f687826c76da8745c
@@ -3,19 +3,19 @@ module SnfCore
3
3
  belongs_to :store
4
4
  belongs_to :product
5
5
 
6
- validates :stock_quantity, presence: true, numericality: {
7
- only_integer: true,
8
- greater_than_or_equal_to: 0
6
+ enum :status, {
7
+ available: 0,
8
+ unavailable: 1
9
9
  }
10
+
11
+ validates :status, presence: true
12
+
10
13
  validates :base_price, presence: true, numericality: {
11
14
  greater_than_or_equal_to: 0
12
15
  }
13
16
 
14
17
  validate :unique_store_product_combination
15
18
 
16
- scope :out_of_stock, -> { where(stock_quantity: 0) }
17
- scope :in_stock, -> { where("stock_quantity > 0") }
18
-
19
19
  private
20
20
 
21
21
  def unique_store_product_combination
@@ -0,0 +1,7 @@
1
+ class ModifyStoreInventories < ActiveRecord::Migration[8.0]
2
+ def change
3
+ remove_column :snf_core_store_inventories, :stock_quantity, :integer
4
+
5
+ add_column :snf_core_store_inventories, :status, :integer, default: 0, null: false
6
+ end
7
+ end
@@ -1,3 +1,3 @@
1
1
  module SnfCore
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snf_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Asrat
@@ -312,15 +312,16 @@ files:
312
312
  - db/migrate/20250226192104_create_snf_core_groups.rb
313
313
  - db/migrate/20250226193938_create_snf_core_customer_groups.rb
314
314
  - db/migrate/20250227075048_create_snf_core_wallets.rb
315
+ - db/migrate/20250227102833_modify_store_inventories.rb
315
316
  - lib/snf_core.rb
316
317
  - lib/snf_core/engine.rb
317
318
  - lib/snf_core/version.rb
318
319
  - lib/tasks/snf_core_tasks.rake
319
- homepage: https://www.mks.com
320
+ homepage: https://mksaddis.com/
320
321
  licenses:
321
322
  - MIT
322
323
  metadata:
323
- homepage_uri: https://www.mks.com
324
+ homepage_uri: https://mksaddis.com/
324
325
  source_code_uri: https://github.com/BITS-DEVSEC
325
326
  changelog_uri: https://github.com/BITS-DEVSEC
326
327
  rdoc_options: []