tango-app-api-payment-subscription 3.5.18 → 3.5.19

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.5.18",
3
+ "version": "3.5.19",
4
4
  "description": "paymentSubscription",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -42,7 +42,11 @@ billingRouter.post( '/payment-reminder', isAllowedSessionHandler, accessVerifica
42
42
 
43
43
  // Purchase Orders (brand-view Purchase Order tab).
44
44
  billingRouter.get( '/purchase-orders', isAllowedSessionHandler, accessVerification( { userType: [ 'tango' ], access: [ { featureName: 'Global', name: 'Billing', permissions: [ 'isAdd' ] } ] } ), getPurchaseOrders );
45
- billingRouter.post( '/purchase-orders', isAllowedSessionHandler, accessVerification( { userType: [ 'tango' ], access: [ { featureName: 'Global', name: 'Billing', permissions: [ 'isAdd' ] } ] } ), poUpload.single( 'file' ), createPurchaseOrder );
45
+ // multer runs FIRST so it consumes the multipart stream off the live request.
46
+ // The auth middlewares are async and do DB awaits while touching req.body;
47
+ // running them before multer leaves the multipart stream unread and busboy
48
+ // throws 'Unexpected end of form'. After multer, text fields are on req.body.
49
+ billingRouter.post( '/purchase-orders', poUpload.single( 'file' ), isAllowedSessionHandler, accessVerification( { userType: [ 'tango' ], access: [ { featureName: 'Global', name: 'Billing', permissions: [ 'isAdd' ] } ] } ), createPurchaseOrder );
46
50
 
47
51
  // Cron-triggered: sends the configured payment reminder emails. Unauthenticated
48
52
  // like the other cron endpoints; protect at the network / scheduler layer.
@@ -152,7 +152,7 @@ paymentSubscriptionRouter.post( '/updateRemind/:notificationId', isAllowedSessio
152
152
  paymentSubscriptionRouter.post( '/createDefaultbillings', paymentController.createDefaultbillings );
153
153
 
154
154
  // Brand documents (Plans & Subscription > Documents accordion).
155
- paymentSubscriptionRouter.post( '/client-document/upload', isAllowedSessionHandler, accessVerification( { userType: [ 'tango' ], access: [ { featureName: 'Global', name: 'Subscription', permissions: [ 'isEdit' ] } ] } ), documentUpload.single( 'file' ), paymentController.uploadClientDocument );
155
+ paymentSubscriptionRouter.post( '/client-document/upload', documentUpload.single( 'file' ), isAllowedSessionHandler, accessVerification( { userType: [ 'tango' ], access: [ { featureName: 'Global', name: 'Subscription', permissions: [ 'isEdit' ] } ] } ), paymentController.uploadClientDocument );
156
156
  paymentSubscriptionRouter.get( '/client-document/list', isAllowedSessionHandler, accessVerification( { userType: [ 'tango' ], access: [ { featureName: 'Global', name: 'Subscription', permissions: [] } ] } ), paymentController.getClientDocuments );
157
157
 
158
158
  // Toggle billing-group-wise pricing for a client (tango only, edit perm).