2025-04-17 - LinkPath structure and examples

From Izara Wiki
Jump to navigation Jump to search

Service - Search Results

reqiuredData structure

  • requiredData as array that have multiple feildName to findData
[
  {
    fieldName: "fieldname if main objType or last fieldName for linkPath",
    combinationComplexFilter: {
      [combinationA]: {
       //* complexFilter as normalize structure
      }
    },
    linkPath: [
      {
        link: {
          objType: {
            serviceTag: "ServciceTag",
            objectType: "linkObjectType1"
          },
          relType: {
            serviceTag: "ServiceTag",
            objectType: "hasLinkObjectType1"
          },
          direction: "to" | "from",
          requestProperties: {
           orderQuantity: 2,
           //...
         }
        },
        //== condition ==
        filterElements: [],
        aggregate: "max" | "min" | "average",
        sortFields: {
          fieldName: "fieldname if main objType or last fieldName for linkPath",
          dataType: "string" | "number" | "array"
        },
        combine: true | false,
        perParentComplexFilters: {
          [combinationTagB]: {
            //* complexFilter as normalize structure
          }
        },
        applyCombinations: [
          //* tag only in combinationComplexFilters
          "combinationTagA"
        ],
        comparison: "lessThan" | "gearterThan" | "lessThanEquals" | "greaterThanEquals" | "high" | "low" | "highLow",
        comparisonValue: "value",
        comparisonSortField: "fieldName"
      },
      //...
    ]
  }
]

example

[
 {
  fieldName: "price",
    combinationComplexFilters: {
    locationNode: {
      //* complexFilter as normalize structure
    }
  },
  linkPath: [
    {
      link: {
        objType: {
          serviceTag: "SellOfferManager",
          objectType: "sellOffer"
        },
        relType: {
          serviceTag: "SellOfferManager",
          objectType: "sellOffer"
        },
        direction: "from",
        requestProperties: {
         orderQuantity: 2,
         //...
       }
      },
      filterElements: [ //* must change to normalize structure
        {
          type: "logical", //example
          fieldName: "price",
          comparison: "greaterThan",
          value: 50
        },
        {
          type: "complexFilter",
          complexFilter: {
            objType: {
              serviceTag: "SellOfferManager",
              objectType: "sellOffer"
            }
            //...
            //.. maybe ref. from main filter
          }
        },
        //...
      ]
    },
    {
      link: {
        objType: {
          serviceTag: "SellOfferManager",
          objectType: "sellOffer"
        },
        relType: {
          serviceTag: "SellOfferManager",
          objectType: "hasOrderPrice"
        },
        direction: "from",
        requestProperties: {
         orderQuantity: 2,
         deliveryMethodIds: [
          "deliveryMethodId_chiangMai"
         ]
         //...
       }
      },
      //== condition ==
      //filterElements
      aggregate: "max",
      sortFields: {
        fieldName: "price",
        dataType: "number"
      },
      combine: true,
      perParentComplexFilters: {
        sellOfferPlan: {
          //* complexFilter as normalize structure
        },
        sellOfferPlanDeliveryMethodLink: {
          //* complexFilter as normalize structure
        },
        sellOfferPlanUserPaymentMethodLink: {
          //* complexFilter as normalize structure
        }
      },
      applyCombinations: [
        //* tag only in combinationComplexFilters
        "locationNode"
      ],
      // comparison: "greaterThan",
      // comparisonValue: "50",
      // comparisonSortField: "upToValue"
    },
    //...
  ]
 },
 //...
]