Merge branch 'pt'
This commit is contained in:
commit
9323f4cad2
@ -9,25 +9,26 @@ SELECT
|
|||||||
t.id,
|
t.id,
|
||||||
t.rec,
|
t.rec,
|
||||||
m.target,
|
m.target,
|
||||||
regex->>'map' map_intention,
|
m.seq,
|
||||||
regex->>'function' regex_function,
|
regex->>'function' regex_function,
|
||||||
e.v ->> 'field' result_key_name,
|
e.v ->> 'field' result_key_name,
|
||||||
e.v ->> 'key' target_json_path,
|
e.v ->> 'key' target_json_path,
|
||||||
e.v ->> 'flag' regex_options_flag,
|
e.v ->> 'flag' regex_options_flag,
|
||||||
|
e.v->>'map' map_intention,
|
||||||
e.v->>'retain' retain_result,
|
e.v->>'retain' retain_result,
|
||||||
e.v->>'regex' regex_expression,
|
e.v->>'regex' regex_expression,
|
||||||
e.rn target_item_number,
|
e.rn target_item_number,
|
||||||
COALESCE(mt.rn,rp.rn,1) result_number,
|
COALESCE(mt.rn,rp.rn,1) result_number,
|
||||||
mt.mt rx_match,
|
mt.mt rx_match,
|
||||||
rp.rp rx_replace,
|
rp.rp rx_replace,
|
||||||
CASE regex->>'map'
|
CASE e.v->>'map'
|
||||||
WHEN 'yes' THEN
|
WHEN 'y' THEN
|
||||||
e.v->>'field'
|
e.v->>'field'
|
||||||
ELSE
|
ELSE
|
||||||
null
|
null
|
||||||
END map_key,
|
END map_key,
|
||||||
CASE regex->>'map'
|
CASE e.v->>'map'
|
||||||
WHEN 'yes' THEN
|
WHEN 'y' THEN
|
||||||
CASE regex->>'function'
|
CASE regex->>'function'
|
||||||
WHEN 'extract' THEN
|
WHEN 'extract' THEN
|
||||||
CASE WHEN array_upper(mt.mt,1)=1
|
CASE WHEN array_upper(mt.mt,1)=1
|
||||||
@ -76,9 +77,9 @@ FROM
|
|||||||
LEFT JOIN LATERAL regexp_replace(t.rec #>> ((e.v ->> 'key')::text[]), e.v ->> 'regex'::text, e.v ->> 'replace'::text,e.v ->> 'flag') WITH ORDINALITY rp(rp, rn) ON
|
LEFT JOIN LATERAL regexp_replace(t.rec #>> ((e.v ->> 'key')::text[]), e.v ->> 'regex'::text, e.v ->> 'replace'::text,e.v ->> 'flag') WITH ORDINALITY rp(rp, rn) ON
|
||||||
m.regex->>'function' = 'replace'
|
m.regex->>'function' = 'replace'
|
||||||
WHERE
|
WHERE
|
||||||
|
t.allj IS NULL
|
||||||
--t.srce = 'PNCC'
|
--t.srce = 'PNCC'
|
||||||
--rec @> '{"Transaction":"ACH Credits","Transaction":"ACH Debits"}'
|
--rec @> '{"Transaction":"ACH Credits","Transaction":"ACH Debits"}'
|
||||||
t.map IS NULL
|
|
||||||
--rec @> '{"Description":"CHECK 93013270 086129935"}'::jsonb
|
--rec @> '{"Description":"CHECK 93013270 086129935"}'::jsonb
|
||||||
ORDER BY
|
ORDER BY
|
||||||
t.id DESC,
|
t.id DESC,
|
||||||
@ -87,13 +88,15 @@ ORDER BY
|
|||||||
COALESCE(mt.rn,rp.rn,1)
|
COALESCE(mt.rn,rp.rn,1)
|
||||||
)
|
)
|
||||||
|
|
||||||
--SELECT * FROM rx
|
--SELECT count(*) FROM rx LIMIT 100
|
||||||
|
|
||||||
|
|
||||||
, agg_to_target_items AS (
|
, agg_to_target_items AS (
|
||||||
SELECT
|
SELECT
|
||||||
srce
|
srce
|
||||||
,id
|
,id
|
||||||
,target
|
,target
|
||||||
|
,seq
|
||||||
,map_intention
|
,map_intention
|
||||||
,regex_function
|
,regex_function
|
||||||
,target_item_number
|
,target_item_number
|
||||||
@ -133,6 +136,7 @@ GROUP BY
|
|||||||
srce
|
srce
|
||||||
,id
|
,id
|
||||||
,target
|
,target
|
||||||
|
,seq
|
||||||
,map_intention
|
,map_intention
|
||||||
,regex_function
|
,regex_function
|
||||||
,target_item_number
|
,target_item_number
|
||||||
@ -142,13 +146,15 @@ GROUP BY
|
|||||||
,retain_key
|
,retain_key
|
||||||
)
|
)
|
||||||
|
|
||||||
--SELECT * FROM agg_to_target_items
|
--SELECT * FROM agg_to_target_items LIMIT 100
|
||||||
|
|
||||||
|
|
||||||
, agg_to_target AS (
|
, agg_to_target AS (
|
||||||
SELECT
|
SELECT
|
||||||
srce
|
srce
|
||||||
,id
|
,id
|
||||||
,target
|
,target
|
||||||
|
,seq
|
||||||
,map_intention
|
,map_intention
|
||||||
,tps.jsonb_concat_obj(COALESCE(map_val,'{}'::JSONB)) map_val
|
,tps.jsonb_concat_obj(COALESCE(map_val,'{}'::JSONB)) map_val
|
||||||
,jsonb_strip_nulls(tps.jsonb_concat_obj(COALESCE(retain_val,'{}'::JSONB))) retain_val
|
,jsonb_strip_nulls(tps.jsonb_concat_obj(COALESCE(retain_val,'{}'::JSONB))) retain_val
|
||||||
@ -158,6 +164,7 @@ GROUP BY
|
|||||||
srce
|
srce
|
||||||
,id
|
,id
|
||||||
,target
|
,target
|
||||||
|
,seq
|
||||||
,map_intention
|
,map_intention
|
||||||
ORDER BY
|
ORDER BY
|
||||||
id
|
id
|
||||||
@ -172,6 +179,7 @@ SELECT
|
|||||||
a.srce
|
a.srce
|
||||||
,a.id
|
,a.id
|
||||||
,a.target
|
,a.target
|
||||||
|
,a.seq
|
||||||
,a.map_intention
|
,a.map_intention
|
||||||
,a.map_val
|
,a.map_val
|
||||||
,a.retain_val retain_value
|
,a.retain_val retain_value
|
||||||
@ -190,7 +198,7 @@ FROM
|
|||||||
SELECT
|
SELECT
|
||||||
srce
|
srce
|
||||||
,id
|
,id
|
||||||
,tps.jsonb_concat_obj(COALESCE(retain_value,'{}'::jsonb)) retain_val
|
,tps.jsonb_concat_obj(COALESCE(retain_value,'{}'::jsonb) ORDER BY seq DESC) retain_val
|
||||||
,tps.jsonb_concat_obj(COALESCE(map,'{}'::jsonb)) map
|
,tps.jsonb_concat_obj(COALESCE(map,'{}'::jsonb)) map
|
||||||
FROM
|
FROM
|
||||||
link_map
|
link_map
|
||||||
@ -199,7 +207,8 @@ GROUP BY
|
|||||||
,id
|
,id
|
||||||
)
|
)
|
||||||
|
|
||||||
SELECT srce, id, jsonb_pretty(retain_val), jsonb_pretty(map) FROM agg_to_id
|
--SELECT agg_to_id.srce, agg_to_id.id, jsonb_pretty(agg_to_id.retain_val) , jsonb_pretty(agg_to_id.map) FROM agg_to_id ORDER BY id desc LIMIT 100
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
UPDATE
|
UPDATE
|
||||||
|
@ -1,11 +1,6 @@
|
|||||||
/*
|
|
||||||
DELETE FROM tps.map_rm where target = 'Strip Amount Commas';
|
UPDATE tps.map_rm
|
||||||
INSERT INTO
|
SET regex =
|
||||||
tps.map_rm
|
|
||||||
SELECT *
|
|
||||||
FROM
|
|
||||||
(VALUES
|
|
||||||
('PNCC', 'Strip Amount Commas',
|
|
||||||
$j$
|
$j$
|
||||||
{
|
{
|
||||||
"name":"Strip Amount Commas",
|
"name":"Strip Amount Commas",
|
||||||
@ -17,263 +12,499 @@ FROM
|
|||||||
"regex": ",",
|
"regex": ",",
|
||||||
"replace":"",
|
"replace":"",
|
||||||
"flag":"g",
|
"flag":"g",
|
||||||
"retain":"y"
|
"retain":"y",
|
||||||
|
"map":"n"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"function":"replace",
|
"function":"replace",
|
||||||
"map":"no",
|
|
||||||
"where": [
|
"where": [
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
$j$::jsonb
|
$j$::jsonb
|
||||||
, 1)
|
WHERE
|
||||||
) x;
|
target = 'Strip Amount Commas';
|
||||||
|
|
||||||
DELETE FROM tps.map_rm where target = 'Parse Descr';
|
|
||||||
INSERT INTO
|
UPDATE tps.map_rm
|
||||||
tps.map_rm
|
SET regex =
|
||||||
SELECT *
|
|
||||||
FROM
|
|
||||||
(VALUES
|
|
||||||
('PNCC', 'Parse Descr',
|
|
||||||
$j$
|
$j$
|
||||||
{
|
{
|
||||||
"name":"Parse Descr",
|
"name":"Parse ACH Credits",
|
||||||
"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
|
|
||||||
tps.map_rm
|
|
||||||
SELECT *
|
|
||||||
FROM
|
|
||||||
(VALUES
|
|
||||||
('PNCC', 'Parse ACH',
|
|
||||||
$j$
|
|
||||||
{
|
|
||||||
"name":"Parse ACH",
|
|
||||||
"description":"parse select components of the description for ACH Credits Receieved",
|
"description":"parse select components of the description for ACH Credits Receieved",
|
||||||
"defn": [
|
"defn": [
|
||||||
{
|
{
|
||||||
"key": "{Description}",
|
"key": "{Description}",
|
||||||
"field":"Comp Name",
|
"field":"beneficiary",
|
||||||
"regex": "Comp Name:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
|
"regex": "Comp Name:(.+?)(?=\\d{6} Com|SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
|
||||||
"flag":"",
|
"flag":"",
|
||||||
"retain":"y"
|
"retain":"y",
|
||||||
|
"map":"n"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "{Description}",
|
"key": "{Description}",
|
||||||
"field":"Cust ID",
|
"field":"Cust ID",
|
||||||
"regex": "Cust ID:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
|
"regex": "Cust ID:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
|
||||||
"flag":"",
|
"flag":"",
|
||||||
"retain":"y"
|
"retain":"y",
|
||||||
|
"map":"n"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "{Description}",
|
"key": "{Description}",
|
||||||
"field":"Desc",
|
"field":"Desc",
|
||||||
"regex": "Desc:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
|
"regex": "Desc:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
|
||||||
"flag":"",
|
"flag":"",
|
||||||
"retain":"y"
|
"retain":"y",
|
||||||
|
"map":"n"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "{Description}",
|
"key": "{Description}",
|
||||||
"field":"Cust Name",
|
"field":"originator",
|
||||||
"regex": "Cust Name:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
|
"regex": "Cust Name:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
|
||||||
"flag":"",
|
"flag":"",
|
||||||
"retain":"y"
|
"retain":"y",
|
||||||
|
"map":"n"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "{Description}",
|
"key": "{Description}",
|
||||||
"field":"Batch Discr",
|
"field":"Batch Discr",
|
||||||
"regex": "Batch Discr:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
|
"regex": "Batch Discr:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
|
||||||
"flag":"",
|
"flag":"",
|
||||||
"retain":"y"
|
"retain":"y",
|
||||||
|
"map":"n"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "{Description}",
|
"key": "{Description}",
|
||||||
"field":"Comp ID",
|
"field":"Comp ID",
|
||||||
"regex": "Comp ID:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
|
"regex": "Comp ID:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
|
||||||
"flag":"",
|
"flag":"",
|
||||||
"retain":"y"
|
"retain":"y",
|
||||||
|
"map":"n"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "{Description}",
|
"key": "{Description}",
|
||||||
"field":"Addenda",
|
"field":"Addenda",
|
||||||
"regex": "Addenda:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
|
"regex": "Addenda:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
|
||||||
"flag":"",
|
"flag":"",
|
||||||
"retain":"y"
|
"retain":"y",
|
||||||
|
"map":"n"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "{Description}",
|
"key": "{Description}",
|
||||||
"field":"SETT",
|
"field":"SETT",
|
||||||
"regex": "SETT:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
|
"regex": "SETT:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
|
||||||
"flag":"",
|
"flag":"",
|
||||||
"retain":"y"
|
"retain":"y",
|
||||||
|
"map":"n"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "{Description}",
|
"key": "{Description}",
|
||||||
"field":"Date",
|
"field":"Date",
|
||||||
"regex": "Date:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
|
"regex": "Date:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
|
||||||
"flag":"",
|
"flag":"",
|
||||||
"retain":"y"
|
"retain":"y",
|
||||||
|
"map":"n"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "{Description}",
|
"key": "{Description}",
|
||||||
"field":"Time",
|
"field":"Time",
|
||||||
"regex": "Time:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
|
"regex": "Time:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
|
||||||
"flag":"",
|
"flag":"",
|
||||||
"retain":"y"
|
"retain":"y",
|
||||||
|
"map":"n"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"function":"extract",
|
"function":"extract",
|
||||||
"map":"no",
|
|
||||||
"where": [
|
"where": [
|
||||||
{
|
{
|
||||||
"Transaction":"ACH Credits"
|
"Transaction":"ACH Credits"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
$j$::jsonb
|
||||||
|
WHERE target = 'Parse ACH Credits';
|
||||||
|
|
||||||
|
|
||||||
|
UPDATE tps.map_rm
|
||||||
|
SET regex =
|
||||||
|
$j$
|
||||||
|
{
|
||||||
|
"name":"Parse ACH Debits",
|
||||||
|
"description":"parse select components of the description for ACH Credits Receieved",
|
||||||
|
"defn": [
|
||||||
|
{
|
||||||
|
"key": "{Description}",
|
||||||
|
"field":"originator",
|
||||||
|
"regex": "Comp Name:(.+?)(?=\\d{6} Com|SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
|
||||||
|
"flag":"",
|
||||||
|
"retain":"y",
|
||||||
|
"map":"n"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"key": "{Description}",
|
||||||
|
"field":"Cust ID",
|
||||||
|
"regex": "Cust ID:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
|
||||||
|
"flag":"",
|
||||||
|
"retain":"y",
|
||||||
|
"map":"n"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "{Description}",
|
||||||
|
"field":"Desc",
|
||||||
|
"regex": "Desc:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
|
||||||
|
"flag":"",
|
||||||
|
"retain":"y",
|
||||||
|
"map":"n"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "{Description}",
|
||||||
|
"field":"beneficiary",
|
||||||
|
"regex": "Cust Name:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
|
||||||
|
"flag":"",
|
||||||
|
"retain":"y",
|
||||||
|
"map":"n"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "{Description}",
|
||||||
|
"field":"Batch Discr",
|
||||||
|
"regex": "Batch Discr:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
|
||||||
|
"flag":"",
|
||||||
|
"retain":"y",
|
||||||
|
"map":"n"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "{Description}",
|
||||||
|
"field":"Comp ID",
|
||||||
|
"regex": "Comp ID:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
|
||||||
|
"flag":"",
|
||||||
|
"retain":"y",
|
||||||
|
"map":"n"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "{Description}",
|
||||||
|
"field":"Addenda",
|
||||||
|
"regex": "Addenda:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
|
||||||
|
"flag":"",
|
||||||
|
"retain":"y",
|
||||||
|
"map":"n"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "{Description}",
|
||||||
|
"field":"SETT",
|
||||||
|
"regex": "SETT:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
|
||||||
|
"flag":"",
|
||||||
|
"retain":"y",
|
||||||
|
"map":"n"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "{Description}",
|
||||||
|
"field":"Date",
|
||||||
|
"regex": "Date:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
|
||||||
|
"flag":"",
|
||||||
|
"retain":"y",
|
||||||
|
"map":"n"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "{Description}",
|
||||||
|
"field":"Time",
|
||||||
|
"regex": "Time:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
|
||||||
|
"flag":"",
|
||||||
|
"retain":"y",
|
||||||
|
"map":"n"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"function":"extract",
|
||||||
|
"where": [
|
||||||
{
|
{
|
||||||
"Transaction":"ACH Debits"
|
"Transaction":"ACH Debits"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
$j$::jsonb
|
$j$::jsonb
|
||||||
, 2)
|
WHERE target = 'Parse ACH Debits';
|
||||||
) x;
|
|
||||||
*/
|
|
||||||
|
|
||||||
UPDATE
|
UPDATE tps.map_rm
|
||||||
tps.map_rm
|
SET regex =
|
||||||
SET
|
|
||||||
regex =
|
|
||||||
$j$
|
$j$
|
||||||
{
|
{
|
||||||
"name":"First 20",
|
"name":"Parse Wires",
|
||||||
"description":"pull first 20 characters from description for mapping",
|
"description":"pull out whatever follows OBI in the description until atleast 3 capital letters followed by a colon are encountered",
|
||||||
"defn": [
|
"defn": [
|
||||||
{
|
{
|
||||||
"key": "{Memo}",
|
"key": "{Description}",
|
||||||
"field":"f20",
|
"field": "dparse",
|
||||||
"regex": ".{1,20}",
|
"regex": "([A-Z]{3,}?:)(.*)(?=[A-Z]{3,}?:|$)",
|
||||||
|
"flag":"g",
|
||||||
|
"retain":"y",
|
||||||
|
"map":"n"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "{Description}",
|
||||||
|
"field": "beneficiary_components",
|
||||||
|
"regex": "BENEFICIARY:(.*?)AC/(\\d*) (.*)(?=[A-Z]{3,}?:|$)",
|
||||||
"flag":"",
|
"flag":"",
|
||||||
"retain":"y"
|
"retain":"y",
|
||||||
|
"map":"n"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "{Description}",
|
||||||
|
"field": "originator_components",
|
||||||
|
"regex": "ORIGINATOR:(.*?)AC/(\\d*) (.*)(?=[A-Z]{3,}?:|$)",
|
||||||
|
"flag":"",
|
||||||
|
"retain":"y",
|
||||||
|
"map":"n"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "{Description}",
|
||||||
|
"field": "beneficiary",
|
||||||
|
"regex": "BENEFICIARY:(.*?)AC/\\d* .*(?=[A-Z]{3,}?:|$)",
|
||||||
|
"flag":"",
|
||||||
|
"retain":"y",
|
||||||
|
"map":"n"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "{Description}",
|
||||||
|
"field": "originator",
|
||||||
|
"regex": "ORIGINATOR:(.*?)AC/\\d* .*(?=[A-Z]{3,}?:|$)",
|
||||||
|
"flag":"",
|
||||||
|
"retain":"y",
|
||||||
|
"map":"n"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "{Description}",
|
||||||
|
"field": "OBI",
|
||||||
|
"regex": "OBI:(.*?)(?=[A-Z]{3,}?:|$)",
|
||||||
|
"flag":"",
|
||||||
|
"retain":"y",
|
||||||
|
"map":"n"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "{Description}",
|
||||||
|
"field": "RFB",
|
||||||
|
"regex": "RFB:(.*?)(?=[A-Z]{3,}?:|$)",
|
||||||
|
"flag":"",
|
||||||
|
"retain":"y",
|
||||||
|
"map":"n"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "{Description}",
|
||||||
|
"field": "ABA",
|
||||||
|
"regex": "ABA:(.*?)(?=[A-Z]{3,}?:|$)",
|
||||||
|
"flag":"",
|
||||||
|
"retain":"y",
|
||||||
|
"map":"n"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "{Description}",
|
||||||
|
"field": "BBI",
|
||||||
|
"regex": "BBI:(.*?)(?=[A-Z]{3,}?:|$)",
|
||||||
|
"flag":"",
|
||||||
|
"retain":"y",
|
||||||
|
"map":"n"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "{Description}",
|
||||||
|
"field": "BENEBNK",
|
||||||
|
"regex": "BENEBNK:(.*?)(?=[A-Z]{3,}?:|$)",
|
||||||
|
"flag":"",
|
||||||
|
"retain":"y",
|
||||||
|
"map":"n"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "{Description}",
|
||||||
|
"field": "IBK",
|
||||||
|
"regex": "IBK:(.*?)(?=[A-Z]{3,}?:|$)",
|
||||||
|
"flag":"",
|
||||||
|
"retain":"y",
|
||||||
|
"map":"n"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "{Description}",
|
||||||
|
"field": "RATE",
|
||||||
|
"regex": "RATE:(.*?)(?=[A-Z]{3,}?:|$)",
|
||||||
|
"flag":"",
|
||||||
|
"retain":"y",
|
||||||
|
"map":"n"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "{Description}",
|
||||||
|
"field": "RECVBNK",
|
||||||
|
"regex": "RECVBNK:(.*?)(?=[A-Z]{3,}?:|$)",
|
||||||
|
"flag":"",
|
||||||
|
"retain":"y",
|
||||||
|
"map":"n"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"function":"extract",
|
||||||
|
"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
|
||||||
|
WHERE target = 'Parse Wires';
|
||||||
|
|
||||||
|
|
||||||
|
UPDATE tps.map_rm
|
||||||
|
SET regex =
|
||||||
|
$j$
|
||||||
|
{
|
||||||
|
"name":"Trans Type",
|
||||||
|
"description":"extract intial description in conjunction with account name and transaction type for mapping",
|
||||||
|
"defn": [
|
||||||
|
{
|
||||||
|
"key": "{AccountName}",
|
||||||
|
"field": "acctn",
|
||||||
|
"regex": "(.*)",
|
||||||
|
"retain": "n",
|
||||||
|
"map":"y"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "{Transaction}",
|
||||||
|
"field": "trans",
|
||||||
|
"regex": "(.*)",
|
||||||
|
"retain": "n",
|
||||||
|
"map":"y"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "{Description}",
|
||||||
|
"field": "ini",
|
||||||
|
"regex": "([\\w].*?)(?=$| -|\\s[0-9].*?|\\s[\\w/]+?:)",
|
||||||
|
"retain": "y",
|
||||||
|
"map":"y"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"where": [
|
||||||
|
{
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"function": "extract"
|
||||||
|
}
|
||||||
|
$j$::jsonb
|
||||||
|
WHERE target = 'Trans Type';
|
||||||
|
|
||||||
|
|
||||||
|
UPDATE tps.map_rm
|
||||||
|
SET regex =
|
||||||
|
$j$
|
||||||
|
{
|
||||||
|
"name":"Currency",
|
||||||
|
"description":"pull out currency indicators from description of misc items and map",
|
||||||
|
"defn": [
|
||||||
|
{
|
||||||
|
"key": "{Description}",
|
||||||
|
"field": "ini",
|
||||||
|
"regex": "([\\w].*?)(?=$| -|\\s[0-9].*?|\\s[\\w/]+?:)",
|
||||||
|
"retain": "y",
|
||||||
|
"map":"y"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "{Description}",
|
||||||
|
"field": "curr1",
|
||||||
|
"regex": ".*(DEBIT|CREDIT).*(USD|CAD).*(?=DEBIT|CREDIT).*(?=USD|CAD).*",
|
||||||
|
"retain": "y",
|
||||||
|
"map":"y"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "{Description}",
|
||||||
|
"field": "curr2",
|
||||||
|
"regex": ".*(?=DEBIT|CREDIT).*(?=USD|CAD).*(DEBIT|CREDIT).*(USD|CAD).*",
|
||||||
|
"retain": "y",
|
||||||
|
"map":"y"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"where": [
|
||||||
|
{
|
||||||
|
"Transaction": "Miscellaneous Credits"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Transaction": "Miscellaneous Debits"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"function": "extract"
|
||||||
|
}
|
||||||
|
$j$::jsonb
|
||||||
|
WHERE target = 'Currency';
|
||||||
|
|
||||||
|
UPDATE tps.map_rm
|
||||||
|
SET regex =
|
||||||
|
$j$
|
||||||
|
{
|
||||||
|
"defn": [
|
||||||
|
{
|
||||||
|
"key": "{Description}",
|
||||||
|
"field": "checkn",
|
||||||
|
"regex": "[^0-9]*([0-9]*)\\s|$",
|
||||||
|
"retain": "y",
|
||||||
|
"map":"n"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"where": [
|
||||||
|
{
|
||||||
|
"Transaction": "Checks Paid"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"function": "extract"
|
||||||
|
}
|
||||||
|
$j$::jsonb
|
||||||
|
WHERE target = 'Check Number';
|
||||||
|
|
||||||
|
|
||||||
|
UPDATE tps.map_rm
|
||||||
|
SET regex =
|
||||||
|
$j$
|
||||||
|
{
|
||||||
|
"name":"ADP Codes",
|
||||||
|
"description":"link to adp code definitions",
|
||||||
|
"defn": [
|
||||||
|
{
|
||||||
|
"key": "{gl_descr}",
|
||||||
|
"field": "gl_descr",
|
||||||
|
"regex": ".*",
|
||||||
|
"flag":"",
|
||||||
|
"retain":"n",
|
||||||
|
"map":"y"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "{prim_offset}",
|
||||||
|
"field": "prim_offset",
|
||||||
|
"regex": ".*",
|
||||||
|
"flag":"",
|
||||||
|
"retain":"n",
|
||||||
|
"map":"y"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "{pay_date}",
|
||||||
|
"field": "pay_month",
|
||||||
|
"regex": ".{1,4}",
|
||||||
|
"flag":"",
|
||||||
|
"retain":"y",
|
||||||
|
"map":"n"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"function":"extract",
|
"function":"extract",
|
||||||
"map":"yes",
|
|
||||||
"where": [
|
"where": [
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
$j$::jsonb
|
$j$::jsonb
|
||||||
WHERE srce = 'HUNT'
|
WHERE
|
||||||
|
target = 'ADP Codes';
|
Loading…
Reference in New Issue
Block a user