@optimiser/common 1.0.253 → 1.0.256
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.
- package/dist/lib/utility.js +11 -2
- package/package.json +1 -1
package/dist/lib/utility.js
CHANGED
|
@@ -2614,13 +2614,15 @@ paratemter : {
|
|
|
2614
2614
|
*/
|
|
2615
2615
|
function SignoutUserFromAllDevices(options, dbMaster, redisClient) {
|
|
2616
2616
|
if (dbMaster) {
|
|
2617
|
+
var sessionID_1 = '';
|
|
2617
2618
|
var updateQuery_1 = { "IsActive": false, "Description": options.Description, "ModifiedBy": options.RemovedBy, "ModifiedDate": new Date() };
|
|
2618
|
-
dbMaster.collection('Session').find({ "UserID": options.UserID, "IsActive": true }, { projection: { "_id":
|
|
2619
|
+
dbMaster.collection('Session').find({ "UserID": options.UserID, "IsActive": true }, { projection: { "_id": 1, "SessionKey": 1, "Platform": 1 } }).toArray(function (err, data) {
|
|
2619
2620
|
if (err) {
|
|
2620
2621
|
if (options.callback)
|
|
2621
2622
|
options.callback({ message: 'error', error: err });
|
|
2622
2623
|
}
|
|
2623
2624
|
if (data) {
|
|
2625
|
+
sessionID_1 = data.map(function (x) { return x._id; });
|
|
2624
2626
|
if (options.Platform) {
|
|
2625
2627
|
data = data.filter(function (x) { return (x.Platform == options.Platform); });
|
|
2626
2628
|
}
|
|
@@ -2633,7 +2635,7 @@ function SignoutUserFromAllDevices(options, dbMaster, redisClient) {
|
|
|
2633
2635
|
}
|
|
2634
2636
|
}
|
|
2635
2637
|
}
|
|
2636
|
-
dbMaster.collection('Session').updateMany({ "UserID": options.UserID, "IsActive": true }, { $set: updateQuery_1 }, function (err, data) {
|
|
2638
|
+
dbMaster.collection('Session').updateMany({ _id: sessionID_1, "UserID": options.UserID, "IsActive": true }, { $set: updateQuery_1 }, function (err, data) {
|
|
2637
2639
|
if (err) {
|
|
2638
2640
|
if (options.callback)
|
|
2639
2641
|
options.callback({ message: 'error', error: err });
|
|
@@ -3664,6 +3666,8 @@ function SyncCompanyLicenceInMasterCompanyAfterAdd(fieldsObj, dbMaster) {
|
|
|
3664
3666
|
setQuery_1['TotalEnterpriseLicence'] = 0;
|
|
3665
3667
|
var totalNoOfFeatureLicence = 0;
|
|
3666
3668
|
var totalNoOfAppLicence = 0;
|
|
3669
|
+
//Added by Chetan on 22Feb2022, for domain licence
|
|
3670
|
+
var totalNoOfDomainLicence = 0;
|
|
3667
3671
|
for (var c = 0; c < companyLicences.length; c++) {
|
|
3668
3672
|
var licenceType = companyLicences[c]._id['LicenceType'];
|
|
3669
3673
|
var licenceName = companyLicences[c]._id['LicenceName'];
|
|
@@ -3677,6 +3681,9 @@ function SyncCompanyLicenceInMasterCompanyAfterAdd(fieldsObj, dbMaster) {
|
|
|
3677
3681
|
else if (licenceType == 'App') {
|
|
3678
3682
|
totalNoOfAppLicence += parseInt(companyLicenceTotal);
|
|
3679
3683
|
}
|
|
3684
|
+
else if (licenceType == 'Domain') {
|
|
3685
|
+
totalNoOfDomainLicence += parseInt(companyLicenceTotal); /*Added by Chetan on 22Feb2022, for domain licence*/
|
|
3686
|
+
}
|
|
3680
3687
|
for (var i in companyLicencesData_2) {
|
|
3681
3688
|
if (i == licenceType) {
|
|
3682
3689
|
var companyLicenceType = companyLicencesData_2[i];
|
|
@@ -3690,6 +3697,8 @@ function SyncCompanyLicenceInMasterCompanyAfterAdd(fieldsObj, dbMaster) {
|
|
|
3690
3697
|
}
|
|
3691
3698
|
setQuery_1['TotalFeatureLicence'] = totalNoOfFeatureLicence;
|
|
3692
3699
|
setQuery_1['TotalAppLicence'] = totalNoOfAppLicence;
|
|
3700
|
+
//Added by Chetan on 22Feb2022, for domain licence
|
|
3701
|
+
setQuery_1['TotalDomainLicence'] = totalNoOfDomainLicence;
|
|
3693
3702
|
setQuery_1.Setting["Licences"] = companyLicencesData_2;
|
|
3694
3703
|
dbMaster.collection('Company').updateOne({ _id: companyId_1, 'IsActive': true }, { $set: setQuery_1 });
|
|
3695
3704
|
}
|