dscf-marketplace 0.13.5 → 0.13.6
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: 02ad82c5c180b78f7d7e6dd9fa99ad4f9d085fada05a9458d4f808dc4786589c
|
|
4
|
+
data.tar.gz: c2f9f253a2c90b0efd917f1479272bac714761e97a502eaaccc453b1cf57bfb4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fa26ea6d381ac3736aae27cb6cd1664629d39a6683524a5266ca8555cbe7c348c0d2c6c642cb1fe32cdfcb017f031091d8c6a07e146e8f7142ca319c83d5bc02
|
|
7
|
+
data.tar.gz: 5906f2d82f237f21a0038c2c2304a4455faeb46982fc5fb9779675796e75feb5f08f3a0584784b978a0ab159f439722a1c2c506f28d08c43ed9bf6f60096d193
|
|
@@ -462,8 +462,19 @@ module Dscf
|
|
|
462
462
|
end
|
|
463
463
|
|
|
464
464
|
items_params.map do |item_params|
|
|
465
|
-
|
|
466
|
-
|
|
465
|
+
# The mobile app names each aggregator-feed line by its polymorphic
|
|
466
|
+
# source (source_id + source_type: "Dscf::Marketplace::AggregatorListing")
|
|
467
|
+
# rather than listing_id/listing_type. Treat that as the listing
|
|
468
|
+
# reference — it identifies WHICH AggregatorListing; the final
|
|
469
|
+
# OrderItem.source is still re-derived per source_kind at build time.
|
|
470
|
+
agg_by_source = item_params[:source_type].to_s == "Dscf::Marketplace::AggregatorListing" &&
|
|
471
|
+
item_params[:source_id].present?
|
|
472
|
+
listing_id = item_params[:listing_id].presence ||
|
|
473
|
+
(agg_by_source ? item_params[:source_id] : nil) ||
|
|
474
|
+
model_params[:listing_id]
|
|
475
|
+
listing_type = item_params[:listing_type].presence ||
|
|
476
|
+
(agg_by_source ? "AggregatorListing" : nil) ||
|
|
477
|
+
model_params[:listing_type]
|
|
467
478
|
quantity = item_params[:quantity].to_i
|
|
468
479
|
|
|
469
480
|
if quantity <= 0
|
|
@@ -572,7 +583,7 @@ module Dscf
|
|
|
572
583
|
:quotation_id, :listing_id, :user_id, :ordered_by_id, :ordered_to_id, :delivery_order_id, :dropoff_address_id,
|
|
573
584
|
:order_type, :status, :fulfillment_type, :payment_method, :received_bank_name, :transaction_reference, :listing_type,
|
|
574
585
|
:agent_id, :retailer_id,
|
|
575
|
-
order_items_attributes: [ :id, :quotation_item_id, :listing_id, :listing_type, :product_id, :unit_id, :quantity, :unit_price, :status, :_destroy ]
|
|
586
|
+
order_items_attributes: [ :id, :quotation_item_id, :listing_id, :listing_type, :source_id, :source_type, :product_id, :unit_id, :quantity, :unit_price, :status, :_destroy ]
|
|
576
587
|
)
|
|
577
588
|
@model_params[:payment_method] = normalize_payment_method(@model_params[:payment_method]) if @model_params.key?(:payment_method)
|
|
578
589
|
@model_params
|