2022-01-10 Pricing Flow: Difference between revisions

From Izara Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[Service Stack - Products]]
[[Service Stack - Products]]


= Filtered List of Sell Offers =
= Filtering Sell Offers by price (complexFilter logical) =


* eg: from Browse Catalog
* Final result expected is a list of sellOfferIds
 
* Original request is sent to sellOffer complexFilter service which uses SellOfferManager service to process Logicals
== SearchResult: sellOffer ==
 
* Final result expected is a list of sellOfferIds and their pricing (eg min or max), along with any other fields wanted
* Original request is sent to sellOffer Search Result service which uses SellOfferManager service to process Logicals and FindData
* Request might originate higher up, eg Product/VariantProduct level, for pricing the sellOffer level is the important start point
* Request might originate higher up, eg Product/VariantProduct level, for pricing the sellOffer level is the important start point
* sellOffer searchType / sellOffer filterType
* sellOffer searchType / sellOffer filterType
* logical/findData types can be maxPrice/minPrice


== Logical: SellOfferManager - sellOffer - maxPrice / minPrice ==
== Logical: SellOfferManager - sellOffer - maxPrice / minPrice ==


* passes on to a sortResult request for sellOffer that has logicalTag = aggregatedSellOfferPrices, sorted by price (ascending)
* passes on to a sortResult request for sellOffer that has sellOffer ComplexFilter with planDeliveryPaymentCombination child complexFilter
* at the end after the sortResult complete message it will perform logical comparison in ProcessLogicalSortedRequest
* requires sorted aggregatedSellOfferPrices so can perform it's comparison
* searchResult requiredData/FindData is "price" fieldname, found after aggregatedSellOfferPrices complexFilter complete
* once aggregatedSellOfferPrices completes triggers ProcessLogicalSortedRequest (set callingFlow = this service's ProcessLogicalSortedRequest), which will trigger SortResult's CopyDataToExternalTable lambda
* CopyDataToExternalTable will copy sellOfferId records to SellOfferManager's LogicalResults table
* SellOfferManager's CompleteLogicalSortedRequest lambda subscribes to sortResult's CopyDataToExternalTableComplete topic, and completes the Logical request
 
== Logical: SellOfferManager - sellOffer - aggregatedSellOfferPrices ==
 
* passes on to sellOffer complexFilter with child complexFilter type planDeliveryPaymentCombination
* we add this step to reduce the number of sellOfferIds that we dig prices combinations for, to only sellOfferIds that have a plan that points to given paymentMethodIds/deliveryMethodIds
* complexFilter will find all unique sellOfferIds that offer requested delivery and payment methods
* complexFilter will find all unique sellOfferIds that offer requested delivery and payment methods
* sellOffer complexFilter passes down to planDeliveryPaymentCombination filterType handled by SellOfferPlan service
* sellOffer complexFilter passes down to planDeliveryPaymentCombination filterType handled by SellOfferPlan service
* sellOffer complexFilter will trigger FindSellOfferFilterComplete lambda (callingFlow = this service's FindSellOfferFilterComplete)
* sellOffer complexFilter will trigger FindSellOfferFilterComplete lambda (callingFlow = this service's FindSellOfferFilterComplete)
* at the end after the sortResult complete message it will perform logical comparison in ProcessLogicalSortedRequest
* searchResult requiredData/FindData fieldName matches logicalTag, this FindData requests finds the aggregated price for each sellOfferId returned from complexFilter
* once sortResult completes triggers ProcessLogicalSortedRequest (set callingFlow = this service's ProcessLogicalSortedRequest), which will trigger SortResult's CopyDataToExternalTable lambda
* CopyDataToExternalTable will perform comparison, then copy sellOfferId results to SellOfferManager's LogicalResults table
* SellOfferManager's CompleteLogicalSortedRequest lambda subscribes to sortResult's CopyDataToExternalTableComplete topic, and completes the Logical request


== Logical: SellOfferPlan - planDeliveryPaymentCombination - planDeliveryPaymentCombination ==
== Logical: SellOfferPlan - planDeliveryPaymentCombination - planDeliveryPaymentCombination ==
Line 39: Line 28:
* queries graph for all sellOfferPlanId + sellOfferPlanDeliveryMethodLinkId + sellOfferPlanPaymentMethodLinkId combinations that match given paymentMethodIds/deliveryMethodIds
* queries graph for all sellOfferPlanId + sellOfferPlanDeliveryMethodLinkId + sellOfferPlanPaymentMethodLinkId combinations that match given paymentMethodIds/deliveryMethodIds
* saves each combination into it's LogicalResultsData table
* saves each combination into it's LogicalResultsData table
* completes it's logical, which completes the planDeliveryPaymentCombination complexFilter which completes the sellOffer complexFilter (after TranslateIds), which triggers SellOfferManager's FindSellOfferFilterComplete lambda
* completes it's logical, which completes the planDeliveryPaymentCombination complexFilter which completes the sellOffer complexFilter (after TranslateIds), which triggers FindData for sellOffer's maxPrice/minPrice


== SellOfferManager - FindSellOfferFilterComplete ==
== FindData: SellOfferManager - sellOffer - maxPrice / minPrice ==


* receives complexFilterComplete message for sellOffer level complexFilter
* one request for each sellOfferId found in above complexFilter
* sellOffer level complexFilter found all unique sellOffers that have planDeliveryPaymentCombination (any combination of given paymentMethodIds/deliveryMethodIds)
* finds all logicalResultMain waiting for this sellOffer complexFilter
* for each logicalResultMain found, send request to CreatePerSellOfferSortedPriceRequests (because next step needs to handle multiple invocations per logicalResultMain)
 
== SellOfferManager - CreatePerSellOfferSortedPriceRequests ==
 
* for one logicalResultMain, iterates all sellOfferIds found in sellOffer-planDeliveryPaymentCombination complexFilter results
* passes on to a sortResult request for orderPrice that has logicalTag = sellOfferQuantityLocationIdCombinations, sorted by price (ascending)
* passes on to a sortResult request for orderPrice that has logicalTag = sellOfferQuantityLocationIdCombinations, sorted by price (ascending)
* for each sellOfferId we need an ordered list of prices that come from the different deliverToLocationIds/paymentMethodIds/deliveryMethodIds combinations
* we need an ordered list of prices for sellOfferId that come from the different deliverToLocationIds/paymentMethodIds/deliveryMethodIds combinations
* searchResult requiredData is "price", will invoke FindData after sellOfferQuantityLocationIdCombinations complexFilter complete
* searchResult requiredData is "price", will invoke FindData after sellOfferQuantityLocationIdCombinations complexFilter complete
* saves each sellOfferQuantityLocationIdCombinations request into AwaitingMultipleStep for the original aggregatedSellOfferPrices logical
* sends sortResult request to SellOfferManager sortResult service
* sends sortResult request to SellOfferManager sortResult service
* once the per sellOffer orderPrice sortResult completes triggers AggregateOneSellOfferPrices for each (set callingFlow = this service's AggregateOneSellOfferPrices)
* awaits sortResult complete then performs aggregation on it (using FindDataSortedRequest standard code) to find the requested max/min value (set callingFlow = this service's ProcessFindDataSortedRequest)


== Logical: SellOfferManager - orderPrice - sellOfferQuantityLocationIdCombinations ==
== Logical: SellOfferManager - orderPrice - sellOfferQuantityLocationIdCombinations ==
Line 71: Line 52:
* this will result in multiple orderPriceIds being created/checked exist for one logicalResultMain
* this will result in multiple orderPriceIds being created/checked exist for one logicalResultMain
* complete each sellOfferQuantityLocationIdCombinations logicalResultMain
* complete each sellOfferQuantityLocationIdCombinations logicalResultMain
* for each sellOfferQuantityLocationIdCombinations logicalResultMain found, the logical complete message will trigger FindData for orderPrice - "price" field (original request created in createPerSellOfferSortedPriceRequests)
* for each sellOfferQuantityLocationIdCombinations logicalResultMain found, the logical complete message will finish the complexFilter and in searchResult will trigger FindData for orderPrice > "price" field (original request created in createPerSellOfferSortedPriceRequests)


== FindData: SellOfferManager - orderPrice - price ==
== FindData: SellOfferManager - orderPrice - price ==
Line 77: Line 58:
* orderPrice record should always exist when entering here, eg created by CreateOrderPriceCombinations
* orderPrice record should always exist when entering here, eg created by CreateOrderPriceCombinations
* finds the sellOffer subtotal for the orderPrice (not delivery/payment method costs yet) and saves into orderPrice record
* finds the sellOffer subtotal for the orderPrice (not delivery/payment method costs yet) and saves into orderPrice record
* passes on to a sorted searchResult request for sellOfferPlanDeliveryMethodLink with fixed dataIds being a list of deliveryMethodLinkIds (no complexFilter), sorted by price (minDeliveryPrice)
* passes on to a sortResult request for sellOfferPlanDeliveryMethodLink with fixed dataIds being a list of deliveryMethodLinkIds (no complexFilter), sorted by price (minDeliveryPrice)
* require minimum DeliveryPrice because there might be multiple locationIds found and we want to use the lowest priced one
* require minimum DeliveryPrice because there might be multiple locationIds found and we want to use the lowest priced one
* searchResult requiredData is "minDeliveryPrice", which is required for the sorting
* searchResult requiredData is "minDeliveryPrice", which is required for the sorting
* once we have the sorted results we actually want the maximum of the (minDeliveryPrice) results, because there might be multiple deliveryMethodLinkIds found in the given sellOfferQuantities, and we want to return the highest priced one
* once we have the sorted results we actually want the maximum of the (minDeliveryPrice) results, because there might be multiple deliveryMethodLinkIds found in the given sellOfferQuantities, and we want to return the highest priced one, do this by saving into createFindDataSortedRequest
* once sellOfferPlanDeliveryMethodLink sorted searchResult completes triggers ProcessFindDataSortedRequest (set callingFlow = this service's ProcessFindDataSortedRequest)
* once sellOfferPlanDeliveryMethodLink sortResult is complete it triggers ProcessFindDataSortedRequest (set callingFlow = this service's ProcessFindDataSortedRequest)


== ProcessFindDataSortedRequest: SellOfferManager - orderPrice - price - sellOfferPlanDeliveryMethodLink ==
== FindData: SellOfferPlan - sellOfferPlanDeliveryMethodLink - minDeliveryPrice ==
 
* will find the lowest delivery price for one sellOfferPlanDeliveryMethodLink
* passes on to sortResult type deliveryMethodRateTable sorted by rate
* when deliveryMethodRateTable sortResult complete will trigger ProcessFindDataSortedRequest which finds the minimum rate and completes the minDeliveryPrice logical (set callingFlow = this service's ProcessFindDataSortedRequest)
 
== Logical: Delivery Method Rate Table - deliveryMethodRateTable - activeSellOfferPlanDeliveryMethodLinkId ==
 
== Logical: Delivery Method Rate Table - deliveryMethodRateTable - deliverToLocationId ==
 
== FindData: Delivery Method Rate Table - deliveryMethodRateTable - rate ==
 
== SellOfferPlan - ProcessFindDataSortedRequest ==
 
* completes the minDeliveryPrice findData by finding the lowest rate
* triggers SellOfferManager's awaiting findData for fieldName "price" in it's ProcessFindDataSortedRequest function, which will find the maximum rate from all deliveryMethodLinkIds sent
 
== SellOfferManager - ProcessFindDataSortedRequest - orderPrice - price - sellOfferPlanDeliveryMethodLink ==


* saves into orderPrice record: deliveryPrice and sellOfferPlanDeliveryMethodLinkId
* saves into orderPrice record: deliveryPrice and sellOfferPlanDeliveryMethodLinkId
* passes on to a sorted searchResult request for sellOfferPlanUserPaymentMethodLink with fixed dataIds being a list of userPaymentMethodLinkIds (no complexFilter), sorted by price (paymentPrice)
* passes on to a sortResult request for sellOfferPlanUserPaymentMethodLink with fixed dataIds being a list of userPaymentMethodLinkIds (no complexFilter), sorted by price (paymentPrice)
* searchResult requiredData is "paymentPrice", which is required for the sorting
* searchResult requiredData is "paymentPrice", which is required for the sorting
* once we have the sorted results we actually want the maximum of the (paymentPrice) results, because there might be multiple userPaymentMethodLinkIds found in the given sellOfferQuantities, and we want to return the highest priced one
* once we have the sorted results we want the maximum of the (paymentPrice) results, because there might be multiple userPaymentMethodLinkIds found in the given sellOfferQuantities, and we want to return the highest priced one
* once sellOfferPlanUserPaymentMethodLink sorted searchResult completes triggers ProcessFindDataSortedRequest (set callingFlow = this service's ProcessFindDataSortedRequest)
* once sellOfferPlanUserPaymentMethodLink sorted searchResult completes triggers ProcessFindDataSortedRequest (set callingFlow = this service's ProcessFindDataSortedRequest)


== ProcessFindDataSortedRequest: SellOfferManager - orderPrice - price - sellOfferPlanUserPaymentMethodLink ==
== FindData: SellOfferPlan - sellOfferPlanUserPaymentMethodLink - paymentPrice ==
 
* completes the paymentPrice findData for each userPaymentMethodLinkIds
* triggers SellOfferManager's awaiting findData for fieldName "price" in it's ProcessFindDataSortedRequest function, which will find the maximum rate from all userPaymentMethodLinkIds sent
 
== SellOfferManager - ProcessFindDataSortedRequest - orderPrice - price - sellOfferPlanUserPaymentMethodLink ==


* saves into orderPrice record: paymentPrice and sellOfferPlanUserPaymentMethodLinkId
* saves into orderPrice record: paymentPrice and sellOfferPlanUserPaymentMethodLinkId
* calculates final orderPrice value  
* calculates final orderPrice value  
* completes the "orderPrice - price" FindData record, this is where one orderPrice is completed
* completes the "orderPrice - price" FindData record, this is where one orderPrice is completed
* FindData records are from the sellOfferQuantityLocationIdCombinations searchResult requests, initiated in CreatePerSellOfferSortedPriceRequests
* FindData records are from the sellOfferQuantityLocationIdCombinations sortResult requests, initiated in sellOffer FindData for maxPrice / minPrice
* each CreatePerSellOfferSortedPriceRequests triggers AwaitingMultipleSteps link created in CreatePerSellOfferSortedPriceRequests but linking to original aggregatedSellOfferPrices logical
* after all "orderPrice - price" are complete for the searchResult, they get sorted in sortResult and the sortResult completes
* each AwaitingMultipleStep triggers AggregateOneSellOffersPrices
* completed sortResult triggers ProcessFindDataSortedRequest for sellOffer - maxPrice / minPrice
 
== SellOfferManager - ProcessFindDataSortedRequest - sellOffer - maxPrice / minPrice ==
 
* finds any maxPrice / minPrice FindData records awaiting sorted orderPrices for one sellOffer
* gets aggregate value and completes found FindData
* once all FindData complete, triggers completion of searchResult and sortResult created in sellOffer maxPrice/minPrice Logical, which triggers SellOfferManager's ProcessLogicalSortedRequest lambda


== SellOfferManager - AggregateOneSellOffersPrices ==
== SellOfferManager - ProcessLogicalSortedRequest - sellOffer - maxPrice / minPrice ==
 
* performs the comparison, saves into LogicalData, completes logicalResult
 
= old - no longer in flow =


* finds all aggregatedSellOfferPrices logicals that match the received sellOffer's sorted prices sellOfferOrderPriceSortedRequest
== SellOfferManager - FindSellOfferFilterComplete ==
* for each logical found find this sellOffer's orderPriceId from SortResult service that matches the requested aggregation
* check any sellOffer AwaitingMultipleSteps remain for aggregatedSellOfferPrices logical, if not complete it
* original maxPricePerSellOffer / minPricePerSellOffer logical created an awaiting step waiting aggregatedSellOfferPrices logical that triggers CompleteLogicalSortedRequest


== SellOfferManager - CompleteLogicalSortedRequest ==
* receives complexFilterComplete message for sellOffer level complexFilter
* sellOffer level complexFilter found all unique sellOffers that have planDeliveryPaymentCombination (any combination of given paymentMethodIds/deliveryMethodIds)
* finds all logicalResultMain waiting for this sellOffer complexFilter
* for each logicalResultMain found, send request to CreatePerSellOfferSortedPriceRequests (because next step needs to handle multiple invocations per logicalResultMain)


* performs maxPricePerSellOffer / minPricePerSellOffer logical's comparison and completes that logical
== SellOfferManager - CreatePerSellOfferSortedPriceRequests ==


== aggregatedSellOfferPrices logical complete ==
* for one logicalResultMain, iterates all sellOfferIds found in sellOffer-planDeliveryPaymentCombination complexFilter results
* passes on to a sortResult request for orderPrice that has logicalTag = sellOfferQuantityLocationIdCombinations, sorted by price (ascending)
* for each sellOfferId we need an ordered list of prices that come from the different deliverToLocationIds/paymentMethodIds/deliveryMethodIds combinations
* searchResult requiredData is "price", will invoke FindData after sellOfferQuantityLocationIdCombinations complexFilter complete
* saves each sellOfferQuantityLocationIdCombinations request into AwaitingMultipleStep for the original aggregatedSellOfferPrices logical
* sends sortResult request to SellOfferManager sortResult service
* once the per sellOffer orderPrice sortResult completes triggers AggregateOneSellOffersPrices for each (set callingFlow = this service's AggregateOneSellOffersPrices)


* completed aggregatedSellOfferPrices logical will pass back to the aggregatedOrderPriceSortedRequest SearchResult initiated in "SellOfferManager - orderPrice - maxPricePerSellOffer / minPricePerSellOffer" logical
* SearchResult triggers FindData field "price"


== FindData: SellOfferManager - orderPrice - price ==
== SellOfferManager - AggregateOneSellOffersPrices ==


* will find cached result in FindData table for the recorded orderPriceId, or will re-calculate if FindData expired
* finds all aggregatedSellOfferPrices logicals that match the received sellOffer's sorted prices sellOfferOrderPriceSortedRequest
* after all FindData for maxPricePerSellOffer / minPricePerSellOffer logical is complete will trigger ProcessLogicalSortedRequest which will perform the comparison and trigger CompleteLogicalSortedRequest to complete the logical
* for each logical found find this sellOffer's aggregated orderPriceId from SortResult service > FindAggregatedValue, matching the logical's aggregation
* check any sellOffer AwaitingMultipleSteps remain for aggregatedSellOfferPrices logical, if not complete it
* completed aggregatedSellOfferPrices logical will trigger CompleteLogicalSortedRequest for original maxPrice / minPrice logical


== SellOfferManager - CompleteLogicalSortedRequest ==


* performs maxPrice / minPrice logical's comparison on the per sellOffer aggregated price, and completes that logical
* also works for orderPrice type maxPricePerSellOffer / minPricePerSellOffer logicals


[[Category:Working documents| 2022-01-10]]
[[Category:Working documents| 2022-01-10]]
[[Category:Working documents - Service Stack - Products| 2022-01-10]]
[[Category:Working documents - Service Stack - Products| 2022-01-10]]

Latest revision as of 03:25, 5 April 2023

Service Stack - Products

Filtering Sell Offers by price (complexFilter logical)

  • Final result expected is a list of sellOfferIds
  • Original request is sent to sellOffer complexFilter service which uses SellOfferManager service to process Logicals
  • Request might originate higher up, eg Product/VariantProduct level, for pricing the sellOffer level is the important start point
  • sellOffer searchType / sellOffer filterType

Logical: SellOfferManager - sellOffer - maxPrice / minPrice

  • passes on to a sortResult request for sellOffer that has sellOffer ComplexFilter with planDeliveryPaymentCombination child complexFilter
  • complexFilter will find all unique sellOfferIds that offer requested delivery and payment methods
  • sellOffer complexFilter passes down to planDeliveryPaymentCombination filterType handled by SellOfferPlan service
  • sellOffer complexFilter will trigger FindSellOfferFilterComplete lambda (callingFlow = this service's FindSellOfferFilterComplete)
  • at the end after the sortResult complete message it will perform logical comparison in ProcessLogicalSortedRequest
  • searchResult requiredData/FindData fieldName matches logicalTag, this FindData requests finds the aggregated price for each sellOfferId returned from complexFilter
  • once sortResult completes triggers ProcessLogicalSortedRequest (set callingFlow = this service's ProcessLogicalSortedRequest), which will trigger SortResult's CopyDataToExternalTable lambda
  • CopyDataToExternalTable will perform comparison, then copy sellOfferId results to SellOfferManager's LogicalResults table
  • SellOfferManager's CompleteLogicalSortedRequest lambda subscribes to sortResult's CopyDataToExternalTableComplete topic, and completes the Logical request

Logical: SellOfferPlan - planDeliveryPaymentCombination - planDeliveryPaymentCombination

  • invokes sellOfferPlan's FindPlanDeliveryPaymentCombinations lambda

sellOfferPlan - FindPlanDeliveryPaymentCombinations

  • queries graph for all sellOfferPlanId + sellOfferPlanDeliveryMethodLinkId + sellOfferPlanPaymentMethodLinkId combinations that match given paymentMethodIds/deliveryMethodIds
  • saves each combination into it's LogicalResultsData table
  • completes it's logical, which completes the planDeliveryPaymentCombination complexFilter which completes the sellOffer complexFilter (after TranslateIds), which triggers FindData for sellOffer's maxPrice/minPrice

FindData: SellOfferManager - sellOffer - maxPrice / minPrice

  • one request for each sellOfferId found in above complexFilter
  • passes on to a sortResult request for orderPrice that has logicalTag = sellOfferQuantityLocationIdCombinations, sorted by price (ascending)
  • we need an ordered list of prices for sellOfferId that come from the different deliverToLocationIds/paymentMethodIds/deliveryMethodIds combinations
  • searchResult requiredData is "price", will invoke FindData after sellOfferQuantityLocationIdCombinations complexFilter complete
  • sends sortResult request to SellOfferManager sortResult service
  • awaits sortResult complete then performs aggregation on it (using FindDataSortedRequest standard code) to find the requested max/min value (set callingFlow = this service's ProcessFindDataSortedRequest)

Logical: SellOfferManager - orderPrice - sellOfferQuantityLocationIdCombinations

  • passes on to planDeliveryPaymentCombination complexFilter, finding all combinations for only the requested sellOfferId
  • will use the same results as aggregatedSellOfferPrices for the planDeliveryPaymentCombination logicalTag
  • once planDeliveryPaymentCombination complexFilter complete triggers SellOfferManager - CreateOrderPriceCombinations (set callingFlow = this service's CreateOrderPriceCombinations)

SellOfferManager - CreateOrderPriceCombinations

  • find all logicalResultMains (ie: sellOfferId+orderQuantity+deliverToLocationIds+deliveryMethodIds+paymentMethodIds+excludeEmpty request) that are waiting for this sellOfferId+planDeliveryPaymentCombination filter (initiated in sellOfferQuantityLocationIdCombinations logical)
  • for each logicalResultMain's planDeliveryPaymentCombination, iterate the logicalResultMain's deliverToLocationIds to create orderPriceId
  • make sure an orderPrice record exists for the calculated orderPriceId
  • this will result in multiple orderPriceIds being created/checked exist for one logicalResultMain
  • complete each sellOfferQuantityLocationIdCombinations logicalResultMain
  • for each sellOfferQuantityLocationIdCombinations logicalResultMain found, the logical complete message will finish the complexFilter and in searchResult will trigger FindData for orderPrice > "price" field (original request created in createPerSellOfferSortedPriceRequests)

FindData: SellOfferManager - orderPrice - price

  • orderPrice record should always exist when entering here, eg created by CreateOrderPriceCombinations
  • finds the sellOffer subtotal for the orderPrice (not delivery/payment method costs yet) and saves into orderPrice record
  • passes on to a sortResult request for sellOfferPlanDeliveryMethodLink with fixed dataIds being a list of deliveryMethodLinkIds (no complexFilter), sorted by price (minDeliveryPrice)
  • require minimum DeliveryPrice because there might be multiple locationIds found and we want to use the lowest priced one
  • searchResult requiredData is "minDeliveryPrice", which is required for the sorting
  • once we have the sorted results we actually want the maximum of the (minDeliveryPrice) results, because there might be multiple deliveryMethodLinkIds found in the given sellOfferQuantities, and we want to return the highest priced one, do this by saving into createFindDataSortedRequest
  • once sellOfferPlanDeliveryMethodLink sortResult is complete it triggers ProcessFindDataSortedRequest (set callingFlow = this service's ProcessFindDataSortedRequest)

FindData: SellOfferPlan - sellOfferPlanDeliveryMethodLink - minDeliveryPrice

  • will find the lowest delivery price for one sellOfferPlanDeliveryMethodLink
  • passes on to sortResult type deliveryMethodRateTable sorted by rate
  • when deliveryMethodRateTable sortResult complete will trigger ProcessFindDataSortedRequest which finds the minimum rate and completes the minDeliveryPrice logical (set callingFlow = this service's ProcessFindDataSortedRequest)

Logical: Delivery Method Rate Table - deliveryMethodRateTable - activeSellOfferPlanDeliveryMethodLinkId

Logical: Delivery Method Rate Table - deliveryMethodRateTable - deliverToLocationId

FindData: Delivery Method Rate Table - deliveryMethodRateTable - rate

SellOfferPlan - ProcessFindDataSortedRequest

  • completes the minDeliveryPrice findData by finding the lowest rate
  • triggers SellOfferManager's awaiting findData for fieldName "price" in it's ProcessFindDataSortedRequest function, which will find the maximum rate from all deliveryMethodLinkIds sent

SellOfferManager - ProcessFindDataSortedRequest - orderPrice - price - sellOfferPlanDeliveryMethodLink

  • saves into orderPrice record: deliveryPrice and sellOfferPlanDeliveryMethodLinkId
  • passes on to a sortResult request for sellOfferPlanUserPaymentMethodLink with fixed dataIds being a list of userPaymentMethodLinkIds (no complexFilter), sorted by price (paymentPrice)
  • searchResult requiredData is "paymentPrice", which is required for the sorting
  • once we have the sorted results we want the maximum of the (paymentPrice) results, because there might be multiple userPaymentMethodLinkIds found in the given sellOfferQuantities, and we want to return the highest priced one
  • once sellOfferPlanUserPaymentMethodLink sorted searchResult completes triggers ProcessFindDataSortedRequest (set callingFlow = this service's ProcessFindDataSortedRequest)

FindData: SellOfferPlan - sellOfferPlanUserPaymentMethodLink - paymentPrice

  • completes the paymentPrice findData for each userPaymentMethodLinkIds
  • triggers SellOfferManager's awaiting findData for fieldName "price" in it's ProcessFindDataSortedRequest function, which will find the maximum rate from all userPaymentMethodLinkIds sent

SellOfferManager - ProcessFindDataSortedRequest - orderPrice - price - sellOfferPlanUserPaymentMethodLink

  • saves into orderPrice record: paymentPrice and sellOfferPlanUserPaymentMethodLinkId
  • calculates final orderPrice value
  • completes the "orderPrice - price" FindData record, this is where one orderPrice is completed
  • FindData records are from the sellOfferQuantityLocationIdCombinations sortResult requests, initiated in sellOffer FindData for maxPrice / minPrice
  • after all "orderPrice - price" are complete for the searchResult, they get sorted in sortResult and the sortResult completes
  • completed sortResult triggers ProcessFindDataSortedRequest for sellOffer - maxPrice / minPrice

SellOfferManager - ProcessFindDataSortedRequest - sellOffer - maxPrice / minPrice

  • finds any maxPrice / minPrice FindData records awaiting sorted orderPrices for one sellOffer
  • gets aggregate value and completes found FindData
  • once all FindData complete, triggers completion of searchResult and sortResult created in sellOffer maxPrice/minPrice Logical, which triggers SellOfferManager's ProcessLogicalSortedRequest lambda

SellOfferManager - ProcessLogicalSortedRequest - sellOffer - maxPrice / minPrice

  • performs the comparison, saves into LogicalData, completes logicalResult

old - no longer in flow

SellOfferManager - FindSellOfferFilterComplete

  • receives complexFilterComplete message for sellOffer level complexFilter
  • sellOffer level complexFilter found all unique sellOffers that have planDeliveryPaymentCombination (any combination of given paymentMethodIds/deliveryMethodIds)
  • finds all logicalResultMain waiting for this sellOffer complexFilter
  • for each logicalResultMain found, send request to CreatePerSellOfferSortedPriceRequests (because next step needs to handle multiple invocations per logicalResultMain)

SellOfferManager - CreatePerSellOfferSortedPriceRequests

  • for one logicalResultMain, iterates all sellOfferIds found in sellOffer-planDeliveryPaymentCombination complexFilter results
  • passes on to a sortResult request for orderPrice that has logicalTag = sellOfferQuantityLocationIdCombinations, sorted by price (ascending)
  • for each sellOfferId we need an ordered list of prices that come from the different deliverToLocationIds/paymentMethodIds/deliveryMethodIds combinations
  • searchResult requiredData is "price", will invoke FindData after sellOfferQuantityLocationIdCombinations complexFilter complete
  • saves each sellOfferQuantityLocationIdCombinations request into AwaitingMultipleStep for the original aggregatedSellOfferPrices logical
  • sends sortResult request to SellOfferManager sortResult service
  • once the per sellOffer orderPrice sortResult completes triggers AggregateOneSellOffersPrices for each (set callingFlow = this service's AggregateOneSellOffersPrices)


SellOfferManager - AggregateOneSellOffersPrices

  • finds all aggregatedSellOfferPrices logicals that match the received sellOffer's sorted prices sellOfferOrderPriceSortedRequest
  • for each logical found find this sellOffer's aggregated orderPriceId from SortResult service > FindAggregatedValue, matching the logical's aggregation
  • check any sellOffer AwaitingMultipleSteps remain for aggregatedSellOfferPrices logical, if not complete it
  • completed aggregatedSellOfferPrices logical will trigger CompleteLogicalSortedRequest for original maxPrice / minPrice logical

SellOfferManager - CompleteLogicalSortedRequest

  • performs maxPrice / minPrice logical's comparison on the per sellOffer aggregated price, and completes that logical
  • also works for orderPrice type maxPricePerSellOffer / minPricePerSellOffer logicals