vr-commons 1.0.162 → 1.0.164

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -415,7 +415,7 @@ exports.stockUtil = {
415
415
  return await vr_models_1.Device.findAll({
416
416
  where: {
417
417
  pairId: { [sequelize_1.Op.in]: pairIds },
418
- deletedAt: null, // ✅ Exclude soft deleted
418
+ // ✅ Exclude soft deleted
419
419
  },
420
420
  include: [{ model: vr_models_1.DevicePaymentPlan, as: "paymentPlan" }],
421
421
  transaction,
@@ -460,7 +460,6 @@ exports.stockUtil = {
460
460
  const devices = await vr_models_1.Device.findAll({
461
461
  where: {
462
462
  pairId: pairId,
463
- deletedAt: null, // ✅ Exclude soft deleted
464
463
  },
465
464
  transaction,
466
465
  });
@@ -518,7 +517,6 @@ exports.stockUtil = {
518
517
  const devices = await vr_models_1.Device.findAll({
519
518
  where: {
520
519
  pairId: pairId,
521
- deletedAt: null,
522
520
  },
523
521
  include: [{ model: vr_models_1.DevicePaymentPlan, as: "paymentPlan" }],
524
522
  transaction,
@@ -568,7 +566,6 @@ exports.stockUtil = {
568
566
  const devices = await vr_models_1.Device.findAll({
569
567
  where: {
570
568
  pairId: pairId,
571
- deletedAt: null,
572
569
  },
573
570
  include: [{ model: vr_models_1.DevicePaymentPlan, as: "paymentPlan" }],
574
571
  transaction,
@@ -643,15 +640,14 @@ exports.stockUtil = {
643
640
  batchNumber++;
644
641
  offset = (batchNumber - 1) * batchSize;
645
642
  const pairIdsResult = await sequelizeInstance.query(`
646
- SELECT "pairId"
647
- FROM "devices"
648
- WHERE "deletedAt" IS NULL
649
- AND ${whereClause}
650
- GROUP BY "pairId"
651
- HAVING COUNT(*) = 2
652
- ORDER BY "pairId" ASC
653
- LIMIT $1
654
- OFFSET $2
643
+ SELECT "pairId"
644
+ FROM "devices"
645
+ WHERE ${whereClause}
646
+ GROUP BY "pairId"
647
+ HAVING COUNT(*) = 2
648
+ ORDER BY "pairId" ASC
649
+ LIMIT $1
650
+ OFFSET $2
655
651
  `, {
656
652
  bind: [batchSize, offset],
657
653
  type: "SELECT",
@@ -679,7 +675,6 @@ exports.stockUtil = {
679
675
  const devices = await vr_models_1.Device.findAll({
680
676
  where: {
681
677
  pairId: pairId,
682
- deletedAt: null,
683
678
  ...buildSequelizeWhere(condition),
684
679
  },
685
680
  transaction: transaction,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vr-commons",
3
- "version": "1.0.162",
3
+ "version": "1.0.164",
4
4
  "description": "Shared functions package",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -103,7 +103,7 @@
103
103
  "rimraf": "^5.0.5",
104
104
  "streamifier": "^0.1.1",
105
105
  "typescript": "^5.3.3",
106
- "vr-models": "^1.0.84",
106
+ "vr-models": "^1.0.85",
107
107
  "zod": "^3.25.20"
108
108
  },
109
109
  "dependencies": {