From baeeaccf537ba0f01d4dba816a2fa6c097392f8c Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Thu, 16 Nov 2023 12:25:02 -0500 Subject: [PATCH] vault backup: 2023-11-16 12:25:02 --- api.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/api.ts b/api.ts index 46e642c..3c79a8b 100644 --- a/api.ts +++ b/api.ts @@ -55,6 +55,14 @@ router.get('/dseg_price/:billcode/:shipcode/:stlc/:dseg/:qty', async (ctx) => { ctx.response.body = ag.guidance.finalPrice.Snapped; }); +// specific customres codes but generic style code and data segment to accomodate custom colors and branding +router.get('/dseg_reason/:billcode/:shipcode/:stlc/:dseg/:qty', async (ctx) => { + const { billcode, shipcode, stlc, dseg, qty } = ctx.params; + const result = await client.queryObject({args: [billcode, shipcode, stlc, dseg, qty], text: query_dseg} ); + const ag = apply_guidance(result.rows[0]["doc"]); + ctx.response.body = ag.guidance.finalPrice.Reason; +}); + app.use(router.routes()); app.use(router.allowedMethods());