iab-InsuranceBizLogic 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,561 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!-- XSLT for Allianz Motor Trade XRTE requests -->
3
+ <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4
+ version="1.0">
5
+ <!-- Specify the output encoding as UTF-8. This causes the output
6
+ document to have encoding="UTF-8" in the ?xml? declaration at the
7
+ top, which makes the XRTE *output* in UTF-8 as well. -->
8
+ <xsl:output method="xml" omit-xml-declaration="yes" encoding="UTF-8" />
9
+
10
+ <!-- FJDTODO there is nowhere in the UI for the discount percentages to
11
+ be input at the moment. Need to add them into the UI and then set
12
+ them to the values input here -->
13
+ <xsl:variable name="discountMD" select="0"/>
14
+ <xsl:variable name="discountEL" select="0"/>
15
+ <xsl:variable name="discountPL" select="0"/>
16
+ <xsl:variable name="discountBI" select="0"/>
17
+ <xsl:variable name="discountPA" select="0"/>
18
+ <xsl:variable name="discountWC" select="0"/>
19
+
20
+ <xsl:key name="personalAccident" match="/MotorTradeQuoteNBRq/PersonalAccidentCover/CoverDetail[GroupDetail/NoOfEmployees > 0]" use="GroupDetail/EmploymentTypeCode/Value"/>
21
+ <xsl:key name="employersLiability" match="/MotorTradeQuoteNBRq/EmployersLiabilityCover/CoverDetail[Employee/Wages > 0]" use="Employee/EmploymentTypeCode/Value"/>
22
+
23
+ <xsl:template match="/MotorTradeQuoteNBRq">
24
+ <RiskEvent>
25
+ <RiskEvent_TransactionType Val="B901 840" />
26
+ <RiskEvent_SchemeRef Val="50208104009" />
27
+ <RiskEvent_BrokerGroup Val="2" />
28
+ <RiskEvent_BrokeragePct Val="0" />
29
+ </RiskEvent>
30
+ <Trade>
31
+ <Trade_Code Val="B566 J65" />
32
+ </Trade>
33
+
34
+ <Cover>
35
+ <Cover_CommissionStandardForCoverByBroker Val="0"/>
36
+ <Cover_SiAmt Val="3000000"/>
37
+ <Cover_Code Val="B205 L14"/>
38
+ </Cover>
39
+
40
+ <!-- Apply templates that output Cover elements -->
41
+ <Cover>
42
+ <Cover_SiAmt Val="5000000"/><!-- TODO take this from "Limit of Indemnity" field when that field is created in IAB UI -->
43
+ <Cover_Code Val="B205 L20"/>
44
+ <Cover_CommissionStandardForCoverByBroker Val="{$discountPL}"/>
45
+ <xsl:apply-templates select="ProductLiabilityCover/CoverDetail/TurnoverBreakdown[TurnoverAmount > 0]" />
46
+ </Cover>
47
+ <xsl:apply-templates select="BusinessInterruptionCover[CoverDetail/SumInsured/Amount > 0]" />
48
+
49
+ <!-- Apply template that outputs InsuranceCover elements -->
50
+ <xsl:apply-templates select="RoadRisksCover/VehicleCover/NCDDetail[NCDYears > 0]" />
51
+
52
+ <!-- Apply template that outputs Premises elements -->
53
+ <xsl:apply-templates select="Location" />
54
+
55
+
56
+ <!-- Personal Accident -->
57
+ <!-- PA: Directors Partners and Principles -->
58
+ <xsl:if test="key('personalAccident', 'B515 186')">
59
+ <Cover>
60
+ <Cover_CommissionStandardForCoverByBroker Val="{$discountPA}"/>
61
+ <Cover_Code Val="B205 P03"/>
62
+ <xsl:if test="key('personalAccident', 'B515 186')/BasisCode/Value = 'B506 100'">
63
+ <Cover_BasisCode Val="B506 100"/>
64
+ </xsl:if>
65
+ </Cover>
66
+ </xsl:if>
67
+ <!-- PA: Clerical and Other -->
68
+ <xsl:if test="key('personalAccident', 'B515 001') or key('personalAccident', 'B515 137')">
69
+ <Cover>
70
+ <Cover_CommissionStandardForCoverByBroker Val="{$discountPA}"/>
71
+ <Cover_Code Val="B205 P03"/>
72
+ </Cover>
73
+ </xsl:if>
74
+
75
+ <!-- WorkingInBusiness elements - derived from Personal Accident and Employers Liability input -->
76
+ <!-- TODO: remove hard-coding of WorkingInBusiness_HeightLimit; it should be set to "Units of Benefit" from BI & PA page -->
77
+ <!-- Clerical -->
78
+ <xsl:variable name="clericalWages" select="number(concat('0', key('employersLiability', 'B515 001')/Employee/Wages))" />
79
+ <WorkingInBusiness>
80
+ <WorkingInBusiness_EmployeeCode Val="B515 001"/>
81
+ <xsl:element name="WorkingInBusiness_NoOfIndividuals">
82
+ <xsl:attribute name="Val">
83
+ <xsl:value-of select="number(concat('0', key('personalAccident', 'B515 001')/GroupDetail/NoOfEmployees))" />
84
+ </xsl:attribute>
85
+ </xsl:element>
86
+ <xsl:if test="$clericalWages > 0">
87
+ <xsl:element name="WorkingInBusiness_WagesSalaryAmt">
88
+ <xsl:attribute name="Val">
89
+ <xsl:value-of select="$clericalWages" />
90
+ </xsl:attribute>
91
+ </xsl:element>
92
+ </xsl:if>
93
+ <WorkingInBusiness_HeightLimit Val="4" />
94
+ </WorkingInBusiness>
95
+
96
+ <!-- Pump Attendants (AKA Shop Assistants in the IAB front end) -->
97
+ <xsl:variable name="pumpWages" select="number(concat('0', key('employersLiability', 'B515 004')/Employee/Wages))" />
98
+ <WorkingInBusiness>
99
+ <WorkingInBusiness_EmployeeCode Val="B515 004"/>
100
+ <WorkingInBusiness_NoOfIndividuals Val="0" /><!-- Note: this is also hard coded to 0 in the spreadsheet VBA -->
101
+ <xsl:if test="$pumpWages > 0">
102
+ <xsl:element name="WorkingInBusiness_WagesSalaryAmt">
103
+ <xsl:attribute name="Val">
104
+ <xsl:value-of select="$pumpWages" />
105
+ </xsl:attribute>
106
+ </xsl:element>
107
+ </xsl:if>
108
+ </WorkingInBusiness>
109
+
110
+ <!-- Other Employees -->
111
+ <xsl:variable name="otherWages" select="number(concat('0', key('employersLiability', 'B515 183')/Employee/Wages))" />
112
+ <WorkingInBusiness>
113
+ <WorkingInBusiness_EmployeeCode Val="B515 219"/>
114
+ <xsl:element name="WorkingInBusiness_NoOfIndividuals">
115
+ <xsl:attribute name="Val">
116
+ <xsl:value-of select="number(concat('0', key('personalAccident', 'B515 137')/GroupDetail/NoOfEmployees))" />
117
+ </xsl:attribute>
118
+ </xsl:element>
119
+ <xsl:if test="$otherWages > 0">
120
+ <xsl:element name="WorkingInBusiness_WagesSalaryAmt">
121
+ <xsl:attribute name="Val">
122
+ <xsl:value-of select="$otherWages" />
123
+ </xsl:attribute>
124
+ </xsl:element>
125
+ </xsl:if>
126
+ <WorkingInBusiness_HeightLimit Val="4" />
127
+ </WorkingInBusiness>
128
+
129
+ <!-- PPD -->
130
+ <WorkingInBusiness>
131
+ <WorkingInBusiness_EmployeeCode Val="B515 186"/>
132
+ <xsl:element name="WorkingInBusiness_NoOfIndividuals">
133
+ <xsl:attribute name="Val">
134
+ <xsl:value-of select="number(concat('0', key('personalAccident', 'B515 186')/GroupDetail/NoOfEmployees))" />
135
+ </xsl:attribute>
136
+ </xsl:element>
137
+ <WorkingInBusiness_HeightLimit Val="8" />
138
+ </WorkingInBusiness>
139
+
140
+ <!-- Apply templates that output Vehicle elements -->
141
+ <xsl:apply-templates select="RoadRisksCover/VehicleCover/Code/Value" />
142
+ <xsl:apply-templates select="WrongfulConversionCover/CoverDetail[SumInsured/Amount > 0 and AnnualLimit/Amount > 0]"/>
143
+ <xsl:apply-templates select="VehicleBusinessUseGroup[NoOf]|VehiclePersonalUseGroup[NoOf]"/>
144
+
145
+ <Vehicle>
146
+ <VehicleCover>
147
+ <VehicleCover_Code Val="B205 A06"/>
148
+ <VehicleCover_ExcessAmt Val="0"/>
149
+ </VehicleCover>
150
+ </Vehicle>
151
+
152
+ <Vehicle>
153
+ <Vehicle_Description Val="NamedDriversDiscount"/>
154
+ <VehicleUsage>
155
+ <VehicleUsage_Code Val="B549 002"/>
156
+ </VehicleUsage>
157
+ </Vehicle>
158
+ </xsl:template>
159
+
160
+ <!-- **************************************************************** -->
161
+
162
+ <!-- cover -->
163
+ <xsl:template match="ProductLiabilityCover/CoverDetail/TurnoverBreakdown[TurnoverAmount > 0]">
164
+ <CoverBreakdown>
165
+ <!-- TODO temporary demo hack to be reconsidered: mapping 2 IAB codes to 1 XRTE code -->
166
+ <xsl:element name="CoverBreakdown_Code">
167
+ <xsl:attribute name="Val">
168
+ <xsl:choose>
169
+ <xsl:when test="TurnoverActivityCode/Value='B520 230'">B205 160</xsl:when>
170
+ <xsl:when test="TurnoverActivityCode/Value='B520 234'">B205 160</xsl:when>
171
+ <xsl:when test="TurnoverActivityCode/Value='B550 231'">B550 407</xsl:when>
172
+ <xsl:when test="TurnoverActivityCode/Value='B520 233'">B550 407</xsl:when>
173
+ <xsl:when test="TurnoverActivityCode/Value='B520 999'">B550 568</xsl:when>
174
+ </xsl:choose>
175
+ </xsl:attribute>
176
+ </xsl:element>
177
+
178
+ <xsl:element name="CoverBreakdown_SiAmt">
179
+ <xsl:attribute name="Val"><xsl:value-of select="TurnoverAmount" /></xsl:attribute>
180
+ </xsl:element>
181
+ </CoverBreakdown>
182
+ </xsl:template>
183
+
184
+ <xsl:template match="BusinessInterruptionCover[CoverDetail/SumInsured/Amount > 0]">
185
+ <Cover>
186
+ <xsl:element name="Cover_SiAmt">
187
+ <xsl:attribute name="Val"><xsl:value-of select="CoverDetail/SumInsured/Amount" /></xsl:attribute>
188
+ </xsl:element>
189
+ <Cover_Code Val="B205 038"/>
190
+ <Cover_IndemnityPeriodInMonths Val="12"/>
191
+ <Cover_CommissionStandardForCoverByBroker Val="{$discountBI}"/>
192
+ </Cover>
193
+ </xsl:template>
194
+
195
+ <!-- FJDTODO other employee types -->
196
+ <xsl:template match="PersonalAccidentCover/CoverDetail[GroupDetail/EmploymentTypeCode/Value = 'B515 186' and GroupDetail/NoOfEmployees > 0]">
197
+ <Cover>
198
+ <Cover_CommissionStandardForCoverByBroker Val="{$discountPA}"/>
199
+ <Cover_Code Val="B205 P03"/>
200
+ <xsl:if test="BasisCode/Value = 'B506 100'">
201
+ <Cover_BasisCode Val="B506 100"/>
202
+ </xsl:if>
203
+ </Cover>
204
+ </xsl:template>
205
+ <!-- TODO template similar to the above (but with no BasisCode) for Clerical and Other workers -->
206
+
207
+
208
+ <!-- **************************************************************** -->
209
+
210
+ <xsl:template match="RoadRisksCover/VehicleCover/NCDDetail[NCDYears > 0]">
211
+ <InsuranceHistory>
212
+ <NcdClaimed>
213
+ <xsl:element name="NcdClaimed_Years">
214
+ <xsl:attribute name="Val"><xsl:value-of select="NCDYears"/></xsl:attribute>
215
+ </xsl:element>
216
+ </NcdClaimed>
217
+ </InsuranceHistory>
218
+ </xsl:template>
219
+
220
+
221
+ <!-- **************************************************************** -->
222
+
223
+ <!-- premises -->
224
+ <xsl:template match="Location">
225
+ <Premises>
226
+ <Premises_PostcodeSector Val="P1 CV21 1"/>
227
+ <!-- the following Val will need to increment with each occurence -->
228
+ <Premises_InsuredObjectRef Val="1"/>
229
+ <Premises_NoOfHoseReels Val="{$discountMD}"/>
230
+ <PremisesCover>
231
+ <PremisesCover_Code Val="B205 X37" />
232
+ <xsl:element name="PremisesCover_ExcessAmt">
233
+ <!-- TODO this is hard-coded to 250 for the demo because
234
+ the XRTE only accepts values from a predefined list.
235
+ Need to replace the text box in the input with a
236
+ dropdown containing the allowed values and then use
237
+ the next line instead of 250:
238
+ <xsl:value-of select="number(concat('0',BuildingsCover/CoverDetail[Code/Value='B205 C22']/Excess/Amount))"/> -->
239
+ <!-- previous line prepends "0" to the Excess/Amount string so that "" gets converted to 0 -->
240
+ <xsl:attribute name="Val">250</xsl:attribute>
241
+ </xsl:element>
242
+ <xsl:apply-templates select="BuildingsCover/CoverDetail[(Code/Value='B205 C22' or Code/Value='B205 X57') and SumInsured/Amount > 0]" />
243
+ <xsl:apply-templates select="ContentsCover/CoverDetail/Breakdown[(Code/Value='B550 019' or Code/Value='B550 001' or Code/Value='B550 550' or Code/Value='B550 002' or Code/Value='B205 104' or Code/Value='B550 409' or Code/Value='B550 464' or Code/Value='B205 E08' or Code/Value='B550 400') and SumInsured/Amount > 0]" />
244
+ <xsl:apply-templates select="EngineeringCover/HiredInPlant[RatingData > 0]" />
245
+
246
+ <xsl:variable name="totalVehicleSumInsuredForLocation" select="sum(VehicleCover/SumInsured/Amount)" />
247
+ <xsl:for-each select="VehicleCover[SumInsured/Amount > 0]">
248
+ <PremisesCoverBreakdown>
249
+ <xsl:element name="PremisesCoverBreakdown_SiAmt">
250
+ <xsl:attribute name="Val"><xsl:value-of select="$totalVehicleSumInsuredForLocation" /></xsl:attribute>
251
+ </xsl:element>
252
+ <xsl:element name="PremisesCoverBreakdown_SiPercentage">
253
+ <xsl:attribute name="Val"><xsl:value-of select="100 * (SumInsured/Amount div $totalVehicleSumInsuredForLocation)" /></xsl:attribute>
254
+ </xsl:element>
255
+ <!-- TODO this template is a temporary hack for the demo and the mapping that it does doesn't really make sense -->
256
+ <xsl:element name="PremisesCoverBreakdown_Code">
257
+ <xsl:attribute name="Val">
258
+ <xsl:choose>
259
+ <xsl:when test="Code/Value='B550 555' or Code/Value='B550 552'">B550 555</xsl:when>
260
+ <xsl:otherwise>B550 557</xsl:otherwise>
261
+ </xsl:choose>
262
+ </xsl:attribute>
263
+ </xsl:element>
264
+ </PremisesCoverBreakdown>
265
+ </xsl:for-each>
266
+ </PremisesCover>
267
+
268
+ <PremisesCover>
269
+ <PremisesCover_Code Val="B205 G06" />
270
+ <xsl:apply-templates select="ContentsCover/CoverDetail/Breakdown[Code/Value='B205 P07' and SumInsured/Amount > 0]" />
271
+ </PremisesCover>
272
+
273
+ <xsl:if test="count(EngineeringCover/HiredInPlant/TypeCode/Value) > 0">
274
+ <PremisesCover>
275
+ <PremisesCover_Code Val="B205 162" />
276
+ </PremisesCover>
277
+ </xsl:if>
278
+
279
+ <!-- TODO only output this PremisesCover if the apply-templates inside it will produce some output -->
280
+ <PremisesCover>
281
+ <PremisesCover_Code Val="B205 M11" />
282
+ <xsl:apply-templates select="MoneyCover/CoverDetail/CoverBreakdown[SumInsured/Amount > 0]"/>
283
+ </PremisesCover>
284
+ </Premises>
285
+ </xsl:template>
286
+
287
+ <xsl:template match="BuildingsCover/CoverDetail[(Code/Value='B205 C22' or Code/Value='B205 X57') and SumInsured/Amount > 0]">
288
+ <PremisesCoverBreakdown>
289
+ <xsl:element name="PremisesCoverBreakdown_SiAmt">
290
+ <xsl:attribute name="Val"><xsl:value-of select="SumInsured/Amount" /></xsl:attribute>
291
+ </xsl:element>
292
+ <xsl:element name="PremisesCoverBreakdown_Code">
293
+ <xsl:attribute name="Val">
294
+ <xsl:choose>
295
+ <!-- Existing Buildings -->
296
+ <xsl:when test="Code/Value='B205 C22'">B205 B01</xsl:when>
297
+ <!-- Tenant's Improvements -->
298
+ <xsl:when test="Code/Value='B205 X57'">B550 395</xsl:when>
299
+ </xsl:choose>
300
+ </xsl:attribute>
301
+ </xsl:element>
302
+ </PremisesCoverBreakdown>
303
+ </xsl:template>
304
+
305
+ <xsl:template match="ContentsCover/CoverDetail/Breakdown[(Code/Value='B550 019' or Code/Value='B550 001' or Code/Value='B550 550' or Code/Value='B550 002' or Code/Value='B205 104' or Code/Value='B550 409' or Code/Value='B550 464' or Code/Value='B205 E08' or Code/Value='B550 400') and SumInsured/Amount > 0]">
306
+ <PremisesCoverBreakdown>
307
+ <xsl:element name="PremisesCoverBreakdown_SiAmt">
308
+ <xsl:attribute name="Val"><xsl:value-of select="SumInsured/Amount" /></xsl:attribute>
309
+ </xsl:element>
310
+ <xsl:element name="PremisesCoverBreakdown_Code">
311
+ <xsl:attribute name="Val">
312
+ <!-- TODO remove demo hack that maps "AudioVisual Media"
313
+ (B550 550), "Wines Fortified Wines And Spirits"
314
+ (B550 002) and "Clothing And Personal Effects" (B205
315
+ 104) to "Cigarettes Cigars and Tobacco" (B550 001)
316
+ -->
317
+ <xsl:choose>
318
+ <xsl:when test="Code/Value='B550 550'">B550 001</xsl:when>
319
+ <xsl:when test="Code/Value='B550 002'">B550 001</xsl:when>
320
+ <xsl:when test="Code/Value='B205 104'">B550 001</xsl:when>
321
+ <xsl:otherwise><xsl:value-of select="Code/Value" /></xsl:otherwise>
322
+ </xsl:choose>
323
+ </xsl:attribute>
324
+ </xsl:element>
325
+ </PremisesCoverBreakdown>
326
+ </xsl:template>
327
+
328
+ <!-- Goods in Transit -->
329
+ <xsl:template match="ContentsCover/CoverDetail/Breakdown[Code/Value='B205 P07' and SumInsured/Amount > 0]">
330
+ <PremisesCoverBreakdown>
331
+ <xsl:element name="PremisesCoverBreakdown_SiAmt">
332
+ <xsl:attribute name="Val"><xsl:value-of select="SumInsured/Amount" /></xsl:attribute>
333
+ </xsl:element>
334
+ <PremisesCoverBreakdown_Code Val="B550 464" />
335
+ </PremisesCoverBreakdown>
336
+ </xsl:template>
337
+
338
+
339
+ <xsl:template match="EngineeringCover/HiredInPlant[RatingData > 0]">
340
+ <PremisesCoverBreakdown>
341
+ <xsl:element name="PremisesCoverBreakdown_SiAmt">
342
+ <xsl:attribute name="Val"><xsl:value-of select="RatingData" /></xsl:attribute>
343
+ </xsl:element>
344
+ <PremisesCoverBreakdown_Code Val="B205 O05" />
345
+ </PremisesCoverBreakdown>
346
+ </xsl:template>
347
+
348
+ <!-- TODO currently both "Money In Transit" (B205 240) and "Money In Bank Night Safe" (B205 M01) IAB are mapped to B205 240. This is a hack for the demo because the spreadsheet only has one field, "In Transit or In A Bank Night Safe" that corresponds to both these IAB fields. -->
349
+ <xsl:template match="MoneyCover/CoverDetail/CoverBreakdown[SumInsured/Amount > 0]">
350
+ <PremisesCoverBreakdown>
351
+ <xsl:element name="PremisesCoverBreakdown_SiAmt">
352
+ <xsl:attribute name="Val"><xsl:value-of select="SumInsured/Amount" /></xsl:attribute>
353
+ </xsl:element>
354
+ <xsl:element name="PremisesCoverBreakdown_Code">
355
+ <xsl:attribute name="Val">
356
+ <xsl:choose>
357
+ <xsl:when test="Code/Value='B205 M06'">B205 M12</xsl:when>
358
+ <xsl:when test="Code/Value='B205 M01'">B205 240</xsl:when>
359
+ <xsl:otherwise><xsl:value-of select="Code/Value" /></xsl:otherwise>
360
+ </xsl:choose>
361
+ </xsl:attribute>
362
+ </xsl:element>
363
+ </PremisesCoverBreakdown>
364
+
365
+ </xsl:template>
366
+
367
+ <!-- **************************************************************** -->
368
+
369
+ <!-- workinginbusiness -->
370
+ <!-- FJDTODO
371
+ <xsl:template match="PersonalAccidentCover/CoverDetail/GroupDetail/[NoOfEmployees > 0]">
372
+ <WorkingInBusiness>
373
+ <WorkingInBusiness_EmployeeCode Val="B515 001"/>
374
+ <xsl:element name="WorkingInBusiness_NoOfIndividuals">
375
+ <xsl:attribute name="Val"><xsl:value-of select="NoOfEmployees" /></xsl:attribute>
376
+ </xsl:element>
377
+ <WorkingInBusiness_WagesSalaryAmt Val="10000"/>
378
+ <WorkingInBusiness_HeightLimit Val="4" />
379
+ </WorkingInBusiness>
380
+ </xsl:template>
381
+ -->
382
+
383
+ <!-- **************************************************************** -->
384
+
385
+ <!-- vehicle -->
386
+ <xsl:template match="RoadRisksCover/VehicleCover/Code/Value">
387
+ <Vehicle>
388
+ <VehicleCover>
389
+ <xsl:element name="VehicleCover_Code">
390
+ <xsl:attribute name="Val"><xsl:value-of select="."/></xsl:attribute>
391
+ </xsl:element>
392
+ </VehicleCover>
393
+ </Vehicle>
394
+ </xsl:template>
395
+
396
+ <xsl:template match="WrongfulConversionCover/CoverDetail[SumInsured/Amount > 0 and AnnualLimit/Amount > 0]">
397
+ <Vehicle>
398
+ <VehicleCover>
399
+ <VehicleCover_Code Val="B205 X73"/>
400
+ <VehicleCover_CommissionStandardForCoverByBroker Val="0"/>
401
+ <VehicleCoverBreakdown>
402
+ <VehicleCoverBreakdown_Code Val="B205 U03"/>
403
+ <xsl:element name="VehicleCoverBreakdown_SiAmt">
404
+ <xsl:attribute name="Val"><xsl:value-of select="SumInsured/Amount" /></xsl:attribute>
405
+ </xsl:element>
406
+ <xsl:element name="VehicleCoverBreakdown_ExcessAmt">
407
+ <xsl:attribute name="Val"><xsl:value-of select="AnnualLimit/Amount" /></xsl:attribute>
408
+ </xsl:element>
409
+ </VehicleCoverBreakdown>
410
+ </VehicleCover>
411
+ <VehicleUsage>
412
+ <VehicleUsage_Code Val="B549 002"/>
413
+ </VehicleUsage>
414
+ <!-- TODO: use an XSL key here? -->
415
+ <xsl:if test="/MotorTradeQuoteNBRq/VehicleBusinessUseGroup[Description='8']/NoOf > 0">
416
+ <xsl:element name="Vehicle_NoOfDrivers">
417
+ <xsl:attribute name="Val"><xsl:value-of select="/MotorTradeQuoteNBRq/VehicleBusinessUseGroup[Description='8']/NoOf" /></xsl:attribute>
418
+ </xsl:element>
419
+ </xsl:if>
420
+ </Vehicle>
421
+ </xsl:template>
422
+
423
+
424
+ <!-- Business Drivers - suppress output as this input node is handled by the WrongfulConversion template -->
425
+ <xsl:template match="VehicleBusinessUseGroup[Description='8']">
426
+ </xsl:template>
427
+
428
+ <!-- Business Use Vehicles -->
429
+ <xsl:template match="VehicleBusinessUseGroup[Description != '8']">
430
+ <Vehicle>
431
+ <xsl:element name="Vehicle_NoOfVehicles">
432
+ <xsl:attribute name="Val"><xsl:value-of select="NoOf" /></xsl:attribute>
433
+ </xsl:element>
434
+ <VehicleUsage>
435
+ <VehicleUsage_Code Val="B549 002"/>
436
+ </VehicleUsage>
437
+ <xsl:choose>
438
+ <xsl:when test="Description='0'">
439
+ <!-- Trade Plates -->
440
+ <Vehicle_TypeCode Val="B900 008"/>
441
+ </xsl:when>
442
+
443
+ <xsl:when test="Description='1'">
444
+ <!-- Recovery Vehicles - 1 vehicle capacity -->
445
+ <Vehicle_CategoryTypeCode Val="B10 30"/>
446
+ <Vehicle_CarryingCapacity Val="1"/>
447
+ </xsl:when>
448
+
449
+ <xsl:when test="Description='2'">
450
+ <!-- Recovery Vehicles - 2 vehicle capacity -->
451
+ <Vehicle_CategoryTypeCode Val="B10 30"/>
452
+ <Vehicle_CarryingCapacity Val="2"/>
453
+ </xsl:when>
454
+
455
+ <xsl:when test="Description='4'">
456
+ <!-- Passenger Carriers up to 8 people -->
457
+ <Vehicle_CategoryTypeCode Val="B10 60"/>
458
+ <Vehicle_CarryingCapacity Val="8"/>
459
+ </xsl:when>
460
+
461
+ <xsl:when test="Description='5'">
462
+ <!-- All Other Vehicles -->
463
+ <Vehicle_TypeCode Val="B900 010"/>
464
+ </xsl:when>
465
+
466
+ <xsl:when test="Description='6'">
467
+ <!-- Courtesy Vehicles -->
468
+ <Vehicle_TypeCode Val="B900 101"/>
469
+ </xsl:when>
470
+ </xsl:choose>
471
+ </Vehicle>
472
+ </xsl:template>
473
+
474
+ <!-- Personal Use Vehicles -->
475
+ <xsl:template match="VehiclePersonalUseGroup[Description != '5' and Description != '6']">
476
+ <Vehicle>
477
+ <VehicleUsage>
478
+ <VehicleUsage_Code Val="B549 011"/>
479
+ </VehicleUsage>
480
+ <xsl:element name="Vehicle_NoOfVehicles">
481
+ <xsl:attribute name="Val"><xsl:value-of select="NoOf" /></xsl:attribute>
482
+ </xsl:element>
483
+ <xsl:choose>
484
+ <xsl:when test="Description = '0'">
485
+ <!-- Personal Use: Cars. TODO: this doesn't appear in the input XML even when a value is entered into the form. -->
486
+ <Vehicle_TypeCode Val="B900 028"/>
487
+ </xsl:when>
488
+
489
+ <xsl:when test="Description = '1'">
490
+ <Vehicle_TypeCode Val="B900 049"/>
491
+ <Vehicle_GrossVehicleWeight Val="2"/>
492
+ </xsl:when>
493
+
494
+ <xsl:when test="Description = '2'">
495
+ <Vehicle_TypeCode Val="B900 049"/>
496
+ <Vehicle_GrossVehicleWeight Val="7"/>
497
+ </xsl:when>
498
+
499
+ <xsl:when test="Description = '3'">
500
+ <Vehicle_TypeCode Val="B900 060"/>
501
+ <Vehicle_EngineCubicCapacity Val="500"/>
502
+ </xsl:when>
503
+
504
+ <xsl:when test="Description = '4'">
505
+ <Vehicle_TypeCode Val="B900 060"/>
506
+ <Vehicle_EngineCubicCapacity Val="1000"/>
507
+ </xsl:when>
508
+
509
+ <xsl:when test="Description>=7 and Description&lt;=13">
510
+ <!-- Group 14 - 20 vehicles -->
511
+ <xsl:element name="Vehicle_CategoryTypeCode">
512
+ <xsl:attribute name="Val">
513
+ <xsl:choose>
514
+ <xsl:when test="Description=7">B10 24</xsl:when>
515
+ <xsl:when test="Description=8">B10 25</xsl:when>
516
+ <xsl:when test="Description=9">B10 T6</xsl:when>
517
+ <xsl:when test="Description=10">B10 AK</xsl:when>
518
+ <xsl:when test="Description=11">B10 26</xsl:when>
519
+ <xsl:when test="Description=12">B10 27</xsl:when>
520
+ <xsl:when test="Description=13">B10 28</xsl:when>
521
+ </xsl:choose>
522
+ </xsl:attribute>
523
+ </xsl:element>
524
+ </xsl:when>
525
+ </xsl:choose>
526
+ </Vehicle>
527
+ </xsl:template>
528
+
529
+ <xsl:template match="VehiclePersonalUseGroup[Description='5']">
530
+ <Vehicle>
531
+ <VehicleUsage>
532
+ <VehicleUsage_Code Val="B549 011"/>
533
+ </VehicleUsage>
534
+ <Vehicle_PermittedDriverCode Val="B134 H"/>
535
+ <xsl:element name="Vehicle_NoOfDrivers">
536
+ <xsl:attribute name="Val"><xsl:value-of select="NoOf" /></xsl:attribute>
537
+ </xsl:element>
538
+ </Vehicle>
539
+ </xsl:template>
540
+
541
+ <xsl:template match="VehiclePersonalUseGroup[Description='6']">
542
+ <Vehicle>
543
+ <VehicleUsage>
544
+ <VehicleUsage_Code Val="B549 011"/>
545
+ </VehicleUsage>
546
+ <Vehicle_PermittedDriverCode Val="B134 I"/>
547
+ <xsl:element name="Vehicle_NoOfDrivers">
548
+ <xsl:attribute name="Val"><xsl:value-of select="NoOf" /></xsl:attribute>
549
+ </xsl:element>
550
+ </Vehicle>
551
+ </xsl:template>
552
+
553
+ <!-- **************************************************************** -->
554
+
555
+ <!-- Suppress default template that copies text to the output -->
556
+ <!-- TODO: make this unneccessary by making sure that everything in the
557
+ input is matched by another rule in this file -->
558
+ <!--
559
+ <xsl:template match="text()"/>
560
+ -->
561
+ </xsl:stylesheet>
metadata ADDED
@@ -0,0 +1,98 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: iab-InsuranceBizLogic
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.2
5
+ platform: ruby
6
+ authors:
7
+ - Gary Mawdsley
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-03-31 00:00:00 -07:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: mime-types
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: "1.15"
24
+ version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: diff-lcs
27
+ type: :runtime
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 1.1.2
34
+ version:
35
+ description: InsuranceBizLogic contains biz logic for stand four insurance processes of NB, MTA, Cancellations, Renewals
36
+ email: garymawdsley@gmail.com
37
+ executables: []
38
+
39
+ extensions: []
40
+
41
+ extra_rdoc_files: []
42
+
43
+ files:
44
+ - lib/bizLogic
45
+ - lib/bizLogic/search.rb
46
+ - lib/bizLogic/continualQNB.rb
47
+ - lib/bizLogic/VPMSHelper.rb
48
+ - lib/bizLogic/xquery1
49
+ - lib/bizLogic/applymta.rb
50
+ - lib/bizLogic/payment.rb
51
+ - lib/bizLogic/diff.rb
52
+ - lib/servicebroker
53
+ - lib/servicebroker/mocks
54
+ - lib/servicebroker/mocks/RoadRisksQuoteNBRs.xml
55
+ - lib/servicebroker/mocks/CommercialCombinedQuoteNBRs.xml
56
+ - lib/servicebroker/broker.rb
57
+ - lib/servicebroker/xsl
58
+ - lib/servicebroker/xsl/in_MotorTrade.xsl
59
+ - lib/servicebroker/xsl/extractPremium.xsl
60
+ - lib/servicebroker/xsl/extractDescription.xsl
61
+ - lib/servicebroker/xsl/extractCode.xsl
62
+ - lib/processengine
63
+ - lib/processengine/HashEnhancement.rb
64
+ - lib/processengine/engine.rb
65
+ - lib/processengine/communicator.rb
66
+ - lib/models
67
+ - lib/models/modbdbxmlje.rb
68
+ - lib/models/modbdbxml.rb
69
+ - lib/models/persist.rb
70
+ has_rdoc: true
71
+ homepage: http://github.com/iab/ActiveRecordBDBXml
72
+ post_install_message:
73
+ rdoc_options:
74
+ - --inline-source
75
+ - --charset=UTF-8
76
+ require_paths:
77
+ - lib
78
+ required_ruby_version: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: "0"
83
+ version:
84
+ required_rubygems_version: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: "0"
89
+ version:
90
+ requirements: []
91
+
92
+ rubyforge_project: ActiveRecordBDBXml
93
+ rubygems_version: 1.2.0
94
+ signing_key:
95
+ specification_version: 2
96
+ summary: InsuranceBizLogic contains biz logic for stand four insurance processes of NB, MTA, Cancellations, Renewals
97
+ test_files: []
98
+