dscf-marketplace 0.2.9 → 0.2.91
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: 22865efb806819a9ccf9e8f3dadd3c64e7debf775582f4631733588320be35de
|
4
|
+
data.tar.gz: bb48c879c14dda629bda997a5b5cdef2ed8f9ee3ba33b782266b476fd4fdccc3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ebdbc4d233a4fa62b7e84e4798b23037e06ceece680244f71b20c518dca76c443e86d0898a941be1be99cc98a7405622e04f39e42ca6036e20093fb7d974cb2e
|
7
|
+
data.tar.gz: 31113ba05dc8eb004d58de5ca4198a9164fe4f2e74e5a03e713436050bef7fe5bb85a94554ded1eb112a995eb90b704efc9cf9203acf37a647646b527ff74421
|
@@ -61,7 +61,7 @@ module Dscf
|
|
61
61
|
|
62
62
|
def default_serializer_includes
|
63
63
|
{
|
64
|
-
index: [ :user, :ordered_by, :ordered_to, :quotation, :
|
64
|
+
index: [ :user, :ordered_by, :ordered_to, :quotation, order_items: [:product] ],
|
65
65
|
show: [ :user, :ordered_by, :ordered_to, :quotation, :listing, :delivery_order, :order_items ],
|
66
66
|
create: [ :user, :ordered_by, :ordered_to, :quotation, :listing ],
|
67
67
|
update: [ :user, :ordered_by, :ordered_to, :quotation, :listing ]
|
@@ -2,6 +2,8 @@ module Dscf::Marketplace
|
|
2
2
|
class OrderItem < ApplicationRecord
|
3
3
|
enum :status, {pending: 0, confirmed: 1, processing: 2, fulfilled: 3, cancelled: 4}
|
4
4
|
|
5
|
+
delegate :name, :description, :thumbnail_url, :images_urls, to: :product, allow_nil: true
|
6
|
+
|
5
7
|
belongs_to :order, optional: true
|
6
8
|
belongs_to :quotation_item, optional: true
|
7
9
|
belongs_to :listing, optional: true
|
@@ -32,6 +34,14 @@ module Dscf::Marketplace
|
|
32
34
|
product&.name
|
33
35
|
end
|
34
36
|
|
37
|
+
def product_thumbnail_url
|
38
|
+
product&.thumbnail_url
|
39
|
+
end
|
40
|
+
|
41
|
+
def product_images_urls
|
42
|
+
product&.images_urls
|
43
|
+
end
|
44
|
+
|
35
45
|
def unit_name
|
36
46
|
unit&.name
|
37
47
|
end
|
@@ -4,7 +4,7 @@ module Dscf
|
|
4
4
|
attributes :id, :order_id, :quotation_item_id, :listing_id,
|
5
5
|
:product_id, :unit_id, :quantity, :unit_price,
|
6
6
|
:status, :created_at, :updated_at,
|
7
|
-
:subtotal, :product_name, :unit_name
|
7
|
+
:subtotal, :product_name, :unit_name, :thumbnail_url, :images_urls
|
8
8
|
|
9
9
|
belongs_to :order
|
10
10
|
belongs_to :quotation_item
|