tango-app-api-payment-subscription 3.0.51-dev → 3.0.52-dev
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/package.json
CHANGED
|
@@ -46,6 +46,7 @@ export const addBilling = async ( req, res ) => {
|
|
|
46
46
|
logSubType: 'billingInfoUpdated',
|
|
47
47
|
changes: [ 'Billing Address', 'Gst Number' ],
|
|
48
48
|
eventType: 'update',
|
|
49
|
+
showTo: [ 'client', 'tango' ],
|
|
49
50
|
};
|
|
50
51
|
insertOpenSearchData( appConfig.opensearch.activityLog, logObj );
|
|
51
52
|
return res.sendSuccess( { message: 'Billing Details Added Successfully', data: resultData } );
|
|
@@ -430,6 +431,7 @@ export const updateSubscription = async ( req, res ) => {
|
|
|
430
431
|
changes: [ `${convertTitleCase( item.name )} Trial Request` ],
|
|
431
432
|
eventType: 'create',
|
|
432
433
|
timestamp: new Date(),
|
|
434
|
+
showTo: [ 'client', 'tango' ],
|
|
433
435
|
};
|
|
434
436
|
insertOpenSearchData( appConfig.opensearch.activityLog, logObj );
|
|
435
437
|
}
|
|
@@ -457,6 +459,7 @@ export const updateSubscription = async ( req, res ) => {
|
|
|
457
459
|
changes: [ `${convertTitleCase( item.name )} subscribed` ],
|
|
458
460
|
eventType: '',
|
|
459
461
|
date: new Date(),
|
|
462
|
+
showTo: [ 'client', 'tango' ],
|
|
460
463
|
};
|
|
461
464
|
insertOpenSearchData( appConfig.opensearch.activityLog, productObj );
|
|
462
465
|
} else {
|
|
@@ -478,6 +481,7 @@ export const updateSubscription = async ( req, res ) => {
|
|
|
478
481
|
changes: [ `${convertTitleCase( item.name )} subscribed` ],
|
|
479
482
|
eventType: '',
|
|
480
483
|
date: new Date(),
|
|
484
|
+
showTo: [ 'client', 'tango' ],
|
|
481
485
|
};
|
|
482
486
|
insertOpenSearchData( appConfig.opensearch.activityLog, productObj );
|
|
483
487
|
}
|
|
@@ -659,6 +663,7 @@ export const unsubscribeProduct = async ( req, res ) => {
|
|
|
659
663
|
logSubType: 'unsubscribedRequest',
|
|
660
664
|
changes: [ `${req.body.clientId} Unsubscribed Request ` ],
|
|
661
665
|
eventType: 'create',
|
|
666
|
+
showTo: [ 'client', 'tango' ],
|
|
662
667
|
};
|
|
663
668
|
insertOpenSearchData( appConfig.opensearch.activityLog, logObj );
|
|
664
669
|
|
|
@@ -693,6 +698,7 @@ export const trialExtendRequest = async ( req, res ) => {
|
|
|
693
698
|
logSubType: 'trialExtendRequest',
|
|
694
699
|
changes: [ `${convertTitleCase( req.body.product )} trial Extend Request` ],
|
|
695
700
|
eventType: 'create',
|
|
701
|
+
showTo: [ 'client', 'tango' ],
|
|
696
702
|
};
|
|
697
703
|
insertOpenSearchData( appConfig.opensearch.activityLog, logObj );
|
|
698
704
|
|
|
@@ -729,6 +735,7 @@ export const trialRequest = async ( req, res ) => {
|
|
|
729
735
|
logSubType: 'trialRequest',
|
|
730
736
|
changes: [ `${convertTitleCase( req.body.product )} trial Request` ],
|
|
731
737
|
eventType: 'create',
|
|
738
|
+
showTo: [ 'client', 'tango' ],
|
|
732
739
|
};
|
|
733
740
|
insertOpenSearchData( appConfig.opensearch.activityLog, logObj );
|
|
734
741
|
|
|
@@ -800,6 +807,7 @@ export const updateInvoiceDetails = async ( req, res ) => {
|
|
|
800
807
|
logSubType: 'updatePaymentInvoice',
|
|
801
808
|
changes: [ 'Pro Rate', 'Payment Type', 'Payment Cycle', 'Currency Type', 'Invoice To', 'Payment Agreement To', 'Invoice On', 'Extend Payment PeriodDays' ],
|
|
802
809
|
eventType: 'update',
|
|
810
|
+
showTo: [ 'client', 'tango' ],
|
|
803
811
|
};
|
|
804
812
|
insertOpenSearchData( appConfig.opensearch.activityLog, logObj );
|
|
805
813
|
return res.sendSuccess( 'Invoice Updated Successfully' );
|
|
@@ -917,6 +925,7 @@ export const trialApproval = async ( req, res ) => {
|
|
|
917
925
|
date: new Date(),
|
|
918
926
|
changes: [ `${convertTitleCase( requestData.name )} trial started` ],
|
|
919
927
|
eventType: '',
|
|
928
|
+
showTo: [ 'client', 'tango' ],
|
|
920
929
|
};
|
|
921
930
|
insertOpenSearchData( appConfig.opensearch.activityLog, logObj );
|
|
922
931
|
let clientProducts = await paymentService.findOne( { clientId: requestData.clientId }, { planDetails: 1 } );
|
|
@@ -1080,6 +1089,7 @@ export const trialExtendRequestApproval = async ( req, res ) => {
|
|
|
1080
1089
|
date: new Date(),
|
|
1081
1090
|
changes: [ `${firstWord + ' ' + secondWord} trial Extended` ],
|
|
1082
1091
|
eventType: '',
|
|
1092
|
+
showTo: [ 'client', 'tango' ],
|
|
1083
1093
|
};
|
|
1084
1094
|
insertOpenSearchData( appConfig.opensearch.activityLog, notifyObj );
|
|
1085
1095
|
// const logObj = {
|
|
@@ -1140,6 +1150,7 @@ export const productSubscribe = async ( req, res ) => {
|
|
|
1140
1150
|
changes: [ `${convertTitleCase( item.name )} product unsubscribed` ],
|
|
1141
1151
|
eventType: '',
|
|
1142
1152
|
timestamp: new Date(),
|
|
1153
|
+
showTo: [ 'client', 'tango' ],
|
|
1143
1154
|
};
|
|
1144
1155
|
insertOpenSearchData( appConfig.opensearch.activityLog, logObj );
|
|
1145
1156
|
await storeService.addremoveElement( { clientId: clientInfo.clientId, product: { $in: item.name } }, { $pull: { product: item.name } } );
|
|
@@ -1166,6 +1177,7 @@ export const productSubscribe = async ( req, res ) => {
|
|
|
1166
1177
|
changes: [ `${convertTitleCase( item.name )} trial started` ],
|
|
1167
1178
|
eventType: '',
|
|
1168
1179
|
timestamp: new Date(),
|
|
1180
|
+
showTo: [ 'client', 'tango' ],
|
|
1169
1181
|
};
|
|
1170
1182
|
insertOpenSearchData( appConfig.opensearch.activityLog, logObj );
|
|
1171
1183
|
product.push( {
|
|
@@ -1197,6 +1209,7 @@ export const productSubscribe = async ( req, res ) => {
|
|
|
1197
1209
|
date: new Date(),
|
|
1198
1210
|
changes: [ `${convertTitleCase( item.name )} prodcut Subscribed` ],
|
|
1199
1211
|
eventType: '',
|
|
1212
|
+
showTo: [ 'client', 'tango' ],
|
|
1200
1213
|
};
|
|
1201
1214
|
insertOpenSearchData( appConfig.opensearch.activityLog, logObj );
|
|
1202
1215
|
product.push( {
|
|
@@ -1210,6 +1223,27 @@ export const productSubscribe = async ( req, res ) => {
|
|
|
1210
1223
|
} else {
|
|
1211
1224
|
let productIndex = product.findIndex( ( ele ) => ele.productName == item.name );
|
|
1212
1225
|
if ( productIndex != -1 ) {
|
|
1226
|
+
let logObj = {
|
|
1227
|
+
userName: req.user?.userName,
|
|
1228
|
+
email: req.user?.email,
|
|
1229
|
+
clientId: clientInfo.clientId,
|
|
1230
|
+
clientNotification: false,
|
|
1231
|
+
adminNotification: true,
|
|
1232
|
+
logSubType: 'productSubscribed',
|
|
1233
|
+
description: 'Your subscription is now active! Get ready to maximize your instore sales potential with the Tangoeye suite',
|
|
1234
|
+
// category: 'Brand Activity Log',
|
|
1235
|
+
// features: 'Subscription',
|
|
1236
|
+
title: 'Subscription',
|
|
1237
|
+
alertCta: [],
|
|
1238
|
+
markasRead: false,
|
|
1239
|
+
logType: 'subscription',
|
|
1240
|
+
showPushNotification: true,
|
|
1241
|
+
date: new Date(),
|
|
1242
|
+
changes: [ `${convertTitleCase( item.name )} prodcut Subscribed` ],
|
|
1243
|
+
eventType: '',
|
|
1244
|
+
showTo: [ 'client', 'tango' ],
|
|
1245
|
+
};
|
|
1246
|
+
insertOpenSearchData( appConfig.opensearch.activityLog, logObj );
|
|
1213
1247
|
if ( item.type == 'subscription' ) {
|
|
1214
1248
|
product[productIndex].subscribedDate = new Date();
|
|
1215
1249
|
product[productIndex].status = 'live';
|
|
@@ -1361,6 +1395,7 @@ export const unsubscribeApproval = async ( req, res ) => {
|
|
|
1361
1395
|
logSubType: 'unsubscribedApproved',
|
|
1362
1396
|
changes: [ `${requestData.clientId} unsubscribed` ],
|
|
1363
1397
|
eventType: '',
|
|
1398
|
+
showTo: [ 'client', 'tango' ],
|
|
1364
1399
|
};
|
|
1365
1400
|
insertOpenSearchData( appConfig.opensearch.activityLog, logObj );
|
|
1366
1401
|
return res.sendSuccess( 'updated Successfully' );
|
|
@@ -1597,6 +1632,7 @@ export const addStoreProduct = async ( req, res ) => {
|
|
|
1597
1632
|
date: new Date(),
|
|
1598
1633
|
changes: [ ` ${req.body.store.toString()} ${convertTitleCase( item.name )} product unsubscribed` ],
|
|
1599
1634
|
eventType: '',
|
|
1635
|
+
showTo: [ 'client', 'tango' ],
|
|
1600
1636
|
|
|
1601
1637
|
};
|
|
1602
1638
|
insertOpenSearchData( appConfig.opensearch.activityLog, logObj );
|
|
@@ -1654,6 +1690,7 @@ export const addStoreProduct = async ( req, res ) => {
|
|
|
1654
1690
|
date: new Date(),
|
|
1655
1691
|
changes: [ `${convertTitleCase( item.name )} trial started` ],
|
|
1656
1692
|
eventType: '',
|
|
1693
|
+
showTo: [ 'client', 'tango' ],
|
|
1657
1694
|
|
|
1658
1695
|
};
|
|
1659
1696
|
insertOpenSearchData( appConfig.opensearch.activityLog, logObj );
|
|
@@ -1681,6 +1718,7 @@ export const addStoreProduct = async ( req, res ) => {
|
|
|
1681
1718
|
date: new Date(),
|
|
1682
1719
|
changes: [ `${convertTitleCase( item.name )} product subscribed` ],
|
|
1683
1720
|
eventType: '',
|
|
1721
|
+
showTo: [ 'client', 'tango' ],
|
|
1684
1722
|
};
|
|
1685
1723
|
insertOpenSearchData( appConfig.opensearch.activityLog, logObj );
|
|
1686
1724
|
}
|
|
@@ -2158,6 +2196,7 @@ export const pricingListUpdate = async ( req, res ) => {
|
|
|
2158
2196
|
logSubType: 'updateProductPricing',
|
|
2159
2197
|
changes: keys,
|
|
2160
2198
|
eventType: 'update',
|
|
2199
|
+
showTo: [ 'client', 'tango' ],
|
|
2161
2200
|
};
|
|
2162
2201
|
insertOpenSearchData( appConfig.opensearch.activityLog, logObj );
|
|
2163
2202
|
return res.sendSuccess( 'Pricig Updated Successfully' );
|
|
@@ -2332,6 +2371,7 @@ export const updatedRevisedPrice = async ( req, res ) => {
|
|
|
2332
2371
|
logSubType: 'revisedPriceUpdation',
|
|
2333
2372
|
changes: [ 'amount', 'revisedAmount', 'discount' ],
|
|
2334
2373
|
eventType: 'update',
|
|
2374
|
+
showTo: [ 'client', 'tango' ],
|
|
2335
2375
|
};
|
|
2336
2376
|
insertOpenSearchData( appConfig.opensearch.activityLog, logObj );
|
|
2337
2377
|
return res.sendSuccess( 'Credit notes Updated Successfully' );
|
|
@@ -2419,19 +2459,21 @@ export const getRemindClients = async ( req, res ) => {
|
|
|
2419
2459
|
userName: userDetails?.userName,
|
|
2420
2460
|
email: userDetails?.email,
|
|
2421
2461
|
changes: [ `${data.product} trial is going to expired.` ],
|
|
2462
|
+
eventType: '',
|
|
2463
|
+
showTo: [ 'client', 'tango' ],
|
|
2422
2464
|
};
|
|
2423
2465
|
insertOpenSearchData( appConfig.opensearch.activityLog, logObj );
|
|
2424
|
-
const templateHtml = fs.readFileSync( path.resolve( path.dirname( '' ) ) + '/src/hbs/trialReminderEmail.hbs', 'utf8' );
|
|
2425
|
-
const template = Handlebars.compile( templateHtml );
|
|
2426
|
-
const html = template( { data: data } );
|
|
2427
|
-
let params = {
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
};
|
|
2434
|
-
await sendEmailWithSES( params.toEmail, params.mailSubject, params.htmlBody, params.attachment, params.sourceEmail );
|
|
2466
|
+
// const templateHtml = fs.readFileSync( path.resolve( path.dirname( '' ) ) + '/src/hbs/trialReminderEmail.hbs', 'utf8' );
|
|
2467
|
+
// const template = Handlebars.compile( templateHtml );
|
|
2468
|
+
// const html = template( { data: data } );
|
|
2469
|
+
// let params = {
|
|
2470
|
+
// toEmail: userDetails.email,
|
|
2471
|
+
// mailSubject: 'TangoEye | Trial Ending Soon',
|
|
2472
|
+
// htmlBody: html,
|
|
2473
|
+
// attachment: '',
|
|
2474
|
+
// sourceEmail: appConfig.cloud.aws.ses.adminEmail,
|
|
2475
|
+
// };
|
|
2476
|
+
// await sendEmailWithSES( params.toEmail, params.mailSubject, params.htmlBody, params.attachment, params.sourceEmail );
|
|
2435
2477
|
}
|
|
2436
2478
|
}
|
|
2437
2479
|
}
|
|
@@ -2729,6 +2771,7 @@ export const updateInvoiceStatus = async ( req, res ) => {
|
|
|
2729
2771
|
logSubType: 'InvoiceStatus',
|
|
2730
2772
|
changes: [ 'amount', 'paymentType', 'status' ],
|
|
2731
2773
|
eventType: 'update',
|
|
2774
|
+
showTo: [ 'client', 'tango' ],
|
|
2732
2775
|
};
|
|
2733
2776
|
insertOpenSearchData( appConfig.opensearch.activityLog, logObj );
|
|
2734
2777
|
return res.sendSuccess( 'Invoice updated Successfully' );
|
|
@@ -3194,7 +3237,7 @@ export const updatePushNotification = async ( req, res ) => {
|
|
|
3194
3237
|
},
|
|
3195
3238
|
};
|
|
3196
3239
|
let updateResult = await updateOpenSearchData( appConfig.opensearch.activityLog, req.params.notificationId, document );
|
|
3197
|
-
if ( updateResult?.statusCode == 200
|
|
3240
|
+
if ( updateResult?.statusCode == 200 ) {
|
|
3198
3241
|
return res.sendSuccess( 'Notification Updated Successfully' );
|
|
3199
3242
|
}
|
|
3200
3243
|
return res.sendError( 'Something went wrong', 500 );
|