Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const logger = require('sp-json-logger')();
const sql = require('mssql');
const dbUrl = process.env.DB_URL;
const MongoClient = require('mongodb').MongoClient;
const ObjectId = require('mongodb').ObjectID;
var db = null; //database connected
const utils = require('./../../jobs/utils/utils.js');
const path = require('path');
sql.Promise = require('bluebird');
const _ = require('underscore');
const Promise = require('bluebird');
const commandName = path.basename(__filename, '.js'); // gives the filename without the .js extension
const TODAYS_DATE = new Date();
const rp = require('request-promise');
const REPORT_STATES = utils.REPORT_STATES;
/**
* One option is a combination of products with VPN > Color > Shade
* Need to find out Reorder points at option level
* So, let's create options levels with keys as "VPN-Color-Shade"
* For example:
* '30782-Pink-Dark'
*/
var runMe = function (payload, config, taskId, messageId) {
var orgModelId = payload.orgModelId;
const logger = require('sp-json-logger')();
const sql = require('mssql');
const dbUrl = process.env.DB_URL;
const MongoClient = require('mongodb').MongoClient;
const ObjectId = require('mongodb').ObjectID;
var db = null; //database connected
const utils = require('./../../jobs/utils/utils.js');
const path = require('path');
sql.Promise = require('bluebird');
const _ = require('underscore');
const Promise = require('bluebird');
const INVENTORY_DIM_TABLE = 'HSInventDimStaging';
const INVENTORY_PER_PAGE = 1000;
const commandName = path.basename(__filename, '.js'); // gives the filename without the .js extension
const maxBatchSize = 1000;
var runMe = function (sqlPool, orgModelId, inventorySyncModel) {
try {
// Global variable for logging
logger.debug({
commandName: commandName,
argv: process.argv,
orgModelId,
inventorySyncModel
const logger = require('sp-json-logger')();
const sql = require('mssql');
const dbUrl = process.env.DB_URL;
const MongoClient = require('mongodb').MongoClient;
const ObjectId = require('mongodb').ObjectID;
var db = null; //database connected
const utils = require('./../../jobs/utils/utils.js');
const path = require('path');
sql.Promise = require('bluebird');
const _ = require('underscore');
const Promise = require('bluebird');
const SALES_TABLE = 'RetailTransactionStaging';
const SALES_PER_PAGE = 1000;
const commandName = path.basename(__filename, '.js'); // gives the filename without the .js extension
const transactionConstants = require('../constants/sales-constants.json');
var runMe = function (sqlPool, orgModelId, salesSyncModel) {
try {
// Global variable for logging
logger.debug({
commandName: commandName,
argv: process.argv,
orgModelId,
salesSyncModel
const logger = require('sp-json-logger')();
const sql = require('mssql');
const dbUrl = process.env.DB_URL;
const MongoClient = require('mongodb').MongoClient;
const ObjectId = require('mongodb').ObjectID;
var db = null; //database connected
const utils = require('./../../jobs/utils/utils.js');
const path = require('path');
sql.Promise = require('bluebird');
const _ = require('underscore');
const Promise = require('bluebird');
const PRODUCT_TABLE = 'HSPRODUCTSYNCTABLEStaging';
const PRODUCTS_PER_PAGE = 1000;
// Global variable for logging
var commandName = path.basename(__filename, '.js'); // gives the filename without the .js extension
var runMe = function (sqlPool, orgModelId, productSyncModel) {
try {
var incrementalProducts, productsToDelete;
logger.debug({
commandName: commandName,
argv: process.argv,
orgModelId,
productSyncModel
const logger = require('sp-json-logger')();
const sql = require('mssql');
const dbUrl = process.env.DB_URL;
const MongoClient = require('mongodb').MongoClient;
const ObjectId = require('mongodb').ObjectID;
var db = null; //database connected
const utils = require('./../../jobs/utils/utils.js');
const path = require('path');
sql.Promise = require('bluebird');
const _ = require('underscore');
const Promise = require('bluebird');
const commandName = path.basename(__filename, '.js'); // gives the filename without the .js extension
const LEAD_TIME_IN_DAYS = 1;
const REVIEW_TIME_IN_DAYS = 1;
const CSL_MULTIPLIER = 1.03; //NORMSINV(0.85) 85% success rate
const TODAYS_DATE = new Date();
var runMe = function (payload, config, taskId, messageId) {
var orgModelId = payload.orgModelId;
var storeModelId = payload.storeModelId;
try {
// Global variable for logging
logger.debug({
commandName: commandName,
const logger = require('sp-json-logger')();
const sql = require('mssql');
const dbUrl = process.env.DB_URL;
const MongoClient = require('mongodb').MongoClient;
const ObjectId = require('mongodb').ObjectID;
var db = null; //database connected
const utils = require('./../../jobs/utils/utils.js');
const path = require('path');
sql.Promise = require('bluebird');
const _ = require('underscore');
const Promise = require('bluebird');
const INVENTORY_SUM_TABLE = 'HSInventSumStaging';
const INVENTORY_DIM_TABLE = 'HSInventDimStaging';
const INVENTORY_PER_PAGE = 1000;
const commandName = path.basename(__filename, '.js'); // gives the filename without the .js extension
const maxBatchSize = 1000;
var runMe = function (sqlPool, orgModelId, inventorySyncModel) {
try {
// Global variable for logging
logger.debug({
commandName: commandName,
argv: process.argv,
orgModelId,
const logger = require('sp-json-logger')();
const sql = require('mssql');
const dbUrl = process.env.DB_URL;
const MongoClient = require('mongodb').MongoClient;
const ObjectId = require('mongodb').ObjectID;
var db = null; //database connected
const utils = require('./../../jobs/utils/utils.js');
const path = require('path');
sql.Promise = require('bluebird');
const _ = require('underscore');
const Promise = require('bluebird');
const PRODUCT_TABLE = 'EcoResProductV2Staging';
const PRODUCTS_PER_PAGE = 1000;
var commandName = path.basename(__filename, '.js'); // gives the filename without the .js extension
var runMe = function (sqlPool, orgModelId, productCategorySyncModel) {
try {
var incrementalProducts, productsToDelete;
// Global variable for logging
logger.debug({
commandName: commandName,
argv: process.argv,
orgModelId,
productCategorySyncModel
const REPORT_EMPTY = 'Executing...';
const REPORT_COMPLETE = 'Complete';
const REPORT_ERROR = 'Error';
const logger = require('sp-json-logger')();
const sql = require('mssql');
const dbUrl = process.env.DB_URL;
const MongoClient = require('mongodb').MongoClient;
const ObjectId = require('mongodb').ObjectID;
var db = null; //database connected
const utils = require('./../../jobs/utils/utils.js');
const path = require('path');
sql.Promise = require('bluebird');
const _ = require('underscore');
const MSDUtil = require('./../../jobs/utils/msd.js');
const Promise = require('bluebird');
const commandName = path.basename(__filename, '.js'); // gives the filename without the .js extension
const TODAYS_DATE = new Date();
const rp = require('request-promise');
var runMe = function (payload, config, taskId, messageId) {
var orgModelId = payload.orgModelId;
var reportModelId = payload.reportModelId;
var createdTransferOrder, stockOrderLineItemModels;
var reportModelInstance;
try {
// Global variable for logging
logger.debug({
const logger = require('sp-json-logger')();
const sql = require('mssql');
const dbUrl = process.env.DB_URL;
const MongoClient = require('mongodb').MongoClient;
const ObjectId = require('mongodb').ObjectID;
var db = null; //database connected
const utils = require('./../../jobs/utils/utils.js');
const path = require('path');
sql.Promise = require('bluebird');
const _ = require('underscore');
const Promise = require('bluebird');
const SALES_LINES_TABLE = 'RetailTransactionSalesLineStaging';
const SALES_LINES_PER_PAGE = 1000;
const commandName = path.basename(__filename, '.js'); // gives the filename without the .js extension
const transactionConstants = require('../constants/sales-constants.json');
var runMe = function (sqlPool, orgModelId, salesLineSyncModel) {
try {
// Global variable for logging
logger.debug({
commandName: commandName,
argv: process.argv,
orgModelId,
salesLineSyncModel
});