tango-app-api-payment-subscription 3.0.50-dev → 3.0.51-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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tango-app-api-payment-subscription",
3
- "version": "3.0.50-dev",
3
+ "version": "3.0.51-dev",
4
4
  "description": "paymentSubscription",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -25,7 +25,7 @@
25
25
  "mongodb": "^6.4.0",
26
26
  "nodemon": "^3.1.0",
27
27
  "swagger-ui-express": "^5.0.0",
28
- "tango-api-schema": "^2.0.103",
28
+ "tango-api-schema": "^2.0.104",
29
29
  "tango-app-api-middleware": "^1.0.72-test",
30
30
  "winston": "^3.12.0",
31
31
  "winston-daily-rotate-file": "^5.0.0"
@@ -487,17 +487,17 @@ export const updateSubscription = async ( req, res ) => {
487
487
 
488
488
  let details = {
489
489
  subscriptionType: premiumType,
490
- subscriptionPeriod: requestBody.subscriptionPeriod,
491
- totalCamera: requestBody.totalCamera,
492
- totalStores: requestBody.totalStores,
493
- storeSize: requestBody.storeSize,
490
+ subscriptionPeriod: requestBody?.subscriptionPeriod || requestBody?.client?.planDetails?.subscriptionPeriod,
491
+ totalCamera: requestBody.totalCamera || requestBody?.client?.planDetails?.totalCamera,
492
+ totalStores: requestBody.totalStores || requestBody?.client?.planDetails?.totalStores,
493
+ storeSize: requestBody?.storeSize || requestBody?.client?.planDetails?.storeSize,
494
494
  product: clientProducts,
495
495
  };
496
496
 
497
497
  req.body = {
498
- 'camaraPerSqft': req.body.storeSize,
499
- 'storesCount': req.body.totalStores,
500
- 'planName': requestBody.subscriptionPeriod,
498
+ 'camaraPerSqft': details.storeSize,
499
+ 'storesCount': details.totalStores,
500
+ 'planName': details.subscriptionPeriod,
501
501
  'products': clientProducts.map( ( item ) => item.productName ),
502
502
  'currencyType': 'rupees',
503
503
  };
@@ -524,7 +524,7 @@ export const updateSubscription = async ( req, res ) => {
524
524
  let data = {
525
525
  planDetails: details,
526
526
  price: pricingDetails.price,
527
- priceType: requestBody.priceType,
527
+ priceType: requestBody?.priceType || requestBody?.client?.priceType,
528
528
 
529
529
  };
530
530
 
@@ -2408,10 +2408,10 @@ export const getRemindClients = async ( req, res ) => {
2408
2408
  clientId: client.clientId,
2409
2409
  clientNotification: false,
2410
2410
  adminNotification: true,
2411
- description: 'Subscription - Your Free trial is about to expire in 3 days. Pleas make sure to subscribe to the products',
2411
+ description: 'Subscription - Your Free trial is about to expire in 3 days. Please make sure to subscribe to the products',
2412
2412
  logSubType: 'trialReminder',
2413
2413
  title: 'Subscription',
2414
- alertCta: [ { buttonName: 'Subscribe now', redirectionUrl: 'manage/settings/payment-subscription', product: data.product, clientId: client.clientId }, { buttonName: 'Remind me later', redirectionUrl: 'remind' } ],
2414
+ alertCta: [ { buttonName: 'Subscribe now', redirectionUrl: 'subscribed', product: item.productName, name: data.product, clientId: client.clientId }, { buttonName: 'Remind me later', redirectionUrl: 'remind' } ],
2415
2415
  markasRead: false,
2416
2416
  logType: 'subscription',
2417
2417
  showPushNotification: true,
@@ -181,13 +181,13 @@ export const validateStoreProductsParams = {
181
181
 
182
182
  export const validateUpdateSubscriptionSchema =joi.object( {
183
183
  clientId: joi.string().required(),
184
- price: joi.number().required(),
185
- priceType: joi.string().required(),
186
- subscriptionType: joi.string().required(),
187
- subscriptionPeriod: joi.string().required(),
188
- totalCamera: joi.number().required(),
189
- totalStores: joi.string().required(),
190
- storeSize: joi.string().required(),
184
+ price: joi.number().optional(),
185
+ priceType: joi.string().optional(),
186
+ subscriptionType: joi.string().optional(),
187
+ subscriptionPeriod: joi.string().optional(),
188
+ totalCamera: joi.number().optional(),
189
+ totalStores: joi.string().optional(),
190
+ storeSize: joi.string().optional(),
191
191
  products: joi.array().required(),
192
192
  } );
193
193