docparse-default-bill

Create default bill mongoose model in memory for use in docparse tests

npm install docparse-default-bill
24 downloads in the last month

Docparse Default Bills

Create default bill mongoose model in memory for use in docparse tests. The bill is an instance of docparse-bill but is not saved to any database.

Build Status Dependency Status 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 mongoose = require('mongoose');
var ObjectId = mongoose.Types.ObjectId;
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

Example Installation

npm install docparse-default-bill eyespect mongoose

npm loves you