2025-04-17 - LinkPath structure and examples: Difference between revisions
Jump to navigation
Jump to search
(Created page with "Service - Search Results 2025-04-17 2025-04-17") |
No edit summary |
||
| Line 1: | Line 1: | ||
[[Service - Search Results]] | [[Service - Search Results]] | ||
= reqiuredData structure = | |||
* requiredData as array that have multiple feildName to findData | |||
<syntaxhighlight lang="js"> | |||
[ | |||
{ | |||
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" | |||
} | |||
}, | |||
//== 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" | |||
}, | |||
//... | |||
] | |||
} | |||
] | |||
</syntaxhighlight> | |||
== example == | |||
<syntaxhighlight lang="js"> | |||
[ | |||
{ | |||
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" | |||
}, | |||
//... | |||
] | |||
}, | |||
//... | |||
] | |||
</syntaxhighlight> | |||
[[Category:Working documents| 2025-04-17]] | [[Category:Working documents| 2025-04-17]] | ||
[[Category:Working documents - Search Results| 2025-04-17]] | [[Category:Working documents - Search Results| 2025-04-17]] | ||
Revision as of 09:37, 17 April 2025
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"
}
},
//== 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"
},
//...
]
},
//...
]