paidup-product-connect
Advanced tools
Comparing version 0.4.7 to 0.4.8
@@ -36,3 +36,3 @@ module.exports = { | ||
description: 'List of categories.', | ||
example: { | ||
example: `{ | ||
status: 200, | ||
@@ -62,4 +62,4 @@ body: [ | ||
"geojson": {}, | ||
"visitbility": true, | ||
"status": true, | ||
"visitbility": false, | ||
"status": false, | ||
"images": {main:'someUrl'}, | ||
@@ -89,15 +89,15 @@ "categories": [], | ||
"paymentPlans": { | ||
//"due1": { | ||
// "description": "Full payment", | ||
// "visible": true, | ||
// "dues": [ | ||
// { | ||
// "description": "some description", | ||
// "dateCharge": "2016-02-26 10:30", | ||
// "amount": 100, | ||
// "discount": 50, | ||
// "applyDiscount": false | ||
// } | ||
// ] | ||
//} | ||
"due1": { | ||
"description": "Full payment", | ||
"visible": true, | ||
"dues": [ | ||
{ | ||
"description": "some description", | ||
"dateCharge": "2016-02-26 10:30", | ||
"amount": 100, | ||
"discount": 50, | ||
"applyDiscount": false | ||
} | ||
] | ||
} | ||
} | ||
@@ -108,4 +108,3 @@ } | ||
] | ||
} | ||
}, | ||
}`}, | ||
error: { | ||
@@ -160,6 +159,4 @@ description: 'error unexpected', | ||
prodJson._id = prod.entityId; | ||
for (var key in prodJson.paymentPlans) { | ||
prodJson.paymentPlans[key].dues.forEach(function(ele, idx, arr){ | ||
prodJson.paymentPlans[key].dues = prodJson.paymentPlans[key].dues.map(function(ele){ | ||
var dc = new Date(ele.dateCharge) | ||
@@ -171,9 +168,10 @@ if(dc < today ){ | ||
} | ||
return ele; | ||
}); | ||
} | ||
category.products.push(prodJson); | ||
result.push(category); | ||
} | ||
}); | ||
result.push(category); | ||
}catch (err){ | ||
@@ -183,6 +181,6 @@ console.log(err) | ||
}); | ||
return exits.success({ | ||
return exits.success(JSON.stringify({ | ||
status: resp.status, | ||
body: result | ||
}) | ||
}) ) | ||
} | ||
@@ -189,0 +187,0 @@ }) |
{ | ||
"name": "paidup-product-connect", | ||
"version": "0.4.7", | ||
"version": "0.4.8", | ||
"description": "Connector for PaidUp Microservice Product", | ||
@@ -5,0 +5,0 @@ "scripts": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20767