From 2d037b567fbaee7aafcfdb617edbcdc84748627b Mon Sep 17 00:00:00 2001 From: Trowbridge Date: Tue, 5 Mar 2019 23:29:25 -0500 Subject: [PATCH] clean up --- index.js | 53 ------------------------------------- route_meta/blend.sql | 32 ---------------------- route_meta/layout.md | 30 --------------------- route_meta/list_months.json | 4 --- route_meta/list_months.sql | 15 ----------- 5 files changed, 134 deletions(-) delete mode 100644 route_meta/blend.sql delete mode 100644 route_meta/layout.md delete mode 100644 route_meta/list_months.json delete mode 100644 route_meta/list_months.sql diff --git a/index.js b/index.js index 4f6b36c..bc8bed4 100644 --- a/index.js +++ b/index.js @@ -30,59 +30,6 @@ Postgres.FirstRow = function (inSQL, args, inResponse) { }); }; -server.get('/scenario_totals', bodyParser.json(), function (req, res) { - - var w = ""; - var c = 1; - var args = []; - - for (var i in req.body) { - //console.log(i); - ///console.log(req.body[i]); - if (c > 1) { - w = w + - ` - AND ` - } - w = w + i + " = '" + req.body[i] + "'"; - args.push(req.body[i]); - c = c + 1; - }; - if (c == 1) { - res.send("no body was sent"); - return; - } - //console.log(w); - //console.log(args); - w = - ` - WITH - ini AS ( - SELECT - order_season - ,version - ,iter - ,SUM(units) units - ,SUM(value_usd) value_usd - FROM - rlarp.osm_fcpool - WHERE - ` + w + - ` - GROUP BY - order_season - ,version - ,iter - ) - SELECT - jsonb_agg(row_to_json(ini)::jsonb) x - FROM - ini` - console.log(w); - Postgres.FirstRow(w, [], res) - //res.json("hi") -}) - server.get('/scenario_package', bodyParser.json(), function (req, res) { var w = ""; diff --git a/route_meta/blend.sql b/route_meta/blend.sql deleted file mode 100644 index a8a95eb..0000000 --- a/route_meta/blend.sql +++ /dev/null @@ -1,32 +0,0 @@ -SELECT - version - ,bill_cust - ,ship_cust - ,part - ,promo - ,terms - ,plnt - ,r_currency - ,c_currency - ,requestdate - orderdate rdiff - ,shipdate - requestdate sdiff - ,sum(fb_qty) fb_qty - ,sum(fb_val_loc) fb_val_loc - ,sum(fb_cst_loc) fb_cst_loc -FROM - rlarp.osm -WHERE - - AND calc_status <> 'CANCELED' -GROUP BY - version - ,bill_cust - ,ship_cust - ,part - ,promo - ,terms - ,plnt - ,r_currency - ,c_currency - ,requestdate - orderdate - ,shipdate - requestdate diff --git a/route_meta/layout.md b/route_meta/layout.md deleted file mode 100644 index 2a0138f..0000000 --- a/route_meta/layout.md +++ /dev/null @@ -1,30 +0,0 @@ -Functional Isolation Level -``` - - +------------------+ - +------> Application | - | | | - | | 📃 local changes +-+ - | | | | - | +------------------+ | - | | - | | - | | - +------------+-------------+ +------v----------------+ - |📃 Frozen Snapshot | |📃 persisted changes | - +---------^----------^-----+ +------+----------------+ - | | | - | | | - | | | - | | | - | | | - +---------+------+ | +-------v-------+ - |🔨 Setup Forecast| +-----------+🔨 materialize | - +--^---------^---+ +-------+-------+ - | | | - | | | -+-------------+---+ +--+-----------------+ | -|Main History(OSM)| |Main Foreast(OSMF) <---------+ -+-----------------+ +--------------------+ - -``` \ No newline at end of file diff --git a/route_meta/list_months.json b/route_meta/list_months.json deleted file mode 100644 index dc99fc0..0000000 --- a/route_meta/list_months.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "quota_rep": "person", - "segment": "greenhoues" -} \ No newline at end of file diff --git a/route_meta/list_months.sql b/route_meta/list_months.sql deleted file mode 100644 index daa3737..0000000 --- a/route_meta/list_months.sql +++ /dev/null @@ -1,15 +0,0 @@ - -SELECT - oseas - ,extract('month' from odate) month - ,sum(fb_qty) fb_qty - ,sum(fb_val_loc) fb_val_loc - ,sum(fb_cst_loc) fb_cst_loc -FROM - rlarp.osm_ppfa_varto_mv -WHERE - - AND calc_status <> 'CANCELED' -GROUP BY - oseas - ,extract('month' from odate) \ No newline at end of file