dscf-marketplace 0.4.7 → 0.4.8
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/businesses_controller.rb +32 -5
- data/app/serializers/dscf/marketplace/business_serializer.rb +3 -0
- data/config/locales/en.yml +10 -0
- data/config/routes.rb +6 -0
- data/lib/dscf/marketplace/engine.rb +5 -0
- data/lib/dscf/marketplace/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c5da4085e2caadf1df71f943d67cece2c0c71321ba45e7238240e27cddbf8732
|
4
|
+
data.tar.gz: 295de7880f4419b2f9a427159f58fcea661cbac0421a8524196cfd18a91eba13
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '04868324b3b929dcfab8299522ffff93a2c527d30b3bfea8f1aa6dfed5890d8ca5f9e4536ad8434e872e71a07239643ae1727ad65db65ce161c84e27b28e4fe3'
|
7
|
+
data.tar.gz: 0570f0c836854f909616af623f4b7660f641852bc1f68f6de1a325ff1ee1c56347500d068b03ac100846619a8e0eb5aebd4a279bf6ef33e4d2dce6b0fd1351c3
|
@@ -2,6 +2,9 @@ module Dscf
|
|
2
2
|
module Marketplace
|
3
3
|
class BusinessesController < ApplicationController
|
4
4
|
include Dscf::Core::Common
|
5
|
+
include Dscf::Core::ReviewableController
|
6
|
+
|
7
|
+
reviewable_model Dscf::Core::Business
|
5
8
|
|
6
9
|
def has_business
|
7
10
|
has_business = current_user&.businesses&.exists? || false
|
@@ -54,17 +57,41 @@ module Dscf
|
|
54
57
|
end
|
55
58
|
|
56
59
|
def eager_loaded_associations
|
57
|
-
[
|
60
|
+
[
|
61
|
+
:business_type, :user, :documents,
|
62
|
+
reviews: {reviewed_by: :user}
|
63
|
+
]
|
58
64
|
end
|
59
65
|
|
60
66
|
def default_serializer_includes
|
61
67
|
{
|
62
|
-
index: [
|
63
|
-
|
64
|
-
|
65
|
-
|
68
|
+
index: [
|
69
|
+
:business_type, :user, :documents,
|
70
|
+
reviews: {reviewed_by: :user}
|
71
|
+
],
|
72
|
+
show: [
|
73
|
+
:business_type, :user, :documents,
|
74
|
+
reviews: {reviewed_by: :user}
|
75
|
+
],
|
76
|
+
create: [ :business_type, :user, :documents, :reviews ],
|
77
|
+
update: [
|
78
|
+
:business_type, :user, :documents,
|
79
|
+
reviews: {reviewed_by: :user}
|
80
|
+
]
|
66
81
|
}
|
67
82
|
end
|
83
|
+
|
84
|
+
def allowed_order_columns
|
85
|
+
%w[id name description contact_email contact_phone tin_number created_at updated_at]
|
86
|
+
end
|
87
|
+
|
88
|
+
def render_success(message = nil, data: nil, serializer_options: {}, status: :ok)
|
89
|
+
if data.is_a?(Dscf::Core::Business) && data.respond_to?(:reviews)
|
90
|
+
includes = default_serializer_includes[:show] || []
|
91
|
+
serializer_options = serializer_options.merge(include: includes)
|
92
|
+
end
|
93
|
+
super
|
94
|
+
end
|
68
95
|
end
|
69
96
|
end
|
70
97
|
end
|
data/config/locales/en.yml
CHANGED
@@ -353,12 +353,22 @@ en:
|
|
353
353
|
create: "Business created successfully"
|
354
354
|
update: "Business updated successfully"
|
355
355
|
destroy: "Business deleted successfully"
|
356
|
+
# ✅ ADD: Review actions
|
357
|
+
approve: "Business approved successfully"
|
358
|
+
reject: "Business rejected successfully"
|
359
|
+
request_modification: "Modification requested for business successfully"
|
360
|
+
resubmit: "Business resubmitted successfully"
|
356
361
|
errors:
|
357
362
|
index: "Failed to retrieve businesses"
|
358
363
|
show: "Failed to retrieve business details"
|
359
364
|
create: "Failed to create business"
|
360
365
|
update: "Failed to update business"
|
361
366
|
destroy: "Failed to delete business"
|
367
|
+
# ✅ ADD: Review action errors
|
368
|
+
approve: "Failed to approve business"
|
369
|
+
reject: "Failed to reject business"
|
370
|
+
request_modification: "Failed to request modification for business"
|
371
|
+
resubmit: "Failed to resubmit business"
|
362
372
|
|
363
373
|
businesses:
|
364
374
|
success:
|
data/config/routes.rb
CHANGED
@@ -20,6 +20,11 @@ module Dscf
|
|
20
20
|
end
|
21
21
|
|
22
22
|
require "active_storage/engine"
|
23
|
+
|
24
|
+
# Extend core Business model with ReviewableModel for review workflow
|
25
|
+
config.to_prepare do
|
26
|
+
Dscf::Core::Business.include Dscf::Core::ReviewableModel if defined?(Dscf::Core::Business)
|
27
|
+
end
|
23
28
|
end
|
24
29
|
end
|
25
30
|
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.4.
|
4
|
+
version: 0.4.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Asrat
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-10-
|
10
|
+
date: 2025-10-09 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: rails
|