iab-InsuranceBizLogic 0.1.7 → 0.1.8

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.
Files changed (2) hide show
  1. data/lib/processengine/engine.rb +24 -0
  2. metadata +1 -1
@@ -145,6 +145,30 @@ class PEngine
145
145
  raise "An error occurred during the authentication process"
146
146
  end
147
147
 
148
+ when "SaveProfile"
149
+ begin
150
+ if params[:User] and params[:User][:User]
151
+ session[:user_email] = params[:User][:User]
152
+ params[:ProfilePersonalDetailsClientContact] = HashWithIndifferentAccess.new
153
+ params[:ProfilePersonalDetailsClientContact][:Email] = params[:User][:User]
154
+ end
155
+ eval(deriveActiveRecordDefinitionOfProduct(session[:product]))
156
+ xml = createXMLMessage(session[:product],params,false) { |k,v| "<#{k}>#{v}</#{k}>" }
157
+ open("#{File.dirname(__FILE__)}/../bizLogic/xquery2") {|f| @query = f.read }
158
+ results = persist.find(@query.gsub('EMAIL',session[:user_email]))
159
+ if !results
160
+ key = persist.create_key_and_doc(xml)
161
+ results = persist.find(@query.gsub('EMAIL',session[:user_email]))
162
+ end
163
+ prepareModels(session[:product],results[0])
164
+ rescue
165
+ if !session[:user_email]
166
+ raise "Credentials missing for new customer"
167
+ end
168
+ raise "An error occurred whilst saving a new profile"
169
+ end
170
+
171
+
148
172
  when "SectionRating"
149
173
  "1553.25"
150
174
 
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.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gary Mawdsley