docparse-default-bill
v1.0.5
Published
Create default bill mongoose model in memory for use in docparse tests
Downloads
7
Readme
Docparse Default Bills
Create default bill mongoose model in memory for use in docparse tests
Dependency tracking by David
Usage
Default object
var inspect = require('eyespect').inspector()
var createDefaultBill = require('docparse-default-bill')
createDefaultBill(function(err, bill) {
if (err) {
inspect(err, 'error creating bill')
return;
}
inspect(bill.toObject(), 'created bill');
});
With custom data
var createDefaulttBill = require('docparse-default-bill')
var loginID = new ObjectId();
var customerID = new ObjectId();
var supplierID = new ObjectId();
var data = {
accountNumber: 'bar bill number',
billNumber: 'bar bill number',
textPages: ['bar page 1 text', 'bar page 2 text'],
hash: 'bar hash',
supplierID: supplierID,
supplierCode: 'POS',
loginID: loginID,
customerID: customerID
};
createDefaultBill(data, function(err, bill) {
if (err) {
inspect(err, 'error creating bill')
return;
}
inspect(bill.toObject(), 'default bill');
});
Installation
npm install docparse-default-bill