From f1c1084b7b01d5cdc1a8501dd770aa75412484b5 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 20 Jan 2026 16:01:39 +0530 Subject: [PATCH] Product column added in the company profile Export --- app/controllers/establishment.controller.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/controllers/establishment.controller.js b/app/controllers/establishment.controller.js index 369af00..8b97d3c 100644 --- a/app/controllers/establishment.controller.js +++ b/app/controllers/establishment.controller.js @@ -416,6 +416,7 @@ exports.getAllEstablishments = async (req, res) => { { header: "Emirate", key: "emirate_name", width: 20 }, { header: "ISIC Code", key: "isic_code", width: 20 }, { header: "Establishment ID", key: "establishment_code", width: 20 }, + { header: "Products", key: "products", width: 20 }, { header: "Total Employees", key: "total_employees", width: 20 }, { header: "Created By", key: "created_user", width: 20 }, { header: "Created On", key: "created_at", width: 20 }, @@ -425,6 +426,8 @@ exports.getAllEstablishments = async (req, res) => { // Format data data.forEach((item) => { + + worksheet.addRow({ id: item.id, factory_name: item.factory_name, @@ -432,6 +435,7 @@ exports.getAllEstablishments = async (req, res) => { emirate_name: item.establishment_emirate?.name || "-", isic_code: item.isic_code || "-", establishment_code: item.establishment_code, + products: item.product_count, total_employees: item.total_employees, created_user: item.created_user?.name || "-", created_at: new Date(item.created_at).toLocaleDateString(),