This commit is contained in:
pt 2020-02-18 19:25:57 +00:00 committed by Gitea
parent 54668f22e1
commit 83039b4a51
3 changed files with 34 additions and 2 deletions

View File

@ -7,4 +7,21 @@ Special concepts
Slowness Options Slowness Options
* move json to a separate table and the change can be marked with a sequence * move json to a separate table and the change can be marked with a sequence
* have the data actually be a query from the database * have the data actually be a query from the database
* reduce number of columns in fc_pool * reduce number of columns in fc_pool
Discussion
* special look at Mar-Apr sales since it is being copied from plan or older data
- [ ] at the end of March, we will swap out the budget from March with actuals and re-forecast
- [ ] need to think through how to overlay actuals into the budget
* last price paid snap - preload
- [ ] dont do this
* FX - currently nothing loaded
- [ ] we'll pick one (see Bruno)
* cost - snap to current cost
- [ ] snap to current
* need to be able to reload the forecast as we lock in new months of sales data - replay changes over top?
* item 1
* refresh new part list
* add comments on monthly
* add a tag that is separate from the comment?
* need to test extrapolating osm_pool into osmp_dev

View File

@ -131,7 +131,7 @@ FROM
) WITH DATA; ) WITH DATA;
CREATE INDEX osm_qr ON rlarp.osm_pool(quota_rep_descr); CREATE INDEX osm_qr ON rlarp.osm_pool(quota_rep_descr);
ALTER TABLE rlarp.osm_pool ADD CONSTRAINT logfk FOREIGN KEY (logid) REFERENCES rlarp.osm_log(id);
DROP TABLE IF EXISTS rlarp.osm_log; DROP TABLE IF EXISTS rlarp.osm_log;

View File

@ -142,6 +142,19 @@ GROUP BY
,version ,version
,iter ,iter
) )
,tags AS (
SELECT DISTINCT
doc->>'tag' tag
FROM
rlarp.osm_log
WHERE doc ? 'tag'
UNION
SELECT * FROM
(VALUES
('price'),
('volume')
) x(tag)
)
SELECT SELECT
jsonb_build_object( jsonb_build_object(
'months' 'months'
@ -152,4 +165,6 @@ SELECT
,(SELECT jsonb_agg(row_to_json(basket)::jsonb) FROM basket) ,(SELECT jsonb_agg(row_to_json(basket)::jsonb) FROM basket)
,'totals' ,'totals'
,(SELECT jsonb_agg(row_to_json(totals)::jsonb) FROM totals) ,(SELECT jsonb_agg(row_to_json(totals)::jsonb) FROM totals)
,'tags'
,(SELECT jsonb_agg(tag) FROM tags)
) package ) package