diff --git a/deploy/reload/dcard/curl_dcard.cmd b/deploy/reload/dcard/curl_dcard.cmd new file mode 100644 index 0000000..3e2d43c --- /dev/null +++ b/deploy/reload/dcard/curl_dcard.cmd @@ -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 \ No newline at end of file diff --git a/deploy/reload/dcard/extract.sql b/deploy/reload/dcard/extract.sql new file mode 100644 index 0000000..efade9d --- /dev/null +++ b/deploy/reload/dcard/extract.sql @@ -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); diff --git a/deploy/reload/dcard/map.json b/deploy/reload/dcard/map.json new file mode 100644 index 0000000..a40517b --- /dev/null +++ b/deploy/reload/dcard/map.json @@ -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" + } +] \ No newline at end of file diff --git a/sample_discovercard/srce.json b/deploy/reload/dcard/srce.json similarity index 100% rename from sample_discovercard/srce.json rename to deploy/reload/dcard/srce.json diff --git a/deploy/reload/dcard/vals.json b/deploy/reload/dcard/vals.json new file mode 100644 index 0000000..4dddc7b --- /dev/null +++ b/deploy/reload/dcard/vals.json @@ -0,0 +1,4299 @@ +[ + { + "map": "First 20", + "ret_val": { + "f20": "DISCOUNT DRUG MART 3" + }, + "source": "dcard", + "mapped": { + "party": "Discount Drug Mart", + "reason": "groceries" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "TARGET STOW OH" + }, + "source": "dcard", + "mapped": { + "party": "Target", + "reason": "groceries" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "CIRCLE K 05416 STOW " + }, + "source": "dcard", + "mapped": { + "party": "Circle K", + "reason": "gasoline" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "TARGET.COM * 800-591" + }, + "source": "dcard", + "mapped": { + "party": "Target", + "reason": "home supplies" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "BESTBUYCOM8055267948" + }, + "source": "dcard", + "mapped": { + "party": "BestBuy", + "reason": "home supplies" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "BUFFALO WILD WINGS K" + }, + "source": "dcard", + "mapped": { + "party": "Buffalo Wild Wings", + "reason": "restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "CASHBACK BONUS REDEM" + }, + "source": "dcard", + "mapped": { + "party": "Discover Card", + "reason": "financing" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "CLE CLINIC PT PMTS 2" + }, + "source": "dcard", + "mapped": { + "party": "Cleveland Clinic", + "reason": "medical" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "WWW.KOHLS.COM #0873 " + }, + "source": "dcard", + "mapped": { + "party": "Kohls", + "reason": "clothes" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "MARATHON PETRO73601 " + }, + "source": "dcard", + "mapped": { + "party": "Marathon", + "reason": "gasoline" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "L A SHISH GRILL STOW" + }, + "source": "dcard", + "mapped": { + "party": "La Shish", + "reason": "restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "OFFICEMAX/OFFICE DEP" + }, + "source": "dcard", + "mapped": { + "party": "Office Max", + "reason": "home supplies" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "SP * ERIKTHEFLUTEMAK" + }, + "source": "dcard", + "mapped": { + "party": "Erik The Flutemaker", + "reason": "gifts" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "SQ *SUGAR RUSH KENT " + }, + "source": "dcard", + "mapped": { + "party": "Sugar Rush", + "reason": "restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "MINIMUM INTEREST CHA" + }, + "source": "dcard", + "mapped": { + "party": "Discover Card", + "reason": "fees" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "CASH ADVANCE FEE" + }, + "source": "dcard", + "mapped": { + "party": "Discover Card", + "reason": "fees" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "SUMMIT CO PARKING GA" + }, + "source": "dcard", + "mapped": { + "party": "Summit County Parking Garage", + "reason": "civic duty" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "AUTOZONE #1941 STREE" + }, + "source": "dcard", + "mapped": { + "party": "Autozone", + "reason": "auto maintenance" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "THE KENT STAGE KENT " + }, + "source": "dcard", + "mapped": { + "party": "The Kent Stage", + "reason": "gifts" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "MSFT *AZURE 800-642-" + }, + "source": "dcard", + "mapped": { + "party": "Azure", + "reason": "recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "CHIPOTLE ONLINE 303-" + }, + "source": "dcard", + "mapped": { + "party": "Chipotle", + "reason": "restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "DIVERSIFIED MINI STO" + }, + "source": "dcard", + "mapped": { + "party": "Diversified Tree Farm", + "reason": "recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "GOOGLE *YOUTUBE VIDE" + }, + "source": "dcard", + "mapped": { + "party": "Youtube", + "reason": "recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "CHIPOTLE 1115 STREET" + }, + "source": "dcard", + "mapped": { + "party": "Chipotle", + "reason": "restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "CHILDRENS HOSPITAL M" + }, + "source": "dcard", + "mapped": { + "party": "Akron Children's Hospital", + "reason": "medical" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "BATH & BODY WORKS.CO" + }, + "source": "dcard", + "mapped": { + "party": "Bath and Body Works", + "reason": "home supplies" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "IN *MR. BULKY'S FOOD" + }, + "source": "dcard", + "mapped": { + "party": "Mr. Bulky's", + "reason": "recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "BP#954778736210 7-EL" + }, + "source": "dcard", + "mapped": { + "party": "BP", + "reason": "gasoline" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "GOOGLE *ASCIIFLOW.CO" + }, + "source": "dcard", + "mapped": { + "party": "ASCII Flow", + "reason": "recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "MSFT * E04004X603 80" + }, + "source": "dcard", + "mapped": { + "party": "Microsoft", + "reason": "home supplies" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "BIG LOTS #00453 STOW" + }, + "source": "dcard", + "mapped": { + "party": "Big Lots", + "reason": "Home Supplies" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "ACME NO. 17 STOW OH" + }, + "source": "dcard", + "mapped": { + "party": "Acme", + "reason": "groceries" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "AT&T *PAYMENT 800-28" + }, + "source": "dcard", + "mapped": { + "party": "AT&T", + "reason": "internet" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "AUTOZONE #0722 STOW " + }, + "source": "dcard", + "mapped": { + "party": "Autozone", + "reason": "auto maint" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "1794MOTHERHOOD #1794" + }, + "source": "dcard", + "mapped": { + "party": "Motherhood", + "reason": "Clothes" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "3 PALMS HUDSON OH" + }, + "source": "dcard", + "mapped": { + "province": "Ohio", + "city": "Hudson", + "reason": "Restaurante", + "party": "3 Palms" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "36241 7-ELEVEN STOW " + }, + "source": "dcard", + "mapped": { + "province": "Ohio", + "city": "Stow", + "reason": "Gasoline", + "party": "7-Eleven" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "7-ELEVEN 36241 STOW " + }, + "source": "dcard", + "mapped": { + "province": "Ohio", + "city": "Stow", + "reason": "Gasoline", + "party": "7-Eleven" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "98626 - 200 PUBLIC S" + }, + "source": "dcard", + "mapped": { + "party": "Public Square Parking Garage", + "reason": "Recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "ACE HARDWARE HUDSON " + }, + "source": "dcard", + "mapped": { + "party": "Ace Hardware", + "reason": "Home Maintenance" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "ACH CAFE AND STARBUC" + }, + "source": "dcard", + "mapped": { + "party": "Starbucks", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "ACME FRESH MARKET UN" + }, + "source": "dcard", + "mapped": { + "party": "Acme", + "reason": "Groceries" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "ADVANCE AUTO PARTS #" + }, + "source": "dcard", + "mapped": { + "party": "Advance Auto", + "reason": "Auto Maintenance" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "ADY*NETFLIX WWW.NETF" + }, + "source": "dcard", + "mapped": { + "party": "Netflix", + "reason": "Recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "AIRBNB INC 415-800-5" + }, + "source": "dcard", + "mapped": { + "party": "Airbnb Inc", + "reason": "Recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "AKRON CHILDRENS HOSP" + }, + "source": "dcard", + "mapped": { + "party": "Akron Childrens", + "reason": "Medical" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "AKRON GENERAL MEDICA" + }, + "source": "dcard", + "mapped": { + "party": "Akron General", + "reason": "Medical" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "AKRON ZOOLOGICAL PAR" + }, + "source": "dcard", + "mapped": { + "party": "Akron Zoological Park", + "reason": "Recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "AMAZON MKTPLACE PMTS" + }, + "source": "dcard", + "mapped": { + "party": "Amazon", + "reason": "Amazon" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "AMAZON VIDEO ON DEMA" + }, + "source": "dcard", + "mapped": { + "party": "Amazon Video", + "reason": "Amazon" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "AMAZON.COM AMZN.COM/" + }, + "source": "dcard", + "mapped": { + "party": "Amazon", + "reason": "Amazon" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "ANC*ANCESTRY.COM 800" + }, + "source": "dcard", + "mapped": { + "party": "Ancestry.com", + "reason": "Recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "APPLEBEES C942048569" + }, + "source": "dcard", + "mapped": { + "party": "Applebees", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "APPLEBEES S942049899" + }, + "source": "dcard", + "mapped": { + "party": "Applebees", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "ARBYS #1831 STOW STO" + }, + "source": "dcard", + "mapped": { + "party": "Arbys", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "ARBYS 1831 STOW OH" + }, + "source": "dcard", + "mapped": { + "party": "Arbys", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "ARBYS 2227 PRINCETON" + }, + "source": "dcard", + "mapped": { + "party": "Arbys", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "ARBYS 5355 UNIONTOWN" + }, + "source": "dcard", + "mapped": { + "party": "Arbys", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "ASIAN CHAO FAIRLAWN " + }, + "source": "dcard", + "mapped": { + "party": "Asian Chao", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "ATT*BILL PAYMENT 800" + }, + "source": "dcard", + "mapped": { + "party": "AT&T", + "reason": "Internet" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "AUTOZONE #0723 AKRON" + }, + "source": "dcard", + "mapped": { + "party": "Autozone", + "reason": "Auto Maintenance" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "AUTOZONE #2465 MOUNT" + }, + "source": "dcard", + "mapped": { + "party": "Autozone", + "reason": "Auto Maintenance" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "AUTOZONE #4506 STOW " + }, + "source": "dcard", + "mapped": { + "party": "Autozone", + "reason": "Auto Maintenance" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "BATH&BODY AKRON OH" + }, + "source": "dcard", + "mapped": { + "party": "Bath & Body Works", + "reason": "Home Supplies" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "BATH&BODY STOW OH" + }, + "source": "dcard", + "mapped": { + "party": "Bath & Body Works", + "reason": "Home Supplies" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "BATHANDBODYWORKS.COM" + }, + "source": "dcard", + "mapped": { + "party": "Bath & Body Works", + "reason": "Home Supplies" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "BEDBATH&BEYOND STOW " + }, + "source": "dcard", + "mapped": { + "party": "Bed Bath & Beyond", + "reason": "Home Supplies" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "BEDBATH&BEYOND#0060 " + }, + "source": "dcard", + "mapped": { + "party": "Bed Bath & Beyond", + "reason": "Home Supplies" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "BEDBATH&BEYOND#0360 " + }, + "source": "dcard", + "mapped": { + "party": "Bed Bath & Beyond", + "reason": "Home Supplies" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "BELLACINOS PIZZA AND" + }, + "source": "dcard", + "mapped": { + "party": "Bellacinos", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "BEST BUY 00002782295" + }, + "source": "dcard", + "mapped": { + "party": "Best Buy", + "reason": "Home Supplies" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "BESTBUY.COM 888-BEST" + }, + "source": "dcard", + "mapped": { + "party": "Best Buy", + "reason": "Home Supplies" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "BESTBUYCOM7424430059" + }, + "source": "dcard", + "mapped": { + "party": "Best Buy", + "reason": "Home Supplies" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "BIG DEES TACK STREET" + }, + "source": "dcard", + "mapped": { + "party": "Big Dees Tack & Supply", + "reason": "Home Supplies" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "BISTRO ON MAIN KENT " + }, + "source": "dcard", + "mapped": { + "party": "Bistro On Main", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "BP#93079431210 BUFFA" + }, + "source": "dcard", + "mapped": { + "party": "BP", + "reason": "Gas" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "BP#954635936241 7-EL" + }, + "source": "dcard", + "mapped": { + "party": "BP", + "reason": "Gas" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "BREWSTER'S TWINSBURG" + }, + "source": "dcard", + "mapped": { + "party": "Brewsters", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "BRICCO KENT KENT OH" + }, + "source": "dcard", + "mapped": { + "party": "Bricco", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "BRUEGGERS #209 STOW " + }, + "source": "dcard", + "mapped": { + "party": "Brueggers Bagels", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "BUMP FIRE SYSTEMS MI" + }, + "source": "dcard", + "mapped": { + "party": "Bump Fire Systems", + "reason": "Recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "BURGER KING #14183 S" + }, + "source": "dcard", + "mapped": { + "party": "Burger King", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "BURGER KING #4422 BR" + }, + "source": "dcard", + "mapped": { + "party": "Burger King", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "BURGER KING #5239 NE" + }, + "source": "dcard", + "mapped": { + "party": "Burger King", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "BURGER KING #5811 ST" + }, + "source": "dcard", + "mapped": { + "party": "Burger King", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "BURGERFI CUYAHOGA FA" + }, + "source": "dcard", + "mapped": { + "party": "BurgerFI", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "BV HEGDE,MD 330-6733" + }, + "source": "dcard", + "mapped": { + "party": "Bv Hegde, MD", + "reason": "Medical" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "BV HEGDE,MD 33067333" + }, + "source": "dcard", + "mapped": { + "party": "Bv Hegde, MD", + "reason": "Medical" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "BV HEGDE,MD KENT OH" + }, + "source": "dcard", + "mapped": { + "party": "Bv Hegde, MD", + "reason": "Medical" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "CAFE O PLAY CUYAHOGA" + }, + "source": "dcard", + "mapped": { + "party": "Café O Play", + "reason": "Recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "CAJUN GRILL CLEVELAN" + }, + "source": "dcard", + "mapped": { + "party": "Cajun Grill", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "CARTER'S #907 STOW O" + }, + "source": "dcard", + "mapped": { + "party": "Carters", + "reason": "Clothes" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "CHARLEYS GRILLED SUB" + }, + "source": "dcard", + "mapped": { + "party": "Charleys Grilled Subs", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "CHARLEYS PHILLY STEA" + }, + "source": "dcard", + "mapped": { + "party": "Charleys Philly Steaks", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "CHICK-FIL-A #01583 C" + }, + "source": "dcard", + "mapped": { + "party": "Chick-Fil-A", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "CHICK-FIL-A #02197 C" + }, + "source": "dcard", + "mapped": { + "party": "Chick-Fil-A", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "CHICK-FIL-A #02216 M" + }, + "source": "dcard", + "mapped": { + "party": "Chick-Fil-A", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "CHICK-FIL-A #02957 M" + }, + "source": "dcard", + "mapped": { + "party": "Chick-Fil-A", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "CHICK-FIL-A #03447 P" + }, + "source": "dcard", + "mapped": { + "party": "Chick-Fil-A", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "CHICK-FIL-A #03490 D" + }, + "source": "dcard", + "mapped": { + "party": "Chick-Fil-A", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "CHILDRENS HOSP ACCOU" + }, + "source": "dcard", + "mapped": { + "party": "Akron Childrens Hospital", + "reason": "Medical" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "CHIPOTLE 0559 MACEDO" + }, + "source": "dcard", + "mapped": { + "party": "Chipotle", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "CHIPOTLE 1152 STOW O" + }, + "source": "dcard", + "mapped": { + "party": "Chipotle", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "CHIPOTLE 1216 HUDSON" + }, + "source": "dcard", + "mapped": { + "party": "Chipotle", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "CHIPOTLE 2027 TWINSB" + }, + "source": "dcard", + "mapped": { + "party": "Chipotle", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "CHMCA PARKING LOCUST" + }, + "source": "dcard", + "mapped": { + "party": "Akron General", + "reason": "Medical" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "CHMC-ER REGISTRATION" + }, + "source": "dcard", + "mapped": { + "party": "Akron General", + "reason": "Medical" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "CITYOFSTOW 330689283" + }, + "source": "dcard", + "mapped": { + "party": "City of Stow", + "reason": "Sewer" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "CITYOFSTOW 402-935-7" + }, + "source": "dcard", + "mapped": { + "party": "City of Stow", + "reason": "Sewer" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "COLDSTONE #1490 HUDS" + }, + "source": "dcard", + "mapped": { + "party": "Coldstone", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "COLLEGE TRANSCRIPT 7" + }, + "source": "dcard", + "mapped": { + "party": "Ashland University", + "reason": "Continuing Education" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "COOKERY, THE HUDSON " + }, + "source": "dcard", + "mapped": { + "party": "The Cookery", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "CVS/PHARMACY #04359 " + }, + "source": "dcard", + "mapped": { + "party": "CVS", + "reason": "Home Supplies" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "CVS/PHARMACY #06167 " + }, + "source": "dcard", + "mapped": { + "party": "CVS", + "reason": "Home Supplies" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "CVS/PHARMACY #08932 " + }, + "source": "dcard", + "mapped": { + "party": "CVS", + "reason": "Home Supplies" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "DAIRY QUEEN #10722 M" + }, + "source": "dcard", + "mapped": { + "party": "Dairy Queen", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "DAIRY QUEEN #17749 S" + }, + "source": "dcard", + "mapped": { + "party": "Dairy Queen", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "DAIRY QUEEN #18902 S" + }, + "source": "dcard", + "mapped": { + "party": "Dairy Queen", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "DAIRY QUEEN#12711 AK" + }, + "source": "dcard", + "mapped": { + "party": "Dairy Queen", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "DAVIS EYE CENTER CUY" + }, + "source": "dcard", + "mapped": { + "party": "Davis Eye Center", + "reason": "Medical" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "DESTINY RESCUE USA 5" + }, + "source": "dcard", + "mapped": { + "party": "Destiny Rescue", + "reason": "Gift" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "DICKS SPORTING GOODS" + }, + "source": "dcard", + "mapped": { + "party": "Dicks Sporting Goods", + "reason": "Recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "DIS*DISNEY MOVIE CLU" + }, + "source": "dcard", + "mapped": { + "party": "Disney Movie Club", + "reason": "Recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "DISCOUNT DRUG MART 6" + }, + "source": "dcard", + "mapped": { + "party": "Discount Drug Mart", + "reason": "Groceries" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "DOLLAR GENERAL #1666" + }, + "source": "dcard", + "mapped": { + "party": "Dollar General", + "reason": "Home Supplies" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "DOLLAR TREE STOW OH" + }, + "source": "dcard", + "mapped": { + "party": "Dollar Tree", + "reason": "Home Supplies" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "DOLRTREE 23000235568" + }, + "source": "dcard", + "mapped": { + "party": "Dollar Tree", + "reason": "Home Supplies" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "DUMA MEATS MOGADORE " + }, + "source": "dcard", + "mapped": { + "party": "Duma Meats", + "reason": "Groceries" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "DUNKIN #345001 Q35 C" + }, + "source": "dcard", + "mapped": { + "party": "Dunkin Doughnuts", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "DUNKIN #353699 Q35 S" + }, + "source": "dcard", + "mapped": { + "party": "Dunkin Doughnuts", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "DURBIN RAILROAD 402-" + }, + "source": "dcard", + "mapped": { + "party": "Durbin Railroad", + "reason": "Recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "EARTH N WOOD PRODUCT" + }, + "source": "dcard", + "mapped": { + "party": "Earht N Wood", + "reason": "Home Maintenance" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "EBAYS HALF.COM SAN J" + }, + "source": "dcard", + "mapped": { + "party": "Half.Com", + "reason": "Education" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "ECARDIO DIAGNOSTICS " + }, + "source": "dcard", + "mapped": { + "party": "Ecardio Diagnostics", + "reason": "Medical" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "EDDYS BIKE SHOP STOW" + }, + "source": "dcard", + "mapped": { + "party": "Eddys Bike Shop", + "reason": "Recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "EDDY'S DELI & RESTAU" + }, + "source": "dcard", + "mapped": { + "party": "Eddys Deli & Restaurante", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "EL CAMPESINO STOW OH" + }, + "source": "dcard", + "mapped": { + "party": "El Campesino", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "ENTERPRISE 101213580" + }, + "source": "dcard", + "mapped": { + "party": "Enterprise", + "reason": "Auto Maintenance" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "ETSY.COM BROOKL NY" + }, + "source": "dcard", + "mapped": { + "party": "Etsy.com", + "reason": "Home Supplies" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "EXXONMOBIL HILLSVILL" + }, + "source": "dcard", + "mapped": { + "party": "Exxonmobil", + "reason": "Gas" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "EXXONMOBIL SCARBRO W" + }, + "source": "dcard", + "mapped": { + "party": "Exxonmobil", + "reason": "Gas" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "EXXONMOBIL SURF CITY" + }, + "source": "dcard", + "mapped": { + "party": "Exxonmobil", + "reason": "Gas" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "FAMILY VIDEO #348 ST" + }, + "source": "dcard", + "mapped": { + "party": "Family Video", + "reason": "Recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "FIVE BELOW 501 STOW " + }, + "source": "dcard", + "mapped": { + "party": "Five Below", + "reason": "Home Supplies" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "FIVE BELOW 501 STOWE" + }, + "source": "dcard", + "mapped": { + "party": "Five Below", + "reason": "Home Supplies" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "FIVE GUYS OH 1086 QS" + }, + "source": "dcard", + "mapped": { + "party": "Five Guys", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "FIXEZ 8662336460 NV" + }, + "source": "dcard", + "mapped": { + "party": "Fixez.com", + "reason": "Phone" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "FRACTURED PRUNE SURF" + }, + "source": "dcard", + "mapped": { + "party": "Fractured Prune", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "GANDER MOUNTAIN TWIN" + }, + "source": "dcard", + "mapped": { + "party": "Gander Mountain", + "reason": "Recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "GET GO #3359 STREETS" + }, + "source": "dcard", + "mapped": { + "party": "Get Go", + "reason": "Gas" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "GET GO #3396 STOW OH" + }, + "source": "dcard", + "mapped": { + "party": "Get Go", + "reason": "Gas" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "GIANT #4419 KENT OH" + }, + "source": "dcard", + "mapped": { + "party": "Giant-Eagle", + "reason": "Groceries" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "GIANT EAGLE #5863 ST" + }, + "source": "dcard", + "mapped": { + "party": "Giant Eagle", + "reason": "Groceries" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "GIANT-EAGLE #0224 TW" + }, + "source": "dcard", + "mapped": { + "party": "Giant-Eagle", + "reason": "Groceries" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "GIANT-EAGLE #4032 ST" + }, + "source": "dcard", + "mapped": { + "party": "Giant-Eagle", + "reason": "Groceries" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "GIANT-EAGLE #4096 ST" + }, + "source": "dcard", + "mapped": { + "party": "Giant-Eagle", + "reason": "Groceries" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "GITHUB.COM 415448667" + }, + "source": "dcard", + "mapped": { + "party": "github.com", + "reason": "Recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "GITHUB.COM 55OO9 415" + }, + "source": "dcard", + "mapped": { + "party": "github.com", + "reason": "Recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "GOOGLE *GOOGLE PLAY " + }, + "source": "dcard", + "mapped": { + "party": "Google Play", + "reason": "Recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "GOOGLE *MEDIOCRE GOO" + }, + "source": "dcard", + "mapped": { + "party": "Google Play", + "reason": "Recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "GOOGLE *MUSIC GOOGLE" + }, + "source": "dcard", + "mapped": { + "party": "Google Play", + "reason": "Recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "GOOGLE *OUTFIT7 GOOG" + }, + "source": "dcard", + "mapped": { + "party": "Google Play", + "reason": "Recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "GREAT HARVEST BREAD " + }, + "source": "dcard", + "mapped": { + "party": "Great Harvest Bread", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "GREATER CLEVELAND RT" + }, + "source": "dcard", + "mapped": { + "party": "Greater Cleveland RTA", + "reason": "Recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "GRUBHUBTWISTEDMELTZ " + }, + "source": "dcard", + "mapped": { + "party": "Twisted Meltz", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "GUIDOPIZZA3306785505" + }, + "source": "dcard", + "mapped": { + "party": "Guidos Pizza", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "GUIDOS ORIGINAL PIZZ" + }, + "source": "dcard", + "mapped": { + "party": "Guidos Pizza", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "GUITAR CENTER #616 F" + }, + "source": "dcard", + "mapped": { + "party": "Guitar Center", + "reason": "Recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "HANDELS ICE CREAM ST" + }, + "source": "dcard", + "mapped": { + "party": "Handles Ice Cream", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "HARTVILLE HARDWARE I" + }, + "source": "dcard", + "mapped": { + "party": "Hartville Hardware", + "reason": "Home Maintenance" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "HARTVILLE KITCHEN - " + }, + "source": "dcard", + "mapped": { + "party": "Hartville Kitchen", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "HEGGYS ALLIANCE ALLI" + }, + "source": "dcard", + "mapped": { + "party": "Heggys", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "HEINENS VILL MKT19 H" + }, + "source": "dcard", + "mapped": { + "party": "Heinens", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "HOBBY LOBBY #405 STO" + }, + "source": "dcard", + "mapped": { + "party": "Hobby Lobby", + "reason": "Home Supplies" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "IKEA HOME SHOPPING B" + }, + "source": "dcard", + "mapped": { + "party": "Ikea", + "reason": "Home Supplies" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "ILP*INSECT LORE 800-" + }, + "source": "dcard", + "mapped": { + "party": "Insect Lore", + "reason": "Education" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "IN *FAMILY MEDICAL C" + }, + "source": "dcard", + "mapped": { + "party": "Family Medical Care", + "reason": "Medical" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "INTEREST CHARGE ON P" + }, + "source": "dcard", + "mapped": { + "party": "Discover Card", + "reason": "Financing" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "INTEREST CHARGE REFU" + }, + "source": "dcard", + "mapped": { + "party": "Discover Card", + "reason": "Financing" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "INTERNET PAYMENT - T" + }, + "source": "dcard", + "mapped": { + "party": "Huntington", + "reason": "Financing" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "JAMBERRY NAILS, LLC " + }, + "source": "dcard", + "mapped": { + "party": "Jamberry Nails", + "reason": "Recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "JERSEY MIKE'S 2063 S" + }, + "source": "dcard", + "mapped": { + "party": "Jersey Mikes", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "JOANN ETC #0171 HUDS" + }, + "source": "dcard", + "mapped": { + "party": "Jo-Ann", + "reason": "Home Supplies" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "JUSTICE #0639 STOW O" + }, + "source": "dcard", + "mapped": { + "party": "Justice", + "reason": "Clothes" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "KING DRAGON STOW OH" + }, + "source": "dcard", + "mapped": { + "party": "King Dragon", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "KOHL'S #0235 MACEDON" + }, + "source": "dcard", + "mapped": { + "party": "Kohls", + "reason": "clothing" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "KOHL'S #0331 STOW OH" + }, + "source": "dcard", + "mapped": { + "party": "Kohls", + "reason": "clothing" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "KSU DINING SERVICES " + }, + "source": "dcard", + "mapped": { + "party": "KSU Dining", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "LAKE FARMPARK ADMISS" + }, + "source": "dcard", + "mapped": { + "party": "Lake Farmpark", + "reason": "Recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "LATE CHARGE REFUND" + }, + "source": "dcard", + "mapped": { + "party": "Discover Card", + "reason": "Financing" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "LATE FEE" + }, + "source": "dcard", + "mapped": { + "party": "Discover Card", + "reason": "Financing" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "LAZIZA RESTAURANT KE" + }, + "source": "dcard", + "mapped": { + "party": "La Ziza", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "LEMONGRASS GRILLE MU" + }, + "source": "dcard", + "mapped": { + "party": "Lemongrass Grille", + "reason": "Restaurnte" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "LITTLE TIKES CO 800-" + }, + "source": "dcard", + "mapped": { + "party": "Little Tikes", + "reason": "Recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "LOGOS BOOKSTORE KENT" + }, + "source": "dcard", + "mapped": { + "party": "Logos Bookstore", + "reason": "Education" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "LOLA BISTRO CLEVELAN" + }, + "source": "dcard", + "mapped": { + "party": "Lola", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "LOVES COUNTRY STORE " + }, + "source": "dcard", + "mapped": { + "party": "Loves Country Store", + "reason": "Recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "LOWE'S OF MACEDONIA," + }, + "source": "dcard", + "mapped": { + "party": "Lowes", + "reason": "Home Supplies" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "LOWE'S OF MT. AIRY, " + }, + "source": "dcard", + "mapped": { + "party": "Lowes", + "reason": "Home Supplies" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "LOWE'S OF STOW, OH. " + }, + "source": "dcard", + "mapped": { + "party": "Lowes", + "reason": "Home Supplies" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "LOWE'S OF STREETSBOR" + }, + "source": "dcard", + "mapped": { + "party": "Lowes", + "reason": "Home Supplies" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "MACS CONVENIENC STOR" + }, + "source": "dcard", + "mapped": { + "party": "Macs Convenience Store", + "reason": "Gas" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "MACS CONVENIENCE STO" + }, + "source": "dcard", + "mapped": { + "party": "Macs Convenience Store", + "reason": "Gas" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "MACY*S .COM #0129 MA" + }, + "source": "dcard", + "mapped": { + "party": "Macys", + "reason": "clothes" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "MACY'S EAST #581 STO" + }, + "source": "dcard", + "mapped": { + "party": "Macys", + "reason": "clothes" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "MALLEYS CHOCOLATES 3" + }, + "source": "dcard", + "mapped": { + "party": "Malleys", + "reason": "Recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "MARATHON PETRO ROOTS" + }, + "source": "dcard", + "mapped": { + "party": "Marathon", + "reason": "Gas" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "MARATHON PETRO TWINS" + }, + "source": "dcard", + "mapped": { + "party": "Marathon", + "reason": "Gas" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "MARATHON PETRO073601" + }, + "source": "dcard", + "mapped": { + "party": "Marathon", + "reason": "Gas" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "MARATHON PETRO144667" + }, + "source": "dcard", + "mapped": { + "party": "Marathon", + "reason": "Gas" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "MARATHON PETRO156059" + }, + "source": "dcard", + "mapped": { + "party": "Marathon", + "reason": "Gas" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "MARATHON PETRO175588" + }, + "source": "dcard", + "mapped": { + "party": "Marathon", + "reason": "Gas" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "MARCOS PIZZA - 1097 " + }, + "source": "dcard", + "mapped": { + "party": "Marcos", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "MARCS ALLIANCE ALLIA" + }, + "source": "dcard", + "mapped": { + "party": "Marcs", + "reason": "Home Supplies" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "MARCS CUYAHOGA CUYAH" + }, + "source": "dcard", + "mapped": { + "party": "Marcs", + "reason": "Home Supplies" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "MARC'S STOW STOW OH" + }, + "source": "dcard", + "mapped": { + "party": "Marcs", + "reason": "Home Supplies" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "MARHOFER CHEVY PARTS" + }, + "source": "dcard", + "mapped": { + "party": "Marhofer Chevy", + "reason": "Auto Maintenance" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "MAURICES STOW OH" + }, + "source": "dcard", + "mapped": { + "party": "Maurices", + "reason": "Clothes" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "MCDONALD'S F11579 ST" + }, + "source": "dcard", + "mapped": { + "party": "McDonalds", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "MCDONALD'S F2542 CUY" + }, + "source": "dcard", + "mapped": { + "party": "McDonalds", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "MCDONALD'S F31878 BR" + }, + "source": "dcard", + "mapped": { + "party": "McDonalds", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "MCDONALD'S F34016 ST" + }, + "source": "dcard", + "mapped": { + "party": "McDonalds", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "MCDONALD'S F34630 SU" + }, + "source": "dcard", + "mapped": { + "party": "McDonalds", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "MCDONALD'S F5863 MAR" + }, + "source": "dcard", + "mapped": { + "party": "McDonalds", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "MCDONALD'S F8064 HAR" + }, + "source": "dcard", + "mapped": { + "party": "McDonalds", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "METROPARKS ZOO CLEVE" + }, + "source": "dcard", + "mapped": { + "party": "Cleveland Zoo", + "reason": "Recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "MFW BOOKS LLC 573202" + }, + "source": "dcard", + "mapped": { + "party": "Mfw Books", + "reason": "Education" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "MICROSOFT *OFFICE 36" + }, + "source": "dcard", + "mapped": { + "party": "Microsoft", + "reason": "Home Supplies" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "MICROSOFT *ONEDRIVE " + }, + "source": "dcard", + "mapped": { + "party": "Microsoft", + "reason": "Home Supplies" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "MICROSOFT *STORE 800" + }, + "source": "dcard", + "mapped": { + "party": "Microsoft", + "reason": "Home Supplies" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "MINUTECLINIC #21441 " + }, + "source": "dcard", + "mapped": { + "party": "Minuteclinic", + "reason": "Medical" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "MOE'S SW GRILL 351 S" + }, + "source": "dcard", + "mapped": { + "party": "Moes Southwest Grille", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "MR BULKY'S FOODS CUY" + }, + "source": "dcard", + "mapped": { + "party": "Mr Bulkys", + "reason": "groceries" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "MSFT *OFFICE 800-642" + }, + "source": "dcard", + "mapped": { + "party": "Microsoft", + "reason": "Home Supplies" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "MSFT *OFFICE OFFICE." + }, + "source": "dcard", + "mapped": { + "party": "Microsoft", + "reason": "Home Supplies" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "MSFT *ONEDRIVE 800-6" + }, + "source": "dcard", + "mapped": { + "party": "Microsoft", + "reason": "Home Supplies" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "MURPHY7219ATWALMRT C" + }, + "source": "dcard", + "mapped": { + "party": "Murphy", + "reason": "Gas" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "MURPHY7515ATWALMART " + }, + "source": "dcard", + "mapped": { + "party": "Murphy", + "reason": "Gas" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "MY LITTLE RED WAGON " + }, + "source": "dcard", + "mapped": { + "party": "My Little Red Wagon", + "reason": "Recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "NETFLIX.COM LOS GATO" + }, + "source": "dcard", + "mapped": { + "party": "Netflix.Com", + "reason": "Recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "NETFLIX.COM NETFLIX." + }, + "source": "dcard", + "mapped": { + "party": "Netflix.Com", + "reason": "Recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "OBGYN ASSOCIATES OF " + }, + "source": "dcard", + "mapped": { + "party": "OBGYN Associates of Akron", + "reason": "Medical" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "OED EDUCATOR LICENSU" + }, + "source": "dcard", + "mapped": { + "party": "OED Educator", + "reason": "Continuing Education" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "OH BUREAU MOTOR VEHI" + }, + "source": "dcard", + "mapped": { + "party": "Ohio BMV", + "reason": "Compliance" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "OLD CAROLINA BBQ STO" + }, + "source": "dcard", + "mapped": { + "party": "Old Carolina BBQ", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "ONCE UPON A CHILD 20" + }, + "source": "dcard", + "mapped": { + "party": "Once Upon A Child", + "reason": "Gift" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "OPC COL*SERVICE FEE " + }, + "source": "dcard", + "mapped": { + "party": "Ashland University", + "reason": "Continuing Education" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "OPC*ASHLAND UNIV ASH" + }, + "source": "dcard", + "mapped": { + "party": "Ashland University", + "reason": "Continuing Education" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "OREILLY AUT000239030" + }, + "source": "dcard", + "mapped": { + "party": "OReilly", + "reason": "Auto Maintenance" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "PAGANINI SCHOOL OF C" + }, + "source": "dcard", + "mapped": { + "party": "Paganini School", + "reason": "Recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "PANERA BREAD #204626" + }, + "source": "dcard", + "mapped": { + "party": "Panera Bread", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "PANERA BREAD #4626 S" + }, + "source": "dcard", + "mapped": { + "party": "Panera Bread", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "PANERA BREAD #4813 S" + }, + "source": "dcard", + "mapped": { + "party": "Panera Bread", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "PANINI'S KENT KENT O" + }, + "source": "dcard", + "mapped": { + "party": "Paninis", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "PARTA - KCG KENT OH" + }, + "source": "dcard", + "mapped": { + "party": "Parta", + "reason": "Recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "PARTY STATION STOW O" + }, + "source": "dcard", + "mapped": { + "party": "Party Station", + "reason": "Recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "PAT CATANS 8 CUY FAL" + }, + "source": "dcard", + "mapped": { + "party": "Pat Catans", + "reason": "Recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "PAY*HOMEAWAY 189997 " + }, + "source": "dcard", + "mapped": { + "party": "HomeAway", + "reason": "recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "PAY*HOMEAWAY HA-GPDR" + }, + "source": "dcard", + "mapped": { + "party": "HomeAway", + "reason": "Recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "PAY*PROPDAMAGEPROTEC" + }, + "source": "dcard", + "mapped": { + "party": "HomeAway", + "reason": "Recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "PAYLESS SHO000296459" + }, + "source": "dcard", + "mapped": { + "party": "Payless Shoe Source", + "reason": "Home Supplies" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "PAYLESS SHOE SOURCE " + }, + "source": "dcard", + "mapped": { + "party": "Payless Shoe Source", + "reason": "Home Supplies" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "PEDIATRIC AND ADOLES" + }, + "source": "dcard", + "mapped": { + "party": "Pediatric And Adolescent", + "reason": "Medical" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "PERKINS RES002250949" + }, + "source": "dcard", + "mapped": { + "party": "Perkinds Restaurnate", + "reason": "Restuarnte" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "PET SUPPLIES PLUS #1" + }, + "source": "dcard", + "mapped": { + "party": "Pet Supplies Plus", + "reason": "Recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "PET SUPPLIES PLUS #6" + }, + "source": "dcard", + "mapped": { + "party": "Pet Supplies Plus", + "reason": "Recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "PILOT SEVILLE OH" + }, + "source": "dcard", + "mapped": { + "party": "Pilot", + "reason": "Gas" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "PINE CONE GIFT SHOPP" + }, + "source": "dcard", + "mapped": { + "party": "Pine Cone Gift Ship", + "reason": "Home Supplies" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "PITA PIT KENT OH" + }, + "source": "dcard", + "mapped": { + "party": "Pita Pit", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "PIZZA HUT 007946 STO" + }, + "source": "dcard", + "mapped": { + "party": "Pizza Hut", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "PIZZA HUT 009343 ALL" + }, + "source": "dcard", + "mapped": { + "party": "Pizza Hut", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "PIZZA HUT 027536 AKR" + }, + "source": "dcard", + "mapped": { + "party": "Pizza Hut", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "POTBELLY #277 CLEVEL" + }, + "source": "dcard", + "mapped": { + "party": "Potbelly", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "PRIMARY PET CARE LLC" + }, + "source": "dcard", + "mapped": { + "party": "Primary Pet Care", + "reason": "Recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "QDI*QUEST DIAGNOSTIC" + }, + "source": "dcard", + "mapped": { + "party": "QDI Quest Diagnostics", + "reason": "Medical" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "REAL DEALS - GRANVIL" + }, + "source": "dcard", + "mapped": { + "party": "Real Deals", + "reason": "Home Supplies" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "RED ROBIN #601 CANTO" + }, + "source": "dcard", + "mapped": { + "party": "Red Robin", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "RED ROBIN NO 601 CAN" + }, + "source": "dcard", + "mapped": { + "party": "Red Robin", + "reason": "Restaurantes" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "REDBOX *DVD RENTAL 8" + }, + "source": "dcard", + "mapped": { + "party": "Redbox", + "reason": "Recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "REDBOX *DVD RENTAL O" + }, + "source": "dcard", + "mapped": { + "party": "Redbox", + "reason": "Recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "REGAL CINEMAS HUDSON" + }, + "source": "dcard", + "mapped": { + "party": "Regal Cinemas", + "reason": "Recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "REMEMBERNHU 402-935-" + }, + "source": "dcard", + "mapped": { + "party": "Remember Nhu", + "reason": "Gift" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "REPUBLIC WIRELESS 80" + }, + "source": "dcard", + "mapped": { + "party": "Republic Wireless", + "reason": "Phones" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "REPUBLIC WIRELESS 87" + }, + "source": "dcard", + "mapped": { + "party": "Republic Wireless", + "reason": "Phones" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "ROCK AUTO 608-661-13" + }, + "source": "dcard", + "mapped": { + "party": "Rock Auto", + "reason": "Auto Maintenance" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "ROCKNE'S KENT KENT O" + }, + "source": "dcard", + "mapped": { + "party": "Rocknes", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "ROCKNES STEELS CORNE" + }, + "source": "dcard", + "mapped": { + "party": "Rocknes", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "ROSEWOOD GRILL HUDSO" + }, + "source": "dcard", + "mapped": { + "party": "Rosewood Grill", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "RSVP NO. 36 STOW OH" + }, + "source": "dcard", + "mapped": { + "party": "RSVP", + "reason": "Home Supplies" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "RUFENER HILLTOP FARM" + }, + "source": "dcard", + "mapped": { + "party": "Rufener Hilltop Farms", + "reason": "Groceries" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "SALLY BEAUTY #1996 S" + }, + "source": "dcard", + "mapped": { + "party": "Sally Beauty", + "reason": "Home Supplies" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "SAMS CLUB - #4750 CU" + }, + "source": "dcard", + "mapped": { + "party": "Sams Club", + "reason": "Groceries" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "SFI*PHOTOSBYSHUTTERF" + }, + "source": "dcard", + "mapped": { + "party": "Shutterfly", + "reason": "Recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "SHEETZ 0296000029644" + }, + "source": "dcard", + "mapped": { + "party": "Sheetz", + "reason": "Gas" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "SHEETZ 0328000032854" + }, + "source": "dcard", + "mapped": { + "party": "Sheetz", + "reason": "Gas" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "SHEETZ 0584000058434" + }, + "source": "dcard", + "mapped": { + "party": "Sheetz", + "reason": "Gas" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "SHEETZ 2296000229624" + }, + "source": "dcard", + "mapped": { + "party": "Sheetz", + "reason": "Gas" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "SHEETZ 2452000245214" + }, + "source": "dcard", + "mapped": { + "party": "Sheetz", + "reason": "Gas" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "SHEETZ 2456000245624" + }, + "source": "dcard", + "mapped": { + "party": "Sheetz", + "reason": "Gas" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "SHELL 57544399009 GA" + }, + "source": "dcard", + "mapped": { + "party": "Shell", + "reason": "Gas" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "SHELL 57546559204 LE" + }, + "source": "dcard", + "mapped": { + "party": "Shell", + "reason": "Gas" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "SHERATONHOTELSFB CUY" + }, + "source": "dcard", + "mapped": { + "party": "Sheraton Hotels", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "SHUTTERFLY 800-986-1" + }, + "source": "dcard", + "mapped": { + "party": "Shutterfly", + "reason": "Recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "SILVER LAKE CC PRO S" + }, + "source": "dcard", + "mapped": { + "party": "Silver Lake", + "reason": "Recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "SIMPLY SWANK SALON &" + }, + "source": "dcard", + "mapped": { + "party": "Simply Swamk", + "reason": "Hygiene" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "SP * WYLEE 888-746-7" + }, + "source": "dcard", + "mapped": { + "party": "Wylee", + "reason": "Recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "SPEEDWAY 03403 110 H" + }, + "source": "dcard", + "mapped": { + "party": "Speedway", + "reason": "Gas" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "SPEEDWAY 03680 104 S" + }, + "source": "dcard", + "mapped": { + "party": "Speedway", + "reason": "Gas" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "SPEEDWAY 03686 496 S" + }, + "source": "dcard", + "mapped": { + "party": "Speedway", + "reason": "Gas" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "SPEEDWAY 05120 234 C" + }, + "source": "dcard", + "mapped": { + "party": "Speedway", + "reason": "Gas" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "SPEEDWAY 09303 KEN K" + }, + "source": "dcard", + "mapped": { + "party": "Speedway", + "reason": "Gas" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "SPOTIFY NEW YORK CIT" + }, + "source": "dcard", + "mapped": { + "party": "Spotify", + "reason": "Recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "SPOTIFYAB STOCKHOLM " + }, + "source": "dcard", + "mapped": { + "party": "Spotify", + "reason": "Recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "SQ *CORNER CUP COFF " + }, + "source": "dcard", + "mapped": { + "party": "Corner Cup Coffee", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "SQ *CORNER CUP COFFE" + }, + "source": "dcard", + "mapped": { + "party": "Corner Cup Coffee", + "reason": "Restaurantes" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "SQ *CRAZYBUTTRUE PO " + }, + "source": "dcard", + "mapped": { + "party": "Crazy But True", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "SQ *CRAZYBUTTRUE POP" + }, + "source": "dcard", + "mapped": { + "party": "Crazy But True", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "SQ *PEACE,LOVE AND L" + }, + "source": "dcard", + "mapped": { + "party": "Peace Love and Little Doughnuts", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "SQ *POPPED KENT OH00" + }, + "source": "dcard", + "mapped": { + "party": "Peace Love and Little Doughnuts", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "SQ *THE DAILY BREW, " + }, + "source": "dcard", + "mapped": { + "party": "The Daily Brew", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "SQ *TWISTED MELTZ KE" + }, + "source": "dcard", + "mapped": { + "party": "Twisted Meltz", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "STAHLS FARM MARKET N" + }, + "source": "dcard", + "mapped": { + "party": "Stahls Farm Market", + "reason": "groceries" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "STARBUCKS #02954 KEN" + }, + "source": "dcard", + "mapped": { + "party": "Starbucks", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "STARBUCKS #13265 STO" + }, + "source": "dcard", + "mapped": { + "party": "Starbucks", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "STARBUCKS #14302 CUY" + }, + "source": "dcard", + "mapped": { + "party": "Starbucks", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "STARBUCKS STORE 0971" + }, + "source": "dcard", + "mapped": { + "party": "Starbucks", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "STARBUCKS STORE 1368" + }, + "source": "dcard", + "mapped": { + "party": "Starbucks", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "STARBUCKS W114115015" + }, + "source": "dcard", + "mapped": { + "party": "Starbucks", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "STEAMPOWERED.COM 425" + }, + "source": "dcard", + "mapped": { + "party": "store.steampowered.com", + "reason": "Recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "STOW DENTAL GROUP IN" + }, + "source": "dcard", + "mapped": { + "party": "Stow Dental Group", + "reason": "Medical" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "STOWNUT DONUT AND DI" + }, + "source": "dcard", + "mapped": { + "party": "Stownut Donut & Diner", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "SUBWAY 00044289255 S" + }, + "source": "dcard", + "mapped": { + "party": "Subway", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "SUBWAY 00062380255 U" + }, + "source": "dcard", + "mapped": { + "party": "Subway", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "SUBWAY 00068957255 S" + }, + "source": "dcard", + "mapped": { + "party": "Subway", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "SUBWAY 00114363255 S" + }, + "source": "dcard", + "mapped": { + "party": "Subway", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "SUBWAY 00213843255 S" + }, + "source": "dcard", + "mapped": { + "party": "Subway", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "SUBWAY 00216093255 A" + }, + "source": "dcard", + "mapped": { + "party": "Subway", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "SUBWAY 00221911255 T" + }, + "source": "dcard", + "mapped": { + "party": "Subway", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "SUBWAY 00366203255 K" + }, + "source": "dcard", + "mapped": { + "party": "Subway", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "SUBWAY 03208014255 P" + }, + "source": "dcard", + "mapped": { + "party": "Subway", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "SUMMA FOOD SERVICE A" + }, + "source": "dcard", + "mapped": { + "party": "Summa Food Service", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "SUMMA HEALTH SYSTE C" + }, + "source": "dcard", + "mapped": { + "party": "Summa Health", + "reason": "Medical" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "SUMMA PARKING AKRON " + }, + "source": "dcard", + "mapped": { + "party": "Summa Parking", + "reason": "Hospitality" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "SUMMA WEST RES HOSP " + }, + "source": "dcard", + "mapped": { + "party": "Summa Western Reserve Hospital", + "reason": "Medical" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "SUNCREST GARDENS PEN" + }, + "source": "dcard", + "mapped": { + "party": "Suncrest Gardens", + "reason": "Recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "SUNOCO 0705503100 BR" + }, + "source": "dcard", + "mapped": { + "party": "Sunoco", + "reason": "Gas" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "SWEET FROG 200080 ST" + }, + "source": "dcard", + "mapped": { + "party": "Sweet Frog", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "SWENSONS STOW KENT S" + }, + "source": "dcard", + "mapped": { + "party": "Swensons", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "TARGET CLEVELAND OH" + }, + "source": "dcard", + "mapped": { + "party": "Target", + "reason": "Groceries" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "TARGET CUYAHOGA FALL" + }, + "source": "dcard", + "mapped": { + "party": "Target", + "reason": "Groceries" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "TARGET STREETSBORO O" + }, + "source": "dcard", + "mapped": { + "party": "Target", + "reason": "Groceries" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "TERRY LUMBER AND SUP" + }, + "source": "dcard", + "mapped": { + "party": "Terry Lumber and Supply", + "reason": "Home Maintenance" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "THANOS FAMILY RESTAU" + }, + "source": "dcard", + "mapped": { + "party": "Thanos Family Restaurante", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "THE DISTRICT BOUTIQU" + }, + "source": "dcard", + "mapped": { + "party": "The District Boutique", + "reason": "Clothing" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "THE HOME DEPOT #3809" + }, + "source": "dcard", + "mapped": { + "party": "The Home Depot", + "reason": "Home Maintenance" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "THE HOME DEPOT #3859" + }, + "source": "dcard", + "mapped": { + "item": "Sand Paper", + "reason": "Home Maintenance", + "party": "The Home Depot" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "THE HOME DEPOT 3859 " + }, + "source": "dcard", + "mapped": { + "party": "The Home Depot", + "reason": "Home Supplies" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "THE MENS WEARHOUSE #" + }, + "source": "dcard", + "mapped": { + "party": "The Mens Warehouse", + "reason": "Hospitality" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "THE OLDE PICKET FENC" + }, + "source": "dcard", + "mapped": { + "party": "The Olde Picket Fence", + "reason": "Recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "THE PETS PAJAMAS AKR" + }, + "source": "dcard", + "mapped": { + "party": "The Pets Pajamas", + "reason": "Recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "TOYS R US #9203 CUYA" + }, + "source": "dcard", + "mapped": { + "party": "Toys R' Us", + "reason": "Gifts" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "TOYS 'R' US CUYAHOGA" + }, + "source": "dcard", + "mapped": { + "party": "Toys R' Us", + "reason": "Gifts" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "TOYSRUS-BABIESRUS 61" + }, + "source": "dcard", + "mapped": { + "party": "Toys R' Us", + "reason": "Gifts" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "TOYSRUS-BABIESRUS 80" + }, + "source": "dcard", + "mapped": { + "party": "Toys R' Us", + "reason": "Gifts" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "TRACTOR SUPPLY #1215" + }, + "source": "dcard", + "mapped": { + "party": "Tractor Supply", + "reason": "Home Supplies" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "TRACTOR-SUPPLY-CO #0" + }, + "source": "dcard", + "mapped": { + "party": "Tractor Supply", + "reason": "Home Supplies" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "TREE CITY COFFEE & P" + }, + "source": "dcard", + "mapped": { + "party": "Tree City Coffee", + "reason": "Recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "TURF TRIMMERS INC KE" + }, + "source": "dcard", + "mapped": { + "party": "Turf Trimmers", + "reason": "Home Maintenance" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "TWISTED MELTZ - KENT" + }, + "source": "dcard", + "mapped": { + "party": "Twisted Meltz", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "UH EVANS MEDICAL CEN" + }, + "source": "dcard", + "mapped": { + "party": "UH Evans Medical Center", + "reason": "Medical" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "U-HAUL OF KENT-STOW " + }, + "source": "dcard", + "mapped": { + "party": "U-Haul", + "reason": "Recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "ULTA #565 STOW OH" + }, + "source": "dcard", + "mapped": { + "party": "Ulta", + "reason": "Home Supplies" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "VIDANGEL.COM 801-921" + }, + "source": "dcard", + "mapped": { + "party": "VidAngel", + "reason": "Recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "VTECHELECTR 402-935-" + }, + "source": "dcard", + "mapped": { + "party": "V-Tech Electronics", + "reason": "Recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "WALGREENS #4295 STOW" + }, + "source": "dcard", + "mapped": { + "party": "Walgreens", + "reason": "Home Supplies" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "WAL-MART SC - #1039 " + }, + "source": "dcard", + "mapped": { + "party": "Wal-Mart", + "reason": "Home Supplies" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "WAL-MART SC - #1499 " + }, + "source": "dcard", + "mapped": { + "party": "Wal-Mart", + "reason": "Home Supplies" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "WAL-MART SC - #2313 " + }, + "source": "dcard", + "mapped": { + "party": "Wal-Mart", + "reason": "Home Supplies" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "WAL-MART SC - #2323 " + }, + "source": "dcard", + "mapped": { + "party": "Wal-Mart", + "reason": "Home Supplies" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "WAL-MART SC - #2506 " + }, + "source": "dcard", + "mapped": { + "party": "Wal-Mart", + "reason": "Home Supplies" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "WAL-MART SC - #7162 " + }, + "source": "dcard", + "mapped": { + "party": "Wal-Mart", + "reason": "Home Supplies" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "WALMART.COM 800-966-" + }, + "source": "dcard", + "mapped": { + "party": "Wal-Mart", + "reason": "Home Supplies" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "WENDY'S BRIMFIELD #1" + }, + "source": "dcard", + "mapped": { + "party": "Wendys", + "reason": "Restaurante" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "WIKIMEDIA 8776009454" + }, + "source": "dcard", + "mapped": { + "party": "Wikimedia", + "reason": "Gift" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "WILLIS GAP GENERAL S" + }, + "source": "dcard", + "mapped": { + "party": "Willis Gap General Store", + "reason": "Gas" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "WOODSYS MUSIC INC KE" + }, + "source": "dcard", + "mapped": { + "party": "Woodsys Music", + "reason": "Recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "WOODSY'S MUSIC, INC." + }, + "source": "dcard", + "mapped": { + "party": "Woodsys Music", + "reason": "Recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "WWW.ADVANCEAUTOPARTS" + }, + "source": "dcard", + "mapped": { + "party": "Advance Auto", + "reason": "Auto Maintenance" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "WYOGA VETERINARY HOS" + }, + "source": "dcard", + "mapped": { + "party": "Wyoga Veterinary", + "reason": "Recreation" + } + }, + { + "map": "First 20", + "ret_val": { + "f20": "WALMART GROCERY 800-" + }, + "source": "dcard", + "mapped": { + "party": "Walmart", + "reason": "groceries" + } + } +] \ No newline at end of file diff --git a/deploy/reload/hunt/curl_hunt.cmd b/deploy/reload/hunt/curl_hunt.cmd new file mode 100644 index 0000000..22a1cce --- /dev/null +++ b/deploy/reload/hunt/curl_hunt.cmd @@ -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 \ No newline at end of file diff --git a/deploy/reload/hunt/extract.sql b/deploy/reload/hunt/extract.sql new file mode 100644 index 0000000..23e8bf2 --- /dev/null +++ b/deploy/reload/hunt/extract.sql @@ -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); diff --git a/deploy/reload/hunt/map.json b/deploy/reload/hunt/map.json new file mode 100644 index 0000000..aa796be --- /dev/null +++ b/deploy/reload/hunt/map.json @@ -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 + } +] \ No newline at end of file diff --git a/deploy/reload/hunt/srce.json b/deploy/reload/hunt/srce.json new file mode 100644 index 0000000..ad03365 --- /dev/null +++ b/deploy/reload/hunt/srce.json @@ -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" + } + ] + } +} \ No newline at end of file diff --git a/deploy/reload/paycom/extract.sql b/deploy/reload/paycom/extract.sql new file mode 100644 index 0000000..997d3a9 --- /dev/null +++ b/deploy/reload/paycom/extract.sql @@ -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 + + diff --git a/deploy/reload/paycom/load.cmd b/deploy/reload/paycom/load.cmd new file mode 100644 index 0000000..fd30bc7 --- /dev/null +++ b/deploy/reload/paycom/load.cmd @@ -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 \ No newline at end of file diff --git a/deploy/reload/paycom/map.json b/deploy/reload/paycom/map.json new file mode 100644 index 0000000..f176294 --- /dev/null +++ b/deploy/reload/paycom/map.json @@ -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 + } +] \ No newline at end of file diff --git a/deploy/reload/paycom/srce.json b/deploy/reload/paycom/srce.json new file mode 100644 index 0000000..785b381 --- /dev/null +++ b/deploy/reload/paycom/srce.json @@ -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" + } + ] + } +} \ No newline at end of file diff --git a/deploy/reload/paycom/vals.json b/deploy/reload/paycom/vals.json new file mode 100644 index 0000000..39a0374 --- /dev/null +++ b/deploy/reload/paycom/vals.json @@ -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" + } + } +] \ No newline at end of file diff --git a/deploy/reload/pncc/extract.sql b/deploy/reload/pncc/extract.sql new file mode 100644 index 0000000..2edb86b --- /dev/null +++ b/deploy/reload/pncc/extract.sql @@ -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 + + diff --git a/deploy/reload/pncc/load.cmd b/deploy/reload/pncc/load.cmd new file mode 100644 index 0000000..fa087a8 --- /dev/null +++ b/deploy/reload/pncc/load.cmd @@ -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 \ No newline at end of file diff --git a/deploy/reload/pncc/map.json b/deploy/reload/pncc/map.json new file mode 100644 index 0000000..f910106 --- /dev/null +++ b/deploy/reload/pncc/map.json @@ -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 + } +] \ No newline at end of file diff --git a/sample_pnc/srce.json b/deploy/reload/pncc/srce.json similarity index 88% rename from sample_pnc/srce.json rename to deploy/reload/pncc/srce.json index a75a534..3564fa6 100644 --- a/sample_pnc/srce.json +++ b/deploy/reload/pncc/srce.json @@ -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}", @@ -53,14 +53,14 @@ "column_name": "Amount" }, { - "path": "{Description}", + "path":"{Description}", "type": "text", "column_name": "Description" }, { "path": "{AdditionalRemittance}", "type": "text", - "column_name": "CurrencyAdditionalRemittance" + "column_name": "AdditionalRemittance" } ] } diff --git a/deploy/reload/pncc/vals.json b/deploy/reload/pncc/vals.json new file mode 100644 index 0000000..56d712b --- /dev/null +++ b/deploy/reload/pncc/vals.json @@ -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" + } + } +] \ No newline at end of file diff --git a/deploy/reload/pncl/extract.sql b/deploy/reload/pncl/extract.sql new file mode 100644 index 0000000..256a6ce --- /dev/null +++ b/deploy/reload/pncl/extract.sql @@ -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' + + diff --git a/deploy/reload/pncl/load.cmd b/deploy/reload/pncl/load.cmd new file mode 100644 index 0000000..19fdc66 --- /dev/null +++ b/deploy/reload/pncl/load.cmd @@ -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 \ No newline at end of file diff --git a/deploy/reload/pncl/srce.json b/deploy/reload/pncl/srce.json new file mode 100644 index 0000000..fffd0de --- /dev/null +++ b/deploy/reload/pncl/srce.json @@ -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}" + } + ] + } +} \ No newline at end of file diff --git a/deploy/reload/pnco/extract.sql b/deploy/reload/pnco/extract.sql new file mode 100644 index 0000000..fee80bf --- /dev/null +++ b/deploy/reload/pnco/extract.sql @@ -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 + + diff --git a/deploy/reload/pnco/load.cmd b/deploy/reload/pnco/load.cmd new file mode 100644 index 0000000..b2a09e4 --- /dev/null +++ b/deploy/reload/pnco/load.cmd @@ -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 \ No newline at end of file diff --git a/deploy/reload/pnco/srce.json b/deploy/reload/pnco/srce.json new file mode 100644 index 0000000..28b948a --- /dev/null +++ b/deploy/reload/pnco/srce.json @@ -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" + } + ] + } +} \ No newline at end of file diff --git a/deploy/setup.sql b/deploy/setup.sql index 26eebe2..dc55258 100644 --- a/deploy/setup.sql +++ b/deploy/setup.sql @@ -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 diff --git a/interface/map_def/srce_map_def_set.sql b/interface/map_def/srce_map_def_set.sql index cdbd286..c69abe4 100644 --- a/interface/map_def/srce_map_def_set.sql +++ b/interface/map_def/srce_map_def_set.sql @@ -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 diff --git a/interface/source_maint/srce_build_view.sql b/interface/source_maint/srce_build_view.sql index e23cdaa..35addf6 100644 --- a/interface/source_maint/srce_build_view.sql +++ b/interface/source_maint/srce_build_view.sql @@ -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$ @@ -28,4 +29,4 @@ RAISE NOTICE '%',_sql; END $f$ -LANGUAGE plpgsql; +LANGUAGE plpgsql; \ No newline at end of file diff --git a/reports/colateral_balalance.sql b/reports/colateral_balalance.sql new file mode 100644 index 0000000..5641c54 --- /dev/null +++ b/reports/colateral_balalance.sql @@ -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 \ No newline at end of file diff --git a/reports/dcard_bal.sql b/reports/dcard_bal.sql new file mode 100644 index 0000000..0eb89d4 --- /dev/null +++ b/reports/dcard_bal.sql @@ -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 \ No newline at end of file diff --git a/reports/loan_balance.sql b/reports/loan_balance.sql new file mode 100644 index 0000000..8ad0496 --- /dev/null +++ b/reports/loan_balance.sql @@ -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 \ No newline at end of file diff --git a/sample_discovercard/data.csv b/sample_discovercard/data.csv deleted file mode 100644 index 997ecee..0000000 --- a/sample_discovercard/data.csv +++ /dev/null @@ -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" diff --git a/sample_discovercard/data.json b/sample_discovercard/data.json deleted file mode 100644 index 790144c..0000000 --- a/sample_discovercard/data.json +++ /dev/null @@ -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" - } -] \ No newline at end of file diff --git a/sample_discovercard/definition.md b/sample_discovercard/definition.md deleted file mode 100644 index 3fea8bb..0000000 --- a/sample_discovercard/definition.md +++ /dev/null @@ -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) diff --git a/sample_discovercard/mapdef.json b/sample_discovercard/mapdef.json deleted file mode 100644 index e04989a..0000000 --- a/sample_discovercard/mapdef.json +++ /dev/null @@ -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" -} \ No newline at end of file diff --git a/sample_discovercard/mapping.md b/sample_discovercard/mapping.md deleted file mode 100644 index 9ad012b..0000000 --- a/sample_discovercard/mapping.md +++ /dev/null @@ -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 \ No newline at end of file diff --git a/sample_discovercard/test_scripts/srce_set_test.sql b/sample_discovercard/test_scripts/srce_set_test.sql deleted file mode 100644 index 163c6b7..0000000 --- a/sample_discovercard/test_scripts/srce_set_test.sql +++ /dev/null @@ -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) \ No newline at end of file diff --git a/sample_discovercard/test_scripts/test_map_set.sql b/sample_discovercard/test_scripts/test_map_set.sql deleted file mode 100644 index e46d91d..0000000 --- a/sample_discovercard/test_scripts/test_map_set.sql +++ /dev/null @@ -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" - } - $$ - ) \ No newline at end of file diff --git a/sample_discovercard/test_scripts/test_map_val_set.sql b/sample_discovercard/test_scripts/test_map_val_set.sql deleted file mode 100644 index 137d537..0000000 --- a/sample_discovercard/test_scripts/test_map_val_set.sql +++ /dev/null @@ -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 - ) \ No newline at end of file diff --git a/sample_discovercard/test_scripts/test_srce_import.sql b/sample_discovercard/test_scripts/test_srce_import.sql deleted file mode 100644 index 2a2e224..0000000 --- a/sample_discovercard/test_scripts/test_srce_import.sql +++ /dev/null @@ -1,7 +0,0 @@ -SELECT - * -FROM - tps.srce_import( - 'dcard' - ,$$[{"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"}]$$ - ) \ No newline at end of file diff --git a/sample_discovercard/vals.json b/sample_discovercard/vals.json deleted file mode 100644 index fc171d6..0000000 --- a/sample_discovercard/vals.json +++ /dev/null @@ -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" - } - } -] \ No newline at end of file diff --git a/sample_pnc/define.sql b/sample_pnc/define.sql deleted file mode 100644 index 84a0a9d..0000000 --- a/sample_pnc/define.sql +++ /dev/null @@ -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 - ) \ No newline at end of file diff --git a/sample_pnc/dump.cmd b/sample_pnc/dump.cmd deleted file mode 100644 index f835af6..0000000 --- a/sample_pnc/dump.cmd +++ /dev/null @@ -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;" \ No newline at end of file diff --git a/sample_pnc/import.sql b/sample_pnc/import.sql deleted file mode 100644 index e69de29..0000000