您位於此處:
InsPolicyService:getModifiedPolicy
當使用者變更現有保單中的受保項目或受保對象時,請使用此服務。服務會取得使用者進行的變更,並傳回修改的原則資料,包括重新計算的價格。
方法:getModifiedPolicy
系統會透過輸入中的兩個節點提供更新:modifiedItems 和 newInsuredItemsRelationships。
運作方式
-
服務會取用要修改之原則的
assetId或policyId。 -
取得包含已保險項目對應的已轉換 JSON。這是目標原則上受保項目和對象的地圖,以及所有修改的屬性。這也可能包含目標原則上目前不存在的新保險項目。
-
以在受保項目對應中指定的值更新產品 JSON 中的受保項目和受保對象屬性值。將新的保險項目新增至產品 JSON。
備註InsPolicyService:getModifiedPolicy不支援將選用涵蓋範圍新增至受保項目。 -
處理在
newInsuredItemsRelationships金鑰中指定的受保項目或受保方之間任何新關聯,並視需要在產品 JSON 中新增子系產品。例如,將司機與汽車配對的新關聯會導致產品 JSON 中該特定汽車例項下的新子系產品。小秘訣只能指定新關聯;無法使用金鑰中的資訊移除現有關聯。
-
使用
aggByKey、effectiveDate、filters和includeInputKey選項重新定價原則,並在產品 JSON 中設定新價格。 -
如果計算稅額和費用,則只會計算新記錄的稅額和費用。例如,如果將額外的汽車 (投保項目) 新增至保單,則服務會計算新汽車的新稅金和費用。保單上的累計稅金與費用值會更新。
如果沒有新的保險項目或涵蓋範圍或新增至保單,則不會重新計算稅金和費用。
-
傳回包含已修改資訊的產品 JSON。如果子系產品是「受保者」,則會建立/更新
primaryParty和otherParties節點。備註如果尚未存在任何
primaryParty,則會從父系例項在newInsuredItemsRelationships中指定的第一個新關係建立primaryParty。接著,父系例項的其他newInsuredItemsRelationships新關係會新增至otherParties陣列。不過,如果已存在
primaryParty,則會將父系例項在newInsuredItemsRelationships中指定的第一個新關係,以及該父系例項的所有其他新關係,新增至otherParties陣列。如果目標「原則」有稅額和/或費用,則此 JSON 會在原則 JSON 中包含
taxesAndFees、taxAmount、feeAmount、totalTaxForTermDiff,和totalFeeForTermDiff欄位。
InsProductService:getRatedProducts 服務中使用的所有遠端選項也可以與此服務搭配使用。
輸入
輸入 |
描述 |
|---|---|
|
更新的保險項目或保險對象詳細資料)。 |
|
受保項目與其他項目或受保者的新關聯,例如將司機新增至汽車或將珠寶新增至家中。 |
遠端選項
選項 |
描述 |
|---|---|
|
產品。 服務會將此選項傳送至包含彙總步驟的計算程序,以便計算程序傳回正確的金額。 例如,汽車保險保單會將多個司機附加至每部受保車輛。受保車輛針對原則中的每個例項有個別的 instanceKey。aggByKey 會取得車輛的所有例項金鑰,並為每個 instanceKey 建立涵蓋範圍保費陣列,並將其傳送至計算程序,以便正確計算保費。 服務會使用此值重新定價原則。 |
|
所修改原則的識別碼。 |
|
已修改原則的原始生效日期,用於重新定價原則。 |
|
使用 API 名稱加上冒號加上值或變數。例如,在 OmniScript 中,變數可以是元素的名稱,例如輸入選項清單。 使用逗號分隔多個篩選參數。 篩選條件可包含 服務會用來重新定價原則 |
|
|
|
|
|
要在 只有計算程序使用的索引鍵在結果中具有值。 服務使用 備註
此選項與 |
|
此金鑰告訴我們在輸入地圖中尋找已修改保險項目的位置。 |
|
計算目標產品的稅額和費用。 如果設定為 true,則會重新計算已修改原則的所有稅額和費用。 如果您使用 Salesforce FSC 並將此選項設為 |
|
決定重新定價原則的等級程序。若未提供,則會根據修改原則的生效日期完成定價。 備註 您無法傳遞 ratingField 的特定時間,因為欄位類型為 Date。因此,等級日期時間戳記預設為 12:00 am。 |
|
此服務用於計算稅額與費用的生效日期。此選項與用於定價產品的 如果提供值,則服務會使用該值。 如果未提供值,且產品 JSON 不是原則,則服務預設為今天日期。 |
|
預設為 設定為 設定為 |
withTaxFeeRounding
|
選擇性 如果為 true,則會使用半偶數捨入方法將計算的稅金與費用金額捨入至兩個小數位數。 如果為 false,則捨入會停用。 預設值為 false。 |
輸入 JSON
以下是如何在輸入地圖中指定 modifiedItems 和 newInsuredItemsRelationships 鍵的範例。modifiedItems 應包含每個產品代碼的例項陣列以及每個例項的屬性資料。newInsuredItemsRelationships 應包含陣列,其中每個元素都是指定子系 ( instanceKey) 與其父系 (parentInstanceKey) 之間關係的地圖。
"modifiedItems": {
"DRIVER": [{
"LN": "Smith",
"GENDER": "Female",
"FN": "Joan",
"instanceKey": "Joan Smith",
"AGE": 20
},
{
"LN": "Smith",
"GENDER": "Male",
"FN": "John",
"instanceKey": "John Smith",
"AGE": 30
},
{
"LN": "Henderson",
"GENDER": "Male",
"FN": "Robert",
"instanceKey": "Robert Henderson",
"AGE": 30
},
{
"LN": "Schell",
"GENDER": "Female",
"FN": "Kinsey",
"instanceKey": "Kinsey Schell",
"AGE": 20
}
],
"AUTO": [{
"VehicleType": "PASSENGER CAR",
"BodyClass": "Sedan/Saloon",
"autoYear": 2017,
"autoModel": "LX350",
"autoLicNum": "Lexus",
"instanceKey": "2015 Lexus LX250"
},
{
"VehicleType": "MULTIPURPOSE PASSENGER VEHICLE (MPV)",
"BodyClass": "Minivan",
"autoYear": 2006,
"autoModel": "Odyssey",
"autoLicNum": "Honda",
"instanceKey": "2006 Honda Odyssey"
},
{
"VehicleType": "PASSENGER CAR",
"BodyClass": "Sedan/Saloon",
"autoYear": 2018,
"autoModel": "BMW",
"autoLicNum": "530",
"instanceKey": "2018 530 BMW"
},
{
"VehicleType": "PASSENGER CAR",
"BodyClass": "Sedan/Saloon",
"autoYear": 2016,
"autoModel": "Toyota",
"autoLicNum": "Camry",
"instanceKey": "2016 Camry Toyota"
}
]
},
"newInsuredItemsRelationships": [
{
"instanceKey": "Joan Smith",
"parentInstanceKey": "2015 Lexus LX250"
},
{
"instanceKey": "Robert Henderson",
"parentInstanceKey": "2018 530 BMW"
}
]輸出 JSON
服務會傳回包含所有使用者修改和新增項目的產品 JSON。其中也包含反映使用者修改的已計算 priceDiff 和 totalPremiumForTermDiff 值。特別針對稅金和費用,也會傳回 totalTaxForTermDiff 和 totalFeeForTermDiff 欄位。它們只會在計算稅金和費用時顯示,並代表目標原則的按比例稅金或費用與修改原則的按比例稅金或費用 (類似於 totalPremiumForTermDiff 欄位) 之間的差異。
{
"totalSize" : 1,
"records" : [ {
"displaySequence" : -1,
"accountId" : "02i000000000000000",
"EffectiveEnd" : "2019-12-31T08:00:00.000+0000",
"EffectiveStart" : "2019-01-01T08:00:00.000+0000",
"Name" : "policy",
"policyNumber" : "4ec13580-2208-5109-095e-b39bdbaaeb56",
"Price" : 25.50,
"productId" : "01tRN000000LCquYAG",
"RecordTypeName__c" : "Product",
"term" : "Annual",
"TotalPremiumForTerm__c" : 25.50,
"totalSumInsured" : 19.25,
"key" : "value",
"feeAmount" : 10,
"taxAmount" : 10,
"nat_test__TotalFeeAmount__c" : 10,
"TotalFeeForTerm__c" : 10.00,
"nat_test__TotalTaxAmount__c" : 10,
"TotalTaxForTerm__c" : 10.00,
"hasAttributes" : false,
"productName" : "AutoRoot",
"ProductCode" : "AutoRoot",
"currencyCode" : "USD",
"currencySymbol" : "$",
"taxesAndFees" : [ {
"PriceListEntryName__c" : null,
"PriceListEntryId__c" : "02i000000000000002",
"isRefundable" : null,
"Id" : null,
"currencySymbol" : "$",
"currencyCode" : "USD",
"calculatedAmount" : 10,
"Amount__c" : 10,
"AdjustmentType__c" : "Tax"
}, {
"PriceListEntryName__c" : null,
"PriceListEntryId__c" : "02i000000000000003",
"isRefundable" : null,
"Id" : null,
"currencySymbol" : "$",
"currencyCode" : "USD",
"calculatedAmount" : 20,
"Amount__c" : 20,
"AdjustmentType__c" : "Fee"
} ],
"coverageCount" : 0,
"childProducts" : {
"totalSize" : 2,
"records" : [ {
"displaySequence" : -1,
"hasAttributes" : true,
"productName" : "Auto",
"ProductCode" : "Auto",
"nat_test__RecordTypeName__c" : "InsuredItemSpec",
"productId" : "01tRN000000LCqrYAG",
"Name" : "1998 Honda Civic",
"instanceKey" : "1998 Honda Civic",
"currencyCode" : "USD",
"currencySymbol" : "$",
"hasCoverages" : true,
"primaryParty" : {
"instanceKey" : "BobJones"
},
"otherParties" : [ {
"productCode" : "Driver",
"instanceKey" : "SarahJones",
"LastName" : "Jones",
"FirstName" : "Sarah"
} ],
"attributeCategories" : {
"totalSize" : 1,
"records" : [ {
"displaySequence" : 1,
"Code__c" : "Auto",
"Name" : "Auto",
"id" : "a0ZRN0000009TMm2AM",
"productAttributes" : {
"totalSize" : 3,
"records" : [ {
"code" : "Make",
"dataType" : "text",
"inputType" : "text",
"multiselect" : false,
"required" : false,
"readonly" : false,
"disabled" : false,
"filterable" : true,
"attributeId" : "a0aRN00000067pjYAA",
"label" : "Make",
"displaySequence" : -1,
"hasRules" : false,
"hidden" : false,
"cloneable" : true,
"isNotTranslatable" : false,
"values" : [ {
"readonly" : false,
"disabled" : false
} ],
"userValues" : "Honda",
"isNotAssetizable" : false
}, {
"code" : "Model",
"dataType" : "text",
"inputType" : "text",
"multiselect" : false,
"required" : false,
"readonly" : false,
"disabled" : false,
"filterable" : true,
"attributeId" : "a0aRN00000067pkYAA",
"label" : "Model",
"displaySequence" : -1,
"hasRules" : false,
"hidden" : false,
"cloneable" : true,
"isNotTranslatable" : false,
"values" : [ {
"readonly" : false,
"disabled" : false
} ],
"userValues" : "Civic",
"isNotAssetizable" : false
}, {
"code" : "ModelYear",
"dataType" : "number",
"inputType" : "number",
"multiselect" : false,
"required" : false,
"readonly" : false,
"disabled" : false,
"filterable" : true,
"attributeId" : "a0aRN00000067plYAA",
"label" : "ModelYear",
"displaySequence" : -1,
"hasRules" : false,
"hidden" : false,
"cloneable" : true,
"isNotTranslatable" : false,
"values" : [ {
"readonly" : false,
"disabled" : false
} ],
"userValues" : 1998,
"isNotAssetizable" : false
} ]
}
} ]
},
"childProducts" : {
"totalSize" : 2,
"records" : [ {
"displaySequence" : -1,
"hasAttributes" : true,
"productName" : "Driver",
"ProductCode" : "Driver",
"nat_test__RecordTypeName__c" : "InsuredPartySpec",
"productId" : "01tRN000000LCqsYAG",
"Name" : "BobJones",
"instanceKey" : "BobJones",
"currencyCode" : "USD",
"currencySymbol" : "$",
"hasCoverages" : true,
"isPrimaryChild" : true,
"attributeCategories" : {
"totalSize" : 1,
"records" : [ {
"displaySequence" : 2,
"Code__c" : "Driver",
"Name" : "Driver",
"id" : "a0ZRN0000009TMn2AM",
"productAttributes" : {
"totalSize" : 2,
"records" : [ {
"code" : "FirstName",
"dataType" : "text",
"inputType" : "text",
"multiselect" : false,
"required" : false,
"readonly" : false,
"disabled" : false,
"filterable" : true,
"attributeId" : "a0aRN00000067pmYAA",
"label" : "FirstName",
"displaySequence" : -1,
"hasRules" : false,
"hidden" : false,
"cloneable" : true,
"isNotTranslatable" : false,
"values" : [ {
"readonly" : false,
"disabled" : false
} ],
"userValues" : "Bob",
"isNotAssetizable" : false
}, {
"code" : "LastName",
"dataType" : "text",
"inputType" : "text",
"multiselect" : false,
"required" : false,
"readonly" : false,
"disabled" : false,
"filterable" : true,
"attributeId" : "a0aRN00000067pnYAA",
"label" : "LastName",
"displaySequence" : -1,
"hasRules" : false,
"hidden" : false,
"cloneable" : true,
"isNotTranslatable" : false,
"values" : [ {
"readonly" : false,
"disabled" : false
} ],
"userValues" : "Jones",
"isNotAssetizable" : false
} ]
}
} ]
}
}, {
"displaySequence" : -1,
"Id" : "01tRN000000LCqsYAG",
"Name" : "Driver",
"productId" : "01tRN000000LCqsYAG",
"productName" : "Driver",
"ProductCode" : "Driver",
"nat_test__RecordTypeName__c" : "InsuredPartySpec",
"instanceKey" : "SarahJones",
"attributeCategories" : {
"totalSize" : 0,
"records" : [ {
"displaySequence" : -1,
"Code__c" : "Driver",
"Name" : "Driver",
"id" : "a0ZRN0000009TMn2AM",
"productAttributes" : {
"totalSize" : 0,
"records" : [ {
"code" : "FirstName",
"dataType" : "text",
"inputType" : "text",
"multiselect" : false,
"required" : false,
"readonly" : false,
"disabled" : false,
"filterable" : true,
"attributeId" : "a0aRN00000067pmYAA",
"label" : "FirstName",
"displaySequence" : -1,
"hasRules" : false,
"hidden" : false,
"cloneable" : true,
"values" : [ {
"readonly" : false,
"disabled" : false
} ],
"userValues" : "Sarah",
"isNotAssetizable" : false
}, {
"code" : "LastName",
"dataType" : "text",
"inputType" : "text",
"multiselect" : false,
"required" : false,
"readonly" : false,
"disabled" : false,
"filterable" : true,
"attributeId" : "a0aRN00000067pnYAA",
"label" : "LastName",
"displaySequence" : -1,
"hasRules" : false,
"hidden" : false,
"cloneable" : true,
"values" : [ {
"readonly" : false,
"disabled" : false
} ],
"userValues" : "Jones",
"isNotAssetizable" : false
} ]
}
} ]
}
} ]
}
}, {
"displaySequence" : -1,
"hasAttributes" : true,
"productName" : "Auto",
"ProductCode" : "Auto",
"nat_test__RecordTypeName__c" : "InsuredItemSpec",
"productId" : "01tRN000000LCqrYAG",
"Name" : "1999 Toyota Camry",
"instanceKey" : "1999 Toyota Camry",
"currencyCode" : "USD",
"currencySymbol" : "$",
"hasCoverages" : true,
"primaryParty" : {
"instanceKey" : "MaryJones"
},
"otherParties" : [ {
"instanceKey" : "BobJones"
} ],
"attributeCategories" : {
"totalSize" : 1,
"records" : [ {
"displaySequence" : 1,
"Code__c" : "Auto",
"Name" : "Auto",
"id" : "a0ZRN0000009TMm2AM",
"productAttributes" : {
"totalSize" : 3,
"records" : [ {
"code" : "Make",
"dataType" : "text",
"inputType" : "text",
"multiselect" : false,
"required" : false,
"readonly" : false,
"disabled" : false,
"filterable" : true,
"attributeId" : "a0aRN00000067pjYAA",
"label" : "Make",
"displaySequence" : -1,
"hasRules" : false,
"hidden" : false,
"cloneable" : true,
"isNotTranslatable" : false,
"values" : [ {
"readonly" : false,
"disabled" : false
} ],
"userValues" : "Toyota",
"isNotAssetizable" : false
}, {
"code" : "Model",
"dataType" : "text",
"inputType" : "text",
"multiselect" : false,
"required" : false,
"readonly" : false,
"disabled" : false,
"filterable" : true,
"attributeId" : "a0aRN00000067pkYAA",
"label" : "Model",
"displaySequence" : -1,
"hasRules" : false,
"hidden" : false,
"cloneable" : true,
"isNotTranslatable" : false,
"values" : [ {
"readonly" : false,
"disabled" : false
} ],
"userValues" : "Camry",
"isNotAssetizable" : false
}, {
"code" : "ModelYear",
"dataType" : "number",
"inputType" : "number",
"multiselect" : false,
"required" : false,
"readonly" : false,
"disabled" : false,
"filterable" : true,
"attributeId" : "a0aRN00000067plYAA",
"label" : "ModelYear",
"displaySequence" : -1,
"hasRules" : false,
"hidden" : false,
"cloneable" : true,
"isNotTranslatable" : false,
"values" : [ {
"readonly" : false,
"disabled" : false
} ],
"userValues" : 1999,
"isNotAssetizable" : false
} ]
}
} ]
},
"childProducts" : {
"totalSize" : 0,
"records" : [ {
"displaySequence" : -1,
"hasAttributes" : true,
"productName" : "Driver",
"ProductCode" : "Driver",
"nat_test__RecordTypeName__c" : "InsuredPartySpec",
"productId" : "01tRN000000LCqsYAG",
"Name" : "BobJones",
"instanceKey" : "BobJones",
"currencyCode" : "USD",
"currencySymbol" : "$",
"hasCoverages" : true,
"isPrimaryChild" : false,
"attributeCategories" : {
"totalSize" : 1,
"records" : [ {
"displaySequence" : 2,
"Code__c" : "Driver",
"Name" : "Driver",
"id" : "a0ZRN0000009TMn2AM",
"productAttributes" : {
"totalSize" : 2,
"records" : [ {
"code" : "FirstName",
"dataType" : "text",
"inputType" : "text",
"multiselect" : false,
"required" : false,
"readonly" : false,
"disabled" : false,
"filterable" : true,
"attributeId" : "a0aRN00000067pmYAA",
"label" : "FirstName",
"displaySequence" : -1,
"hasRules" : false,
"hidden" : false,
"cloneable" : true,
"isNotTranslatable" : false,
"values" : [ {
"readonly" : false,
"disabled" : false
} ],
"userValues" : "Bob",
"isNotAssetizable" : false
}, {
"code" : "LastName",
"dataType" : "text",
"inputType" : "text",
"multiselect" : false,
"required" : false,
"readonly" : false,
"disabled" : false,
"filterable" : true,
"attributeId" : "a0aRN00000067pnYAA",
"label" : "LastName",
"displaySequence" : -1,
"hasRules" : false,
"hidden" : false,
"cloneable" : true,
"isNotTranslatable" : false,
"values" : [ {
"readonly" : false,
"disabled" : false
} ],
"userValues" : "Jones",
"isNotAssetizable" : false
} ]
}
} ]
}
}, {
"displaySequence" : -1,
"hasAttributes" : true,
"productName" : "Driver",
"ProductCode" : "Driver",
"nat_test__RecordTypeName__c" : "InsuredPartySpec",
"productId" : "01tRN000000LCqsYAG",
"Name" : "MaryJones",
"instanceKey" : "MaryJones",
"currencyCode" : "USD",
"currencySymbol" : "$",
"hasCoverages" : true,
"isPrimaryChild" : true,
"attributeCategories" : {
"totalSize" : 1,
"records" : [ {
"displaySequence" : 2,
"Code__c" : "Driver",
"Name" : "Driver",
"id" : "a0ZRN0000009TMn2AM",
"productAttributes" : {
"totalSize" : 2,
"records" : [ {
"code" : "FirstName",
"dataType" : "text",
"inputType" : "text",
"multiselect" : false,
"required" : false,
"readonly" : false,
"disabled" : false,
"filterable" : true,
"attributeId" : "a0aRN00000067pmYAA",
"label" : "FirstName",
"displaySequence" : -1,
"hasRules" : false,
"hidden" : false,
"cloneable" : true,
"isNotTranslatable" : false,
"values" : [ {
"readonly" : false,
"disabled" : false
} ],
"userValues" : "Mary",
"isNotAssetizable" : false
}, {
"code" : "LastName",
"dataType" : "text",
"inputType" : "text",
"multiselect" : false,
"required" : false,
"readonly" : false,
"disabled" : false,
"filterable" : true,
"attributeId" : "a0aRN00000067pnYAA",
"label" : "LastName",
"displaySequence" : -1,
"hasRules" : false,
"hidden" : false,
"cloneable" : true,
"isNotTranslatable" : false,
"values" : [ {
"readonly" : false,
"disabled" : false
} ],
"userValues" : "Jones",
"isNotAssetizable" : false
} ]
}
} ]
}
} ]
}
} ]
}
} ]
}