dscf-marketplace 0.13.9 → 0.13.10
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/dscf/marketplace/product.rb +2 -1
- data/app/models/dscf/marketplace/retailer.rb +1 -1
- data/db/migrate/20260708000001_make_retailer_tin_number_optional.rb +5 -0
- data/db/migrate/20260708000002_make_product_gross_weight_optional.rb +13 -0
- data/lib/dscf/marketplace/version.rb +1 -1
- metadata +3 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2ceef3327d3d9ce4e71a2b412bc95c909aef51e1fc86a3b9888035473825ffb5
|
|
4
|
+
data.tar.gz: 5f326b8b1ead9bdf266ee04ac629961ebd3f9f4aa615c310058c70b48b2765a4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: afa2ef1d16856d57808dc61721c6d1c56384d5c5b9a1d58d81aa263c5dd2a60bcd1ef57c4f32d4e3d0107e79cc0046adb1d057ed3a491964eebe2c1670b79e21
|
|
7
|
+
data.tar.gz: b8d4a631aa5917d4eb0cee9facd1daeaf8c8db6af9fd0b699268ca9f4a1d92293215d20466c4cd3778d1467b4f6f73c8884da6fd52c492db05e070a04c2dedd0
|
|
@@ -17,7 +17,8 @@ module Dscf
|
|
|
17
17
|
validates :name, presence: true, length: {maximum: 200}
|
|
18
18
|
validates :description, length: {maximum: 2000}, allow_blank: true
|
|
19
19
|
validates :category_id, presence: true
|
|
20
|
-
|
|
20
|
+
# Weight is optional; when provided it must be positive.
|
|
21
|
+
validates :gross_weight, numericality: {greater_than: 0}, allow_nil: true
|
|
21
22
|
validates :business_only, inclusion: {in: [ true, false ]}
|
|
22
23
|
validates :unit_id, presence: true
|
|
23
24
|
validates :base_quantity, presence: true, numericality: {greater_than: 0}
|
|
@@ -10,7 +10,7 @@ module Dscf::Marketplace
|
|
|
10
10
|
# Validations
|
|
11
11
|
validates :name, presence: true
|
|
12
12
|
validates :phone, presence: true
|
|
13
|
-
|
|
13
|
+
# TIN is optional — retailers onboarded in the field may not have one yet.
|
|
14
14
|
validates :location, presence: true
|
|
15
15
|
|
|
16
16
|
# Scopes
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
class MakeProductGrossWeightOptional < ActiveRecord::Migration[8.0]
|
|
2
|
+
def up
|
|
3
|
+
# Weight is optional; drop the NOT NULL + 0.0 default so an unset weight
|
|
4
|
+
# stores NULL ("unknown") rather than a misleading 0.0.
|
|
5
|
+
change_column_null :dscf_marketplace_products, :gross_weight, true
|
|
6
|
+
change_column_default :dscf_marketplace_products, :gross_weight, from: 0.0, to: nil
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def down
|
|
10
|
+
change_column_default :dscf_marketplace_products, :gross_weight, from: nil, to: 0.0
|
|
11
|
+
change_column_null :dscf_marketplace_products, :gross_weight, false, 0.0
|
|
12
|
+
end
|
|
13
|
+
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: dscf-marketplace
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.13.
|
|
4
|
+
version: 0.13.10
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Asrat
|
|
@@ -597,6 +597,8 @@ files:
|
|
|
597
597
|
- db/migrate/20260703000001_add_supplier_adjustment_to_dscf_marketplace_order_items.rb
|
|
598
598
|
- db/migrate/20260704000001_add_agent_id_to_dscf_marketplace_orders.rb
|
|
599
599
|
- db/migrate/20260704000002_create_dscf_marketplace_otp_verifications.rb
|
|
600
|
+
- db/migrate/20260708000001_make_retailer_tin_number_optional.rb
|
|
601
|
+
- db/migrate/20260708000002_make_product_gross_weight_optional.rb
|
|
600
602
|
- db/seeds.rb
|
|
601
603
|
- lib/dscf/marketplace.rb
|
|
602
604
|
- lib/dscf/marketplace/engine.rb
|