diff --git a/app/controllers/establishment.controller.js b/app/controllers/establishment.controller.js index 56ae38d..0ae354d 100644 --- a/app/controllers/establishment.controller.js +++ b/app/controllers/establishment.controller.js @@ -1415,6 +1415,16 @@ exports.establishmentBulkUpload = async (req, res) => { } }; +exports.downloadCompanyProfileSample = async (req, res) => { + try { + const filePath = path.join(__dirname, "../uploads/company_profile_upload_sample.csv"); + return res.download(filePath, "company_profile_upload_sample.csv"); + } catch (error) { + return res.status(500).send({ status: "failed", message: error.message }); + } +}; + + // exports.establishmentBulkUpload = async (req, res) => { // try { diff --git a/app/routes/routes.js b/app/routes/routes.js index e6540e7..00091cb 100644 --- a/app/routes/routes.js +++ b/app/routes/routes.js @@ -2794,6 +2794,31 @@ router.get("/emirates", [verifySignature, verifyToken], establishmentController. */ router.get("/city-towns", [verifySignature, verifyToken], establishmentController.getAllCityTowns); +/** + * @swagger + * /api/establishment/download-sample-file: + * get: + * summary: Download sample CSV template for bulk product upload + * tags: [Products] + * security: + * - appSignature: [] + * - bearerAuth: [] + * responses: + * 200: + * description: Sample CSV file downloaded successfully + * content: + * text/csv: + * schema: + * type: string + * format: binary + * 404: + * description: File not found + * 500: + * description: Server error + */ +router.get("/establishment/download-sample-file",[verifySignature, verifyToken], establishmentController.downloadCompanyProfileSample); + + diff --git a/app/uploads/company_profile_upload_sample.csv b/app/uploads/company_profile_upload_sample.csv new file mode 100644 index 0000000..70bb0e2 --- /dev/null +++ b/app/uploads/company_profile_upload_sample.csv @@ -0,0 +1 @@ +Establishment Code,Factory Name,User Name,Email,Emirate,HS Code 1,HS Code 2,HS Code 3,HS Code 4,HS Code 5,Permanent Factory Code,Industry Code Business Register,Industry Code Current Production,Description,Industry Code Mismatch Remarks,Establishment Address,City/Town,Postal Code,PO Box,Makani Number,Contact Person Name,Contact Person Designation,Mobile Number,Website,Number of Emirati Male,Number of Emirati Female,Number of Non-Emirati Male,Number of Non-Emirati Female