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: ac67a4d6ccac52aad74574a62d841183717112bad1c093526a9b9966421a4747
4
- data.tar.gz: e11523f30c6f601d8bad9f14c271a8077354d79e21c3a23bb991779f8c8f8cf7
3
+ metadata.gz: 02ad82c5c180b78f7d7e6dd9fa99ad4f9d085fada05a9458d4f808dc4786589c
4
+ data.tar.gz: c2f9f253a2c90b0efd917f1479272bac714761e97a502eaaccc453b1cf57bfb4
5
5
  SHA512:
6
- metadata.gz: 3468066de76f24decf7c547c0eb3b28044607082b64163251d667f3f8754adad9e47d2a0dfb99f91d93dd07c0595ad01e7dc896d77d222b9b4c25cfcf3598188
7
- data.tar.gz: 88a186edeb669c7d90fda622a7c5a4835d4479f1d80064d926cbd396ed09c800efb3da3cb34ddd3e67b0269cc81ef6bc8d7454456b6cc5b5e3bf3805d8df48f4
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
- listing_id = item_params[:listing_id] || model_params[:listing_id]
466
- listing_type = item_params[:listing_type] || model_params[:listing_type]
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
@@ -1,5 +1,5 @@
1
1
  module Dscf
2
2
  module Marketplace
3
- VERSION = "0.13.5".freeze
3
+ VERSION = "0.13.6".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dscf-marketplace
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.5
4
+ version: 0.13.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Asrat