2024-11-17 - SearchResult linkPath combination step

From Izara Wiki
Revision as of 00:01, 25 November 2024 by Sven the Barbarian (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Service - Search Results

Overview

Allow multiple ComplexFilterResultMainIds to be calculated then passed to a later stage of the Link Path where all combinations of the ComplexFilter results are performed against that step.

Idea

LinkStep sets complexFilterCombinations property, is an array of ComplexFilter requests, multiple objTypes is ok.

ComplexFilters are calculated for each parent id entering the linkPath step that has the complexFilterCombinations property (this allows the first step to process for the initial identifier sent from processRequiredData).

Calculate ComplexFilters before the linkPath's main processing, this allows the ComplexFilter results to also be used in the same step.

Calculates the ComplexFilter results for each and stores the complexFilterMainId in an array in requiredData table, propertyName: combinationComplexFilterIds. I believe multiple combination linkPath steps could combine their results in one array as they will be used together at a linkPath step to process all combinations.

LinkPath step that uses the combinations has a property names applyCombinations, when this is set multiple requests are sent out with the combination ComplexFilterIds added to requestParams.

filterElements has a wildcard that adds in the parent Identifier, this will need to handle multiple Identifier fields (eg add group with each Identifier field and AND operator)

Combination tags

  • complexFilterCombinations is an object where complexFilter requests are grouped by combinationTags
  • applyCombinations is a list of combinationTags to apply at this step
  • all combinations of all tags are then passed in as requestParams to multiple requests at that step

Example

used to calculated {sellOfferPlanId}_{sellOfferPlanDeliveryMethodLinkId}_{sellOfferPlanPaymentMethodLinkId} combination required to calculate all OrderPrices for a SellOffer.

  • SellOffer SearchResultMain enters processRequiredData with a linkPath field
  • Each sellOfferId is sent into first link step
  • linkPath has one link step, objType orderPrice, linked by hasOrderPrice (link is lambda relationship/no storageTag)
  • step has complexFilterCombinations for sellOfferPlan, sellOfferPlanDeliveryMethodLink, and sellOfferPlanPaymentMethodLink
    • sellOfferPlan complexFilter
      • has a translate filterElement linking to the parent Identifier wildcard, which will store the sellOfferPlanId for the parent sellOffer
    • sellOfferPlanDeliveryMethodLink complexFilter
      • will find sellOfferPlanDeliveryMethodLinkIds
      • (path1) childComplexFilter DeliveryMethod with OR filterElements for all deliveryMethodIds
      • (path1) childComplexFilter RateTable
      • (path1) childComplexFilter locationNode with OR filterElements for all locationNodes (parent LocationNodes would need to be found outside this flow and used to generate the filterElements)
      • (path2) childComplexFilter from sellOfferPlanDeliveryMethodLink to SellOfferPlan with translate filterElement linking to parent Identifier wildcard (sellOfferId)
    • sellOfferPlanPaymentMethodLink complexFilter
      • will find sellOfferPlanPaymentMethodLinkIds
      • OR filterElements for paymentMethodIds
      • childComplexFilter from sellOfferPlanPaymentMethodLink to SellOfferPlan with translate filterElement linking to parent Identifier wildcard (sellOfferId)
  • step is hasMany = false, toMany = true, combine = true (with aggregate), so normally would create SortResult
  • step has applyCombinations so will be sending out many requests to find multiple OrderPrices per combination, all results will be joined together to perform the final SortResult combined aggregate
  • use combinedSearchResult flow
  • iterate all combinations by querying all ComplexFilter results in combinationComplexFilterIds, will need to paginate and save all leaf searchResults before making operation filters etc
  • each combination adds sellOfferPlanId, sellOfferPlanDeliveryMethodLinkId and sellOfferPlanPaymentMethodLinkId to requestParams
  • requestParams pass to orderPrice complexfilter
  • orderPrice complexfilter has translate element connecting to sellOffer using parent sellOfferId
  • the translateIds flow will trigger hook that calculates the orderPrices using requestParams and sellOfferId, and saves resulting orderPriceIds into parent complexFilter
  • these orderPriceIds get passed up to searchResult, combined with all combination results
  • linkPath flow receives combinedSearchResultComplete message and completes SortResult and Aggregate to get final price
  • price is returned to processRequiredData as the value