imperituroard 1.1.11 → 1.1.12

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 28a8ed8a7d0e3e2896f7c67a7d63911c82e4c263
4
- data.tar.gz: df3d6c2b96ac564a4feee8e9df5ac6c884b46187
3
+ metadata.gz: 5198d998fbd582bceeb23ed0aae23336538cd3ae
4
+ data.tar.gz: acfe02d6260bc7898565496fddaa3cb5759b78b8
5
5
  SHA512:
6
- metadata.gz: 65ae8bf70ab9db28066ac1b566612d975ec165b4fa34b2fb58fb3bb7ec50defe7c5192fa0d88ff3a89f3d5d7022be8a81c0965e2638a2ffb77810a13c9759e57
7
- data.tar.gz: 85e98458692adc97a666e40c7b26287f9e1985011d3d81acf57a8f5fb7ce4df19c2430727d85cf78bdd1f450b90f43506f56e42124c87353455ea13c7ddedca9
6
+ metadata.gz: 141216aa7ce9480c4dbbbe7b3d6749e58a80e812389485ee78bf6536e0b296052f2a9456fff879c2bed0194c02868952c143f6cd09ba51d16bf32ff046c07bce
7
+ data.tar.gz: 80e2937875b1f9e28b52297d1544f0c2e05a815fbe17dc4d785860c9fc59d80fb3f98c23cd56e81034569747021186ab6707dc7007cfcecf7151beab2d81c3fe
@@ -191,10 +191,11 @@ class Dabrab
191
191
 
192
192
 
193
193
  def delivery_report_transform(hub_report_in)
194
+
194
195
  #{"number"=>"375297116638", "time"=>1588673492000, "status"=>2, "substatus"=>23, "msg_status"=>23033, "message_id"=>"486649ba-a573-4ee9-8f58-018ed20ca6fd", "extra_id"=>"444/0/ServiceModel/ScGetReports.svc/GetReports", "sent_via"=>"viber", "controller"=>"reports", "action"=>"delivery", "report"=>{"number"=>"375297116638", "time"=>1588673492000, "status"=>2, "substatus"=>23, "msg_status"=>23033, "message_id"=>"486649ba-a573-4ee9-8f58-018ed20ca6fd", "extra_id"=>"444/0/ServiceModel/ScGetReports.svc/GetReports", "sent_via"=>"viber"}}
195
196
  #p hub_report
196
197
  #p "hub_report"
197
- report_to_recip =
198
+ report_to_recip = []
198
199
 
199
200
  data_for_status = {
200
201
  23011 => {:status_id => 5, :status_grid => 3, :status_grname => "DELIVERED", :status_name => "DELIVERED_TO_HANDSET", :status_descr => "Message delivered by SMS",
@@ -223,40 +224,40 @@ class Dabrab
223
224
  if hub_report_in.key?("msg_status")
224
225
  hub_report = hub_report_in
225
226
 
226
- if data_for_status[hub_report[:msg_status]] != nil && data_for_status[hub_report[:msg_status]] != {} && data_for_status[hub_report[:msg_status]] != [] && data_for_status[hub_report[:msg_status]] != ""
227
+ if data_for_status[hub_report["msg_status"]] != nil && data_for_status[hub_report["msg_status"]] != {} && data_for_status[hub_report["msg_status"]] != [] && data_for_status[hub_report["msg_status"]] != ""
228
+
227
229
  report_to_recip.push({
228
230
 
229
231
  "bulkId": "00000000-0000-0000-0000-000000000000",
230
- "messageId": hub_report[:report][:message_id],
231
- "to": hub_report[:report][:number],
232
+ "messageId": hub_report["report"]["message_id"],
233
+ "to": hub_report["report"]["number"],
232
234
  # "sentAt": "2020-05-05T20:00:00.000+0000",
233
235
  # "doneAt": "2020-05-05T20:00:00.000+0000",
234
236
  "status": {
235
- "groupId": data_for_status[hub_report[:msg_status]][:status_grid],
236
- "groupName": data_for_status[hub_report[:msg_status]][:status_grname],
237
- "id": data_for_status[hub_report[:msg_status]][:status_id],
238
- "name": data_for_status[hub_report[:msg_status]][:status_name],
239
- "description": data_for_status[hub_report[:msg_status]][:status_descr]
237
+ "groupId": data_for_status[hub_report["msg_status"]][:status_grid],
238
+ "groupName": data_for_status[hub_report["msg_status"]][:status_grname],
239
+ "id": data_for_status[hub_report["msg_status"]][:status_id],
240
+ "name": data_for_status[hub_report["msg_status"]][:status_name],
241
+ "description": data_for_status[hub_report["msg_status"]][:status_descr]
240
242
  },
241
243
  "error": {
242
- "groupId": data_for_status[hub_report[:msg_status]][:error_grid],
243
- "groupName": data_for_status[hub_report[:msg_status]][:error_grname],
244
- "id": data_for_status[hub_report[:msg_status]][:error_id],
245
- "name": data_for_status[hub_report[:msg_status]][:error_name],
246
- "description": data_for_status[hub_report[:msg_status]][:error_descr],
247
- "permanent": data_for_status[hub_report[:msg_status]][:error_permanent]
244
+ "groupId": data_for_status[hub_report["msg_status"]][:error_grid],
245
+ "groupName": data_for_status[hub_report["msg_status"]][:error_grname],
246
+ "id": data_for_status[hub_report["msg_status"]][:error_id],
247
+ "name": data_for_status[hub_report["msg_status"]][:error_name],
248
+ "description": data_for_status[hub_report["msg_status"]][:error_descr],
249
+ "permanent": data_for_status[hub_report["msg_status"]][:error_permanent]
248
250
  }
249
251
  })
250
252
 
251
253
 
252
254
  else
253
- report_to_recip["results"].app
254
255
 
255
256
  report_to_recip.push({
256
257
 
257
258
  "bulkId": "00000000-0000-0000-0000-000000000000",
258
- "messageId": hub_report[:report][:message_id],
259
- "to": hub_report[:report][:number],
259
+ "messageId": hub_report["report"]["message_id"],
260
+ "to": hub_report["report"]["number"],
260
261
  # "sentAt": "2020-05-05T20:00:00.000+0000",
261
262
  # "doneAt": "2020-05-05T20:00:00.000+0000",
262
263
  "status": {
@@ -282,40 +283,38 @@ class Dabrab
282
283
 
283
284
  hub_report_in["_json"].each {|hub_report2|
284
285
 
285
- if data_for_status[hub_report[:msg_status]] != nil && data_for_status[hub_report[:msg_status]] != {} && data_for_status[hub_report[:msg_status]] != [] && data_for_status[hub_report[:msg_status]] != ""
286
+ if data_for_status[hub_report["msg_status"]] != nil && data_for_status[hub_report["msg_status"]] != {} && data_for_status[hub_report["msg_status"]] != [] && data_for_status[hub_report["msg_status"]] != ""
286
287
  report_to_recip.push({
287
288
 
288
289
  "bulkId": "00000000-0000-0000-0000-000000000000",
289
- "messageId": hub_report2[:message_id],
290
- "to": hub_report2[:number],
290
+ "messageId": hub_report2["message_id"],
291
+ "to": hub_report2["number"],
291
292
  # "sentAt": "2020-05-05T20:00:00.000+0000",
292
293
  # "doneAt": "2020-05-05T20:00:00.000+0000",
293
294
  "status": {
294
- "groupId": data_for_status[hub_report2[:msg_status]][:status_grid],
295
- "groupName": data_for_status[hub_report2[:msg_status]][:status_grname],
296
- "id": data_for_status[hub_report2[:msg_status]][:status_id],
297
- "name": data_for_status[hub_report2[:msg_status]][:status_name],
298
- "description": data_for_status[hub_report2[:msg_status]][:status_descr]
295
+ "groupId": data_for_status[hub_report2["msg_status"]][:status_grid],
296
+ "groupName": data_for_status[hub_report2["msg_status"]][:status_grname],
297
+ "id": data_for_status[hub_report2["msg_status"]][:status_id],
298
+ "name": data_for_status[hub_report2["msg_status"]][:status_name],
299
+ "description": data_for_status[hub_report2["msg_status"]][:status_descr]
299
300
  },
300
301
  "error": {
301
- "groupId": data_for_status[hub_report2[:msg_status]][:error_grid],
302
- "groupName": data_for_status[hub_report2[:msg_status]][:error_grname],
303
- "id": data_for_status[hub_report2[:msg_status]][:error_id],
304
- "name": data_for_status[hub_report2[:msg_status]][:error_name],
305
- "description": data_for_status[hub_report2[:msg_status]][:error_descr],
306
- "permanent": data_for_status[hub_report2[:msg_status]][:error_permanent]
302
+ "groupId": data_for_status[hub_report2["msg_status"]][:error_grid],
303
+ "groupName": data_for_status[hub_report2["msg_status"]][:error_grname],
304
+ "id": data_for_status[hub_report2["msg_status"]][:error_id],
305
+ "name": data_for_status[hub_report2["msg_status"]][:error_name],
306
+ "description": data_for_status[hub_report2["msg_status"]][:error_descr],
307
+ "permanent": data_for_status[hub_report2["msg_status"]][:error_permanent]
307
308
  }
308
309
  })
309
310
 
310
311
 
311
312
  else
312
- report_to_recip["results"].app
313
-
314
313
  report_to_recip.push({
315
314
 
316
315
  "bulkId": "00000000-0000-0000-0000-000000000000",
317
- "messageId": hub_report2[:message_id],
318
- "to": hub_report2[:number],
316
+ "messageId": hub_report2["message_id"],
317
+ "to": hub_report2["number"],
319
318
  # "sentAt": "2020-05-05T20:00:00.000+0000",
320
319
  # "doneAt": "2020-05-05T20:00:00.000+0000",
321
320
  "status": {
@@ -335,9 +334,7 @@ class Dabrab
335
334
  }
336
335
  })
337
336
  end
338
-
339
337
  }
340
-
341
338
  end
342
339
 
343
340
  {:code => 200, :result => "Data processed", :body => {:report_to_recip => {"results": report_to_recip}}}
@@ -1,4 +1,4 @@
1
1
  module Imperituroard
2
- VERSION = "1.1.11"
2
+ VERSION = "1.1.12"
3
3
  end
4
4
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: imperituroard
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.11
4
+ version: 1.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dzmitry Buynovskiy