iab-InsuranceBizLogic 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/processengine/engine.rb +25 -4
  2. metadata +3 -2
@@ -19,6 +19,8 @@ require 'processengine/HashEnhancement'
19
19
 
20
20
  require 'rexml/document'
21
21
 
22
+ require 'kerrylondon'
23
+
22
24
  class PEngine
23
25
  include XMLDiff
24
26
  include Marshaller
@@ -34,11 +36,10 @@ class PEngine
34
36
 
35
37
  def deriveActiveRecordDefinitionOfProduct(product)
36
38
  if (PRODUCTMODELS.has_key?(product))
37
- productModel = PRODUCTMODELS[product.to_sym]
39
+ return PRODUCTMODELS[product.to_sym]
38
40
  else
39
- PRODUCTMODELS[product.to_sym] = getRAILSClassRequiresForProductModelFromOilDef(product)
41
+ return getRAILSClassRequiresForProductModelFromOilDef(product)
40
42
  end
41
- productModel
42
43
  end
43
44
 
44
45
  def addDefaults(p1)
@@ -73,7 +74,18 @@ class PEngine
73
74
  end
74
75
  return p1
75
76
  end
76
-
77
+
78
+ def drill(params,tweak)
79
+ params.each do |p,v|
80
+ if (v.class.to_s == "HashWithIndifferentAccess")
81
+ drill(v,tweak)
82
+ elsif Kerrylondon.mapping.has_key?(p)
83
+ newkey = Kerrylondon.mapping[p]
84
+ tweak[newkey] = v
85
+ end
86
+ end
87
+ end
88
+
77
89
  def push(session,process,params)
78
90
  package = 'CommercialProperty'
79
91
  persist = Persist.instance
@@ -102,6 +114,15 @@ class PEngine
102
114
  #cmd = SBroker.RequestRatingService("NB",session[:product],true,false,false)
103
115
  #quote = cmd.call(xml)
104
116
 
117
+ when "GetBrokerQuotes"
118
+ eval(deriveActiveRecordDefinitionOfProduct(session[:product]))
119
+ dataTweak = Hash.new
120
+ drill(params,dataTweak)
121
+ #dataTweaks contains values that override the kerry london adapter defaults
122
+ result = Kerrylondon.makeQuote("Tony Lorriman","liability1","CSP",false,Kerrylondon.keyfacts(dataTweak))
123
+ premiums = "<ContractorPlant>#{result}</ContractorPlant>"
124
+ prepareModels(session[:product],premiums)
125
+
105
126
  when "RefineNBQuote"
106
127
  eval(deriveActiveRecordDefinitionOfProduct(session[:product]))
107
128
  origxml = persist.get(session[:policyKey])
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iab-InsuranceBizLogic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gary Mawdsley
@@ -66,6 +66,7 @@ files:
66
66
  - lib/processengine/communicator.rb
67
67
  has_rdoc: true
68
68
  homepage: http://github.com/iab/InsuranceBizLogic
69
+ licenses:
69
70
  post_install_message:
70
71
  rdoc_options:
71
72
  - --inline-source
@@ -87,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
87
88
  requirements: []
88
89
 
89
90
  rubyforge_project: InsuranceBizLogic
90
- rubygems_version: 1.2.0
91
+ rubygems_version: 1.3.5
91
92
  signing_key:
92
93
  specification_version: 2
93
94
  summary: InsuranceBizLogic contains biz logic for stand four insurance processes of NB, MTA, Cancellations, Renewals