From 045e050b0e478136cfce292991342fa95edfe077 Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Thu, 7 Aug 2025 23:16:18 -0400 Subject: [PATCH] move files around --- api.ts => new_targets/archive/api.ts | 0 .../archive/apply_guidance.ts | 0 new_targets/{ => archive}/price_queue.ms.sql | 0 new_targets/{ => archive}/price_queue.pg.sql | 0 .../archive/set_anchors.ts | 0 .../archive/sql}/apply_guidance.pg.sql | 0 .../archive/sql}/consume_pricepool.pg.sql | 0 .../archive/sql}/db_apply.pg.sql | 0 {sql => new_targets/archive/sql}/get.pg.sql | 0 .../archive/sql}/get_cust.pg.sql | 0 .../archive/sql}/get_dseg.pg.sql | 0 .../archive/sql}/get_guidance.pg.sql | 0 .../archive/sql}/get_guidance_dseg.pg.sql | 0 .../archive/sql}/get_hist.pg.sql | 0 .../archive/sql}/get_hist_debug.pg.sql | 0 .../archive/sql}/get_list.pg.sql | 0 {sql => new_targets/archive/sql}/gethist.sql | 0 .../archive/sql}/gethist_table.pg.sql | 0 .../archive/sql}/link_matrix.pg.sql | 0 .../archive/sql}/live_quotes_review.pg.sql | 0 .../archive/sql}/price_pool.sql | 0 .../archive/sql}/quote_review.pg.sql | 0 .../archive/sql}/spread.pg.sql | 0 .../{ => archive}/target_prices_unpack.ms.sql | 0 new_targets/basic_setup/lastprice.ms.sql | 13 - new_targets/basic_setup/make_hist.ms.sql | 59 ---- new_targets/basic_setup/setup.md | 26 -- .../basic_setup/single_price_call.ms.sql | 162 ---------- new_targets/basic_setup/target_prices.ms.sql | 18 -- .../basic_setup/target_prices_copy.ms.sql | 23 -- .../build_pricing_path.pg.sql | 0 .../get_option_costs_priceg.pg.sql | 0 .../get_options_merged.pg.sql | 0 .../load_target_price.pg.sql | 0 new_targets/dev.json | 60 ---- new_targets/history.json | 280 ------------------ new_targets/history_new.json | 63 ---- new_targets/process_queue.ms.sql | 109 ------- new_targets/process_queue.pg.sql | 69 ----- new_targets/process_queue_proc.pg.sql | 69 ----- new_targets/procs/greatest_least.ms.sql | 27 -- new_targets/procs/guidance_logic.ms.sql | 35 +++ .../{scripts => procs}/matrix_guidance.ms.sql | 0 .../{scripts => procs}/matrix_guidance.pg.sql | 0 new_targets/procs/template.json | 75 ----- new_targets/quotes_link.ms.sql | 15 - new_targets/target_prices_copy.ms.sql | 23 -- new_targets/ui_schema.json | 72 +++-- 48 files changed, 77 insertions(+), 1121 deletions(-) rename api.ts => new_targets/archive/api.ts (100%) rename apply_guidance.ts => new_targets/archive/apply_guidance.ts (100%) rename new_targets/{ => archive}/price_queue.ms.sql (100%) rename new_targets/{ => archive}/price_queue.pg.sql (100%) rename set_anchors.ts => new_targets/archive/set_anchors.ts (100%) rename {sql => new_targets/archive/sql}/apply_guidance.pg.sql (100%) rename {sql => new_targets/archive/sql}/consume_pricepool.pg.sql (100%) rename {sql => new_targets/archive/sql}/db_apply.pg.sql (100%) rename {sql => new_targets/archive/sql}/get.pg.sql (100%) rename {sql => new_targets/archive/sql}/get_cust.pg.sql (100%) rename {sql => new_targets/archive/sql}/get_dseg.pg.sql (100%) rename {sql => new_targets/archive/sql}/get_guidance.pg.sql (100%) rename {sql => new_targets/archive/sql}/get_guidance_dseg.pg.sql (100%) rename {sql => new_targets/archive/sql}/get_hist.pg.sql (100%) rename {sql => new_targets/archive/sql}/get_hist_debug.pg.sql (100%) rename {sql => new_targets/archive/sql}/get_list.pg.sql (100%) rename {sql => new_targets/archive/sql}/gethist.sql (100%) rename {sql => new_targets/archive/sql}/gethist_table.pg.sql (100%) rename {sql => new_targets/archive/sql}/link_matrix.pg.sql (100%) rename {sql => new_targets/archive/sql}/live_quotes_review.pg.sql (100%) rename {sql => new_targets/archive/sql}/price_pool.sql (100%) rename {sql => new_targets/archive/sql}/quote_review.pg.sql (100%) rename {sql => new_targets/archive/sql}/spread.pg.sql (100%) rename new_targets/{ => archive}/target_prices_unpack.ms.sql (100%) delete mode 100644 new_targets/basic_setup/lastprice.ms.sql delete mode 100644 new_targets/basic_setup/make_hist.ms.sql delete mode 100644 new_targets/basic_setup/setup.md delete mode 100644 new_targets/basic_setup/single_price_call.ms.sql delete mode 100644 new_targets/basic_setup/target_prices.ms.sql delete mode 100644 new_targets/basic_setup/target_prices_copy.ms.sql rename new_targets/{procs => builder}/build_pricing_path.pg.sql (100%) rename new_targets/{procs => builder}/get_option_costs_priceg.pg.sql (100%) rename new_targets/{procs => builder}/get_options_merged.pg.sql (100%) rename new_targets/{procs => builder}/load_target_price.pg.sql (100%) delete mode 100644 new_targets/dev.json delete mode 100644 new_targets/history.json delete mode 100644 new_targets/history_new.json delete mode 100644 new_targets/process_queue.ms.sql delete mode 100644 new_targets/process_queue.pg.sql delete mode 100644 new_targets/process_queue_proc.pg.sql delete mode 100644 new_targets/procs/greatest_least.ms.sql rename new_targets/{scripts => procs}/matrix_guidance.ms.sql (100%) rename new_targets/{scripts => procs}/matrix_guidance.pg.sql (100%) delete mode 100644 new_targets/procs/template.json delete mode 100644 new_targets/quotes_link.ms.sql delete mode 100644 new_targets/target_prices_copy.ms.sql diff --git a/api.ts b/new_targets/archive/api.ts similarity index 100% rename from api.ts rename to new_targets/archive/api.ts diff --git a/apply_guidance.ts b/new_targets/archive/apply_guidance.ts similarity index 100% rename from apply_guidance.ts rename to new_targets/archive/apply_guidance.ts diff --git a/new_targets/price_queue.ms.sql b/new_targets/archive/price_queue.ms.sql similarity index 100% rename from new_targets/price_queue.ms.sql rename to new_targets/archive/price_queue.ms.sql diff --git a/new_targets/price_queue.pg.sql b/new_targets/archive/price_queue.pg.sql similarity index 100% rename from new_targets/price_queue.pg.sql rename to new_targets/archive/price_queue.pg.sql diff --git a/set_anchors.ts b/new_targets/archive/set_anchors.ts similarity index 100% rename from set_anchors.ts rename to new_targets/archive/set_anchors.ts diff --git a/sql/apply_guidance.pg.sql b/new_targets/archive/sql/apply_guidance.pg.sql similarity index 100% rename from sql/apply_guidance.pg.sql rename to new_targets/archive/sql/apply_guidance.pg.sql diff --git a/sql/consume_pricepool.pg.sql b/new_targets/archive/sql/consume_pricepool.pg.sql similarity index 100% rename from sql/consume_pricepool.pg.sql rename to new_targets/archive/sql/consume_pricepool.pg.sql diff --git a/sql/db_apply.pg.sql b/new_targets/archive/sql/db_apply.pg.sql similarity index 100% rename from sql/db_apply.pg.sql rename to new_targets/archive/sql/db_apply.pg.sql diff --git a/sql/get.pg.sql b/new_targets/archive/sql/get.pg.sql similarity index 100% rename from sql/get.pg.sql rename to new_targets/archive/sql/get.pg.sql diff --git a/sql/get_cust.pg.sql b/new_targets/archive/sql/get_cust.pg.sql similarity index 100% rename from sql/get_cust.pg.sql rename to new_targets/archive/sql/get_cust.pg.sql diff --git a/sql/get_dseg.pg.sql b/new_targets/archive/sql/get_dseg.pg.sql similarity index 100% rename from sql/get_dseg.pg.sql rename to new_targets/archive/sql/get_dseg.pg.sql diff --git a/sql/get_guidance.pg.sql b/new_targets/archive/sql/get_guidance.pg.sql similarity index 100% rename from sql/get_guidance.pg.sql rename to new_targets/archive/sql/get_guidance.pg.sql diff --git a/sql/get_guidance_dseg.pg.sql b/new_targets/archive/sql/get_guidance_dseg.pg.sql similarity index 100% rename from sql/get_guidance_dseg.pg.sql rename to new_targets/archive/sql/get_guidance_dseg.pg.sql diff --git a/sql/get_hist.pg.sql b/new_targets/archive/sql/get_hist.pg.sql similarity index 100% rename from sql/get_hist.pg.sql rename to new_targets/archive/sql/get_hist.pg.sql diff --git a/sql/get_hist_debug.pg.sql b/new_targets/archive/sql/get_hist_debug.pg.sql similarity index 100% rename from sql/get_hist_debug.pg.sql rename to new_targets/archive/sql/get_hist_debug.pg.sql diff --git a/sql/get_list.pg.sql b/new_targets/archive/sql/get_list.pg.sql similarity index 100% rename from sql/get_list.pg.sql rename to new_targets/archive/sql/get_list.pg.sql diff --git a/sql/gethist.sql b/new_targets/archive/sql/gethist.sql similarity index 100% rename from sql/gethist.sql rename to new_targets/archive/sql/gethist.sql diff --git a/sql/gethist_table.pg.sql b/new_targets/archive/sql/gethist_table.pg.sql similarity index 100% rename from sql/gethist_table.pg.sql rename to new_targets/archive/sql/gethist_table.pg.sql diff --git a/sql/link_matrix.pg.sql b/new_targets/archive/sql/link_matrix.pg.sql similarity index 100% rename from sql/link_matrix.pg.sql rename to new_targets/archive/sql/link_matrix.pg.sql diff --git a/sql/live_quotes_review.pg.sql b/new_targets/archive/sql/live_quotes_review.pg.sql similarity index 100% rename from sql/live_quotes_review.pg.sql rename to new_targets/archive/sql/live_quotes_review.pg.sql diff --git a/sql/price_pool.sql b/new_targets/archive/sql/price_pool.sql similarity index 100% rename from sql/price_pool.sql rename to new_targets/archive/sql/price_pool.sql diff --git a/sql/quote_review.pg.sql b/new_targets/archive/sql/quote_review.pg.sql similarity index 100% rename from sql/quote_review.pg.sql rename to new_targets/archive/sql/quote_review.pg.sql diff --git a/sql/spread.pg.sql b/new_targets/archive/sql/spread.pg.sql similarity index 100% rename from sql/spread.pg.sql rename to new_targets/archive/sql/spread.pg.sql diff --git a/new_targets/target_prices_unpack.ms.sql b/new_targets/archive/target_prices_unpack.ms.sql similarity index 100% rename from new_targets/target_prices_unpack.ms.sql rename to new_targets/archive/target_prices_unpack.ms.sql diff --git a/new_targets/basic_setup/lastprice.ms.sql b/new_targets/basic_setup/lastprice.ms.sql deleted file mode 100644 index 5ee8da1..0000000 --- a/new_targets/basic_setup/lastprice.ms.sql +++ /dev/null @@ -1,13 +0,0 @@ --- FAnalysis.PRICING.lastprice definition - --- Drop table - --- DROP TABLE FAnalysis.PRICING.lastprice; - -CREATE TABLE pricing.lastprice ( - customer varchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, - mold varchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, - part_stats nvarchar(MAX) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL -); - -CREATE UNIQUE NONCLUSTERED INDEX lastprice_cust_mold ON FAnalysis.PRICING.lastprice (customer ASC, mold ASC) ; diff --git a/new_targets/basic_setup/make_hist.ms.sql b/new_targets/basic_setup/make_hist.ms.sql deleted file mode 100644 index ad930a9..0000000 --- a/new_targets/basic_setup/make_hist.ms.sql +++ /dev/null @@ -1,59 +0,0 @@ --------------------------------------------------------------------------------- --- Step 1: Rebuild last price history at sales matrix refresh time --------------------------------------------------------------------------------- - -DELETE FROM pricing.lastprice; - -WITH srt AS ( - SELECT - customer, - mold, - part, - version, - qty, - ROUND(sales_usd / qty, 5) AS price, - odate, - oseas, - ordnum, - quoten, - ROW_NUMBER() OVER ( - PARTITION BY customer, mold, part, version - ORDER BY odate DESC - ) AS rn - FROM rlarp.osm_stack - WHERE - --quotes can't be integrated until we have datasegment or correct part code - version IN ('Actual'/*,'Quotes'*/) AND - customer IS NOT NULL AND - fs_line = '41010' AND - calc_status <> 'CANCELLED' AND - qty <> 0 AND - mold <> '' -), -json_rows AS ( - SELECT - customer, - mold, - part, - version, - CONCAT( - '"', part, '":', - ( - SELECT version, qty, price, odate, ordnum, quoten - FOR JSON PATH, WITHOUT_ARRAY_WRAPPER - ) - ) AS part_json - FROM srt - WHERE rn = 1 -) -,onerow AS ( -SELECT - customer, - mold, - CONCAT('{', STRING_AGG(part_json, ','), '}') AS part_stats -FROM json_rows -GROUP BY customer, mold -) -INSERT INTO pricing.lastprice SELECT * FROM onerow; - ---CREATE UNIQUE INDEX lastprice_cust_mold ON pricing.lastprice(customer, mold); diff --git a/new_targets/basic_setup/setup.md b/new_targets/basic_setup/setup.md deleted file mode 100644 index 734c978..0000000 --- a/new_targets/basic_setup/setup.md +++ /dev/null @@ -1,26 +0,0 @@ -minimal setup to run a single pricing call: -```sql -EXEC pricing.single_price_call - @bill = 'GRIF0001', - @ship = 'GRIF0001', - @part = 'XNS0T1G3G18B096', - @stlc = 'XNS0T1G3', - @v1ds = 'v1:T..PLT..', - @vol = 9600; -``` - -make sure pricing schema is setup - -Target Prices ----------------------- -1. create target table: `target_prices.ms.sql` -2. populate targets: `target_prices_copy.ms.sql` - -Price History ----------------------- -1. create history table: `lastprice.ms.sql` -2. populate history: `make_hist.ms.sql` - -Proc Definitions ----------------------- -1. create proc: `single_price_call.ms.sql` diff --git a/new_targets/basic_setup/single_price_call.ms.sql b/new_targets/basic_setup/single_price_call.ms.sql deleted file mode 100644 index 9210fb4..0000000 --- a/new_targets/basic_setup/single_price_call.ms.sql +++ /dev/null @@ -1,162 +0,0 @@ -CREATE OR ALTER PROCEDURE pricing.single_price_call - @bill VARCHAR(100), - @ship VARCHAR(100), - @part VARCHAR(100), - @stlc VARCHAR(100), - @v1ds VARCHAR(100), - @vol NUMERIC(18,6) -AS -BEGIN - SET NOCOUNT ON; - - DECLARE @phist NVARCHAR(MAX); - - -- Declare table variable for the input row - DECLARE @queue TABLE ( - bill VARCHAR(100), - ship VARCHAR(100), - part VARCHAR(100), - stlc VARCHAR(100), - v1ds VARCHAR(100), - vol NUMERIC(18,6), - chan VARCHAR(50), - cust VARCHAR(100), - tier VARCHAR(50), - pltq NUMERIC(18,6), - price NUMERIC(18,6), - expl NVARCHAR(MAX), - hist NVARCHAR(MAX), - LAST nvarchar(max) - ); - - -------------------------------------------------------------------------------- - -- Step 1: Insert input row into queue - -------------------------------------------------------------------------------- - INSERT INTO @queue (bill, ship, part, stlc, v1ds, vol) - VALUES (@bill, @ship, @part, @stlc, @v1ds, @vol); - - -------------------------------------------------------------------------------- - -- Step 2: Enrich the row with chan, tier, cust, pltq - -------------------------------------------------------------------------------- - UPDATE q - SET - chan = - CASE SUBSTRING(bc.cclass, 2, 3) - WHEN 'DIS' THEN - CASE SUBSTRING(sc.cclass, 2, 3) - WHEN 'DIS' THEN 'WHS' - ELSE 'DRP' - END - ELSE 'DIR' - END, - tier = - CASE SUBSTRING(bc.cclass, 2, 3) - WHEN 'DIR' THEN bc.tier - ELSE ISNULL(sc.tier, bc.tier) - END, - cust = - CASE SUBSTRING(bc.cclass, 2, 3) - WHEN 'DIS' THEN - CASE SUBSTRING(sc.cclass, 2, 3) - WHEN 'DIS' THEN bc.dba - ELSE sc.dba - END - ELSE q.bill - END, - pltq = i.mpck - FROM @queue q - LEFT JOIN rlarp.cust bc ON bc.code = q.bill - LEFT JOIN rlarp.cust sc ON sc.code = q.ship - LEFT JOIN CMSInterfaceIn.[CMS.CUSLG].itemm i ON i.item = q.part; - - - -------------------------------------------------------------------------------- - -- Step 3: Get last price info directly into @queue columns - -------------------------------------------------------------------------------- - UPDATE q - SET - q.hist = ( - SELECT TOP 1 - j.qty, - j.price, - j.odate, - j.ordnum, - j.quoten - FROM pricing.lastprice lp - OUTER APPLY OPENJSON(lp.part_stats) AS p - OUTER APPLY OPENJSON(p.value) - WITH ( - qty NUMERIC(20,5), - price NUMERIC(20,5), - odate DATE, - ordnum INT, - quoten INT - ) AS j - WHERE - lp.customer = q.cust - AND lp.mold = SUBSTRING(q.part,1,8) - AND p.[key] COLLATE SQL_Latin1_General_CP1_CI_AS = q.part - ORDER BY j.odate DESC - FOR JSON PATH, WITHOUT_ARRAY_WRAPPER - ), - q.last = ( - SELECT TOP 1 - CAST(ROUND(j.price, 5) AS NVARCHAR(50)) -- must be string to store in NVARCHAR column - FROM pricing.lastprice lp - OUTER APPLY OPENJSON(lp.part_stats) AS p - OUTER APPLY OPENJSON(p.value) - WITH ( - qty NUMERIC(20,5), - price NUMERIC(20,5), - odate DATE, - ordnum INT, - quoten INT - ) AS j - WHERE - lp.customer = q.cust - AND lp.mold = SUBSTRING(q.part,1,8) - AND p.[key] COLLATE SQL_Latin1_General_CP1_CI_AS = q.part - ORDER BY j.odate DESC - ) - FROM @queue q; - - - - -------------------------------------------------------------------------------- - -- Step 4: Apply pricing and embed price history + last price from queue columns - -------------------------------------------------------------------------------- - UPDATE q - SET - price = tp.price, - expl = ( - SELECT - 'target price' AS [source], - tp.price AS [target_price], - CAST(q.last AS NUMERIC(20,5)) AS [last_price], - FLOOR(q.vol / NULLIF(q.pltq, 0)) AS [calculated_pallets], - ROUND(q.vol / NULLIF(q.pltq, 0), 5) AS [exact_pallets], - CONCAT(tp.lower_bound, '-', ISNULL(CAST(tp.upper_bound AS VARCHAR), '∞')) AS [volume range], - q.cust AS [customer], - q.chan AS [channel], - q.tier AS [tier], - JSON_QUERY(tp.math) AS [target math], - JSON_QUERY(q.hist) AS [price history] - FOR JSON PATH, WITHOUT_ARRAY_WRAPPER - ) - FROM @queue q - INNER JOIN pricing.target_prices tp ON - q.stlc = tp.stlc - AND q.v1ds = tp.ds - AND q.chan = tp.chan - AND q.tier = tp.tier - AND FLOOR(q.vol / NULLIF(q.pltq, 0)) >= tp.lower_bound - AND ( - tp.upper_bound IS NULL OR FLOOR(q.vol / NULLIF(q.pltq, 0)) < tp.upper_bound - ); - - - -------------------------------------------------------------------------------- - -- Step Last: Return just the enriched row - -------------------------------------------------------------------------------- - SELECT price, expl FROM @queue; -END; diff --git a/new_targets/basic_setup/target_prices.ms.sql b/new_targets/basic_setup/target_prices.ms.sql deleted file mode 100644 index 9385860..0000000 --- a/new_targets/basic_setup/target_prices.ms.sql +++ /dev/null @@ -1,18 +0,0 @@ -DROP TABLE pricing.target_prices; - -CREATE TABLE pricing.target_prices ( - stlc nvarchar(8) NOT NULL, - ds nvarchar(20) NOT NULL, - chan nvarchar(3) NOT NULL, - tier nvarchar(1) NOT NULL, - vol nvarchar(20) NOT NULL, - lower_bound int NOT NULL, - upper_bound int NULL, - price numeric(28,6) NOT NULL, - math nvarchar(MAX) NULL -); - -ALTER TABLE pricing.target_prices -ADD CONSTRAINT uq_target_prices_unique_combo -UNIQUE (stlc, ds, chan, tier, vol, lower_bound); - diff --git a/new_targets/basic_setup/target_prices_copy.ms.sql b/new_targets/basic_setup/target_prices_copy.ms.sql deleted file mode 100644 index 34eac26..0000000 --- a/new_targets/basic_setup/target_prices_copy.ms.sql +++ /dev/null @@ -1,23 +0,0 @@ -DELETE FROM pricing.target_prices; - -INSERT INTO - pricing.target_prices -SELECT - stlc, - ds, - chan, - tier, - vol, - -- Extract lower bound: text between '[' and ',' - TRY_CAST(SUBSTRING(vol, 2, CHARINDEX(',', vol) - 2) AS INT) AS lower_bound, - -- Extract upper bound: text between ',' and ')' - CASE - WHEN RIGHT(vol, 2) = ',)' THEN NULL - ELSE TRY_CAST(SUBSTRING(vol, CHARINDEX(',', vol) + 1, LEN(vol) - CHARINDEX(',', vol) - 1) AS INT) - END AS upper_bound, - price, - math -FROM - usmidsap02.ubm.pricequote.target_prices_view; - ---SELECT COUNT(*) FROM pricing.target_prices \ No newline at end of file diff --git a/new_targets/procs/build_pricing_path.pg.sql b/new_targets/builder/build_pricing_path.pg.sql similarity index 100% rename from new_targets/procs/build_pricing_path.pg.sql rename to new_targets/builder/build_pricing_path.pg.sql diff --git a/new_targets/procs/get_option_costs_priceg.pg.sql b/new_targets/builder/get_option_costs_priceg.pg.sql similarity index 100% rename from new_targets/procs/get_option_costs_priceg.pg.sql rename to new_targets/builder/get_option_costs_priceg.pg.sql diff --git a/new_targets/procs/get_options_merged.pg.sql b/new_targets/builder/get_options_merged.pg.sql similarity index 100% rename from new_targets/procs/get_options_merged.pg.sql rename to new_targets/builder/get_options_merged.pg.sql diff --git a/new_targets/procs/load_target_price.pg.sql b/new_targets/builder/load_target_price.pg.sql similarity index 100% rename from new_targets/procs/load_target_price.pg.sql rename to new_targets/builder/load_target_price.pg.sql diff --git a/new_targets/dev.json b/new_targets/dev.json deleted file mode 100644 index 9f43c43..0000000 --- a/new_targets/dev.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "details": [ - { - "label": "History", - "details": [ - { - "label": "Last Sale: 2025-06-12", - "value": 0.10120, - "type": "currency", - "note": "Ord# 1008338" - } - ] - }, - { - "label": "List", - "details": [ - { - "label": "List:GUAU", - "value": 0.11000, - "type": "currency", - "note": "U.AEA.DI" - } - ] - }, - { - "label": "Target Support", - "details": [ - { - "label": "Anchor:XNS0T1G3", - "value": 0.08000, - "type": "currency", - "note": "+" - }, - { - "label": "Channel:WHS", - "value": 0.20000, - "type": "percentage", - "note": "x" - }, - { - "label": "Volume:1-8", - "value": 0.10000, - "type": "percentage", - "note": "x" - } - ] - }, - { - "label": "Guidance", - "details": [ - { - "label": "Last Price Capped", - "value": 0.10120, - "type": "currency", - "note": "Last price 0.10120 capped at 0.0000000000000%" - } - ] - } - ] -} diff --git a/new_targets/history.json b/new_targets/history.json deleted file mode 100644 index b524c75..0000000 --- a/new_targets/history.json +++ /dev/null @@ -1,280 +0,0 @@ -{ - "v1:B..CSE..": [ - { - "version": "Actual", - "part": "XNS0T1G2G18C140", - "qty": 8960.00, - "price": 0.092910, - "odate": "2016-02-10", - "ordnum": 784718, - "quoten": 28971, - "flags": [] - }, - { - "version": "Quotes", - "part": "XNS0T1G2G18C140", - "qty": 9100.00, - "price": 0.092910, - "odate": "2016-02-10", - "ordnum": 0, - "quoten": 29543, - "flags": [] - } - ], - "v1:T..CSE..": [ - { - "version": "Quotes", - "part": "XNS0T1G2X03C140", - "qty": 6020.00, - "price": 0.092910, - "odate": "2016-02-10", - "ordnum": 0, - "quoten": 29543, - "flags": [] - }, - { - "version": "Actual", - "part": "XNS0T1G2X03C140", - "qty": 6020.00, - "price": 0.092910, - "odate": "2016-02-09", - "ordnum": 784655, - "flags": [] - } - ], - "v1:B..PLT..": [ - { - "version": "Actual", - "part": "XNS0T1G3G18B096", - "qty": 9600.00, - "price": 0.126130, - "odate": "2024-10-31", - "ordnum": 992442, - "quoten": 79774, - "flags": [ - "most_recent_sale", - "largest_volume_sale" - ] - }, - { - "version": "Quotes", - "part": "XNS0T1G3G18B096", - "qty": 38400.00, - "price": 0.126130, - "odate": "2024-10-29", - "ordnum": 0, - "quoten": 79774, - "flags": [ - "most_recent_quote", - "largest_volume_quote" - ] - }, - { - "version": "Actual", - "part": "XNS0T1G3G18B096", - "qty": 9600.00, - "price": 0.126130, - "odate": "2024-08-02", - "ordnum": 985899, - "flags": [] - }, - { - "version": "Actual", - "part": "XNS0T1G3G18B096", - "qty": 38400.00, - "price": 0.128250, - "odate": "2023-12-04", - "ordnum": 969894, - "quoten": 75273, - "flags": [] - }, - { - "version": "Quotes", - "part": "XNS0T1G3G18B096", - "qty": 38400.00, - "price": 0.128250, - "odate": "2023-12-04", - "ordnum": 0, - "quoten": 75273, - "flags": [] - }, - { - "version": "Quotes", - "part": "XNS0T1G3G18B096", - "qty": 19200.00, - "price": 0.135000, - "odate": "2023-02-13", - "ordnum": 0, - "quoten": 73602, - "flags": [] - }, - { - "version": "Quotes", - "part": "XNS0T1G3G18B096", - "qty": 38400.00, - "price": 0.145020, - "odate": "2022-01-26", - "ordnum": 0, - "quoten": 69130, - "flags": [] - }, - { - "version": "Actual", - "part": "XNS0T1G3G18B096", - "qty": 28800.00, - "price": 0.125480, - "odate": "2021-07-16", - "ordnum": 922664, - "quoten": 64686, - "flags": [] - }, - { - "version": "Quotes", - "part": "XNS0T1G3G18B096", - "qty": 38400.00, - "price": 0.125480, - "odate": "2021-07-08", - "ordnum": 0, - "quoten": 64686, - "flags": [] - }, - { - "version": "Actual", - "part": "XNS0T1G3G18B096", - "qty": 38400.00, - "price": 0.100390, - "odate": "2020-11-12", - "ordnum": 905400, - "flags": [] - }, - { - "version": "Quotes", - "part": "XNS0T1G3G18B096", - "qty": 38400.00, - "price": 0.100390, - "odate": "2020-08-13", - "ordnum": 0, - "quoten": 58215, - "flags": [] - }, - { - "version": "Quotes", - "part": "XNS0T1G3G18B096", - "qty": 28800.00, - "price": 0.100390, - "odate": "2020-06-11", - "ordnum": 0, - "quoten": 57254, - "flags": [] - }, - { - "version": "Actual", - "part": "XNS0T1G3G18B096", - "qty": 28800.00, - "price": 0.100390, - "odate": "2020-06-10", - "ordnum": 890715, - "quoten": 57254, - "flags": [] - }, - { - "version": "Actual", - "part": "XNS0T1G3G18B096", - "qty": 28800.00, - "price": 0.098910, - "odate": "2019-07-23", - "ordnum": 870300, - "quoten": 51460, - "flags": [] - }, - { - "version": "Quotes", - "part": "XNS0T1G3G18B096", - "qty": 28800.00, - "price": 0.098910, - "odate": "2019-07-18", - "ordnum": 0, - "quoten": 51460, - "flags": [] - }, - { - "version": "Actual", - "part": "XNS0T1G3G18B096", - "qty": 19200.00, - "price": 0.095290, - "odate": "2018-10-09", - "ordnum": 853112, - "quoten": 44775, - "flags": [] - }, - { - "version": "Actual", - "part": "XNS0T1G3G18B096", - "qty": 9600.00, - "price": 0.095290, - "odate": "2018-10-09", - "ordnum": 853112, - "quoten": 44775, - "flags": [] - }, - { - "version": "Quotes", - "part": "XNS0T1G3G18B096", - "qty": 9600.00, - "price": 0.095290, - "odate": "2018-08-21", - "ordnum": 0, - "quoten": 44775, - "flags": [] - }, - { - "version": "Quotes", - "part": "XNS0T1G3G18B096", - "qty": 38400.00, - "price": 0.094160, - "odate": "2017-10-13", - "ordnum": 0, - "quoten": 38844, - "flags": [] - }, - { - "version": "Actual", - "part": "XNS0T1G2G18B079", - "qty": 47790.00, - "price": 0.092910, - "odate": "2016-06-10", - "ordnum": 794232, - "flags": [] - }, - { - "version": "Quotes", - "part": "XNS0T1G2G18B079", - "qty": 47790.00, - "price": 0.092910, - "odate": "2016-02-10", - "ordnum": 0, - "quoten": 29543, - "flags": [] - }, - { - "version": "Quotes", - "part": "XNS0T1G2G18B079", - "qty": 47790.00, - "price": 0.091200, - "odate": "2015-12-17", - "ordnum": 0, - "quoten": 28971, - "flags": [] - }, - { - "version": "Quotes", - "part": "XNS0T1G2G18B079", - "qty": 47790.00, - "price": 0.091200, - "odate": "2015-09-21", - "ordnum": 0, - "quoten": 27873, - "flags": [] - } - ] -} \ No newline at end of file diff --git a/new_targets/history_new.json b/new_targets/history_new.json deleted file mode 100644 index c2ca3da..0000000 --- a/new_targets/history_new.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "mrs": { - "version": "Actual", - "datasegment": "v1:T..CSE..", - "part": "XNS0T1G3X18C140", - "qty": 4200.00, - "price": 0.146300, - "odate": "2025-08-01", - "ordnum": 1011917, - "flag": "mrs" - }, - "mrq": { - "version": "Quotes", - "datasegment": "v1:B..CSE..", - "part": "XNS0T1G3G18C140", - "qty": 7560.00, - "price": 0.115800, - "odate": "2024-12-10", - "ordnum": 0, - "quoten": 81983, - "flag": "mrq" - }, - "lvs": { - "version": "Actual", - "datasegment": "v1:B..PLT..", - "part": "XNS0T1G3G18B096", - "qty": 28800.00, - "price": 0.098360, - "odate": "2025-05-23", - "ordnum": 1006860, - "flag": "lvs" - }, - "lvq": { - "version": "Quotes", - "datasegment": "v1:B..CSE..", - "part": "XNS0T1G3G18C140", - "qty": 7560.00, - "price": 0.115800, - "odate": "2024-12-10", - "ordnum": 0, - "quoten": 81983, - "flag": "lvq" - }, - "v1:B..CSE..": { - "dss": { - "version": "Actual", - "datasegment": "v1:B..CSE..", - "part": "XNS0T1G3G18C140", - "qty": 2520.00, - "price": 0.106540, - "odate": "2025-07-17", - "ordnum": 1010952 - }, - "dsq": { - "version": "Quotes", - "datasegment": "v1:B..CSE..", - "part": "XNS0T1G3G18C140", - "qty": 2520.00, - "price": 0.106540, - "odate": "2025-07-17", - "quoten": 81983 - }} -} diff --git a/new_targets/process_queue.ms.sql b/new_targets/process_queue.ms.sql deleted file mode 100644 index d2743c2..0000000 --- a/new_targets/process_queue.ms.sql +++ /dev/null @@ -1,109 +0,0 @@ -CREATE OR ALTER PROCEDURE pricing.process_queue -AS -BEGIN - SET NOCOUNT ON; - -------------------------------------------------------------------------------- - -- Step 1: Insert input row into real queue table - -------------------------------------------------------------------------------- - - -------------------------------------------------------------------------------- - -- Step 2: Enrich the row with chan, tier, cust, pltq - -------------------------------------------------------------------------------- - UPDATE q - SET - q.chan = - CASE SUBSTRING(bc.cclass, 2, 3) - WHEN 'DIS' THEN - CASE SUBSTRING(sc.cclass, 2, 3) - WHEN 'DIS' THEN 'WHS' - ELSE 'DRP' - END - ELSE 'DIR' - END, - q.tier = - CASE SUBSTRING(bc.cclass, 2, 3) - WHEN 'DIR' THEN bc.tier - ELSE ISNULL(sc.tier, bc.tier) - END, - q.cust = - CASE SUBSTRING(bc.cclass, 2, 3) - WHEN 'DIS' THEN - CASE SUBSTRING(sc.cclass, 2, 3) - WHEN 'DIS' THEN q.ship - ELSE q.ship - END - ELSE q.bill - END, - q.pltq = i.mpck - FROM - pricing.price_queue q - LEFT JOIN rlarp.cust bc ON bc.code = q.bill - LEFT JOIN rlarp.cust sc ON sc.code = q.ship - LEFT JOIN CMSInterfaceIn.[CMS.CUSLG].itemm i ON i.item = q.part; - - -------------------------------------------------------------------------------- - -- Step 3: Apply pricing from target_prices - -------------------------------------------------------------------------------- - - DECLARE @updated TABLE ( - id BIGINT, - bill VARCHAR(100), - ship VARCHAR(100), - part VARCHAR(100), - stlc VARCHAR(100), - v1ds VARCHAR(100), - vol NUMERIC(18,6), - chan VARCHAR(50), - cust VARCHAR(100), - tier VARCHAR(50), - pltq NUMERIC(18,6), - price NUMERIC(18,6), - expl NVARCHAR(MAX) - ); - - UPDATE q - SET - q.price = tp.price, - q.expl = ( - SELECT - 'target price' AS [source], - FLOOR(q.vol / NULLIF(q.pltq, 0)) AS [calculated_pallets], - ROUND(q.vol / NULLIF(q.pltq, 0), 5) AS [exact_pallets], - CONCAT(tp.lower_bound, '-', ISNULL(CAST(tp.upper_bound AS VARCHAR), '∞')) AS [volume range], - q.cust AS [customer], - q.chan AS [channel], - q.tier AS [tier], - JSON_QUERY(tp.math) AS [target math] -- important if math is JSON - FOR JSON PATH, WITHOUT_ARRAY_WRAPPER - ) - OUTPUT - inserted.id, - inserted.bill, - inserted.ship, - inserted.part, - inserted.stlc, - inserted.v1ds, - inserted.vol, - inserted.chan, - inserted.cust, - inserted.tier, - inserted.pltq, - inserted.price, - inserted.expl - INTO @updated - FROM pricing.price_queue q - INNER JOIN pricing.target_prices tp ON - q.stlc = tp.stlc - AND q.v1ds = tp.ds - AND q.chan = tp.chan - AND q.tier = tp.tier - AND FLOOR(q.vol / NULLIF(q.pltq, 0)) >= tp.lower_bound - AND ( - tp.upper_bound IS NULL OR FLOOR(q.vol / NULLIF(q.pltq, 0)) < tp.upper_bound - ); - - -------------------------------------------------------------------------------- - -- Step 4: Return just the enriched row - -------------------------------------------------------------------------------- - SELECT * FROM @updated; -END; diff --git a/new_targets/process_queue.pg.sql b/new_targets/process_queue.pg.sql deleted file mode 100644 index 0beff68..0000000 --- a/new_targets/process_queue.pg.sql +++ /dev/null @@ -1,69 +0,0 @@ -CREATE OR REPLACE FUNCTION pricequote.process_queue() -RETURNS SETOF pricequote.price_queue -LANGUAGE plpgsql -AS $$ -BEGIN - - -------------------------------------------------------------------------------- - -- Step 1: Set channel, tier, and pallet quantity - -------------------------------------------------------------------------------- - UPDATE pricequote.price_queue s - SET - chan = cr.chan, - tier = cr.tier, - pltq = cr.mpck - FROM ( - SELECT - q.bill, - q.ship, - q.part, - i.mpck, - CASE SUBSTRING(bc.cclass, 2, 3) - WHEN 'DIS' THEN - CASE SUBSTRING(sc.cclass, 2, 3) - WHEN 'DIS' THEN 'WHS' - ELSE 'DRP' - END - ELSE 'DIR' - END AS chan, - CASE SUBSTRING(bc.cclass, 2, 3) - WHEN 'DIR' THEN bc.tier - ELSE COALESCE(sc.tier, bc.tier) - END AS tier - FROM pricequote.price_queue q - LEFT JOIN rlarp.cust bc ON bc.code = q.bill - LEFT JOIN rlarp.cust sc ON sc.code = q.ship - LEFT JOIN "CMS.CUSLG".itemm i ON i.item = q.part - ) cr - WHERE - cr.bill = s.bill AND - COALESCE(cr.ship, '') = COALESCE(s.ship, '') AND - cr.part = s.part; - - -------------------------------------------------------------------------------- - -- Step 2: Set price and explanation from target_prices, return touched rows - -------------------------------------------------------------------------------- - RETURN QUERY - WITH updated AS ( - UPDATE pricequote.price_queue q - SET - price = tp.price, - expl = jsonb_build_object( - 'source', 'target price', - 'calculated_pallets', FLOOR(q.vol / NULLIF(q.pltq, 0))::INT, - 'exact_pallets', ROUND(q.vol / NULLIF(q.pltq, 0), 5), - 'volume range', tp.vol - ) - FROM pricequote.target_prices tp - WHERE - q.stlc = tp.stlc - AND q.v1ds = tp.ds - AND q.chan = tp.chan - AND q.tier = tp.tier - AND tp.vol @> FLOOR(q.vol / NULLIF(q.pltq, 0))::INT - RETURNING q.* - ) - SELECT * FROM updated; - -END; -$$; diff --git a/new_targets/process_queue_proc.pg.sql b/new_targets/process_queue_proc.pg.sql deleted file mode 100644 index 4044b1f..0000000 --- a/new_targets/process_queue_proc.pg.sql +++ /dev/null @@ -1,69 +0,0 @@ -CREATE OR REPLACE PROCEDURE pricequote.process_queue_proc() -LANGUAGE plpgsql -AS $$ -BEGIN - - -------------------------------------------------------------------------------- - -- Step 1: Set channel, tier, and pallet quantity - -------------------------------------------------------------------------------- - UPDATE pricequote.price_queue s - SET - chan = cr.chan, - tier = cr.tier, - pltq = cr.mpck, - cust = cr.cust - FROM ( - SELECT - q.bill, - q.ship, - q.part, - i.mpck, - CASE SUBSTRING(bc.cclass, 2, 3) - WHEN 'DIS' THEN - CASE SUBSTRING(sc.cclass, 2, 3) - WHEN 'DIS' THEN 'WHS' - ELSE 'DRP' - END - ELSE 'DIR' - END AS chan, - CASE SUBSTRING(bc.cclass, 2, 3) - WHEN 'DIR' THEN bc.tier - ELSE COALESCE(sc.tier, bc.tier) - END AS tier, - CASE SUBSTRING(bc.cclass, 2, 3) - WHEN 'DIR' THEN bc.dba - ELSE COALESCE(sc.dba, bc.dba) - END AS cust - FROM pricequote.price_queue q - LEFT JOIN rlarp.cust bc ON bc.code = q.bill - LEFT JOIN rlarp.cust sc ON sc.code = q.ship - LEFT JOIN "CMS.CUSLG".itemm i ON i.item = q.part - ) cr - WHERE - cr.bill = s.bill AND - COALESCE(cr.ship, '') = COALESCE(s.ship, '') AND - cr.part = s.part; - - -------------------------------------------------------------------------------- - -- Step 2: Set price and explanation from target_prices - -------------------------------------------------------------------------------- - UPDATE pricequote.price_queue q - SET - price = tp.price, - expl = jsonb_build_object( - 'source', 'target price', - 'calculated_pallets', FLOOR(q.vol / NULLIF(q.pltq, 0))::INT, - 'exact_pallets', ROUND(q.vol / NULLIF(q.pltq, 0), 5), - 'volume range', tp.vol - ) - FROM pricequote.target_prices tp - WHERE - q.stlc = tp.stlc - AND q.v1ds = tp.ds - AND q.chan = tp.chan - AND q.tier = tp.tier - AND tp.vol @> FLOOR(q.vol / NULLIF(q.pltq, 0))::INT; - -END; -$$; - diff --git a/new_targets/procs/greatest_least.ms.sql b/new_targets/procs/greatest_least.ms.sql deleted file mode 100644 index 1a5b6c5..0000000 --- a/new_targets/procs/greatest_least.ms.sql +++ /dev/null @@ -1,27 +0,0 @@ -CREATE OR ALTER FUNCTION dbo.LEAST_NUMERIC205( - @a NUMERIC(20,5), - @b NUMERIC(20,5) -) -RETURNS NUMERIC(20,5) -AS -BEGIN - RETURN CASE - WHEN @a IS NULL THEN @b - WHEN @b IS NULL THEN @a - WHEN @a < @b THEN @a ELSE @b - END -END - -CREATE OR ALTER FUNCTION dbo.GREATEST_NUMERIC205( - @a NUMERIC(20,5), - @b NUMERIC(20,5) -) -RETURNS NUMERIC(20,5) -AS -BEGIN - RETURN CASE - WHEN @a IS NULL THEN @b - WHEN @b IS NULL THEN @a - WHEN @a > @b THEN @a ELSE @b - END -END \ No newline at end of file diff --git a/new_targets/procs/guidance_logic.ms.sql b/new_targets/procs/guidance_logic.ms.sql index c13ede9..8f6f0a9 100644 --- a/new_targets/procs/guidance_logic.ms.sql +++ b/new_targets/procs/guidance_logic.ms.sql @@ -1,3 +1,37 @@ + +-- This function returns the least of two NUMERIC(20,5) values. +CREATE OR ALTER FUNCTION dbo.LEAST_NUMERIC205( + @a NUMERIC(20,5), + @b NUMERIC(20,5) +) +RETURNS NUMERIC(20,5) +AS +BEGIN + RETURN CASE + WHEN @a IS NULL THEN @b + WHEN @b IS NULL THEN @a + WHEN @a < @b THEN @a ELSE @b + END +END +GO + +-- This function returns the greatest of two NUMERIC(20,5) values. +CREATE OR ALTER FUNCTION dbo.GREATEST_NUMERIC205( + @a NUMERIC(20,5), + @b NUMERIC(20,5) +) +RETURNS NUMERIC(20,5) +AS +BEGIN + RETURN CASE + WHEN @a IS NULL THEN @b + WHEN @b IS NULL THEN @a + WHEN @a > @b THEN @a ELSE @b + END +END +GO + +-- This function implements the guidance logic for pricing based on target, last, and list prices. CREATE OR ALTER FUNCTION pricing.guidance_logic ( @target_price NUMERIC(20,5), @last_price NUMERIC(20,5), @@ -82,3 +116,4 @@ BEGIN INSERT INTO @result VALUES (@price, @reason); RETURN; END +GO \ No newline at end of file diff --git a/new_targets/scripts/matrix_guidance.ms.sql b/new_targets/procs/matrix_guidance.ms.sql similarity index 100% rename from new_targets/scripts/matrix_guidance.ms.sql rename to new_targets/procs/matrix_guidance.ms.sql diff --git a/new_targets/scripts/matrix_guidance.pg.sql b/new_targets/procs/matrix_guidance.pg.sql similarity index 100% rename from new_targets/scripts/matrix_guidance.pg.sql rename to new_targets/procs/matrix_guidance.pg.sql diff --git a/new_targets/procs/template.json b/new_targets/procs/template.json deleted file mode 100644 index c337666..0000000 --- a/new_targets/procs/template.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "details": [ - { - "label": "Model Inputs", - "details": [ - { - "label": "Base Cost", - "value": 1.22446, - "type": "currency" - } - ] - }, - { - "label": "Peer Target", - "details": [ - { - "label": "Peer Median Margin", - "value": 36.873, - "type": "percent", - "note": "DIR|102 - HANGING POTS|110 - INJECTION|Tier 2" - } - ] - }, - { - "label": "Target Support", - "details": [ - { - "label": "Tier 1 Truckload", - "value": 80, - "type": "currency", - "note": "reviewed floor price" - }, - { - "label": "Warehouse", - "value": 1.2, - "type": "percent" - } - ] - }, - { - "label": "Factor Adjustment", - "details": [ - { - "label": "Package UOM", - "value": -0.01, - "type": "percent" - }, - { - "label": "# of Pallets", - "value": 0.02, - "type": "percent", - "note": "0.03" - }, - { - "label": "Urgency", - "value": 0.03, - "type": "percent", - "note": "Top Priority" - }, - { - "label": "State Adder/Subtractor", - "value": -0.02, - "type": "percent", - "note": "OH" - }, - { - "label": "Branding", - "value": 0, - "type": "currency" - } - ] - } - ] -} - diff --git a/new_targets/quotes_link.ms.sql b/new_targets/quotes_link.ms.sql deleted file mode 100644 index 91800e8..0000000 --- a/new_targets/quotes_link.ms.sql +++ /dev/null @@ -1,15 +0,0 @@ -SELECT - lq.* - ,t.* -FROM - rlarp.live_quotes lq - OUTER APPLY pricing.fn_single_price_call( - lq.billto, - lq.shipto, - lq.part, - substring(lq.part,1,8), - lq.v1ds, - lq.units_each - ) t ---WHERE --- qid = 112794 \ No newline at end of file diff --git a/new_targets/target_prices_copy.ms.sql b/new_targets/target_prices_copy.ms.sql deleted file mode 100644 index 34eac26..0000000 --- a/new_targets/target_prices_copy.ms.sql +++ /dev/null @@ -1,23 +0,0 @@ -DELETE FROM pricing.target_prices; - -INSERT INTO - pricing.target_prices -SELECT - stlc, - ds, - chan, - tier, - vol, - -- Extract lower bound: text between '[' and ',' - TRY_CAST(SUBSTRING(vol, 2, CHARINDEX(',', vol) - 2) AS INT) AS lower_bound, - -- Extract upper bound: text between ',' and ')' - CASE - WHEN RIGHT(vol, 2) = ',)' THEN NULL - ELSE TRY_CAST(SUBSTRING(vol, CHARINDEX(',', vol) + 1, LEN(vol) - CHARINDEX(',', vol) - 1) AS INT) - END AS upper_bound, - price, - math -FROM - usmidsap02.ubm.pricequote.target_prices_view; - ---SELECT COUNT(*) FROM pricing.target_prices \ No newline at end of file diff --git a/new_targets/ui_schema.json b/new_targets/ui_schema.json index 189f52e..c337666 100644 --- a/new_targets/ui_schema.json +++ b/new_targets/ui_schema.json @@ -1,28 +1,23 @@ { "details": [ { - "label": "History", + "label": "Model Inputs", "details": [ { - "label": "Last Sale", - "value": 0.081, - "type": "currency" - }, - { - "label": "Last Quote", - "value": 0.079, + "label": "Base Cost", + "value": 1.22446, "type": "currency" } ] }, { - "label": "List", + "label": "Peer Target", "details": [ { - "label": "Code", - "value": "GUAU", - "type": "text", - "note": "Griffin East - US A List" + "label": "Peer Median Margin", + "value": 36.873, + "type": "percent", + "note": "DIR|102 - HANGING POTS|110 - INJECTION|Tier 2" } ] }, @@ -30,34 +25,51 @@ "label": "Target Support", "details": [ { - "label": "Anchor", - "value": 0.080, + "label": "Tier 1 Truckload", + "value": 80, "type": "currency", - "note": "Tier 1 Truckload Black" + "note": "reviewed floor price" }, { - "label": "Color :L", - "value": 0.10, - "type": "percent", - "note": " x " - }, - { - "label": "Tier 2", - "value": 0.02, - "type": "percent", - "note": " x " + "label": "Warehouse", + "value": 1.2, + "type": "percent" } ] }, { - "label": "Guidance", + "label": "Factor Adjustment", "details": [ { - "label": "Last Price Capped", - "value": 0.080, - "type": "Last price 0.079 capped at 1%" + "label": "Package UOM", + "value": -0.01, + "type": "percent" + }, + { + "label": "# of Pallets", + "value": 0.02, + "type": "percent", + "note": "0.03" + }, + { + "label": "Urgency", + "value": 0.03, + "type": "percent", + "note": "Top Priority" + }, + { + "label": "State Adder/Subtractor", + "value": -0.02, + "type": "percent", + "note": "OH" + }, + { + "label": "Branding", + "value": 0, + "type": "currency" } ] } ] } +