diff --git a/build_json.xlsx b/build_json.xlsx deleted file mode 100644 index 0c7022c..0000000 Binary files a/build_json.xlsx and /dev/null differ diff --git a/coa.md b/coa.md deleted file mode 100644 index ca7ec47..0000000 --- a/coa.md +++ /dev/null @@ -1,31 +0,0 @@ -Balance Sheet ------------------------ -* Cash - - On-hand - - Hunt Checking - - Hunt Savings -* Prepaid - - Auto Insurance - - Home Insurance -* Investments - - Principle 401k - - Fidelity 401k - - STRS - - PPG 401k - - Norwex SP -* Assets - - Auto Cost - - Auto Depr - - Home -* Credit - - Chase - - Discover - - Kohls - - Lowes - - BestBuy - - Target - - TheHomeDepot -* Mortgage - - Principle - - diff --git a/readme.md b/readme.md index e7c2ac0..aea1511 100644 --- a/readme.md +++ b/readme.md @@ -1,4 +1,107 @@ -Concepts +Overview +---------------------------------------------- + + +``` + +--------------+ + |csv data | + +-----+--------+ + | + | + v ++----web ui----+ +----func+----+ +---table----+ +|import screen +------> |srce.sql +----------> |tps.srce | <-------------------+ ++--------------+ +-------------+ +------------+ | + |p1:srce | | + |p2:file path | | ++-----web ui---+ +-------------+ +----table---+ | +|create map | |tps.map_rm | +--+--db proc-----+ +|profile +---------------------------------> | | |update tps.trans | ++------+-------+ +-----+------+ |column allj to | + | ^ |contain map data | + | | +--+--------------+ + v foreign key ^ ++----web ui+----+ | | +|assign maps | + | +|for return | +---table----+ | ++values +--------------------------------> |tps.map_rv | | ++---------------+ | +---------------------+ + +------------+ + +``` + +The goal is to: +1. house external data and prevent duplication on insert +2. apply mappings to the data to make it meaningful +3. be able to reference it from outside sources (no action required) + +There are 5 tables +* tps.srce : definition of source +* tps.trans : actual data +* tps.trans_log : log of inserts +* tps.map_rm : map profile +* tps.map_rv : profile associated values + +# tps.srce schema + { + "name": "WMPD", + "descr": "Williams Paid File", + "type":"csv", + "schema": [ + { + "key": "Carrier", + "type": "text" + }, + { + "key": "Pd Amt", + "type": "numeric" + }, + { + "key": "Pay Dt", + "type": "date" + } + ], + "unique_constraint": { + "fields":[ + "{Pay Dt}", + "{Carrier}" + ] + } + } + +# tps.map_rm schema + { + "name":"Strip Amount Commas", + "description":"the Amount field comes from PNC with commas embeded so it cannot be cast to numeric", + "defn": [ + { + "key": "{Amount}", /*this is a Postgres text array stored in json*/ + "field": "amount", /*key name assigned to result of regex/* + "regex": ",", /*regular expression/* + "flag":"g", + "retain":"y", + "map":"n" + } + ], + "function":"replace", + "where": [ + { + } + ] + } + + + + + + + + + + + + +Notes ====================================== pull various static files into postgres and do basic transformation without losing the original document