dscf-marketplace 0.13.11 → 0.13.12
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/controllers/dscf/marketplace/sub_suppliers_controller.rb +1 -1
- data/app/models/dscf/marketplace/sub_supplier.rb +11 -7
- data/app/serializers/dscf/marketplace/sub_supplier_serializer.rb +2 -4
- data/db/migrate/20260709000001_remove_supplier_from_dscf_marketplace_sub_suppliers.rb +10 -0
- data/lib/dscf/marketplace/version.rb +1 -1
- data/spec/factories/dscf/marketplace/sub_suppliers.rb +0 -1
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f9046b11415bd21ad907cc8c1c91cbc686c20a1ee190ed05d37e237462bcade4
|
|
4
|
+
data.tar.gz: 4e40a8e77aa18c7c650b8e7eb134834548a6e4d8de414c29f3cbf07336e08f98
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a42817c825294cdf7446c52f1e091b4e808973aba691f07b7d0d8f6e7ebfd51ffc56e2ae3ef58f2ebef15fd3c8e32028e840c878371e50cb21db6d7f8088b693
|
|
7
|
+
data.tar.gz: f73775c91a7bdcf29be33684066f7b3c17a9d21035cd40f8365d7cf18cb400cefe67846abc84fe232a82828e6bbcb289b6db8d8e2e90890befdd9dc23a7bae32
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
module Dscf::Marketplace
|
|
2
2
|
class SubSupplier < ApplicationRecord
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
include Dscf::Marketplace::AttachmentUrls
|
|
4
|
+
|
|
5
|
+
# Sub-suppliers are independent, offline entities the aggregator manages
|
|
6
|
+
# directly — never linked to a Supplier. (Requirements doc: sub-suppliers
|
|
7
|
+
# "don't act directly on the system"; see AggregatorListing#confirming_business.)
|
|
5
8
|
|
|
6
9
|
# Active Storage
|
|
7
10
|
has_one_attached :business_license
|
|
@@ -16,17 +19,18 @@ module Dscf::Marketplace
|
|
|
16
19
|
validates :city, presence: true
|
|
17
20
|
validates :code, presence: true, uniqueness: true
|
|
18
21
|
|
|
19
|
-
# Scopes
|
|
20
|
-
scope :by_supplier, ->(id) { where(supplier_id: id) }
|
|
21
|
-
|
|
22
22
|
# Ransack
|
|
23
23
|
def self.ransackable_attributes(_auth_object = nil)
|
|
24
|
-
%w[id
|
|
24
|
+
%w[id business_name contact_person_name contact_person_phone
|
|
25
25
|
city sub_city woreda code created_at updated_at]
|
|
26
26
|
end
|
|
27
27
|
|
|
28
28
|
def self.ransackable_associations(_auth_object = nil)
|
|
29
|
-
%w[
|
|
29
|
+
%w[business_license_attachment business_license_blob]
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def business_license_url
|
|
33
|
+
attachment_url_for(business_license)
|
|
30
34
|
end
|
|
31
35
|
|
|
32
36
|
private
|
|
@@ -2,13 +2,11 @@ module Dscf
|
|
|
2
2
|
module Marketplace
|
|
3
3
|
class SubSupplierSerializer < ActiveModel::Serializer
|
|
4
4
|
attributes :id, :code, :business_name, :contact_person_name, :contact_person_phone,
|
|
5
|
-
:city, :sub_city, :woreda, :
|
|
5
|
+
:city, :sub_city, :woreda, :business_license_url,
|
|
6
6
|
:created_at, :updated_at
|
|
7
7
|
|
|
8
8
|
def business_license_url
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
Rails.application.routes.url_helpers.rails_storage_proxy_url(object.business_license, only_path: true)
|
|
9
|
+
object.business_license_url
|
|
12
10
|
end
|
|
13
11
|
end
|
|
14
12
|
end
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
class RemoveSupplierFromDscfMarketplaceSubSuppliers < ActiveRecord::Migration[8.0]
|
|
2
|
+
def change
|
|
3
|
+
# Sub-suppliers are never linked to a supplier — that relationship was
|
|
4
|
+
# modeled by mistake; sub-suppliers are independent, offline entities the
|
|
5
|
+
# aggregator manages directly (see AggregatorListing#confirming_business).
|
|
6
|
+
remove_reference :dscf_marketplace_sub_suppliers, :supplier,
|
|
7
|
+
foreign_key: {to_table: :dscf_marketplace_suppliers},
|
|
8
|
+
index: {name: "supplier_on_dm_sub_suppliers_indx"}
|
|
9
|
+
end
|
|
10
|
+
end
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
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.12
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Asrat
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-07-
|
|
10
|
+
date: 2026-07-09 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: rails
|
|
@@ -600,6 +600,7 @@ files:
|
|
|
600
600
|
- db/migrate/20260704000002_create_dscf_marketplace_otp_verifications.rb
|
|
601
601
|
- db/migrate/20260708000001_make_retailer_tin_number_optional.rb
|
|
602
602
|
- db/migrate/20260708000002_make_product_gross_weight_optional.rb
|
|
603
|
+
- db/migrate/20260709000001_remove_supplier_from_dscf_marketplace_sub_suppliers.rb
|
|
603
604
|
- db/seeds.rb
|
|
604
605
|
- lib/dscf/marketplace.rb
|
|
605
606
|
- lib/dscf/marketplace/engine.rb
|