From 3174e12944a5e51e6b0d283152eb9b570310bd10 Mon Sep 17 00:00:00 2001 From: niyibi250 Date: Thu, 23 May 2024 15:50:07 +0200 Subject: [PATCH] ft(back): establish PR Feat: Product Lifecycle Notification System #84 --- package-lock.json | 29 +++++++++++++++++++++++++ package.json | 2 ++ src/controller/checkforproductchange.ts | 4 ++++ 3 files changed, 35 insertions(+) create mode 100644 src/controller/checkforproductchange.ts diff --git a/package-lock.json b/package-lock.json index 16615fa2..9dcff7ed 100644 --- a/package-lock.json +++ b/package-lock.json @@ -51,6 +51,7 @@ "@types/jsonwebtoken": "^9.0.6", "@types/mailgun-js": "^0.22.18", "@types/morgan": "^1.9.9", + "@types/node-cron": "^3.0.11", "@types/nodemailer": "^6.4.15", "@types/passport": "^1.0.16", "@types/passport-facebook": "^3.0.3", @@ -65,6 +66,7 @@ "eslint-plugin-import": "^2.29.1", "eslint-plugin-prettier": "^5.1.3", "jest": "^29.7.0", + "node-cron": "^3.0.3", "prettier": "^3.2.5", "ts-jest": "^29.1.2", "ts-node-dev": "^2.0.0", @@ -1879,6 +1881,12 @@ "undici-types": "~5.26.4" } }, + "node_modules/@types/node-cron": { + "version": "3.0.11", + "resolved": "https://registry.npmjs.org/@types/node-cron/-/node-cron-3.0.11.tgz", + "integrity": "sha512-0ikrnug3/IyneSHqCBeslAhlK2aBfYek1fGo4bP4QnZPmiqSGRK+Oy7ZMisLWkesffJvQ1cqAcBnJC+8+nxIAg==", + "dev": true + }, "node_modules/@types/nodemailer": { "version": "6.4.15", "resolved": "https://registry.npmjs.org/@types/nodemailer/-/nodemailer-6.4.15.tgz", @@ -7215,6 +7223,27 @@ "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-5.1.0.tgz", "integrity": "sha512-eh0GgfEkpnoWDq+VY8OyvYhFEzBk6jIYbRKdIlyTiAXIVJ8PyBaKb0rp7oDtoddbdoHWhq8wwr+XZ81F1rpNdA==" }, + "node_modules/node-cron": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/node-cron/-/node-cron-3.0.3.tgz", + "integrity": "sha512-dOal67//nohNgYWb+nWmg5dkFdIwDm8EpeGYMekPMrngV3637lqnX0lbUcCtgibHTz6SEz7DAIjKvKDFYCnO1A==", + "dev": true, + "dependencies": { + "uuid": "8.3.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/node-cron/node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "dev": true, + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/node-fetch": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", diff --git a/package.json b/package.json index 3f3ff677..3d7137bc 100644 --- a/package.json +++ b/package.json @@ -85,6 +85,7 @@ "@types/jsonwebtoken": "^9.0.6", "@types/mailgun-js": "^0.22.18", "@types/morgan": "^1.9.9", + "@types/node-cron": "^3.0.11", "@types/nodemailer": "^6.4.15", "@types/passport": "^1.0.16", "@types/passport-facebook": "^3.0.3", @@ -99,6 +100,7 @@ "eslint-plugin-import": "^2.29.1", "eslint-plugin-prettier": "^5.1.3", "jest": "^29.7.0", + "node-cron": "^3.0.3", "prettier": "^3.2.5", "ts-jest": "^29.1.2", "ts-node-dev": "^2.0.0", diff --git a/src/controller/checkforproductchange.ts b/src/controller/checkforproductchange.ts new file mode 100644 index 00000000..857ad40e --- /dev/null +++ b/src/controller/checkforproductchange.ts @@ -0,0 +1,4 @@ +import Product from '../database/models/productEntity' +import UserModel from '../database/models/userModel' + +