From 2829887a5712126672e41d2d478332942b0fe119 Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Fri, 27 Oct 2017 13:08:03 -0400 Subject: [PATCH] get rid of bad maps --- map_rm_template.pgsql | 240 +++++++++++++++++++++--------------------- 1 file changed, 120 insertions(+), 120 deletions(-) diff --git a/map_rm_template.pgsql b/map_rm_template.pgsql index 34dae15..b40e35e 100644 --- a/map_rm_template.pgsql +++ b/map_rm_template.pgsql @@ -30,127 +30,8 @@ FROM $j$::jsonb , 1) ) x; - -DELETE FROM tps.map_rm where target = 'Parse Descr'; -INSERT INTO -tps.map_rm -SELECT * -FROM -(VALUES - ('PNCC', 'Parse Descr', - $j$ - { - "name":"Parse Descr", - "description":"parse the description based on at least three capital letters followed by a comma until another set of at lesat 3 capital letters and a comma is encountered", - "defn": [ - { - "key": "{Description}", - "field": "dparse", - "regex": "([A-Z]{3,}?:)(.*)(?=[A-Z]{3,}?:|$)", - "flag":"g", - "retain":"y" - } - ], - "function":"extract", - "map":"no", - "where": [ - { - } - ] - } - $j$::jsonb - , 2) -) x; - - -DELETE FROM tps.map_rm where target = 'Extract OBI'; -INSERT INTO -tps.map_rm -SELECT * -FROM -(VALUES - ('PNCC', 'Extract OBI', - $j$ - { - "name":"Extract OBI", - "description":"pull out whatever follows OBI in the description until atleast 3 capital letters followed by a colon are encountered", - "defn": [ - { - "key": "{Description}", - "field": "obi", - "regex": "OBI:(.*?)(?=[A-Z]{3,}?:|$)", - "flag":"", - "retain":"y" - } - ], - "function":"extract", - "map":"no", - "where": [ - { - "Transaction":"Money Transfer DB - Wire" - }, - { - "Transaction":"Money Transfer CR-Other" - }, - { - "Transaction":"Intl Money Transfer Debits" - }, - { - "Transaction":"Money Transfer DB - Other" - }, - { - "Transaction":"Money Transfer CR-Wire" - } - ] - } - $j$::jsonb - , 2) -) x; - -DELETE FROM tps.map_rm where target = 'Extract RFB'; -INSERT INTO -tps.map_rm -SELECT * -FROM -(VALUES - ('PNCC', 'Extract RFB', - $j$ - { - "name":"Extract RFB", - "description":"pull out whatever follows RFB in the description until atleast 3 capital letters followed by a colon are encountered", - "defn": [ - { - "key": "{Description}", - "field": "rfb", - "regex": "RFB:(.*?)(?=[A-Z]{3,}?:|$)", - "flag":"", - "retain":"y" - } - ], - "function":"extract", - "map":"no", - "where": [ - { - "Transaction":"Money Transfer DB - Wire" - }, - { - "Transaction":"Money Transfer CR-Other" - }, - { - "Transaction":"Intl Money Transfer Debits" - }, - { - "Transaction":"Money Transfer DB - Other" - }, - { - "Transaction":"Money Transfer CR-Wire" - } - ] - } - $j$::jsonb - , 2) -) x; */ + DELETE FROM tps.map_rm where target = 'Parse ACH'; INSERT INTO @@ -249,3 +130,122 @@ FROM $j$::jsonb , 2) ) x; + +/* + +DELETE FROM tps.map_rm where target = 'Parse Wires'; +INSERT INTO +tps.map_rm +SELECT * +FROM +(VALUES + ('PNCC', 'Parse Wires', + $j$ + { + "name":"Parse Wires", + "description":"pull out whatever follows OBI in the description until atleast 3 capital letters followed by a colon are encountered", + "defn": [ + { + "key": "{Description}", + "field": "dparse", + "regex": "([A-Z]{3,}?:)(.*)(?=[A-Z]{3,}?:|$)", + "flag":"g", + "retain":"y" + }, + { + "key": "{Description}", + "field": "beneficiary_components", + "regex": "BENEFICIARY:(.*?)AC/(\\d*) (.*)(?=[A-Z]{3,}?:|$)", + "flag":"", + "retain":"y" + }, + { + "key": "{Description}", + "field": "originator_components", + "regex": "ORIGINATOR:(.*?)AC/(\\d*) (.*)(?=[A-Z]{3,}?:|$)", + "flag":"", + "retain":"y" + }, + { + "key": "{Description}", + "field": "OBI", + "regex": "OBI:(.*?)(?=[A-Z]{3,}?:|$)", + "flag":"", + "retain":"y" + }, + { + "key": "{Description}", + "field": "RFB", + "regex": "RFB:(.*?)(?=[A-Z]{3,}?:|$)", + "flag":"", + "retain":"y" + }, + { + "key": "{Description}", + "field": "ABA", + "regex": "ABA:(.*?)(?=[A-Z]{3,}?:|$)", + "flag":"", + "retain":"y" + }, + { + "key": "{Description}", + "field": "BBI", + "regex": "BBI:(.*?)(?=[A-Z]{3,}?:|$)", + "flag":"", + "retain":"y" + }, + { + "key": "{Description}", + "field": "BENEBNK", + "regex": "BENEBNK:(.*?)(?=[A-Z]{3,}?:|$)", + "flag":"", + "retain":"y" + }, + { + "key": "{Description}", + "field": "IBK", + "regex": "IBK:(.*?)(?=[A-Z]{3,}?:|$)", + "flag":"", + "retain":"y" + }, + { + "key": "{Description}", + "field": "RATE", + "regex": "RATE:(.*?)(?=[A-Z]{3,}?:|$)", + "flag":"", + "retain":"y" + }, + { + "key": "{Description}", + "field": "RECVBNK", + "regex": "RECVBNK:(.*?)(?=[A-Z]{3,}?:|$)", + "flag":"", + "retain":"y" + } + ], + "function":"extract", + "map":"no", + "where": [ + { + "Transaction":"Money Transfer DB - Wire" + }, + { + "Transaction":"Money Transfer DB - Other" + }, + { + "Transaction":"Money Transfer CR-Wire" + }, + { + "Transaction":"Money Transfer CR-Other" + }, + { + "Transaction":"Intl Money Transfer Debits" + }, + { + "Transaction":"Intl Money Transfer Credits" + } + ] + } + $j$::jsonb + , 2) +) x; \ No newline at end of file