Loading
保險
InsProductAsyncRatingService:repriceProduct

InsProductAsyncRatingService:repriceProduct

根據 selectedProduct JSON 和 userInput 以非同步方式重新計算產品的價格。

類別:InsProductAsyncRatingService

方法:repriceProduct

此服務是針對「群組福利大量產品分級」使用個案所建立。

運作方式

  1. 此服務會取得 JSON、userInput 和 censusId 的 selectedProduct
  2. 接著,服務會查看產品,以判斷產品是否針對「以普查為基礎的等級」或「以摘要為基礎的等級」(根據「PricingStrategyType__c」欄位) 進行設定。
  3. 服務會呼叫 InsuranceRatingPtc.rateCensus Core 服務以計算所有產品的價格。InsuranceRatingPtc.rateCensus 服務為非同步服務,因此不會立即退回價格。而是會傳回一個 asyncRequestId。

輸入

輸入 描述
groupClassIds

選擇性。

群組類別識別碼清單。

productCategories

選擇性。

產品種類清單。順序應與 productIds 相同

selectedProduct

必要。

要重新定價的產品。

userInputs

必要。

等級程序用來取得產品價格的輸入資料集。

針對「對應 <字串、物件>」,所有產品都會使用相同的輸入資料集。

針對「清單對應<字串」、「物件>>」,清單的大小應與 productIds 大小相同。如果某些產品沒有 userInput,請在「清單」中新增 {}。

不支援選取具有 CoverageProductCode.isSelected 的涵蓋範圍,但在計算定價時會將其納入考量。

遠端選項

選項 描述
censusId

必要。

群組普查的識別碼。

effectiveDate

用於等級的生效日期。

使用「YYYY-MM-DD HH:MM:SS」格式。

預設為今天日期。

evalOptionalCoverageRelationship 決定是否根據參與者與主要普查成員的關係來評估參與者可用的選擇性涵蓋範圍。如果此選項設定為 true,則服務會先呼叫 updateOptionalCovIsSelectedField,然後再呼叫 repriceProduct。
ruleAttributeSetValues 決定是否執行「設定值」規則。如果此選項設定為 true,則服務會先執行屬性「設定值」規則,再呼叫定價引擎。
validateCoverageSelection 決定是否要對所選的涵蓋範圍執行驗證規則。當此選項設定為 true 時,服務會先呼叫 InsuranceSelectValidationService,再呼叫 repriceProduct。

輸入 JSON

以下是範例輸入 JSON:

{
 "userInputs": {"DentalCoverage.copay": 100},
 "groupClassIds": ["0rEDI0000000IEe2AM", "0rEDI0000000IEe4Hr"],
 "productCategories": ["Dental"],
 "selectedProduct": {
   "records": [
    {
      "displaySequence": -1,
      "CalculatedPriceData": {
        "2015 Lexus LX250": {
          " DRIVER.FN": null,
          "AUTO.instanceKey": "2015 Lexus LX250",
          "totalPrice": 1650,
          "comprehensiveTotal": 500,
          "collisionTotal": 500,
          "liabilityTotal": 650,
          "totalTotal": 400,
          "perAccidentTotal": 150,
          "perPersonTotal": 100,
          "ID": "1"
        }
      },
      "Id": "01tB0000001qc4JIAQ",
      "Name": "Auto Root",
      "ProductCode": "AUTOROOT",
      "IsRecommended__c": false,
      "RecordTypeName__c": "Product",
      "IsConfigurable__c": false,
      "PricingFormula__c": "SUM(liabilityTotal + comprehensiveTotal + collisionTotal + stateTotal)",
      "Term__c": "Annual",
      "TotalInsuredFormula__c": "SUM(AUTO.carValue)",
      "productId": "01tB0000001qc4JIAQ",
      "currencyCode": "USD",
      "currencySymbol": "$",
      "Price": 1000,
      "totalSumInsured": 0,
      "taxesAndFees": [
        {
          "calculatedAmount": 100,
          "currencySymbol": "$",
          "currencyCode": "USD",
          "Type__c": "Fee",
          "RatingType__c": "Amount",
          "ProcedureSource__c": null,
          "ProcedureName__c": null,
          "ProcedureFormula__c": null,
          "Percent__c": null,
          "JurisdictionId__c": null,
          "IsRefundable__c": false,
          "Condition__c": null,
          "Amount__c": 100,
          "Name": "acaf9c93-67b1-5a94-c98f-e7a1387361f1",
          "Id": "a4OB0000000ErbeMAC"
        },
        {
          "calculatedAmount": 50,
          "currencySymbol": "$",
          "currencyCode": "USD",
          "Type__c": "Tax",
          "RatingType__c": "Percent",
          "ProcedureSource__c": null,
          "ProcedureName__c": null,
          "ProcedureFormula__c": null,
          "Percent__c": 5,
          "JurisdictionId__c": null,
          "IsRefundable__c": true,
          "Condition__c": null,
          "Amount__c": null,
          "Name": "c4b50dd7-7b28-27c0-8b9f-87cd68e6a478",
          "Id": "a4OB0000000ErbfMAC"
        }
      ],
      "taxAmount": 160,
      "feeAmount": 145,
      "totalTaxFeeAmount": 305,
      "childProducts": {
        "totalSize": 2,
        "records": [
          {
            "displaySequence": 1,
            "Id": "01tB0000001qc5lIAA",
            "Name": "Collision Deductible Waiver",
            "Description": "We waive your Collision deductible when you're in an accident caused by a driver who has no insurance.",
            "ProductCode": "COL_WAIVER",
            "IsRecommended__c": false,
            "RecordTypeName__c": "CoverageSpec",
            "IsConfigurable__c": true,
            "productId": "01tB0000001qc5lIAA",
            "pciId": "a4bB0000000CzkzIAC",
            "isOptional": false,
            "isSelected": true,
            "attributeCategories": {
              "totalSize": 1,
              "records": [
                {
                  "displaySequence": 1981,
                  "Code__c": "AUTO_COVERAGE",
                  "Name": "Auto Coverage",
                  "productAttributes": {
                    "totalSize": 1,
                    "records": [
                      {
                        "code": "DED_WAIVER",
                        "dataType": "text",
                        "inputType": "dropdown",
                        "multiselect": false,
                        "required": false,
                        "readonly": false,
                        "disabled": false,
                        "filterable": true,
                        "label": "Collision Deductible Waiver",
                        "displaySequence": 3,
                        "hasRules": false,
                        "hidden": false,
                        "values": [
                          {
                            "id": "0",
                            "label": "No coverage",
                            "readonly": false,
                            "disabled": false,
                            "value": "No coverage"
                          },
                          {
                            "id": "1",
                            "label": "$1,000 deductible",
                            "readonly": false,
                            "disabled": false,
                            "value": "1000"
                          }
                        ],
                        "userValues": "No coverage"
                      }
                    ]
                  }
                }
              ]
            }
          }
        ]
      }
    }
  ]
 }
}

選項 JSON

以下是範例選項 JSON:


{     
  "censusId": "0rfRO00000009WTYAY",
  "effectiveDate": "2023-06-22 00:00:00"
}

輸出 JSON

以下是範例輸出 JSON:

{
  "asyncRequestId": {
    "01tRO000000k6RyYAI": "8zk9f00000Q5jUEHNS"
  }
}
 
正在載入
Salesforce Help | Article