imperituroard 1.1.11 → 1.1.12
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5198d998fbd582bceeb23ed0aae23336538cd3ae
|
4
|
+
data.tar.gz: acfe02d6260bc7898565496fddaa3cb5759b78b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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[
|
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[
|
231
|
-
"to": hub_report[
|
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[
|
236
|
-
"groupName": data_for_status[hub_report[
|
237
|
-
"id": data_for_status[hub_report[
|
238
|
-
"name": data_for_status[hub_report[
|
239
|
-
"description": data_for_status[hub_report[
|
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[
|
243
|
-
"groupName": data_for_status[hub_report[
|
244
|
-
"id": data_for_status[hub_report[
|
245
|
-
"name": data_for_status[hub_report[
|
246
|
-
"description": data_for_status[hub_report[
|
247
|
-
"permanent": data_for_status[hub_report[
|
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[
|
259
|
-
"to": hub_report[
|
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[
|
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[
|
290
|
-
"to": hub_report2[
|
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[
|
295
|
-
"groupName": data_for_status[hub_report2[
|
296
|
-
"id": data_for_status[hub_report2[
|
297
|
-
"name": data_for_status[hub_report2[
|
298
|
-
"description": data_for_status[hub_report2[
|
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[
|
302
|
-
"groupName": data_for_status[hub_report2[
|
303
|
-
"id": data_for_status[hub_report2[
|
304
|
-
"name": data_for_status[hub_report2[
|
305
|
-
"description": data_for_status[hub_report2[
|
306
|
-
"permanent": data_for_status[hub_report2[
|
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[
|
318
|
-
"to": hub_report2[
|
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}}}
|