Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    docparse-default-billpublic

    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

    Keywords

    none

    install

    npm i docparse-default-bill

    Downloadsweekly downloads

    13

    version

    1.0.5

    license

    none

    repository

    githubgithub

    last publish

    collaborators

    • avatar