From a7edde9e5d20690713112f3c53ba90ad366658d3 Mon Sep 17 00:00:00 2001 From: Methapon Metanipat Date: Mon, 28 Oct 2024 16:52:53 +0700 Subject: [PATCH] feat: add option to share product inside one group --- src/controllers/04-product-controller.ts | 6 ++++++ src/controllers/04-product-group-controller.ts | 2 ++ 2 files changed, 8 insertions(+) diff --git a/src/controllers/04-product-controller.ts b/src/controllers/04-product-controller.ts index 4fbbe13..18fd275 100644 --- a/src/controllers/04-product-controller.ts +++ b/src/controllers/04-product-controller.ts @@ -105,6 +105,12 @@ export class ProductController extends Controller { registeredBranch: { OR: permissionCondCompany(req.user) }, }, }, + { + productGroup: { + shared: true, + registeredBranch: { OR: permissionCondCompany(req.user) }, + }, + }, ], }, }); diff --git a/src/controllers/04-product-group-controller.ts b/src/controllers/04-product-group-controller.ts index 0282585..20a3f5b 100644 --- a/src/controllers/04-product-group-controller.ts +++ b/src/controllers/04-product-group-controller.ts @@ -33,6 +33,7 @@ type ProductGroupCreate = { detail: string; remark: string; status?: Status; + shared?: boolean; registeredBranchId: string; }; @@ -41,6 +42,7 @@ type ProductGroupUpdate = { detail?: string; remark?: string; status?: "ACTIVE" | "INACTIVE"; + shared?: boolean; registeredBranchId?: string; };