tango-app-api-payment-subscription 3.5.11 → 3.5.12
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
|
@@ -10,6 +10,7 @@ import { leadGet } from '../services/lead.service.js';
|
|
|
10
10
|
import { findOneClient } from '../services/clientPayment.services.js';
|
|
11
11
|
import * as billingService from '../services/billing.service.js';
|
|
12
12
|
import * as storeService from '../services/store.service.js';
|
|
13
|
+
import * as basePriceService from '../services/basePrice.service.js';
|
|
13
14
|
import { symbolFor } from '../utils/currency.js';
|
|
14
15
|
export const subscribedStoreList = async ( req, res ) => {
|
|
15
16
|
try {
|
|
@@ -878,6 +879,23 @@ export async function getLeadProducts( req, res ) {
|
|
|
878
879
|
}
|
|
879
880
|
}
|
|
880
881
|
|
|
882
|
+
// Tango product catalog with base prices (the clientId-absent basepricing doc).
|
|
883
|
+
// Used by the Assign-CSM popup to show each onboarding product's base price
|
|
884
|
+
// next to the negotiated-price input. Returns [{ productName, basePrice }].
|
|
885
|
+
export async function getBaseProducts( req, res ) {
|
|
886
|
+
try {
|
|
887
|
+
const catalog = await basePriceService.findOne( { clientId: { $exists: false } }, { basePricing: 1, _id: 0 } );
|
|
888
|
+
const products = ( catalog?.basePricing || [] ).map( ( p ) => ( {
|
|
889
|
+
productName: p.productName,
|
|
890
|
+
basePrice: p.basePrice,
|
|
891
|
+
} ) );
|
|
892
|
+
return res.sendSuccess( { products } );
|
|
893
|
+
} catch ( error ) {
|
|
894
|
+
logger.error( { error: error, function: 'getBaseProducts' } );
|
|
895
|
+
return res.sendError( error, 500 );
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
|
|
881
899
|
export async function getClientProducts( req, res ) {
|
|
882
900
|
try {
|
|
883
901
|
const client = await findOneClient( { clientId: req.params.id }, { 'planDetails.product': 1, '_id': 0 } );
|
|
@@ -153,6 +153,10 @@ export const validatePriceSchema = joi.object( {
|
|
|
153
153
|
type: joi.string().optional(),
|
|
154
154
|
clientId: joi.string().required(),
|
|
155
155
|
products: joi.array().optional(),
|
|
156
|
+
pricing: joi.array().items( joi.object( {
|
|
157
|
+
productName: joi.string().required(),
|
|
158
|
+
negotiatePrice: joi.number().required(),
|
|
159
|
+
} ) ).optional(),
|
|
156
160
|
} );
|
|
157
161
|
|
|
158
162
|
export const validatePriceParams = {
|
|
@@ -44,6 +44,11 @@
|
|
|
44
44
|
<p style="margin:0;">To discuss reinstatement and clear the outstanding amount, please contact us. We'd like to help you resolve this and restore your account.</p>
|
|
45
45
|
</td>
|
|
46
46
|
</tr>
|
|
47
|
+
<tr>
|
|
48
|
+
<td style="background-color:#ffffff;padding:6px 24px 6px 30px;font-size:14px;line-height:150%;color:#8a93a2;">
|
|
49
|
+
<p style="margin:0;font-style:italic;">If you have already paid this invoice, please disregard this email.</p>
|
|
50
|
+
</td>
|
|
51
|
+
</tr>
|
|
47
52
|
<tr>
|
|
48
53
|
<td style="background-color:#ffffff;padding:14px 24px 24px 30px;font-size:16px;line-height:150%;color:#384860;">
|
|
49
54
|
<p style="margin:0;">Best regards,<br>{{companyName}}</p>
|
|
@@ -44,6 +44,11 @@
|
|
|
44
44
|
<p style="margin:0;">To take your account off hold, please complete the outstanding payment. For any queries, please reach out to our customer support team.</p>
|
|
45
45
|
</td>
|
|
46
46
|
</tr>
|
|
47
|
+
<tr>
|
|
48
|
+
<td style="background-color:#ffffff;padding:6px 24px 6px 30px;font-size:14px;line-height:150%;color:#8a93a2;">
|
|
49
|
+
<p style="margin:0;font-style:italic;">If you have already paid this invoice, please disregard this email.</p>
|
|
50
|
+
</td>
|
|
51
|
+
</tr>
|
|
47
52
|
<tr>
|
|
48
53
|
<td style="background-color:#ffffff;padding:14px 24px 24px 30px;font-size:16px;line-height:150%;color:#384860;">
|
|
49
54
|
<p style="margin:0;">Best regards,<br>{{companyName}}</p>
|
|
@@ -44,6 +44,11 @@
|
|
|
44
44
|
<p style="margin:0;">To reactivate your account, please complete the outstanding payment as soon as possible. For any queries, please reach out to our customer support team.</p>
|
|
45
45
|
</td>
|
|
46
46
|
</tr>
|
|
47
|
+
<tr>
|
|
48
|
+
<td style="background-color:#ffffff;padding:6px 24px 6px 30px;font-size:14px;line-height:150%;color:#8a93a2;">
|
|
49
|
+
<p style="margin:0;font-style:italic;">If you have already paid this invoice, please disregard this email.</p>
|
|
50
|
+
</td>
|
|
51
|
+
</tr>
|
|
47
52
|
<tr>
|
|
48
53
|
<td style="background-color:#ffffff;padding:14px 24px 24px 30px;font-size:16px;line-height:150%;color:#384860;">
|
|
49
54
|
<p style="margin:0;">Best regards,<br>{{companyName}}</p>
|
|
@@ -3,7 +3,7 @@ export const billingRouter = express.Router();
|
|
|
3
3
|
import { accessVerification, isAllowedSessionHandler, validate } from 'tango-app-api-middleware';
|
|
4
4
|
import { getPaymentReminder, savePaymentReminder } from '../controllers/paymentReminder.controller.js';
|
|
5
5
|
import { triggerPaymentReminders } from '../controllers/paymentReminderTrigger.controller.js';
|
|
6
|
-
import { createBillingGroup, deleteBillingGroup, getAllBillingGroups, getBillingGroups, getClientProducts, getInvoices, getLeadProducts, onetimePayment, subscribedStoreList, updateBillingGroup, gstinLookup } from '../controllers/billing.controllers.js';
|
|
6
|
+
import { createBillingGroup, deleteBillingGroup, getAllBillingGroups, getBillingGroups, getClientProducts, getInvoices, getLeadProducts, getBaseProducts, onetimePayment, subscribedStoreList, updateBillingGroup, gstinLookup } from '../controllers/billing.controllers.js';
|
|
7
7
|
import { billingGroupSchema, clientProductsValid, createBillingGroupsSchema, deleteBillingGroupsSchema, getBillingGroupsSchema, getInvoiceSchema, leadProductsValid, onetimeFeeValid, subscribedStoreListSchema, updateBillingGroupsSchema } from '../dtos/validation.dtos.js';
|
|
8
8
|
|
|
9
9
|
|
|
@@ -28,6 +28,8 @@ billingRouter.get( '/getLeadProducts/:email', isAllowedSessionHandler, validate(
|
|
|
28
28
|
|
|
29
29
|
billingRouter.get( '/getClientProducts/:id', isAllowedSessionHandler, validate( clientProductsValid ), getClientProducts );
|
|
30
30
|
|
|
31
|
+
billingRouter.get( '/getBaseProducts', isAllowedSessionHandler, getBaseProducts );
|
|
32
|
+
|
|
31
33
|
|
|
32
34
|
billingRouter.get( '/gst-lookup/:gstin', isAllowedSessionHandler, accessVerification( { userType: [ 'tango' ], access: [ { featureName: 'Global', name: 'Billing', permissions: [ 'isAdd' ] } ] } ), gstinLookup );
|
|
33
35
|
|