dscf-marketplace 0.8.6 → 0.8.7
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/application_controller.rb +2 -5
- data/app/controllers/dscf/marketplace/retailers_controller.rb +2 -0
- data/app/controllers/dscf/marketplace/suppliers_controller.rb +2 -0
- data/app/policies/dscf/marketplace/retailer_policy.rb +33 -0
- data/db/seeds.rb +1 -0
- data/lib/dscf/marketplace/engine.rb +34 -0
- data/lib/dscf/marketplace/version.rb +1 -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: 8e791e3a5f71157ea4ae7cb2c108ab41ef68ebbefed8af758b11515c740c5881
|
|
4
|
+
data.tar.gz: aeac37e4a2e5992c961f23ddd4cd6c35fa7870606c09aa673ba6f7f78cb74271
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6cfb90e904ddc2b9ae3c0fad6852b04b9dd850bf523899d622c0ec9dbfa7b014969d8917629a56346e279aaa32c8df857458f19847de1e0bc8cd3e2be1713bb2
|
|
7
|
+
data.tar.gz: 82b526e8864c0aabd0e32f092e889eaae0c26a29888fee70c246e188dec83649b4a411f56de499a1e062c78bbf61c6174be9ea9433e58ec595b1d85885f90fdd
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
module Dscf
|
|
2
2
|
module Marketplace
|
|
3
|
-
class ApplicationController <
|
|
4
|
-
|
|
5
|
-
include Dscf::Core::JsonResponse
|
|
6
|
-
before_action :authenticate_user
|
|
7
|
-
before_action :demo_bypass_permissions!
|
|
3
|
+
class ApplicationController < Dscf::Core::ApplicationController
|
|
4
|
+
before_action :demo_bypass_permissions!, prepend: true
|
|
8
5
|
|
|
9
6
|
# TEMPORARY DEMO BYPASS:
|
|
10
7
|
# Bypass marketplace authorization checks for authenticated users only.
|
|
@@ -2,6 +2,7 @@ module Dscf
|
|
|
2
2
|
module Marketplace
|
|
3
3
|
class RetailersController < ApplicationController
|
|
4
4
|
include Dscf::Core::Common
|
|
5
|
+
include Dscf::Core::RoleAssignable
|
|
5
6
|
|
|
6
7
|
skip_before_action :authenticate_user, only: [ :register ]
|
|
7
8
|
|
|
@@ -22,6 +23,7 @@ module Dscf
|
|
|
22
23
|
)
|
|
23
24
|
|
|
24
25
|
user.save!
|
|
26
|
+
assign_default_role(user)
|
|
25
27
|
retailer.save!
|
|
26
28
|
|
|
27
29
|
render_success("retailers.success.register", data: retailer, status: :created)
|
|
@@ -2,6 +2,7 @@ module Dscf
|
|
|
2
2
|
module Marketplace
|
|
3
3
|
class SuppliersController < ApplicationController
|
|
4
4
|
include Dscf::Core::Common
|
|
5
|
+
include Dscf::Core::RoleAssignable
|
|
5
6
|
|
|
6
7
|
skip_before_action :authenticate_user, only: :register
|
|
7
8
|
|
|
@@ -16,6 +17,7 @@ module Dscf
|
|
|
16
17
|
password_confirmation: params[:password_confirmation],
|
|
17
18
|
temp_password: true
|
|
18
19
|
)
|
|
20
|
+
assign_default_role(user)
|
|
19
21
|
|
|
20
22
|
business_type = Dscf::Core::BusinessType.find_or_create_by!(name: "Supplier")
|
|
21
23
|
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
module Dscf
|
|
2
|
+
module Marketplace
|
|
3
|
+
class RetailerPolicy < Dscf::Core::ApplicationPolicy
|
|
4
|
+
def register?
|
|
5
|
+
true
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
def index?
|
|
9
|
+
user.present?
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def show?
|
|
13
|
+
user.present?
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def my_retailers?
|
|
17
|
+
user.present?
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def create?
|
|
21
|
+
user.present?
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def update?
|
|
25
|
+
user.present?
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def destroy?
|
|
29
|
+
user.super_admin?
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
data/db/seeds.rb
CHANGED
|
@@ -22,6 +22,7 @@ Dscf::Core::PermissionRegistry.register("dscf-marketplace") do
|
|
|
22
22
|
resource :delivery_vehicles, actions: %i[index show create update destroy]
|
|
23
23
|
resource :locations, actions: %i[get_location]
|
|
24
24
|
resource :agents, actions: %i[index show create update destroy register]
|
|
25
|
+
resource :retailers, actions: %i[index show create update destroy register my_retailers]
|
|
25
26
|
resource :dashboard, actions: %i[summary]
|
|
26
27
|
end
|
|
27
28
|
|
|
@@ -19,6 +19,40 @@ module Dscf
|
|
|
19
19
|
app.config.paths["db/migrate"].concat(core_engine.config.paths["db/migrate"].expanded) unless app.root.to_s.match(root.to_s + File::SEPARATOR)
|
|
20
20
|
end
|
|
21
21
|
|
|
22
|
+
initializer "dscf_marketplace.register_permissions", after: :load_config_initializers do
|
|
23
|
+
config.after_initialize do
|
|
24
|
+
if defined?(Dscf::Core::PermissionRegistry)
|
|
25
|
+
Dscf::Core::PermissionRegistry.register("dscf-marketplace") do
|
|
26
|
+
resource :categories, actions: %i[index show create update destroy subcategories]
|
|
27
|
+
resource :products, actions: %i[index show create update destroy filter supplier_products]
|
|
28
|
+
resource :units, actions: %i[index show create update destroy]
|
|
29
|
+
resource :unit_conversions, actions: %i[index show create update destroy]
|
|
30
|
+
resource :supplier_products, actions: %i[index show create update destroy my_products]
|
|
31
|
+
resource :listings, actions: %i[index show create update destroy activate pause sold_out my_listings listings_by_supplier]
|
|
32
|
+
resource :request_for_quotations, actions: %i[index show create update destroy send_rfq close respond my_rfqs filter]
|
|
33
|
+
resource :rfq_items, actions: %i[index show create update destroy]
|
|
34
|
+
resource :quotations, actions: %i[index show create update destroy accept reject send_quotation my_quotes filter]
|
|
35
|
+
resource :quotation_items, actions: %i[index show create update destroy]
|
|
36
|
+
resource :orders, actions: %i[index show create update destroy confirm cancel complete my_orders filter]
|
|
37
|
+
resource :order_items, actions: %i[index show create update destroy]
|
|
38
|
+
resource :delivery_orders, actions: %i[
|
|
39
|
+
index show create update destroy pickup start_delivery complete_delivery mark_failed accept summary
|
|
40
|
+
my_driver_deliveries filter convert_orders
|
|
41
|
+
]
|
|
42
|
+
resource :delivery_stops, actions: %i[index show create update destroy verify]
|
|
43
|
+
resource :delivery_order_items, actions: %i[index show create update destroy receiver_confirm report_issue dispute_delivery]
|
|
44
|
+
resource :delivery_vehicles, actions: %i[index show create update destroy]
|
|
45
|
+
resource :locations, actions: %i[get_location]
|
|
46
|
+
resource :agents, actions: %i[index show create update destroy register]
|
|
47
|
+
resource :retailers, actions: %i[index show create update destroy register my_retailers]
|
|
48
|
+
resource :dashboard, actions: %i[summary]
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
rescue ActiveRecord::NoDatabaseError, ActiveRecord::StatementInvalid
|
|
52
|
+
# Skip during db:create or db:migrate
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
|
|
22
56
|
require "active_storage/engine"
|
|
23
57
|
end
|
|
24
58
|
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.8.
|
|
4
|
+
version: 0.8.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Asrat
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-06-
|
|
10
|
+
date: 2026-06-17 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: rails
|
|
@@ -489,6 +489,7 @@ files:
|
|
|
489
489
|
- app/policies/dscf/marketplace/quotation_item_policy.rb
|
|
490
490
|
- app/policies/dscf/marketplace/quotation_policy.rb
|
|
491
491
|
- app/policies/dscf/marketplace/request_for_quotation_policy.rb
|
|
492
|
+
- app/policies/dscf/marketplace/retailer_policy.rb
|
|
492
493
|
- app/policies/dscf/marketplace/rfq_item_policy.rb
|
|
493
494
|
- app/policies/dscf/marketplace/supplier_policy.rb
|
|
494
495
|
- app/policies/dscf/marketplace/supplier_product_policy.rb
|