Merge pull request #21 from fleetside72/dev_setup

Dev setup
This commit is contained in:
fleetside72 2018-05-31 00:37:46 -04:00 committed by GitHub
commit 26ecccda00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
44 changed files with 6622 additions and 941 deletions

View File

@ -0,0 +1,4 @@
curl -H "Content-Type: application/json" -X POST -d@./srce.json http://localhost:81/srce_set
curl -H "Content-Type: application/json" -X POST -d@./map.json http://localhost:81/mapdef_set
curl -H "Content-Type: application/json" -X POST -d@./vals.json http://localhost:81/mapval_set
curl -v -F upload=@//mnt/c/Users/fleet/Downloads/dcard.csv http://localhost:81/import?srce=dcard

View File

@ -0,0 +1,24 @@
--source
SELECT DEFN FROM TPS.SRCE WHERE SRCE = 'DCARD'
--mapdef
SELECT jsonb_agg(row_to_json(x)::jsonb) FROM (SELECT srce, target "name", regex, seq "sequence" FROM tps.map_rm WHERE srce = 'DCARD') x
--map values
SELECT jsonb_agg(row_to_JSON(x)::jsonb) FROM (SELECT srce "source", target "map", retval ret_val, "map" mapped FROM tps.map_rv WHERE srce = 'DCARD') X
--records
copy (
select
to_char(r."Trans. Date",'mm/dd/yyyy') "Trans. Date"
,to_char(r."Post Date",'mm/dd/yyyy') "Post Date"
,r."Description"
,r."Amount"
,r."Category"
from
tps.trans
join lateral jsonb_populate_record(null::tps.dcard, rec) r on true
where
srce = 'DCARD'
) to
'C:\users\fleet\downloads\dcard.csv' with (format csv, header true);

View File

@ -0,0 +1,25 @@
[
{
"regex": {
"function": "extract",
"description": "pull first 20 characters from description for mapping",
"where": [
{}
],
"defn": [
{
"regex": ".{1,20}",
"map": "y",
"field": "f20",
"flag": "",
"key": "{Description}",
"retain": "y"
}
],
"name": "First 20"
},
"sequence": 2,
"name": "First 20",
"srce": "dcard"
}
]

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,3 @@
curl -H "Content-Type: application/json" -X POST -d@./srce.json http://localhost:81/srce_set
curl -H "Content-Type: application/json" -X POST -d@./mapdef.json http://localhost:81/mapdef_set
curl -v -F upload=@//mnt/c/Users/fleet/Downloads/hunt.csv http://localhost:81/import?srce=hunt

View File

@ -0,0 +1,27 @@
--source
COPY (SELECT DEFN FROM TPS.SRCE WHERE SRCE = 'HUNT') TO 'C:\users\fleet\documents\tps_etl\reload\hunt\srce.json' WITH (FORMAT TEXT, HEADER FALSE)
--mapdef
COPY (SELECT jsonb_agg(row_to_json(x)::jsonb) FROM (SELECT srce, target "name", regex, seq "sequence" FROM tps.map_rm WHERE srce = 'HUNT') x) TO 'C:\users\fleet\documents\tps_etl\reload\hunt\map.json' WITH (FORMAT TEXT, HEADER FALSE)
--map values
SELECT jsonb_agg(row_to_JSON(x)::jsonb) FROM (SELECT srce "source", target "map", retval ret_val, "map" mapped FROM tps.map_rv WHERE srce = 'HUNT') X
--records
copy (
select
to_char(r."Date",'mm/dd/yy') "Date"
,r."Reference Number"
,r."Payee Name"
,r."Memo"
,r."Amount"
,r."Category Name"
from
tps.trans
join lateral jsonb_populate_record(null::tps.hunt, rec) r on true
where
srce = 'HUNT'
order by
r."Date" asc
) to
'C:\users\fleet\downloads\hunt.csv' with (format csv, header true);

View File

@ -0,0 +1,25 @@
[
{
"name": "First 20",
"srce": "hunt",
"regex": {
"defn": [
{
"key": "{Memo}",
"map": "y",
"flag": "",
"field": "f20",
"regex": ".{1,20}",
"retain": "y"
}
],
"name": "First 20",
"where": [
{}
],
"function": "replace",
"description": "pull first 20 characters from description for mapping"
},
"sequence": 1
}
]

View File

@ -0,0 +1,42 @@
{
"name": "hunt",
"source": "client_file",
"loading_function": "csv",
"constraint": [
"{Date}"
],
"schemas": {
"default": [
{
"path": "{Date}",
"type": "date",
"column_name": "Date"
},
{
"path": "{Reference Number}",
"type": "numeric",
"column_name": "Reference Number"
},
{
"path": "{Payee Name}",
"type": "text",
"column_name": "Payee Name"
},
{
"path": "{Memo}",
"type": "text",
"column_name": "Memo"
},
{
"path": "{Amount}",
"type": "numeric",
"column_name": "Amount"
},
{
"path": "{Category Name}",
"type": "text",
"column_name": "Cateogry Name"
}
]
}
}

View File

@ -0,0 +1,58 @@
--transactions with date in download format for constraint
COPY
(
SELECT
r."perd_start",
r."perd_end",
r."check_date",
r."loc_code",
r."loc_descr",
r."loc_glseg",
r."loc_over",
r."dep_code",
r."dep_descr",
r."dep_nat",
r."dep_over",
r."di_code",
r."di_descr",
r."di_glseg",
r."di_over",
r."title_code",
r."title_descr",
r."title_glseg",
r."title_over",
r."ee_code",
r."ee_glseg",
r."ee_over",
r."acct_type_code",
r."hours",
r."nat_code",
r."nat_over",
r."gl_ref",
r."gl_group",
r."gl_descr",
r."gl_code",
r."gl_amount",
r."pp_code",
r."pp_descr",
r."pp_gl",
r."pp_over",
r."transaction"
FROM
tps.trans
JOIN LATERAL jsonb_populate_record(NULL::tps.PAYCOM, rec) r ON TRUE
WHERE
srce = 'PAYCOM'
)
TO 'C:\users\ptrowbridge\downloads\PAYCOM.csv' WITH (format csv, header TRUE)
--source
SELECT DEFN FROM TPS.SRCE WHERE SRCE = 'PAYCOM'
--mapdef
SELECT jsonb_agg(row_to_json(x)::jsonb) FROM (SELECT srce, target "name", regex, seq "sequence" FROM tps.map_rm WHERE srce = 'PAYCOM') x
--map values
SELECT jsonb_agg(row_to_JSON(x)::jsonb) FROM (SELECT srce "source", target "map", retval ret_val, "map" mapped FROM tps.map_rv WHERE srce = 'PAYCOM') X

View File

@ -0,0 +1,4 @@
curl -H "Content-Type: application/json" -X POST -d@./srce.json http://localhost:81/srce_set
curl -H "Content-Type: application/json" -X POST -d@./map.json http://localhost:81/mapdef_set
curl -H "Content-Type: application/json" -X POST -d@./vals.json http://localhost:81/mapval_set
curl -v -F upload=@//mnt/c/Users/ptrowbridge/Downloads/PAYCOM.csv http://localhost:81/import?srce=PAYCOM

View File

@ -0,0 +1,64 @@
[
{
"name": "Extract month and code",
"srce": "PAYCOM",
"regex": {
"defn": [
{
"key": "{check_date}",
"map": "n",
"flag": "",
"field": "check_month",
"regex": "(\\d{4})-(\\d{2})-\\d{2}",
"retain": "y"
},
{
"key": "{loc_code}",
"map": "y",
"flag": "",
"field": "loc_code_rx",
"regex": ".*",
"retain": "n"
}
],
"name": "Paycom",
"where": [
{}
],
"function": "extract",
"description": "extract month and code"
},
"sequence": 1
},
{
"name": "SUBSEQUENT PAYOUT",
"srce": "PAYCOM",
"regex": {
"defn": [
{
"key": "{gl_group}",
"map": "y",
"flag": "",
"field": "gl_group",
"regex": ".*",
"retain": "n"
},
{
"key": "{acct_type_code}",
"map": "y",
"flag": "",
"field": "acct_type_code",
"regex": ".*",
"retain": "n"
}
],
"name": "Paycom",
"where": [
{}
],
"function": "extract",
"description": "map payroll code and account group to subsequent payout"
},
"sequence": 2
}
]

View File

@ -0,0 +1,195 @@
{
"constraint": [
"{transaction}",
"{loc_code}",
"{perd_start}",
"{perd_end}"
],
"name": "PAYCOM",
"source": "client_file",
"loading_function": "csv",
"schemas": {
"default": [
{
"path": "{perd_start}",
"type": "date",
"column_name": "perd_start"
},
{
"path": "{perd_end}",
"type": "date",
"column_name": "perd_end"
},
{
"path": "{check_date}",
"type": "date",
"column_name": "check_date"
},
{
"path": "{loc_code}",
"type": "text",
"column_name": "loc_code"
},
{
"path": "{loc_descr}",
"type": "text",
"column_name": "loc_descr"
},
{
"path": "{loc_glseg}",
"type": "text",
"column_name": "loc_glseg"
},
{
"path": "{loc_over}",
"type": "text",
"column_name": "loc_over"
},
{
"path": "{dep_code}",
"type": "text",
"column_name": "dep_code"
},
{
"path": "{dep_descr}",
"type": "text",
"column_name": "dep_descr"
},
{
"path": "{dep_nat}",
"type": "text",
"column_name": "dep_nat"
},
{
"path": "{dep_over}",
"type": "text",
"column_name": "dep_over"
},
{
"path": "{di_code}",
"type": "text",
"column_name": "di_code"
},
{
"path": "{di_descr}",
"type": "text",
"column_name": "di_descr"
},
{
"path": "{di_glseg}",
"type": "text",
"column_name": "di_glseg"
},
{
"path": "{di_over}",
"type": "text",
"column_name": "di_over"
},
{
"path": "{title_code}",
"type": "text",
"column_name": "title_code"
},
{
"path": "{title_descr}",
"type": "text",
"column_name": "title_descr"
},
{
"path": "{title_glseg}",
"type": "text",
"column_name": "title_glseg"
},
{
"path": "{title_over}",
"type": "text",
"column_name": "title_over"
},
{
"path": "{ee_code}",
"type": "text",
"column_name": "ee_code"
},
{
"path": "{ee_glseg}",
"type": "text",
"column_name": "ee_glseg"
},
{
"path": "{ee_over}",
"type": "text",
"column_name": "ee_over"
},
{
"path": "{acct_type_code}",
"type": "text",
"column_name": "acct_type_code"
},
{
"path": "{hours}",
"type": "numeric",
"column_name": "hours"
},
{
"path": "{nat_code}",
"type": "text",
"column_name": "nat_code"
},
{
"path": "{nat_over}",
"type": "text",
"column_name": "nat_over"
},
{
"path": "{gl_ref}",
"type": "text",
"column_name": "gl_ref"
},
{
"path": "{gl_group}",
"type": "text",
"column_name": "gl_group"
},
{
"path": "{gl_descr}",
"type": "text",
"column_name": "gl_descr"
},
{
"path": "{gl_code}",
"type": "text",
"column_name": "gl_code"
},
{
"path": "{gl_amount}",
"type": "numeric",
"column_name": "gl_amount"
},
{
"path": "{pp_code}",
"type": "text",
"column_name": "pp_code"
},
{
"path": "{pp_descr}",
"type": "text",
"column_name": "pp_descr"
},
{
"path": "{pp_gl}",
"type": "text",
"column_name": "pp_gl"
},
{
"path": "{pp_over}",
"type": "text",
"column_name": "pp_over"
},
{
"path": "{transaction}",
"type": "text",
"column_name": "transaction"
}
]
}
}

View File

@ -0,0 +1,139 @@
[
{
"map": "Extract month and code",
"mapped": {
"trial_bal": "65"
},
"source": "PAYCOM",
"ret_val": {
"loc_code_rx": "SLS"
}
},
{
"map": "Extract month and code",
"mapped": {
"trial_bal": "59"
},
"source": "PAYCOM",
"ret_val": {
"loc_code_rx": "SEB"
}
},
{
"map": "Extract month and code",
"mapped": {
"trial_bal": "93"
},
"source": "PAYCOM",
"ret_val": {
"loc_code_rx": "MDF"
}
},
{
"map": "Extract month and code",
"mapped": {
"trial_bal": "93"
},
"source": "PAYCOM",
"ret_val": {
"loc_code_rx": "ELY"
}
},
{
"map": "Extract month and code",
"mapped": {
"trial_bal": "93"
},
"source": "PAYCOM",
"ret_val": {
"loc_code_rx": "TWN"
}
},
{
"map": "Extract month and code",
"mapped": {
"trial_bal": "88"
},
"source": "PAYCOM",
"ret_val": {
"loc_code_rx": "SPK"
}
},
{
"map": "SUBSEQUENT PAYOUT",
"mapped": {
"third_party": "PRINCIPAL LIFE P"
},
"source": "PAYCOM",
"ret_val": {
"gl_group": "4.Liab",
"acct_type_code": "40P"
}
},
{
"map": "SUBSEQUENT PAYOUT",
"mapped": {
"third_party": "PRINCIPAL LIFE P"
},
"source": "PAYCOM",
"ret_val": {
"gl_group": "4.Liab",
"acct_type_code": "CUF"
}
},
{
"map": "SUBSEQUENT PAYOUT",
"mapped": {
"third_party": "PRINCIPAL LIFE P"
},
"source": "PAYCOM",
"ret_val": {
"gl_group": "4.Liab",
"acct_type_code": "K4L"
}
},
{
"map": "SUBSEQUENT PAYOUT",
"mapped": {
"third_party": "PRINCIPAL LIFE P"
},
"source": "PAYCOM",
"ret_val": {
"gl_group": "5.Liab",
"acct_type_code": "40P"
}
},
{
"map": "SUBSEQUENT PAYOUT",
"mapped": {
"third_party": "PRINCIPAL LIFE P"
},
"source": "PAYCOM",
"ret_val": {
"gl_group": "5.Liab",
"acct_type_code": "CUF"
}
},
{
"map": "SUBSEQUENT PAYOUT",
"mapped": {
"third_party": "Basic NEO"
},
"source": "PAYCOM",
"ret_val": {
"gl_group": "4.Liab",
"acct_type_code": "FSA"
}
},
{
"map": "SUBSEQUENT PAYOUT",
"mapped": {
"third_party": "Basic NEO"
},
"source": "PAYCOM",
"ret_val": {
"gl_group": "4.Liab",
"acct_type_code": "FSD"
}
}
]

View File

@ -0,0 +1,32 @@
--transactions with date in download format for constraint
COPY
(
SELECT
to_char(r."AsOfDate",'mm/dd/yyyy') "AsOfDate"
,r."BankId"
,r."AccountNumber"
,r."AccountName"
,r."BaiControl"
,r."Currency"
,r."Transaction"
,r."Reference"
,r."Amount"
,r."Description"
FROM
tps.trans
JOIN LATERAL jsonb_populate_record(NULL::tps.pncc, rec) r ON TRUE
WHERE
srce = 'PNCC'
)
TO 'C:\users\ptrowbridge\downloads\pncc.csv' WITH (format csv, header TRUE)
--source
SELECT DEFN FROM TPS.SRCE WHERE SRCE = 'PNCC'
--mapdef
SELECT jsonb_agg(row_to_json(x)::jsonb) FROM (SELECT srce, target "name", regex, seq "sequence" FROM tps.map_rm WHERE srce = 'PNCC') x
--map values
SELECT jsonb_agg(row_to_JSON(x)::jsonb) FROM (SELECT srce "source", target "map", retval ret_val, "map" mapped FROM tps.map_rv WHERE srce = 'PNCC') X

View File

@ -0,0 +1,4 @@
curl -H "Content-Type: application/json" -X POST -d@./srce.json http://localhost:81/srce_set
curl -H "Content-Type: application/json" -X POST -d@./map.json http://localhost:81/mapdef_set
curl -H "Content-Type: application/json" -X POST -d@./vals.json http://localhost:81/mapval_set
curl -v -F upload=@//mnt/c/Users/ptrowbridge/Downloads/pncc.csv http://localhost:81/import?srce=PNCC

455
deploy/reload/pncc/map.json Normal file
View File

@ -0,0 +1,455 @@
[
{
"name": "Check Number",
"srce": "PNCC",
"regex": {
"defn": [
{
"key": "{Description}",
"map": "n",
"field": "checkn",
"regex": "[^0-9]*([0-9]*)\\s|$",
"retain": "y"
}
],
"where": [
{
"Transaction": "Checks Paid"
}
],
"function": "extract"
},
"sequence": 2
},
{
"name": "Strip Amount Commas",
"srce": "PNCC",
"regex": {
"defn": [
{
"key": "{Amount}",
"map": "n",
"flag": "g",
"field": "amount",
"regex": ",",
"retain": "y",
"replace": ""
}
],
"name": "Strip Amount Commas",
"where": [
{}
],
"function": "replace",
"description": "the Amount field come from PNC with commas embeded so it cannot be cast to numeric"
},
"sequence": 1
},
{
"name": "Trans Type",
"srce": "PNCC",
"regex": {
"defn": [
{
"key": "{AccountName}",
"map": "y",
"field": "acctn",
"regex": "(.*)",
"retain": "n"
},
{
"key": "{Transaction}",
"map": "y",
"field": "trans",
"regex": "(.*)",
"retain": "n"
},
{
"key": "{Description}",
"map": "y",
"field": "ini",
"regex": "([\\w].*?)(?=$| -|\\s[0-9].*?|\\s[\\w/]+?:)",
"retain": "y"
}
],
"name": "Trans Type",
"where": [
{}
],
"function": "extract",
"description": "extract intial description in conjunction with account name and transaction type for mapping"
},
"sequence": 1
},
{
"name": "Currency",
"srce": "PNCC",
"regex": {
"defn": [
{
"key": "{Description}",
"map": "y",
"field": "ini",
"regex": "([\\w].*?)(?=$| -|\\s[0-9].*?|\\s[\\w/]+?:)",
"retain": "y"
},
{
"key": "{Description}",
"map": "y",
"field": "curr1",
"regex": ".*(DEBIT|CREDIT).*(USD|CAD).*(?=DEBIT|CREDIT).*(?=USD|CAD).*",
"retain": "y"
},
{
"key": "{Description}",
"map": "y",
"field": "curr2",
"regex": ".*(?=DEBIT|CREDIT).*(?=USD|CAD).*(DEBIT|CREDIT).*(USD|CAD).*",
"retain": "y"
}
],
"name": "Currency",
"where": [
{
"Transaction": "Miscellaneous Credits"
},
{
"Transaction": "Miscellaneous Debits"
}
],
"function": "extract",
"description": "pull out currency indicators from description of misc items and map"
},
"sequence": 2
},
{
"name": "Parse ACH Credits",
"srce": "PNCC",
"regex": {
"defn": [
{
"key": "{Description}",
"map": "n",
"flag": "",
"field": "beneficiary",
"regex": "Comp Name:(.+?)(?=\\d{6} Com|SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
"retain": "y"
},
{
"key": "{Description}",
"map": "n",
"flag": "",
"field": "Cust ID",
"regex": "Cust ID:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
"retain": "y"
},
{
"key": "{Description}",
"map": "n",
"flag": "",
"field": "Desc",
"regex": "Desc:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
"retain": "y"
},
{
"key": "{Description}",
"map": "n",
"flag": "",
"field": "originator",
"regex": "Cust Name:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
"retain": "y"
},
{
"key": "{Description}",
"map": "n",
"flag": "",
"field": "Batch Discr",
"regex": "Batch Discr:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
"retain": "y"
},
{
"key": "{Description}",
"map": "n",
"flag": "",
"field": "Comp ID",
"regex": "Comp ID:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
"retain": "y"
},
{
"key": "{Description}",
"map": "n",
"flag": "",
"field": "Addenda",
"regex": "Addenda:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
"retain": "y"
},
{
"key": "{Description}",
"map": "n",
"flag": "",
"field": "SETT",
"regex": "SETT:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
"retain": "y"
},
{
"key": "{Description}",
"map": "n",
"flag": "",
"field": "Date",
"regex": "Date:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
"retain": "y"
},
{
"key": "{Description}",
"map": "n",
"flag": "",
"field": "Time",
"regex": "Time:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
"retain": "y"
}
],
"name": "Parse ACH Credits",
"where": [
{
"Transaction": "ACH Credits"
}
],
"function": "extract",
"description": "parse select components of the description for ACH Credits Receieved"
},
"sequence": 2
},
{
"name": "Parse ACH Debits",
"srce": "PNCC",
"regex": {
"defn": [
{
"key": "{Description}",
"map": "n",
"flag": "",
"field": "originator",
"regex": "Comp Name:(.+?)(?=\\d{6} Com|SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
"retain": "y"
},
{
"key": "{Description}",
"map": "n",
"flag": "",
"field": "Cust ID",
"regex": "Cust ID:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
"retain": "y"
},
{
"key": "{Description}",
"map": "n",
"flag": "",
"field": "Desc",
"regex": "Desc:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
"retain": "y"
},
{
"key": "{Description}",
"map": "n",
"flag": "",
"field": "beneficiary",
"regex": "Cust Name:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
"retain": "y"
},
{
"key": "{Description}",
"map": "n",
"flag": "",
"field": "Batch Discr",
"regex": "Batch Discr:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
"retain": "y"
},
{
"key": "{Description}",
"map": "n",
"flag": "",
"field": "Comp ID",
"regex": "Comp ID:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
"retain": "y"
},
{
"key": "{Description}",
"map": "n",
"flag": "",
"field": "Addenda",
"regex": "Addenda:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
"retain": "y"
},
{
"key": "{Description}",
"map": "n",
"flag": "",
"field": "SETT",
"regex": "SETT:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
"retain": "y"
},
{
"key": "{Description}",
"map": "n",
"flag": "",
"field": "Date",
"regex": "Date:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
"retain": "y"
},
{
"key": "{Description}",
"map": "n",
"flag": "",
"field": "Time",
"regex": "Time:(.+?)(?=SEC:|Cust ID:|Desc:|Comp Name:|Comp ID:|Batch Discr:|Cust Name:|Addenda:|SETT:|Date:|Time:|$)",
"retain": "y"
}
],
"name": "Parse ACH Debits",
"where": [
{
"Transaction": "ACH Debits"
}
],
"function": "extract",
"description": "parse select components of the description for ACH Credits Receieved"
},
"sequence": 2
},
{
"name": "Parse Wires",
"srce": "PNCC",
"regex": {
"defn": [
{
"key": "{Description}",
"map": "n",
"flag": "g",
"field": "dparse",
"regex": "([A-Z]{3,}?:)(.*)(?=[A-Z]{3,}?:|$)",
"retain": "y"
},
{
"key": "{Description}",
"map": "n",
"flag": "",
"field": "beneficiary_components",
"regex": "BENEFICIARY:(.*?)AC/([\\d-]*) (.*)(?=[A-Z]{3,}?:|$)",
"retain": "y"
},
{
"key": "{Description}",
"map": "n",
"flag": "",
"field": "originator_components",
"regex": "ORIGINATOR:(.*?)AC/(\\d*) (.*)(?=[A-Z]{3,}?:|$)",
"retain": "y"
},
{
"key": "{Description}",
"map": "n",
"flag": "",
"field": "beneficiary",
"regex": "BENEFICIARY:(.*?)AC/[\\d-]* .*(?=[A-Z]{3,}?:|$)",
"retain": "y"
},
{
"key": "{Description}",
"map": "n",
"flag": "",
"field": "originator",
"regex": "ORIGINATOR:(.*?)AC/\\d* .*(?=[A-Z]{3,}?:|$)",
"retain": "y"
},
{
"key": "{Description}",
"map": "n",
"flag": "",
"field": "OBI",
"regex": "OBI:(.*?)(?=[A-Z]{3,}?:|$)",
"retain": "y"
},
{
"key": "{Description}",
"map": "n",
"flag": "",
"field": "RFB",
"regex": "RFB:(.*?)(?=[A-Z]{3,}?:|$)",
"retain": "y"
},
{
"key": "{Description}",
"map": "n",
"flag": "",
"field": "ABA",
"regex": "ABA:(.*?)(?=[A-Z]{3,}?:|$)",
"retain": "y"
},
{
"key": "{Description}",
"map": "n",
"flag": "",
"field": "BBI",
"regex": "BBI:(.*?)(?=[A-Z]{3,}?:|$)",
"retain": "y"
},
{
"key": "{Description}",
"map": "n",
"flag": "",
"field": "BENEBNK",
"regex": "BENEBNK:(.*?)(?=[A-Z]{3,}?:|$)",
"retain": "y"
},
{
"key": "{Description}",
"map": "n",
"flag": "",
"field": "IBK",
"regex": "IBK:(.*?)(?=[A-Z]{3,}?:|$)",
"retain": "y"
},
{
"key": "{Description}",
"map": "n",
"flag": "",
"field": "RATE",
"regex": "RATE:(.*?)(?=[A-Z]{3,}?:|$)",
"retain": "y"
},
{
"key": "{Description}",
"map": "n",
"flag": "",
"field": "RECVBNK",
"regex": "RECVBNK:(.*?)(?=[A-Z]{3,}?:|$)",
"retain": "y"
}
],
"name": "Parse Wires",
"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"
}
],
"function": "extract",
"description": "pull out whatever follows OBI in the description until atleast 3 capital letters followed by a colon are encountered"
},
"sequence": 2
}
]

View File

@ -1,7 +1,7 @@
{
"name": "PNCC",
"type": "csv",
"descr": "PNC Cash Accounts",
"source": "client_file",
"loading_function": "csv",
"constraint": [
"{AsOfDate}"
],
@ -15,7 +15,7 @@
{
"path": "{BankId}",
"type": "text",
"column_name": "BankID"
"column_name": "BankId"
},
{
"path": "{AccountNumber}",
@ -60,7 +60,7 @@
{
"path": "{AdditionalRemittance}",
"type": "text",
"column_name": "CurrencyAdditionalRemittance"
"column_name": "AdditionalRemittance"
}
]
}

View File

@ -0,0 +1,952 @@
[
{
"map": "Trans Type",
"mapped": {
"sign": "-1",
"party": "PNC",
"ledger": "Manual",
"reason": "Bank Fees",
"trantype": "Disbursement"
},
"source": "PNCC",
"ret_val": {
"ini": "CANADA TAX",
"acctn": "The HC Operating Company OPERA",
"trans": "Detail Debit Adjustments"
}
},
{
"map": "Trans Type",
"mapped": {
"sign": "-1",
"ledger": "AP - ACH",
"trantype": "Disbursement"
},
"source": "PNCC",
"ret_val": {
"ini": "ACH DEBIT SETTLEMENT",
"acctn": "The HC Operating Company OPERA",
"trans": "ACH Debits"
}
},
{
"map": "Trans Type",
"mapped": {
"sign": "-1",
"ledger": "Manual",
"reason": "Returned Deposit RTM",
"trantype": "Collections"
},
"source": "PNCC",
"ret_val": {
"ini": "RET DEP ITEM RTM",
"acctn": "The HC Operating Company FBO P",
"trans": "Deposited Items Returned"
}
},
{
"map": "Trans Type",
"mapped": {
"sign": "-1",
"ledger": "Manual",
"reason": "Returned Deposit STOP",
"trantype": "Collections"
},
"source": "PNCC",
"ret_val": {
"ini": "RET DEP ITEM STOP",
"acctn": "The HC Operating Company FBO P",
"trans": "Deposited Items Returned"
}
},
{
"map": "Trans Type",
"mapped": {
"sign": "1",
"ledger": "AR - Collections",
"trantype": "Collections"
},
"source": "PNCC",
"ret_val": {
"ini": "CREDIT ADJUSTMENT",
"acctn": "The HC Operating Company FBO P",
"trans": "Detail Credit Adjustments"
}
},
{
"map": "Trans Type",
"mapped": {
"sign": "1",
"ledger": "Manual",
"reason": "Returned Check",
"trantype": "Disbursement"
},
"source": "PNCC",
"ret_val": {
"ini": "REFER TO MAKER OF CK RETURN CK",
"acctn": "The HC Operating Company OPERA",
"trans": "Detail Credit Adjustments"
}
},
{
"map": "Trans Type",
"mapped": {
"sign": "-1",
"ledger": "Manual",
"reason": "Payroll Adjustment",
"trantype": "Disbursement"
},
"source": "PNCC",
"ret_val": {
"ini": "DEBIT ADJUSTMENT",
"acctn": "The HC Operating Company PAYR",
"trans": "Detail Debit Adjustments"
}
},
{
"map": "Trans Type",
"mapped": {
"sign": "1",
"ledger": "AR - Collections",
"trantype": "Collections"
},
"source": "PNCC",
"ret_val": {
"ini": "DEPOSIT",
"acctn": "The HC Operating Company FBO P",
"trans": "Detail Deposits"
}
},
{
"map": "Trans Type",
"mapped": {
"sign": "-1",
"ledger": "AP - Wire",
"trantype": "Disbursement"
},
"source": "PNCC",
"ret_val": {
"ini": "INTL WIRE OUT",
"acctn": "The HC Operating Company OPERA",
"trans": "Intl Money Transfer Debits"
}
},
{
"map": "Trans Type",
"mapped": {
"sign": "-1",
"ledger": "AP - Wire",
"trantype": "Disbursement"
},
"source": "PNCC",
"ret_val": {
"ini": "INTL WIRES OUT",
"acctn": "The HC Operating Company OPERA",
"trans": "Intl Money Transfer Debits"
}
},
{
"map": "Trans Type",
"mapped": {
"sign": "1",
"ledger": "AR - Collections",
"trantype": "Collections"
},
"source": "PNCC",
"ret_val": {
"ini": "WHLS LBX DEP",
"acctn": "The HC Operating Company FBO P",
"trans": "Lockbox Deposits"
}
},
{
"map": "Trans Type",
"mapped": {
"sign": "1",
"ledger": "AR - Collections",
"trantype": "Collections"
},
"source": "PNCC",
"ret_val": {
"ini": "WHLS LBX DEP932855",
"acctn": "The HC Operating Company FBO P",
"trans": "Lockbox Deposits"
}
},
{
"map": "Trans Type",
"mapped": {
"sign": "1",
"ledger": "Manual",
"reason": "Revolver Advance",
"trantype": "Revolver Borrow"
},
"source": "PNCC",
"ret_val": {
"ini": "ADVANCE",
"acctn": "The HC Operating Company OPERA",
"trans": "Miscellaneous Credits"
}
},
{
"map": "Trans Type",
"mapped": {
"sign": "1",
"ledger": "Manual",
"trantype": "Collections"
},
"source": "PNCC",
"ret_val": {
"ini": "DEPOSIT:",
"acctn": "The HC Operating Company FBO P",
"trans": "Miscellaneous Credits"
}
},
{
"map": "Trans Type",
"mapped": {
"sign": "1",
"ledger": "Manual",
"reason": "Misc Credit",
"trantype": "Disbursement"
},
"source": "PNCC",
"ret_val": {
"ini": "MISC CREDIT",
"acctn": "The HC Operating Company OPERA",
"trans": "Miscellaneous Credits"
}
},
{
"map": "Trans Type",
"mapped": {
"sign": "1",
"ledger": "Manual",
"reason": "Revolver Payment",
"trantype": "Revolver Borrow"
},
"source": "PNCC",
"ret_val": {
"ini": "PAYMENT",
"acctn": "The HC Operating Company FBO P",
"trans": "Miscellaneous Credits"
}
},
{
"map": "Trans Type",
"mapped": {
"sign": "-1",
"ledger": "Manual",
"reason": "Revolver Payment",
"trantype": "Revolver Payment"
},
"source": "PNCC",
"ret_val": {
"ini": "PAYMENT",
"acctn": "The HC Operating Company FBO P",
"trans": "Miscellaneous Debits"
}
},
{
"map": "Trans Type",
"mapped": {
"sign": "1",
"ledger": "AR - Collections",
"trantype": "Collections"
},
"source": "PNCC",
"ret_val": {
"ini": "INTTL WIRES IN",
"acctn": "The HC Operating Company FBO P",
"trans": "Intl Money Transfer Credits"
}
},
{
"map": "Trans Type",
"mapped": {
"sign": "1",
"ledger": "Manual",
"reason": "Revolver Advance",
"trantype": "Revolver Borrow"
},
"source": "PNCC",
"ret_val": {
"ini": "PNC BANK- NJ LOAN PROCEEDS",
"acctn": "The HC Operating Company FBO P",
"trans": "Money Transfer CR-Other"
}
},
{
"map": "Trans Type",
"mapped": {
"sign": "1",
"ledger": "Manual",
"reason": "Revolver Advance",
"trantype": "Revolver Borrow"
},
"source": "PNCC",
"ret_val": {
"ini": "PNC BANK-PGH LOAN PROCEEDS",
"acctn": "The HC Operating Company OPERA",
"trans": "Money Transfer CR-Other"
}
},
{
"map": "Trans Type",
"mapped": {
"sign": "1",
"ledger": "AR - Collections",
"trantype": "Collections"
},
"source": "PNCC",
"ret_val": {
"ini": "FED WIRE IN",
"acctn": "The HC Operating Company FBO P",
"trans": "Money Transfer CR-Wire"
}
},
{
"map": "Trans Type",
"mapped": {
"sign": "1",
"ledger": "Manual",
"reason": "Returned Wires",
"trantype": "Disbursement"
},
"source": "PNCC",
"ret_val": {
"ini": "FED WIRE IN",
"acctn": "The HC Operating Company OPERA",
"trans": "Money Transfer CR-Wire"
}
},
{
"map": "Trans Type",
"mapped": {
"sign": "-1",
"ledger": "Manual",
"reason": "Returned Item",
"trantype": "Disbursement"
},
"source": "PNCC",
"ret_val": {
"ini": "BOOK TRANSFER DEBIT",
"acctn": "The HC Operating Company OPERA",
"trans": "Money Transfer DB - Other"
}
},
{
"map": "Trans Type",
"mapped": {
"sign": "-1",
"ledger": "Manual",
"reason": "Freight Wires",
"trantype": "Disbursement"
},
"source": "PNCC",
"ret_val": {
"ini": "FED WIRE OUT",
"acctn": "The HC Operating Company FREIG",
"trans": "Money Transfer DB - Wire"
}
},
{
"map": "Trans Type",
"mapped": {
"sign": "-1",
"ledger": "AP - Wire",
"trantype": "Disbursement"
},
"source": "PNCC",
"ret_val": {
"ini": "FED WIRE OUT",
"acctn": "The HC Operating Company OPERA",
"trans": "Money Transfer DB - Wire"
}
},
{
"map": "Trans Type",
"mapped": {
"sign": "-1",
"ledger": "Manual",
"trantype": "Disbursement"
},
"source": "PNCC",
"ret_val": {
"ini": "FED WIRE OUT",
"acctn": "The HC Operating Company PAYR",
"trans": "Money Transfer DB - Wire"
}
},
{
"map": "Trans Type",
"mapped": {
"sign": "1",
"ledger": "Manual",
"reason": "ZBA Funding",
"trantype": "Funding"
},
"source": "PNCC",
"ret_val": {
"ini": "FUNDS TRANSFER FROM ACCT",
"acctn": "The HC Operating Company FREIG",
"trans": "ZBA Credits"
}
},
{
"map": "Trans Type",
"mapped": {
"sign": "1",
"ledger": "Manual",
"reason": "ZBA Funding",
"trantype": "Funding"
},
"source": "PNCC",
"ret_val": {
"ini": "FUNDS TRANSFER FROM ACCT",
"acctn": "The HC Operating Company OPERA",
"trans": "ZBA Credits"
}
},
{
"map": "Trans Type",
"mapped": {
"sign": "1",
"ledger": "Manual",
"reason": "ZBA Funding",
"trantype": "Funding"
},
"source": "PNCC",
"ret_val": {
"ini": "FUNDS TRANSFER FROM ACCT",
"acctn": "The HC Operating Company PAYR",
"trans": "ZBA Credits"
}
},
{
"map": "Trans Type",
"mapped": {
"sign": "-1",
"ledger": "Manual",
"reason": "ZBA Funding",
"trantype": "Funding"
},
"source": "PNCC",
"ret_val": {
"ini": "FUNDS TRANSFER TO ACCT",
"acctn": "The HC Operating Company OPERA",
"trans": "ZBA Debits"
}
},
{
"map": "Trans Type",
"mapped": {
"sign": "-1",
"ledger": "Manual",
"reason": "ZBA Funding",
"trantype": "Funding"
},
"source": "PNCC",
"ret_val": {
"ini": "FUNDS TRANSFER TO ACCT",
"acctn": "The HC Operating Company PAYR",
"trans": "ZBA Debits"
}
},
{
"map": "Currency",
"mapped": {
"party": "The HC Canada Operating Company, Ltd.",
"ledger": "Manual",
"reason": "IC - Can to US Settlement",
"trantype": "Interco Collection"
},
"source": "PNCC",
"ret_val": {
"ini": "DEPOSIT:",
"curr1": [
"CREDIT",
"USD"
],
"curr2": [
"DEBIT",
"CAD"
]
}
},
{
"map": "Trans Type",
"mapped": {
"sign": "-1",
"party": "PNC",
"ledger": "Manual",
"reason": "Bank Fees",
"trantype": "Fees"
},
"source": "PNCC",
"ret_val": {
"ini": "CORPORATE ACCOUNT ANALYSIS CHARGE",
"acctn": "The HC Operating Company OPERA",
"trans": "Miscellaneous Fees"
}
},
{
"map": "Trans Type",
"mapped": {
"sign": "-1",
"party": "PNC",
"ledger": "Manual",
"reason": "Bank Fees",
"trantype": "Fees"
},
"source": "PNCC",
"ret_val": {
"ini": "PNC MERCHANT FINCL ADJ",
"acctn": "The HC Operating Company FBO P",
"trans": "Miscellaneous Fees"
}
},
{
"map": "Trans Type",
"mapped": {
"sign": "-1",
"ledger": "Manual",
"reason": "Revolver Payment",
"trantype": "Revolver Payment"
},
"source": "PNCC",
"ret_val": {
"ini": "PNC BANK- NJ LOAN PMTS",
"acctn": "The HC Operating Company FBO P",
"trans": "Miscellaneous Debits"
}
},
{
"map": "Trans Type",
"mapped": {
"sign": "-1",
"ledger": "Manual",
"trantype": "Disbursement"
},
"source": "PNCC",
"ret_val": {
"ini": "WITHDRAWAL:",
"acctn": "The HC Operating Company FBO P",
"trans": "Miscellaneous Debits"
}
},
{
"map": "Trans Type",
"mapped": {
"sign": "1",
"ledger": "Manual",
"reason": "Returned Item",
"trantype": "Collections"
},
"source": "PNCC",
"ret_val": {
"ini": "BOOK TRANSFER CREDIT",
"acctn": "The HC Operating Company FBO P",
"trans": "Money Transfer CR-Other"
}
},
{
"map": "Trans Type",
"mapped": {
"sign": "1",
"ledger": "Manual",
"reason": "Returned Item",
"trantype": "Collections"
},
"source": "PNCC",
"ret_val": {
"ini": "BOOK TRANSFER CREDIT",
"acctn": "The HC Operating Company OPERA",
"trans": "Money Transfer CR-Other"
}
},
{
"map": "Trans Type",
"mapped": {
"sign": "1",
"ledger": "Manual",
"reason": "Returned Item",
"trantype": "Collections"
},
"source": "PNCC",
"ret_val": {
"ini": "BOOK TRANSFER CREDIT GHFTDD DDA CREDIT",
"acctn": "The HC Operating Company FBO P",
"trans": "Money Transfer CR-Other"
}
},
{
"map": "Trans Type",
"mapped": {
"sign": "1",
"ledger": "Manual",
"reason": "Payroll Credits",
"trantype": "Disbursement"
},
"source": "PNCC",
"ret_val": {
"ini": "19UDV",
"acctn": "The HC Operating Company PAYR",
"trans": "ACH Credits"
}
},
{
"map": "Trans Type",
"mapped": {
"sign": "1",
"ledger": "AR - Collections",
"trantype": "Collections"
},
"source": "PNCC",
"ret_val": {
"ini": "ACH CREDIT RECEIVED",
"acctn": "The HC Operating Company FBO P",
"trans": "ACH Credits"
}
},
{
"map": "Trans Type",
"mapped": {
"sign": "1",
"ledger": "Manual",
"reason": "Payroll Credits",
"trantype": "Disbursement"
},
"source": "PNCC",
"ret_val": {
"ini": "ACH CREDIT RECEIVED",
"acctn": "The HC Operating Company PAYR",
"trans": "ACH Credits"
}
},
{
"map": "Trans Type",
"mapped": {
"sign": "1",
"ledger": "Manual",
"reason": "AP ACH Returned",
"trantype": "Disbursement"
},
"source": "PNCC",
"ret_val": {
"ini": "ACH CREDIT RETURN",
"acctn": "The HC Operating Company OPERA",
"trans": "ACH Credits"
}
},
{
"map": "Trans Type",
"mapped": {
"sign": "-1",
"ledger": "Manual",
"reason": "Auto ACH Out",
"trantype": "Disbursement"
},
"source": "PNCC",
"ret_val": {
"ini": "ACH DEBIT RECEIVED",
"acctn": "The HC Operating Company FBO P",
"trans": "ACH Debits"
}
},
{
"map": "Trans Type",
"mapped": {
"sign": "-1",
"ledger": "Manual",
"reason": "Auto ACH Out",
"trantype": "Disbursement"
},
"source": "PNCC",
"ret_val": {
"ini": "ACH DEBIT RECEIVED",
"acctn": "The HC Operating Company OPERA",
"trans": "ACH Debits"
}
},
{
"map": "Trans Type",
"mapped": {
"sign": "-1",
"ledger": "Manual",
"reason": "Auto ACH Out",
"trantype": "Disbursement"
},
"source": "PNCC",
"ret_val": {
"ini": "ACH DEBIT RECEIVED",
"acctn": "The HC Operating Company PAYR",
"trans": "ACH Debits"
}
},
{
"map": "Trans Type",
"mapped": {
"sign": "-1",
"ledger": "AP - Check Run",
"trantype": "Disbursement"
},
"source": "PNCC",
"ret_val": {
"ini": "CASHED CHECK",
"acctn": "The HC Operating Company OPERA",
"trans": "Checks Paid"
}
},
{
"map": "Trans Type",
"mapped": {
"sign": "-1",
"ledger": "Manual",
"reason": "Payroll Checks",
"trantype": "Disbursement"
},
"source": "PNCC",
"ret_val": {
"ini": "CASHED CHECK",
"acctn": "The HC Operating Company PAYR",
"trans": "Checks Paid"
}
},
{
"map": "Trans Type",
"mapped": {
"sign": "-1",
"ledger": "Manual",
"reason": "Freight Checks",
"trantype": "Disbursement"
},
"source": "PNCC",
"ret_val": {
"ini": "CHECK",
"acctn": "The HC Operating Company FREIG",
"trans": "Checks Paid"
}
},
{
"map": "Trans Type",
"mapped": {
"sign": "-1",
"ledger": "AP - Check Run",
"trantype": "Disbursement"
},
"source": "PNCC",
"ret_val": {
"ini": "CHECK",
"acctn": "The HC Operating Company OPERA",
"trans": "Checks Paid"
}
},
{
"map": "Trans Type",
"mapped": {
"sign": "-1",
"ledger": "Manual",
"reason": "Payroll Checks",
"trantype": "Disbursement"
},
"source": "PNCC",
"ret_val": {
"ini": "CHECK",
"acctn": "The HC Operating Company PAYR",
"trans": "Checks Paid"
}
},
{
"map": "Trans Type",
"mapped": {
"sign": "-1",
"ledger": "Manual",
"reason": "Freight Checks",
"trantype": "Disbursement"
},
"source": "PNCC",
"ret_val": {
"ini": "SUBSTITUTE CHK",
"acctn": "The HC Operating Company FREIG",
"trans": "Checks Paid"
}
},
{
"map": "Trans Type",
"mapped": {
"sign": "-1",
"ledger": "AP - Check Run",
"trantype": "Disbursement"
},
"source": "PNCC",
"ret_val": {
"ini": "SUBSTITUTE CHK",
"acctn": "The HC Operating Company OPERA",
"trans": "Checks Paid"
}
},
{
"map": "Trans Type",
"mapped": {
"sign": "-1",
"ledger": "Manual",
"reason": "Returned Deposit NSF",
"trantype": "Collections"
},
"source": "PNCC",
"ret_val": {
"ini": "RET DEP ITEM NSF UN",
"acctn": "The HC Operating Company FBO P",
"trans": "Deposited Items Returned"
}
},
{
"map": "Currency",
"mapped": {
"party": "The HC Canada Operating Company, Ltd.",
"ledger": "Manual",
"reason": "IC - US to CAN Settlement",
"trantype": "Interco Funding"
},
"source": "PNCC",
"ret_val": {
"ini": "WITHDRAWAL:",
"curr1": [
"DEBIT",
"USD"
],
"curr2": [
"CREDIT",
"CAD"
]
}
},
{
"map": "Currency",
"mapped": {
"party": "The HC Canada Operating Company, Ltd.",
"ledger": "Manual",
"reason": "IC - round-trip settlement return",
"trantype": "Interco Collection"
},
"source": "PNCC",
"ret_val": {
"ini": "DEPOSIT:",
"curr1": [
"CREDIT",
"USD"
],
"curr2": [
"DEBIT",
"USD"
]
}
},
{
"map": "Currency",
"mapped": {
"party": "The HC Canada Operating Company, Ltd.",
"ledger": "Manual",
"reason": "IC - Can to US Settlement",
"trantype": "Interco Collection"
},
"source": "PNCC",
"ret_val": {
"ini": "DEPOSIT:",
"curr1": [
"DEBIT",
"USD"
],
"curr2": [
"CREDIT",
"CAD"
]
}
},
{
"map": "Trans Type",
"mapped": {
"sign": "1",
"ledger": "Manual",
"trantype": "Collections"
},
"source": "PNCC",
"ret_val": {
"ini": "DEPOSIT:",
"acctn": "The HC Operating Company OPERA",
"trans": "Miscellaneous Credits"
}
},
{
"map": "Trans Type",
"mapped": {
"sign": "-1",
"ledger": "Manual",
"reason": "Payroll Checks",
"trantype": "Disbursement"
},
"source": "PNCC",
"ret_val": {
"ini": "SUBSTITUTE CHK",
"acctn": "The HC Operating Company PAYR",
"trans": "Checks Paid"
}
},
{
"map": "Trans Type",
"mapped": {
"sign": "-1",
"ledger": "manual",
"trantype": "Disbursement"
},
"source": "PNCC",
"ret_val": {
"ini": "ACH DEBIT RETURN",
"acctn": "The HC Operating Company OPERA",
"trans": "ACH Debits"
}
},
{
"map": "Trans Type",
"mapped": {
"sign": "1",
"ledger": "manual",
"trantype": "Disbursement"
},
"source": "PNCC",
"ret_val": {
"ini": "ACH CREDIT SETTLEMENT",
"acctn": "The HC Operating Company OPERA",
"trans": "ACH Credits"
}
},
{
"map": "Trans Type",
"mapped": {
"sign": "-1",
"ledger": "Manual",
"trantype": "Disbursement"
},
"source": "PNCC",
"ret_val": {
"ini": "CHECK",
"acctn": "The HC Operating Company FBO P",
"trans": "Checks Paid"
}
},
{
"map": "Trans Type",
"mapped": {
"sign": "1",
"ledger": "AR - Collections",
"trantype": "Collections"
},
"source": "PNCC",
"ret_val": {
"ini": "POSTING CORRECTION RETURN CK",
"acctn": "The HC Operating Company FBO P",
"trans": "Detail Credit Adjustments"
}
}
]

View File

@ -0,0 +1,30 @@
--transactions with date in download format for constraint
--transactions with date in download format for constraint
COPY
(
SELECT
r."Schedule#"
,to_char(r."PostDate",'mm/dd/yyyy') "PostDate"
,r."Assn#"
,r."Coll#"
,COALESCE(r."AdvanceRate",0) "AdvanceRate"
,COALESCE(r."Sales",0) "Sales"
,COALESCE(r."Credits & Adjustments",0) "Credits & Adjustments"
,COALESCE(r."Gross Collections",0) "Gross Collections"
,COALESCE(r."CollateralBalance",0) "CollateralBalance"
,COALESCE(r."MaxEligible",0) "MaxEligible"
,COALESCE(r."Ineligible Amount",0) "Ineligible Amount"
,COALESCE(r."Reserve Amount",0) "Reserve Amount"
FROM
tps.trans
JOIN LATERAL jsonb_populate_record(NULL::tps.pncl, rec) r ON TRUE
WHERE
srce = 'PNCL'
--and case when rec->>'Credits & Adjustments' is null then 'null' else '' end <> 'null'
)
TO 'C:\users\ptrowbridge\downloads\pncl.csv' WITH (format csv, header TRUE)
--source
SELECT DEFN FROM TPS.SRCE WHERE SRCE = 'PNCL'

View File

@ -0,0 +1,2 @@
curl -H "Content-Type: application/json" -X POST -d@./srce.json http://localhost:81/srce_set
curl -v -F upload=@//mnt/c/Users/ptrowbridge/Downloads/pncl.csv http://localhost:81/import?srce=PNCL

View File

@ -0,0 +1,73 @@
{
"constraint": [
"{PostDate}",
"{Schedule#}"
],
"source": "client_file",
"loading_function": "csv",
"name": "PNCL",
"schemas": {
"default": [
{
"path": "{Schedule#}",
"type": "text",
"column_name": "Schedule#"
},
{
"type": "date",
"column_name": "PostDate",
"path": "{PostDate}"
},
{
"type": "text",
"column_name": "Assn#",
"path": "{Assn#}"
},
{
"type": "text",
"column_name": "Coll#",
"path": "{Coll#}"
},
{
"type": "numeric",
"column_name": "AdvanceRate",
"path": "{AdvanceRate}"
},
{
"type": "numeric",
"column_name": "Sales",
"path": "{Sales}"
},
{
"type": "numeric",
"column_name": "Credits & Adjustments",
"path": "{Credits & Adjustments}"
},
{
"type": "numeric",
"column_name": "Gross Collections",
"path": "{Gross Collections}"
},
{
"type": "numeric",
"column_name": "CollateralBalance",
"path": "{CollateralBalance}"
},
{
"type": "numeric",
"column_name": "MaxEligible",
"path": "{MaxEligible}"
},
{
"type": "numeric",
"column_name": "Ineligible Amount",
"path": "{Ineligible Amount}"
},
{
"type": "numeric",
"column_name": "Reserve Amount",
"path": "{Reserve Amount}"
}
]
}
}

View File

@ -0,0 +1,32 @@
--transactions with date in download format for constraint
--transactions with date in download format for constraint
COPY
(
SELECT
r."Loan#"
,to_char(r."Post Date",'mm/dd/yyyy') "Post Date"
,to_char(r."Effective Date",'mm/dd/yyyy') "Effective Date"
,r."Reference #"
,r."Description"
,r."Advances"
,r."Adjustments"
,r."Payments"
,r."Loan Balance"
FROM
tps.trans
JOIN LATERAL jsonb_populate_record(NULL::tps.pnco, rec) r ON TRUE
WHERE
srce = 'PNCO'
)
TO 'C:\users\ptrowbridge\downloads\pnco.csv' WITH (format csv, header TRUE)
--source
SELECT DEFN FROM TPS.SRCE WHERE SRCE = 'PNCO'
--mapdef
SELECT jsonb_agg(row_to_json(x)::jsonb) FROM (SELECT srce, target "name", regex, seq "sequence" FROM tps.map_rm WHERE srce = 'PNCO') x
--map values
SELECT jsonb_agg(row_to_JSON(x)::jsonb) FROM (SELECT srce "source", target "map", retval ret_val, "map" mapped FROM tps.map_rv WHERE srce = 'PNCO') X

View File

@ -0,0 +1,2 @@
curl -H "Content-Type: application/json" -X POST -d@./srce.json http://localhost:81/srce_set
curl -v -F upload=@//mnt/c/Users/ptrowbridge/Downloads/pnco.csv http://localhost:81/import?srce=PNCO

View File

@ -0,0 +1,60 @@
{
"name": "PNCO",
"source": "client_file",
"loading_function": "csv",
"constraint": [
"{Post Date}",
"{Effective Date}",
"{Loan#}",
"{Reference #}"
],
"schemas": {
"default": [
{
"path": "{Loan#}",
"type": "text",
"column_name":"Loan#"
},
{
"path": "{Post Date}",
"type": "date",
"column_name":"Post Date"
},
{
"path": "{Effective Date}",
"type": "date",
"column_name":"Effective Date"
},
{
"path": "{Reference #}",
"type": "text",
"column_name":"Reference #"
},
{
"path": "{Description}",
"type": "text",
"column_name":"Description"
},
{
"path": "{Advances}",
"type": "numeric",
"column_name":"Advances"
},
{
"path": "{Adjustments}",
"type": "numeric",
"column_name":"Adjustments"
},
{
"path": "{Payments}",
"type": "numeric",
"column_name":"Payments"
},
{
"path": "{Loan Balance}",
"type": "numeric",
"column_name":"Loan Balance"
}
]
}
}

View File

@ -25,6 +25,7 @@ CREATE ROLE api WITH
--grant schema USAGE
GRANT USAGE ON SCHEMA tps TO api;
GRANT USAGE ON SCHEMA tpsv TO api;
--grant current table privledges
GRANT SELECT, UPDATE, INSERT, DELETE ON ALL TABLES IN SCHEMA tps TO api;
@ -279,27 +280,29 @@ BEGIN
tps.map_rm (srce, target, regex, seq, hist)
SELECT
--data source
_defn->>'srce'
ae.r->>'srce'
--map name
,_defn->>'name'
,ae.r->>'name'
--map definition
,_defn
,ae.r->'regex'
--map aggregation sequence
,(_defn->>'sequence')::INTEGER
,(ae.r->>'sequence')::INTEGER
--history definition
,jsonb_build_object(
'hist_defn',_defn
'hist_defn',ae.r
,'effective',jsonb_build_array(CURRENT_TIMESTAMP,null::timestamptz)
) || '[]'::jsonb
FROM
jsonb_array_elements(_defn) ae(r)
ON CONFLICT ON CONSTRAINT map_rm_pk DO UPDATE SET
srce = _defn->>'srce'
,target = _defn->>'name'
,regex = _defn
,seq = (_defn->>'sequence')::INTEGER
srce = excluded.srce
,target = excluded.target
,regex = excluded.regex
,seq = excluded.seq
,hist =
--the new definition going to position -0-
jsonb_build_object(
'hist_defn',_defn
'hist_defn',excluded.regex
,'effective',jsonb_build_array(CURRENT_TIMESTAMP,null::timestamptz)
)
--the previous definition, set upper bound of effective range which was previously null

View File

@ -16,27 +16,29 @@ BEGIN
tps.map_rm (srce, target, regex, seq, hist)
SELECT
--data source
_defn->>'srce'
ae.r->>'srce'
--map name
,_defn->>'name'
,ae.r->>'name'
--map definition
,_defn
,ae.r->'regex'
--map aggregation sequence
,(_defn->>'sequence')::INTEGER
,(ae.r->>'sequence')::INTEGER
--history definition
,jsonb_build_object(
'hist_defn',_defn
'hist_defn',ae.r
,'effective',jsonb_build_array(CURRENT_TIMESTAMP,null::timestamptz)
) || '[]'::jsonb
FROM
jsonb_array_elements(_defn) ae(r)
ON CONFLICT ON CONSTRAINT map_rm_pk DO UPDATE SET
srce = _defn->>'srce'
,target = _defn->>'name'
,regex = _defn
,seq = (_defn->>'sequence')::INTEGER
srce = excluded.srce
,target = excluded.target
,regex = excluded.regex
,seq = excluded.seq
,hist =
--the new definition going to position -0-
jsonb_build_object(
'hist_defn',_defn
'hist_defn',excluded.regex
,'effective',jsonb_build_array(CURRENT_TIMESTAMP,null::timestamptz)
)
--the previous definition, set upper bound of effective range which was previously null

View File

@ -1,3 +1,4 @@
DROP FUNCTION IF EXISTS tps.build_srce_view_sql(text, text);
CREATE OR REPLACE FUNCTION tps.build_srce_view_sql(_srce text, _schema text) RETURNS TEXT
AS
$f$

View File

@ -0,0 +1,19 @@
SELECT
r.*
,CASE "Schedule#"
WHEN '02IN Raw Material' THEN 13097563.42
WHEN '03IN Finished Goods' THEN 35790696.52
ELSE 0
END + SUM("Sales"+"Credits & Adjustments"-"Gross Collections") OVER (PARTITION BY "Schedule#" ORDER BY "Schedule#" ASC, "PostDate" ASC) running_bal
,(LEAST("CollateralBalance" - "Ineligible Amount","MaxEligible")*("AdvanceRate"/100))::NUMERIC(20,2) qualified_collateral
,(("CollateralBalance" - "Ineligible Amount")*("AdvanceRate"/100))::NUMERIC(20,2) qualified_collateral_nl
FROM
tpsv.pncl_default r
WHERE
--AND rec @> '{"Schedule#":"01AR"}'
--AND rec @> '{"Schedule#":"02IN Raw Material"}'
"Schedule#" = '03IN Finished Goods'
ORDER BY
"Schedule#" asc
,r."PostDate" asc

8
reports/dcard_bal.sql Normal file
View File

@ -0,0 +1,8 @@
\timing
SELECT
r.*
,SUM(r."Amount") OVER (ORDER BY r."Post Date" asc , r."Description") + 1061.1 + 22.40 balance
FROM
tpsv.dcard_default r
ORDER BY
r."Post Date" asc

12
reports/loan_balance.sql Normal file
View File

@ -0,0 +1,12 @@
\timing
SELECT
r.*,
SUM(r."Advances"+r."Adjustments"-r."Payments") OVER (PARTITION BY "Loan#" ORDER BY r."Post Date" asc, r."Reference #" asc)
FROM
tpsv.pnco_default r
WHERE
"Loan#" = '606780191'
ORDER BY
r."Loan#"
,r."Post Date" ASC
,r."Reference #" ASC

View File

@ -1,40 +0,0 @@
Trans. Date,Post Date,Description,Amount,Category
01/02/2018,01/02/2018,"GOOGLE *YOUTUBE VIDEOS G.CO/HELPPAY#CAP0H07TXV",4.26,"Services"
01/02/2018,01/02/2018,"MICROSOFT *ONEDRIVE 800-642-7676 WA",4.26,"Services"
01/03/2018,01/03/2018,"CLE CLINIC PT PMTS 216-445-6249 OHAK2C57F2F0B3",200.00,"Medical Services"
01/04/2018,01/04/2018,"AT&T *PAYMENT 800-288-2020 TX",57.14,"Services"
01/04/2018,01/07/2018,"WWW.KOHLS.COM #0873 MIDDLETOWN OH",-7.90,"Payments and Credits"
01/05/2018,01/07/2018,"PIZZA HUT 007946 STOW OH",9.24,"Restaurants"
01/05/2018,01/07/2018,"SUBWAY 00044289255 STOW OH",10.25,"Restaurants"
01/06/2018,01/07/2018,"ACME NO. 17 STOW OH",103.98,"Supermarkets"
01/06/2018,01/07/2018,"DISCOUNT DRUG MART 32 STOW OH",1.69,"Merchandise"
01/06/2018,01/07/2018,"DISCOUNT DRUG MART 32 STOW OH",2.19,"Merchandise"
01/09/2018,01/09/2018,"CIRCLE K 05416 STOW OH00947R",3.94,"Gasoline"
01/09/2018,01/09/2018,"CIRCLE K 05416 STOW OH00915R",52.99,"Gasoline"
01/13/2018,01/13/2018,"AUTOZONE #0722 STOW OH",85.36,"Automotive"
01/13/2018,01/13/2018,"DISCOUNT DRUG MART 32 STOW OH",26.68,"Merchandise"
01/13/2018,01/13/2018,"EL CAMPESINO STOW OH",6.50,"Restaurants"
01/13/2018,01/13/2018,"TARGET STOW OH",197.90,"Merchandise"
01/14/2018,01/14/2018,"DISCOUNT DRUG MART 32 STOW OH",13.48,"Merchandise"
01/15/2018,01/15/2018,"TARGET.COM * 800-591-3869 MN",22.41,"Merchandise"
01/16/2018,01/16/2018,"BUFFALO WILD WINGS KENT KENT OH",63.22,"Restaurants"
01/16/2018,01/16/2018,"PARTA - KCG KENT OH",4.00,"Government Services"
01/16/2018,01/16/2018,"REMEMBERNHU 402-935-7733 IA",60.00,"Services"
01/16/2018,01/16/2018,"TARGET.COM * 800-591-3869 MN",44.81,"Merchandise"
01/16/2018,01/16/2018,"TREE CITY COFFEE & PASTR KENT OH",17.75,"Restaurants"
01/17/2018,01/17/2018,"BESTBUYCOM805526794885 888-BESTBUY MN",343.72,"Merchandise"
01/19/2018,01/19/2018,"DISCOUNT DRUG MART 32 STOW OH",5.98,"Merchandise"
01/19/2018,01/19/2018,"U-HAUL OF KENT-STOW KENT OH",15.88,"Travel/ Entertainment"
01/19/2018,01/19/2018,"WALMART GROCERY 800-966-6546 AR",5.99,"Supermarkets"
01/19/2018,01/19/2018,"WALMART GROCERY 800-966-6546 AR",17.16,"Supermarkets"
01/19/2018,01/19/2018,"WALMART GROCERY 800-966-6546 AR",500.97,"Supermarkets"
01/20/2018,01/20/2018,"GOOGLE *GOOGLE PLAY G.CO/HELPPAY#CAP0HFFS7W",2.12,"Services"
01/20/2018,01/20/2018,"LOWE'S OF STOW, OH. STOW OH",256.48,"Home Improvement"
01/23/2018,01/23/2018,"CASHBACK BONUS REDEMPTION PYMT/STMT CRDT",-32.20,"Awards and Rebate Credits"
01/23/2018,01/23/2018,"INTERNET PAYMENT - THANK YOU",-2394.51,"Payments and Credits"
01/27/2018,01/27/2018,"GIANT-EAGLE #4096 STOW OH",67.81,"Supermarkets"
01/27/2018,01/27/2018,"OFFICEMAX/OFFICE DEPOT63 STOW OH",21.06,"Merchandise"
01/27/2018,01/27/2018,"TARGET STOW OH",71.00,"Merchandise"
01/29/2018,01/29/2018,"NETFLIX.COM NETFLIX.COM CA19899514437",14.93,"Services"
01/30/2018,01/30/2018,"SQ *TWISTED MELTZ KENT OH0002305843011416898511",16.87,"Restaurants"
01/30/2018,01/30/2018,"TARGET STOW OH",49.37,"Merchandise"
1 Trans. Date Post Date Description Amount Category
2 01/02/2018 01/02/2018 GOOGLE *YOUTUBE VIDEOS G.CO/HELPPAY#CAP0H07TXV 4.26 Services
3 01/02/2018 01/02/2018 MICROSOFT *ONEDRIVE 800-642-7676 WA 4.26 Services
4 01/03/2018 01/03/2018 CLE CLINIC PT PMTS 216-445-6249 OHAK2C57F2F0B3 200.00 Medical Services
5 01/04/2018 01/04/2018 AT&T *PAYMENT 800-288-2020 TX 57.14 Services
6 01/04/2018 01/07/2018 WWW.KOHLS.COM #0873 MIDDLETOWN OH -7.90 Payments and Credits
7 01/05/2018 01/07/2018 PIZZA HUT 007946 STOW OH 9.24 Restaurants
8 01/05/2018 01/07/2018 SUBWAY 00044289255 STOW OH 10.25 Restaurants
9 01/06/2018 01/07/2018 ACME NO. 17 STOW OH 103.98 Supermarkets
10 01/06/2018 01/07/2018 DISCOUNT DRUG MART 32 STOW OH 1.69 Merchandise
11 01/06/2018 01/07/2018 DISCOUNT DRUG MART 32 STOW OH 2.19 Merchandise
12 01/09/2018 01/09/2018 CIRCLE K 05416 STOW OH00947R 3.94 Gasoline
13 01/09/2018 01/09/2018 CIRCLE K 05416 STOW OH00915R 52.99 Gasoline
14 01/13/2018 01/13/2018 AUTOZONE #0722 STOW OH 85.36 Automotive
15 01/13/2018 01/13/2018 DISCOUNT DRUG MART 32 STOW OH 26.68 Merchandise
16 01/13/2018 01/13/2018 EL CAMPESINO STOW OH 6.50 Restaurants
17 01/13/2018 01/13/2018 TARGET STOW OH 197.90 Merchandise
18 01/14/2018 01/14/2018 DISCOUNT DRUG MART 32 STOW OH 13.48 Merchandise
19 01/15/2018 01/15/2018 TARGET.COM * 800-591-3869 MN 22.41 Merchandise
20 01/16/2018 01/16/2018 BUFFALO WILD WINGS KENT KENT OH 63.22 Restaurants
21 01/16/2018 01/16/2018 PARTA - KCG KENT OH 4.00 Government Services
22 01/16/2018 01/16/2018 REMEMBERNHU 402-935-7733 IA 60.00 Services
23 01/16/2018 01/16/2018 TARGET.COM * 800-591-3869 MN 44.81 Merchandise
24 01/16/2018 01/16/2018 TREE CITY COFFEE & PASTR KENT OH 17.75 Restaurants
25 01/17/2018 01/17/2018 BESTBUYCOM805526794885 888-BESTBUY MN 343.72 Merchandise
26 01/19/2018 01/19/2018 DISCOUNT DRUG MART 32 STOW OH 5.98 Merchandise
27 01/19/2018 01/19/2018 U-HAUL OF KENT-STOW KENT OH 15.88 Travel/ Entertainment
28 01/19/2018 01/19/2018 WALMART GROCERY 800-966-6546 AR 5.99 Supermarkets
29 01/19/2018 01/19/2018 WALMART GROCERY 800-966-6546 AR 17.16 Supermarkets
30 01/19/2018 01/19/2018 WALMART GROCERY 800-966-6546 AR 500.97 Supermarkets
31 01/20/2018 01/20/2018 GOOGLE *GOOGLE PLAY G.CO/HELPPAY#CAP0HFFS7W 2.12 Services
32 01/20/2018 01/20/2018 LOWE'S OF STOW, OH. STOW OH 256.48 Home Improvement
33 01/23/2018 01/23/2018 CASHBACK BONUS REDEMPTION PYMT/STMT CRDT -32.20 Awards and Rebate Credits
34 01/23/2018 01/23/2018 INTERNET PAYMENT - THANK YOU -2394.51 Payments and Credits
35 01/27/2018 01/27/2018 GIANT-EAGLE #4096 STOW OH 67.81 Supermarkets
36 01/27/2018 01/27/2018 OFFICEMAX/OFFICE DEPOT63 STOW OH 21.06 Merchandise
37 01/27/2018 01/27/2018 TARGET STOW OH 71.00 Merchandise
38 01/29/2018 01/29/2018 NETFLIX.COM NETFLIX.COM CA19899514437 14.93 Services
39 01/30/2018 01/30/2018 SQ *TWISTED MELTZ KENT OH0002305843011416898511 16.87 Restaurants
40 01/30/2018 01/30/2018 TARGET STOW OH 49.37 Merchandise

View File

@ -1,275 +0,0 @@
[
{
"Trans. Date": "1/2/2018",
"Post Date": "1/2/2018",
"Description": "GOOGLE *YOUTUBE VIDEOS G.CO/HELPPAY#CAP0H07TXV",
"Amount": 4.26,
"Category": "Services"
},
{
"Trans. Date": "1/2/2018",
"Post Date": "1/2/2018",
"Description": "MICROSOFT *ONEDRIVE 800-642-7676 WA",
"Amount": 4.26,
"Category": "Services"
},
{
"Trans. Date": "1/3/2018",
"Post Date": "1/3/2018",
"Description": "CLE CLINIC PT PMTS 216-445-6249 OHAK2C57F2F0B3",
"Amount": 200,
"Category": "Medical Services"
},
{
"Trans. Date": "1/4/2018",
"Post Date": "1/4/2018",
"Description": "AT&T *PAYMENT 800-288-2020 TX",
"Amount": 57.14,
"Category": "Services"
},
{
"Trans. Date": "1/4/2018",
"Post Date": "1/7/2018",
"Description": "WWW.KOHLS.COM #0873 MIDDLETOWN OH",
"Amount": -7.9,
"Category": "Payments and Credits"
},
{
"Trans. Date": "1/5/2018",
"Post Date": "1/7/2018",
"Description": "PIZZA HUT 007946 STOW OH",
"Amount": 9.24,
"Category": "Restaurants"
},
{
"Trans. Date": "1/5/2018",
"Post Date": "1/7/2018",
"Description": "SUBWAY 00044289255 STOW OH",
"Amount": 10.25,
"Category": "Restaurants"
},
{
"Trans. Date": "1/6/2018",
"Post Date": "1/7/2018",
"Description": "ACME NO. 17 STOW OH",
"Amount": 103.98,
"Category": "Supermarkets"
},
{
"Trans. Date": "1/6/2018",
"Post Date": "1/7/2018",
"Description": "DISCOUNT DRUG MART 32 STOW OH",
"Amount": 1.69,
"Category": "Merchandise"
},
{
"Trans. Date": "1/6/2018",
"Post Date": "1/7/2018",
"Description": "DISCOUNT DRUG MART 32 STOW OH",
"Amount": 2.19,
"Category": "Merchandise"
},
{
"Trans. Date": "1/9/2018",
"Post Date": "1/9/2018",
"Description": "CIRCLE K 05416 STOW OH00947R",
"Amount": 3.94,
"Category": "Gasoline"
},
{
"Trans. Date": "1/9/2018",
"Post Date": "1/9/2018",
"Description": "CIRCLE K 05416 STOW OH00915R",
"Amount": 52.99,
"Category": "Gasoline"
},
{
"Trans. Date": "1/13/2018",
"Post Date": "1/13/2018",
"Description": "AUTOZONE #0722 STOW OH",
"Amount": 85.36,
"Category": "Automotive"
},
{
"Trans. Date": "1/13/2018",
"Post Date": "1/13/2018",
"Description": "DISCOUNT DRUG MART 32 STOW OH",
"Amount": 26.68,
"Category": "Merchandise"
},
{
"Trans. Date": "1/13/2018",
"Post Date": "1/13/2018",
"Description": "EL CAMPESINO STOW OH",
"Amount": 6.5,
"Category": "Restaurants"
},
{
"Trans. Date": "1/13/2018",
"Post Date": "1/13/2018",
"Description": "TARGET STOW OH",
"Amount": 197.9,
"Category": "Merchandise"
},
{
"Trans. Date": "1/14/2018",
"Post Date": "1/14/2018",
"Description": "DISCOUNT DRUG MART 32 STOW OH",
"Amount": 13.48,
"Category": "Merchandise"
},
{
"Trans. Date": "1/15/2018",
"Post Date": "1/15/2018",
"Description": "TARGET.COM * 800-591-3869 MN",
"Amount": 22.41,
"Category": "Merchandise"
},
{
"Trans. Date": "1/16/2018",
"Post Date": "1/16/2018",
"Description": "BUFFALO WILD WINGS KENT KENT OH",
"Amount": 63.22,
"Category": "Restaurants"
},
{
"Trans. Date": "1/16/2018",
"Post Date": "1/16/2018",
"Description": "PARTA - KCG KENT OH",
"Amount": 4,
"Category": "Government Services"
},
{
"Trans. Date": "1/16/2018",
"Post Date": "1/16/2018",
"Description": "REMEMBERNHU 402-935-7733 IA",
"Amount": 60,
"Category": "Services"
},
{
"Trans. Date": "1/16/2018",
"Post Date": "1/16/2018",
"Description": "TARGET.COM * 800-591-3869 MN",
"Amount": 44.81,
"Category": "Merchandise"
},
{
"Trans. Date": "1/16/2018",
"Post Date": "1/16/2018",
"Description": "TREE CITY COFFEE & PASTR KENT OH",
"Amount": 17.75,
"Category": "Restaurants"
},
{
"Trans. Date": "1/17/2018",
"Post Date": "1/17/2018",
"Description": "BESTBUYCOM805526794885 888-BESTBUY MN",
"Amount": 343.72,
"Category": "Merchandise"
},
{
"Trans. Date": "1/19/2018",
"Post Date": "1/19/2018",
"Description": "DISCOUNT DRUG MART 32 STOW OH",
"Amount": 5.98,
"Category": "Merchandise"
},
{
"Trans. Date": "1/19/2018",
"Post Date": "1/19/2018",
"Description": "U-HAUL OF KENT-STOW KENT OH",
"Amount": 15.88,
"Category": "Travel/ Entertainment"
},
{
"Trans. Date": "1/19/2018",
"Post Date": "1/19/2018",
"Description": "WALMART GROCERY 800-966-6546 AR",
"Amount": 5.99,
"Category": "Supermarkets"
},
{
"Trans. Date": "1/19/2018",
"Post Date": "1/19/2018",
"Description": "WALMART GROCERY 800-966-6546 AR",
"Amount": 17.16,
"Category": "Supermarkets"
},
{
"Trans. Date": "1/19/2018",
"Post Date": "1/19/2018",
"Description": "WALMART GROCERY 800-966-6546 AR",
"Amount": 500.97,
"Category": "Supermarkets"
},
{
"Trans. Date": "1/20/2018",
"Post Date": "1/20/2018",
"Description": "GOOGLE *GOOGLE PLAY G.CO/HELPPAY#CAP0HFFS7W",
"Amount": 2.12,
"Category": "Services"
},
{
"Trans. Date": "1/20/2018",
"Post Date": "1/20/2018",
"Description": "LOWE'S OF STOW, OH. STOW OH",
"Amount": 256.48,
"Category": "Home Improvement"
},
{
"Trans. Date": "1/23/2018",
"Post Date": "1/23/2018",
"Description": "CASHBACK BONUS REDEMPTION PYMT/STMT CRDT",
"Amount": -32.2,
"Category": "Awards and Rebate Credits"
},
{
"Trans. Date": "1/23/2018",
"Post Date": "1/23/2018",
"Description": "INTERNET PAYMENT - THANK YOU",
"Amount": -2394.51,
"Category": "Payments and Credits"
},
{
"Trans. Date": "1/27/2018",
"Post Date": "1/27/2018",
"Description": "GIANT-EAGLE #4096 STOW OH",
"Amount": 67.81,
"Category": "Supermarkets"
},
{
"Trans. Date": "1/27/2018",
"Post Date": "1/27/2018",
"Description": "OFFICEMAX/OFFICE DEPOT63 STOW OH",
"Amount": 21.06,
"Category": "Merchandise"
},
{
"Trans. Date": "1/27/2018",
"Post Date": "1/27/2018",
"Description": "TARGET STOW OH",
"Amount": 71,
"Category": "Merchandise"
},
{
"Trans. Date": "1/29/2018",
"Post Date": "1/29/2018",
"Description": "NETFLIX.COM NETFLIX.COM CA19899514437",
"Amount": 14.93,
"Category": "Services"
},
{
"Trans. Date": "1/30/2018",
"Post Date": "1/30/2018",
"Description": "SQ *TWISTED MELTZ KENT OH0002305843011416898511",
"Amount": 16.87,
"Category": "Restaurants"
},
{
"Trans. Date": "1/30/2018",
"Post Date": "1/30/2018",
"Description": "TARGET STOW OH",
"Amount": 49.37,
"Category": "Merchandise"
}
]

View File

@ -1,157 +0,0 @@
sample data
------------------------------------
| Trans. Date | Post Date | Description | Amount | Category |
| ----------- | --------- | ---------------------------------------------- | ------ | -------------------- |
| 1/2/2018 | 1/2/2018 | GOOGLE *YOUTUBE VIDEOS G.CO/HELPPAY#CAP0H07TXV | 4.26 | Services |
| 1/2/2018 | 1/2/2018 | MICROSOFT *ONEDRIVE 800-642-7676 WA | 4.26 | Services |
| 1/3/2018 | 1/3/2018 | CLE CLINIC PT PMTS 216-445-6249 OHAK2C57F2F0B3 | 200 | Medical Services |
| 1/4/2018 | 1/4/2018 | AT&T *PAYMENT 800-288-2020 TX | 57.14 | Services |
| 1/4/2018 | 1/7/2018 | WWW.KOHLS.COM #0873 MIDDLETOWN OH | -7.9 | Payments and Credits |
| 1/5/2018 | 1/7/2018 | PIZZA HUT 007946 STOW OH | 9.24 | Restaurants |
| 1/5/2018 | 1/7/2018 | SUBWAY 00044289255 STOW OH | 10.25 | Restaurants |
| 1/6/2018 | 1/7/2018 | ACME NO. 17 STOW OH | 103.98 | Supermarkets |
| 1/6/2018 | 1/7/2018 | DISCOUNT DRUG MART 32 STOW OH | 1.69 | Merchandise |
| 1/6/2018 | 1/7/2018 | DISCOUNT DRUG MART 32 STOW OH | 2.19 | Merchandise |
| 1/9/2018 | 1/9/2018 | CIRCLE K 05416 STOW OH00947R | 3.94 | Gasoline |
| 1/9/2018 | 1/9/2018 | CIRCLE K 05416 STOW OH00915R | 52.99 | Gasoline |
screen
------------------------------------
```
+---------------+
Name:|DCARD |
+---------------+
+---------------+
Desc:|Discover Card |
+---------------+
Col Name Data Type Unique Constraint Flag
+-----------------------------------------------------------------------+
+-----------------+ +-------------------+ +---+
|Trans. Date | |date |\/| | X |
+-----------------+ +-------------------+ +---+
+-----------------+ +-------------------+ +---+
|Post Date | |date |\/| | X |
+-----------------+ +-------------------+ +---+
+-----------------+ +-------------------+ +---+
|Description | |text |\/| | X |
+-----------------+ +-------------------+ +---+
+-----------------+ +-------------------+ +---+
|Amount | |numeric |\/| | |
+-----------------+ +-------------------+ +---+
+-----------------+ +-------------------+ +---+
|Category | |text |\/| | |
+-----------------+ +-------------------+ +---+
Somehow be able to add more
```
screen builds json
--------------------------------------
{
"name": "DCARD",
"description":"Discover Card",
"type": "csv",
"schema": [
{
"key": "Trans. Date",
"type": "date"
},
{
"key": "Post Date",
"type": "date"
},
{
"key": "Description",
"type": "text"
},
{
"key": "Amount",
"type": "numeric"
},
{
"key": "Category",
"type": "text"
}
],
"unique_constraint": {
"type": "key",
"fields": [
"{Post Date}",
"{Trans. Date}",
"{Description}"
]
}
}
SQL
---------------------------------------
SELECT
jsonb_pretty(r.x)
FROM
tps.srce_set(
'DCARD',
$$
{
"name": "DCARD",
"description":"Discover Card",
"type": "csv",
"schema": [
{
"key": "Trans. Date",
"type": "date"
},
{
"key": "Post Date",
"type": "date"
},
{
"key": "Description",
"type": "text"
},
{
"key": "Amount",
"type": "numeric"
},
{
"key": "Category",
"type": "text"
}
],
"unique_constraint": {
"type": "key",
"fields": [
"{Post Date}",
"{Trans. Date}",
"{Description}"
]
}
}
$$
) r(x)
backend handles SQL
-----------------------------------
`sql = "SELECT tps.srce_set(_name, _json)"`
`json_return_value = connection.execute(sql)`
handle json_return_value
* insert: notify and clear? update list of sources on screen?
* could not insert: print reason from json
import the data
------------------------------------
SELECT
*
FROM
tps.srce_import('C:\users\fleet\documents\tps_etl\sample_discovercard\data.csv','DCARD') x(message)

View File

@ -1,20 +0,0 @@
{
"srce": "dcard",
"sequence": 1,
"defn": [
{
"key": "{Description}",
"map": "y",
"flag": "",
"field": "f20",
"regex": ".{1,20}",
"retain": "y"
}
],
"name": "First 20",
"where": [
{}
],
"function": "extract",
"description": "pull first 20 characters from description for mapping"
}

View File

@ -1,169 +0,0 @@
regular expression screen
---------------------------------------------
```
+------------------------+----+
source | DCARD | \/ |
+-----------------------------+
+-----------------------------+
new name |First 20 |
+-----------------------------+
+-----------------------------+
function | extract(replace) | \/ |
+------------------------+----+
(each block is a regex, all blocks are concatenated into an array and linked to mapped ^alues)
first 20 characters
+----------------------------------+
+----------------------------------------------------------------------------------------------------+
+ | +-----------------------------+ |
| | Field Name| Description | \/| expressed as jsonb path "{Description}") |
+-------+ | +-----------------------------+ |
| | +-------------------------+ |
+ |label of return ^alue |f20 | |
| +-------------------------+ |
| +-------------------------+ |
| regular expression |.{1,20} | supply test run ^alues |
| +-------------------------+ |
| +-------------------------+ |
| replace wit | | |
| +-------------------------+ |
| +---+ |
| Map Results|Y/N| |
| +---+ |
| +---+ |
| Find All Matches| g | |
| +---+ |
| filter(s) |
| +-------------------------------------------+ |
| +----------------+ +----------------+ |
| |Category | |Restaurantes | |
| +----------------+ +----------------+ |
| +----------------+ +----------------+ |
| |Category | |Services | |
| +----------------+ +----------------+ |
| |
+----------------------------------------------------------------------------------------------------+
```
map definition
----------------------------------------------------------
{
"defn": [
{
"key": "{Description}",
"map": "y",
"flag": "g",
"field": "f20",
"regex": ".{1,20}",
"retain": "y"
}
],
"name": "First 20",
"where": [
{"Category":"Restaurantes"},
{"Category":"Services"}
],
"function": "extract",
"description": "pull first 20 characters from description for mapping"
}
SQL
---------------------------------------------
SELECT
x.x
FROM
tps.srce_map_def_set(
'DCARD'::text,
'First 20'::text,
$$ {
"defn": [
{
"key": "{Description}",
"map": "y",
"flag": "",
"field": "f20",
"regex": ".{1,20}",
"retain": "y"
}
],
"name": "First 20",
"where": [
{}
],
"function": "extract",
"description": "pull first 20 characters from description for mapping"
} $$::jsonb,
1::int
) x(x)
assign new key/values to the results of the regular expression, and then back to the underlying row it came from
-----------------------------------------------------------------------------------------------------------------
| returned from expression | party | reason | city | provice | |
| ------------------------------- | ----------------- | ------------- | ------ | ------- | --- |
| {"f20": "BIG LOTS #00453 STOW"} | Big Lots | Home Supplies | Stow | Ohio | |
| {"f20": "1794MOTHERHOOD #1794"} | Motherhood | Clothes | | | |
| {"f20": "3 PALMS HUDSON OH"} | 3 Palms | Restaurantes | Hudson | Ohio | |
| {"f20": "36241 7-ELEVEN STOW "} | 7-Eleven | Gasoline | Stow | Ohio | |
| {"f20": "7-ELEVEN 36241 STOW "} | 7-Eleven | Gasoline | Stow | Ohio | |
| {"f20": "98626 - 200 PUBLIC S"} | Public Sq Parking | Recreation | | | |
| {"f20": "ACE HARDWARE HUDSON "} | Ace Hardware | Home Maint | Hudson | Ohio | |
| {"f20": "ACH CAFE AND STARBUC"} | Starbucks | Restaurantes | | | |
function call to setup a a new map value
---------------------------------------------
SELECT
x.message
FROM
tps.srce_map_val_set(
'DCARD'
,'First 20'
,'{"f20": "DISCOUNT DRUG MART 3"}'::JSONB
,'{"party":"Discount Drug Mart","reason":"groceries"}'::JSONB
) x(message);
function call to re-run all the maps for a source
----------------------------------------------------
SELECT
x.message
FROM
tps.srce_map_overwrite('DCARD') x(message);
mass insert
------------------------------------------------------
INSERT INTO
tps.map_rv
SELECT
*
FROM
(
VALUES
('DCARD','First 20','{"f20": "DISCOUNT DRUG MART 3"}','{"party":"Discount Drug Mart","reason":"groceries"}'),
('DCARD','First 20','{"f20": "TARGET STOW OH"}','{"party":"Target","reason":"groceries"}'),
('DCARD','First 20','{"f20": "WALMART GROCERY 800-"}','{"party":"Walmart","reason":"groceries"}'),
('DCARD','First 20','{"f20": "CIRCLE K 05416 STOW "}','{"party":"Circle K","reason":"gasoline"}'),
('DCARD','First 20','{"f20": "TARGET.COM * 800-591"}','{"party":"Target","reason":"home supplies"}'),
('DCARD','First 20','{"f20": "ACME NO. 17 STOW OH"}','{"party":"Acme","reason":"groceries"}'),
('DCARD','First 20','{"f20": "AT&T *PAYMENT 800-28"}','{"party":"AT&T","reason":"internet"}'),
('DCARD','First 20','{"f20": "AUTOZONE #0722 STOW "}','{"party":"Autozone","reason":"auto maint"}'),
('DCARD','First 20','{"f20": "BESTBUYCOM8055267948"}','{"party":"BestBuy","reason":"home supplies"}'),
('DCARD','First 20','{"f20": "BUFFALO WILD WINGS K"}','{"party":"Buffalo Wild Wings","reason":"restaurante"}'),
('DCARD','First 20','{"f20": "CASHBACK BONUS REDEM"}','{"party":"Discover Card","reason":"financing"}'),
('DCARD','First 20','{"f20": "CLE CLINIC PT PMTS 2"}','{"party":"Cleveland Clinic","reason":"medical"}')
) x

View File

@ -1,4 +0,0 @@
SELECT * FROM TPS.SRCE_SET(
$$
{"name":"dcard","source":"client_file","loading_function":"csv","constraint":["{Trans. Date}","{Post Date}","{Description}"],"schemas":{"default":[{"path":"{Trans. Date}","type":"date","column_name":"Trans. Date"},{"path":"{Post Date}","type":"date","column_name":"Post Date"},{"path":"{Description}","type":"text","column_name":"Description"},{"path":"{Amount}","type":"numeric","column_name":"Amount"},{"path":"{Category}","type":"text","column_name":"Category"}],"mapped":[{"path":"{Trans. Date}","type":"date","column_name":"Trans. Date"},{"path":"{Post Date}","type":"date","column_name":"Post Date"},{"path":"{Description}","type":"text","column_name":"Description"},{"path":"{Amount}","type":"numeric","column_name":"Amount"},{"path":"{Category}","type":"text","column_name":"Category"},{"path":"{party}","type":"text","column_name":"Party"},{"path":"{reason}","type":"text","column_name":"Reason"}]}}
$$::JSONB)

View File

@ -1,27 +0,0 @@
SELECT
*
FROM
tps.srce_map_def_set(
$$
{
"srce":"dcard",
"sequence":1,
"defn": [
{
"key": "{Description}",
"map": "y",
"flag": "",
"field": "f20",
"regex": ".{1,20}",
"retain": "y"
}
],
"name": "First 20",
"where": [
{}
],
"function": "extract",
"description": "pull first 20 characters from description for mapping"
}
$$
)

View File

@ -1,6 +0,0 @@
SELECT
*
FROM
tps.map_rv_set(
$$[{"source":"dcard","map":"First 20","ret_val":{"f20": "DISCOUNT DRUG MART 3"},"mapped":{"party":"Discount Drug Mart","reason":"groceries"}},{"source":"dcard","map":"First 20","ret_val":{"f20": "TARGET STOW OH"},"mapped":{"party":"Target","reason":"groceries"}},{"source":"dcard","map":"First 20","ret_val":{"f20": "WALMART GROCERY 800-"},"mapped":{"party":"Walmart","reason":"groceries"}},{"source":"dcard","map":"First 20","ret_val":{"f20": "CIRCLE K 05416 STOW "},"mapped":{"party":"Circle K","reason":"gasoline"}},{"source":"dcard","map":"First 20","ret_val":{"f20": "TARGET.COM * 800-591"},"mapped":{"party":"Target","reason":"home supplies"}},{"source":"dcard","map":"First 20","ret_val":{"f20": "ACME NO. 17 STOW OH"},"mapped":{"party":"Acme","reason":"groceries"}},{"source":"dcard","map":"First 20","ret_val":{"f20": "AT&T *PAYMENT 800-28"},"mapped":{"party":"AT&T","reason":"internet"}},{"source":"dcard","map":"First 20","ret_val":{"f20": "AUTOZONE #0722 STOW "},"mapped":{"party":"Autozone","reason":"auto maint"}},{"source":"dcard","map":"First 20","ret_val":{"f20": "BESTBUYCOM8055267948"},"mapped":{"party":"BestBuy","reason":"home supplies"}},{"source":"dcard","map":"First 20","ret_val":{"f20": "BUFFALO WILD WINGS K"},"mapped":{"party":"Buffalo Wild Wings","reason":"restaurante"}},{"source":"dcard","map":"First 20","ret_val":{"f20": "CASHBACK BONUS REDEM"},"mapped":{"party":"Discover Card","reason":"financing"}},{"source":"dcard","map":"First 20","ret_val":{"f20": "CLE CLINIC PT PMTS 2"},"mapped":{"party":"Cleveland Clinic","reason":"medical"}}]$$::jsonb
)

File diff suppressed because one or more lines are too long

View File

@ -1,134 +0,0 @@
[
{
"source": "dcard",
"map": "First 20",
"ret_val": {
"f20": "DISCOUNT DRUG MART 3"
},
"mapped": {
"party": "Discount Drug Mart",
"reason": "groceries"
}
},
{
"source": "dcard",
"map": "First 20",
"ret_val": {
"f20": "TARGET STOW OH"
},
"mapped": {
"party": "Target",
"reason": "groceries"
}
},
{
"source": "dcard",
"map": "First 20",
"ret_val": {
"f20": "WALMART GROCERY 800-"
},
"mapped": {
"party": "Walmart",
"reason": "groceries"
}
},
{
"source": "dcard",
"map": "First 20",
"ret_val": {
"f20": "CIRCLE K 05416 STOW "
},
"mapped": {
"party": "Circle K",
"reason": "gasoline"
}
},
{
"source": "dcard",
"map": "First 20",
"ret_val": {
"f20": "TARGET.COM * 800-591"
},
"mapped": {
"party": "Target",
"reason": "home supplies"
}
},
{
"source": "dcard",
"map": "First 20",
"ret_val": {
"f20": "ACME NO. 17 STOW OH"
},
"mapped": {
"party": "Acme",
"reason": "groceries"
}
},
{
"source": "dcard",
"map": "First 20",
"ret_val": {
"f20": "AT&T *PAYMENT 800-28"
},
"mapped": {
"party": "AT&T",
"reason": "internet"
}
},
{
"source": "dcard",
"map": "First 20",
"ret_val": {
"f20": "AUTOZONE #0722 STOW "
},
"mapped": {
"party": "Autozone",
"reason": "auto maint"
}
},
{
"source": "dcard",
"map": "First 20",
"ret_val": {
"f20": "BESTBUYCOM8055267948"
},
"mapped": {
"party": "BestBuy",
"reason": "home supplies"
}
},
{
"source": "dcard",
"map": "First 20",
"ret_val": {
"f20": "BUFFALO WILD WINGS K"
},
"mapped": {
"party": "Buffalo Wild Wings",
"reason": "restaurante"
}
},
{
"source": "dcard",
"map": "First 20",
"ret_val": {
"f20": "CASHBACK BONUS REDEM"
},
"mapped": {
"party": "Discover Card",
"reason": "financing"
}
},
{
"source": "dcard",
"map": "First 20",
"ret_val": {
"f20": "CLE CLINIC PT PMTS 2"
},
"mapped": {
"party": "Cleveland Clinic",
"reason": "medical"
}
}
]

View File

@ -1,74 +0,0 @@
SELECT
*
FROM
tps.srce_set(
$$
{
"name": "PNCC",
"type": "csv",
"descr": "PNC Cash Accounts",
"constraint": [
"{AsOfDate}"
],
"schemas": {
"default": [
{
"path": "{AsOfDate}",
"type": "date",
"column_name": "AsOfDate"
},
{
"path": "{BankId}",
"type": "text",
"column_name": "BankID"
},
{
"path": "{AccountNumber}",
"type": "text",
"column_name": "AccountNumber"
},
{
"path": "{AccountName}",
"type": "text",
"column_name": "AccountName"
},
{
"path": "{BaiControl}",
"type": "text",
"column_name": "BaiControl"
},
{
"path": "{Currency}",
"type": "text",
"column_name": "Currency"
},
{
"path": "{Transaction}",
"type": "text",
"column_name": "Transaction"
},
{
"path": "{Reference}",
"type": "text",
"column_name": "Reference"
},
{
"path": "{Amount}",
"type": "text",
"column_name": "Amount"
},
{
"path": "{Description}",
"type": "text",
"column_name": "Description"
},
{
"path": "{AdditionalRemittance}",
"type": "text",
"column_name": "CurrencyAdditionalRemittance"
}
]
}
}
$$::jsonb
)

View File

@ -1,2 +0,0 @@
psql -U ptrowbridge -d ubm -p 5432 -h ushcc10091 -c "COPY (SELECT jsonb_agg(rec) rec from tps.trans where srce = 'PNCC') TO 'c:\users\ptrowbridge\downloads\pncc.csv' WITH (format csv, header true)"
psql -U ptrowbridge -d ubm_dev -p 5432 -h ushcc10091 -c "CREATE TEMP TABLE x(j jsonb); COPY x FROM 'c:\users\ptrowbridge\downloads\pncc.csv' with (format csv, header true); SELECT * FROM x JOIN LATERAL tps.srce_import('PNCC',x.j) ON TRUE; DROP TABLE X;"

View File