2025-07-29 - variantProduct SearchResults: Difference between revisions

From Izara Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
Line 14: Line 14:
Create a new setting in objectSchema that specifies an objType only exists in searchResult, the searchResultData and requiredData is saved using a flow.
Create a new setting in objectSchema that specifies an objType only exists in searchResult, the searchResultData and requiredData is saved using a flow.


* objectSchema has searchResultGenerated setting
see [[Per Service Schemas#searchResultGenerated]]
* objectSchema sets flowType for generating the searchResult data
 
* cannot be shown in forms (can perhaps show, limited to specific identifier for searchResultData)
* objectSchema sets generatedBy to searchResultGenerated
* can be used in tableOutput
* objectSchema sets searchResultGeneratedFlowType for generating the searchResult data
* perhaps searchResultGeneratedFlowType throws error if initial request does not include variantId/productId in requiredData, because these are required for any links used (maybe only if have other linkPath requiredData, but we always save variantId/productId in requiredData so maybe always throw error)
* original request can enter SortResult, pass to searchResult at which time a searchResultMain is created and the flow is invoked which saves all data up to processRequiredData complete
* original request can enter SortResult, pass to searchResult at which time a searchResultMain is created and the flow is invoked which saves all data up to processRequiredData complete
* flow creates 2 processSearchResult requests, product and variant, after they complete the data is combined into the final searchResultMain data
* flow creates 2 processSearchResult requests, product and variant, after they complete the data is combined into the final searchResultMain data, adding requireData for the variantId and productId
* variant as the base objType, all linkPaths are specified according to variant as the top level objType
* identifier for variantProduct is automatically searchResultData identifiers
* when combine searchResults product requiredData gets transferred into the matching variant fieldnames/requiredData
* has relationships (storageType = lambda) to variant and product which uses the requiredData record, this allows frontend to use schema to link either to variant or product for independant results for each
* have additional fieldnames, such as type ("variant" or "product"), these can be added automatically to requiredData
* if want single result field, eg maxPrice, add a field to the variantProduct objectSchema, this will force requiredData to pass to a flow to find value (which checks already exists in requiredData, if not find depending on is variant or product and place in requiredData)
* objectSchema sets available links etc to match variant objType
* maybe have syncronous flows in searchResult that eg create/check requiredData, so external flows not need to adjust data directly
* objectSchema sets what filter/requiredData sets are needed (for variant and for product) (not sure about this)
* if both variants and products link to productAttributes, then we could have a relationship from variantProduct to productAttribute where the translateId flow passes to correct link, this would allow connecting links (eg to translations) to be set as normal on frontend
* perhaps use extend setting to inherit fields and relationships from variant, or another setting specific for searchResultGenerated = true
* perhaps request is generated using variant schema, and flow automatically removes variant level filters/linkSteps when creating product request
 
note 2025-11-10
* difficulty comes from creating eg the linkPaths for this objType
* consider processRequiredData is also handled by a flow (or the same flow), which handles variant and product separately
* but how do we use schema to allow frontend to choose links to other objects? This is why above states use variant as base, so frontend can link from variantProduct to other objects according to variants schema
* can restrict that other objTypes do not see/cannot link to searchResultGenerated objects


= idea 2 =
= idea 2 =

Latest revision as of 00:04, 11 November 2025

Service - Variant Manager

Service - Search Results

Overview

  • Catalog lists of listings on frontend want option to show variants mixed with stand alone listings that match filters
  • Want to be able to use SearchResult/SortResult services so can use on catalog, table output, graph output etc
  • Form could show data but variantProduct has no editable fields
  • Want linkPath values for variant to only show data for child products that pass filters

idea 1 (try this)

Create a new setting in objectSchema that specifies an objType only exists in searchResult, the searchResultData and requiredData is saved using a flow.

see Per Service Schemas#searchResultGenerated

  • objectSchema sets generatedBy to searchResultGenerated
  • objectSchema sets searchResultGeneratedFlowType for generating the searchResult data
  • perhaps searchResultGeneratedFlowType throws error if initial request does not include variantId/productId in requiredData, because these are required for any links used (maybe only if have other linkPath requiredData, but we always save variantId/productId in requiredData so maybe always throw error)
  • original request can enter SortResult, pass to searchResult at which time a searchResultMain is created and the flow is invoked which saves all data up to processRequiredData complete
  • flow creates 2 processSearchResult requests, product and variant, after they complete the data is combined into the final searchResultMain data, adding requireData for the variantId and productId
  • identifier for variantProduct is automatically searchResultData identifiers
  • has relationships (storageType = lambda) to variant and product which uses the requiredData record, this allows frontend to use schema to link either to variant or product for independant results for each
  • if want single result field, eg maxPrice, add a field to the variantProduct objectSchema, this will force requiredData to pass to a flow to find value (which checks already exists in requiredData, if not find depending on is variant or product and place in requiredData)
  • maybe have syncronous flows in searchResult that eg create/check requiredData, so external flows not need to adjust data directly
  • if both variants and products link to productAttributes, then we could have a relationship from variantProduct to productAttribute where the translateId flow passes to correct link, this would allow connecting links (eg to translations) to be set as normal on frontend

idea 2

Frontend managed, don't like this option as no variantProduct data stored on backend for search/sort.

  • frontend creates two requests, one for products that match and have no variantion links, one for variants that have products that match
  • frontend combines them

idea 3

Have objType for variantProduct and translateIds that converts product and variant into it. Incomplete idea, many possible issues, might need a record in graph.

  • have a translateIds lambda from variant <> variantProductId, and product <> variantProductId
  • ids only get saved into translateIds table and searchResult etc tables (will work with no storageTags?)
  • maybe store variantProduct in graph, instance links to a variant or to a product
  • do separate requiredData/linkPaths for variant and for item

idea 4

Make new objTypes to handle relationships.

varProRequest objType

  • has it's own uuid
  • is parent objType that records search params

variantProduct objType

  • is one listing result, product or variant
  • partition key is varProRequestId
  • sortKey identifies type (P/V) and identifier

varProDataValue objType

  • translateIds similar to orderPrice
  • requestProperties include varProRequestId and linkPath for product and for variant
  • can return multiple values (eg attributes)
  • stores multiple varProDataValueIds in translateIds
  • each varProDataValue record stores the variantProductId and value