From ee991823d0b695807193217bb138474ddc723b23 Mon Sep 17 00:00:00 2001 From: Gerald Baulig Date: Mon, 11 Mar 2024 11:55:15 +0100 Subject: [PATCH] fix(config): disable fulfillment and invoicing by default on production Surpress warning if disabled --- src/service.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/service.ts b/src/service.ts index dbaa5fb..9ccd75b 100644 --- a/src/service.ts +++ b/src/service.ts @@ -384,7 +384,10 @@ export class OrderingService // optional Fulfillment const fulfillment_cfg = cfg.get('client:fulfillment'); - if (fulfillment_cfg && !fulfillment_cfg.disabled) { + if (fulfillment_cfg.disabled) { + // ignore! + } + else if (fulfillment_cfg) { this.creates_fulfillments_on_submit = fulfillment_cfg.createOnSubmit; this.cleanup_fulfillments_post_submit = fulfillment_cfg.cleanupPostSubmit; this.fulfillment_tech_user = fulfillment_cfg.users?.tech_user; @@ -402,7 +405,10 @@ export class OrderingService } const fulfillment_product_cfg = cfg.get('client:fulfillment_product'); - if (fulfillment_product_cfg && !fulfillment_product_cfg.disabled) { + if (fulfillment_product_cfg.disabled) { + // ignore! + } + else if (fulfillment_product_cfg) { this.fulfillment_product_service = createClient( { ...fulfillment_product_cfg, @@ -417,7 +423,10 @@ export class OrderingService } const invoicing_cfg = cfg.get('client:invoice'); - if (invoicing_cfg && !invoicing_cfg.disabled) { + if (invoicing_cfg.disabled) { + // ignore! + } + else if (invoicing_cfg) { this.creates_invoices_on_submit = invoicing_cfg.createOnSubmit; this.cleanup_invoices_post_submit = invoicing_cfg.cleanupPostSubmit; this.invoice_tech_user = invoicing_cfg.users?.tech_user;