dscf-marketplace 0.2.0 → 0.2.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 70190000bbbdf144579c8e6c27608664b18a4a8460ac43350f9dc1162c355b0a
|
4
|
+
data.tar.gz: 1e661035af4d825af27418bf07a7342eaa641d39ea6e20fd1cc62dd64aecbd75
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a1fb37f55cd3d15a6a89098f435dd8f7797748440dff0f68aac15be45a92c1e3b7807ef2307013846cdab795153a8b956fdc50eaa569424a9ec88695f77763e
|
7
|
+
data.tar.gz: a18369805514a3d9d24562ada719551baf8e06621a5bb5b806afafd900f8245dbdc16568f6514ec77953055c6faece98fa937961ba05a28d9c8aaed853393828
|
@@ -0,0 +1,34 @@
|
|
1
|
+
module Dscf
|
2
|
+
module Marketplace
|
3
|
+
class BusinessesController < ApplicationController
|
4
|
+
include Dscf::Core::Common
|
5
|
+
|
6
|
+
def has_business
|
7
|
+
has_business = current_user&.businesses&.exists? || false
|
8
|
+
render_success("business.success.has_business_check", data: {has_business: has_business})
|
9
|
+
end
|
10
|
+
|
11
|
+
private
|
12
|
+
|
13
|
+
def model_params
|
14
|
+
params.require(:business).permit(
|
15
|
+
:name, :description, :contact_email, :contact_phone, :tin_number,
|
16
|
+
:business_type_id, :user_id
|
17
|
+
)
|
18
|
+
end
|
19
|
+
|
20
|
+
def eager_loaded_associations
|
21
|
+
[ :business_type, :user ]
|
22
|
+
end
|
23
|
+
|
24
|
+
def default_serializer_includes
|
25
|
+
{
|
26
|
+
index: [ :business_type, :user ],
|
27
|
+
show: [ :business_type, :user ],
|
28
|
+
create: [ :business_type, :user ],
|
29
|
+
update: [ :business_type, :user ]
|
30
|
+
}
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module Dscf
|
2
|
+
module Marketplace
|
3
|
+
class BusinessSerializer < ActiveModel::Serializer
|
4
|
+
attributes :id, :name, :description, :contact_email, :contact_phone,
|
5
|
+
:tin_number, :created_at, :updated_at
|
6
|
+
|
7
|
+
belongs_to :business_type
|
8
|
+
belongs_to :user
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
data/config/locales/en.yml
CHANGED
@@ -241,6 +241,18 @@ en:
|
|
241
241
|
update: "Failed to update delivery vehicle"
|
242
242
|
destroy: "Failed to delete delivery vehicle"
|
243
243
|
|
244
|
+
# Authentication
|
245
|
+
auth:
|
246
|
+
success:
|
247
|
+
otp_sent: "OTP sent successfully"
|
248
|
+
errors:
|
249
|
+
invalid_fin: "Invalid FIN number"
|
250
|
+
|
251
|
+
# Business
|
252
|
+
business:
|
253
|
+
success:
|
254
|
+
has_business_check: "Business check completed successfully"
|
255
|
+
|
244
256
|
# Global fallback messages
|
245
257
|
operations:
|
246
258
|
success:
|
data/config/routes.rb
CHANGED
@@ -16,6 +16,12 @@ Dscf::Marketplace::Engine.routes.draw do
|
|
16
16
|
|
17
17
|
resources :unit_conversions
|
18
18
|
|
19
|
+
resources :businesses do
|
20
|
+
collection do
|
21
|
+
get "has_business"
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
19
25
|
# Trading Models
|
20
26
|
resources :supplier_products do
|
21
27
|
resources :listings, only: [ :index ]
|
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.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Asrat
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-09-
|
10
|
+
date: 2025-09-02 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: rails
|
@@ -417,6 +417,7 @@ files:
|
|
417
417
|
- MIT-LICENSE
|
418
418
|
- Rakefile
|
419
419
|
- app/controllers/dscf/marketplace/application_controller.rb
|
420
|
+
- app/controllers/dscf/marketplace/businesses_controller.rb
|
420
421
|
- app/controllers/dscf/marketplace/categories_controller.rb
|
421
422
|
- app/controllers/dscf/marketplace/delivery_order_items_controller.rb
|
422
423
|
- app/controllers/dscf/marketplace/delivery_orders_controller.rb
|
@@ -450,6 +451,7 @@ files:
|
|
450
451
|
- app/models/dscf/marketplace/supplier_product.rb
|
451
452
|
- app/models/dscf/marketplace/unit.rb
|
452
453
|
- app/models/dscf/marketplace/unit_conversion.rb
|
454
|
+
- app/serializers/dscf/marketplace/business_serializer.rb
|
453
455
|
- app/serializers/dscf/marketplace/category_serializer.rb
|
454
456
|
- app/serializers/dscf/marketplace/delivery_order_item_serializer.rb
|
455
457
|
- app/serializers/dscf/marketplace/delivery_order_serializer.rb
|