您位於此處:
針對 repriceProduct 每個產品一個評分程序
針對使用每個根產品單一評分程序的產品格式化 InsProductService:repriceProduct userInputs。
針對在產品階層中使用多個等級程序或在階層任何層級中使用多個規格的多個產品,您會以不同的格式設定輸入 JSON。請參閱 repriceProduct 每個產品的多個等級程序或任何層級的多個規格。
Winter '23 版本 240.22 之前設定的產品在指定階層層級中可以有多個子系規格、沒有孫系規格,且只有一個根層級的等級程序。針對這些產品,請使用與您在先前版本中使用相同的 userInputs 格式。
若要避免發生錯誤,請一次只使用一種 userInputs 格式執行服務。
從 Summer '20 開始,輸入 JSON 會接受 additionalInputs 節點。使用此節點將 stage 設定為額外輸入,以便系統在服務執行時正確評估階段。
不支援資格規則。
針對任何產品,您可以從產品檢視其 API 索引標籤中的服務清單取得 userInputs 物件的目標格式。物件索引鍵位於表單 "<ProductCode>.<AttributeCode>" 中,其中 ProductCode 是產品的代碼,或相關聯涵蓋範圍規格、保險項目規格或等級實情的產品代碼。
涵蓋範圍的 <productCode>.isSelected 也可用於運算式集或計算程序。
此服務僅支援其記錄陣列中的一個物件。
{
"selectedProduct": {
"records": [{
"rootProductId": "01t1I000002fuBoQAI",
"rootProductCode": "AUTOROOT",
"timestamp": 1533948385704,
"hasInstanceKeys": true,
"childProductsCount": 8,
"instanceKeyChildren": 2,
"pathFromChild": "[0]",
"pathFromRoot": "[0]",
"attributeCategories": {
...
}
"childProducts": {
...
}
"Price": 80,
"productId": "01t1I000002fuBoQAI",
"Term__c": "Semi-Annual",
"PricingFormula__c": "SUM(AutoPremium__autoPremium + rentalTotal + medicalTotal + roadsideTotal + dedWaiverTotal + uninsuredMotoristPDTotal + uninsuredMotoristBITotal)",
"IsConfigurable__c": true,
"RecordTypeName__c": "Product",
"IsRecommended__c": false,
"ProductCode": "AUTOROOT",
"Name": "Auto Root",
"Id": "01t1I000002fuBoQAI",
"RawPriceData": [{
"aggregationResults": {},
"calculationResults": [{
"ID": "0",
"comprehensiveTotal": 500,
"rentalTotal": 40,
"medicalTotal": 10,
"roadsideTotal": 10,
"dedWaiverTotal": 10,
"uninsuredMotoristPDTotal": 0,
"uninsuredMotoristBITotal": 100,
"AUTO.instanceKey": "2015 Lexus LX250",
"DRIVER.FN": "Joan",
"DRIVER.LN": "Smith"
},
{
...
}
]
},
{
"aggregationResults": {},
"calculationResults": [{
"ID": "4",
"comprehensiveTotal": 500,
"rentalTotal": 40,
"medicalTotal": 10,
"roadsideTotal": 10,
"dedWaiverTotal": 10,
"uninsuredMotoristPDTotal": 0,
"uninsuredMotoristBITotal": 100,
"AUTO.instanceKey": "2006 Honda Odyssey",
"DRIVER.FN": "Joan",
"DRIVER.LN": "Smith"
},
{
...
}
]
}
],
"CalculatedPriceData": {
"2006 Honda Odyssey": {
"ID": "4",
"comprehensiveTotal": 500,
"rentalTotal": 40,
"medicalTotal": 10,
"roadsideTotal": 10,
"dedWaiverTotal": 10,
"uninsuredMotoristPDTotal": 0,
"uninsuredMotoristBITotal": 100,
"AUTO.instanceKey": "2006 Honda Odyssey",
"DRIVER.FN": "Joan",
"DRIVER.LN": "Smith"
},
"2015 Lexus LX250": {
"ID": "0",
"comprehensiveTotal": 500,
"rentalTotal": 40,
"medicalTotal": 10,
"roadsideTotal": 10,
"dedWaiverTotal": 10,
"uninsuredMotoristPDTotal": 0,
"uninsuredMotoristBITotal": 100,
"AUTO.instanceKey": "2015 Lexus LX250",
"DRIVER.FN": "Joan",
"DRIVER.LN": "Smith"
}
},
"displaySequence": -1
}]
}
}替代方法是定義 Omnistudio 資料對應器轉換,此轉換會將傳入輸入 JSON 的資料對應至服務所需的格式。此「資料對應器」的輸出 JSON 是 repriceProduct 所需的 selectedProducts 節點,以及在產品檢視 API 索引標籤中定義的 userInputs JSON。若要設定服務使用「資料對應器」,請將「preTransformBundle」選項設定為「資料對應器」的名稱。
