docparse-create-customer

1.0.9 • Public • Published

create new customer documents in a test database for use in docparse tests. The mongoose database is mocked out with an in-memory store

Build Status

Dependency Status Dependency tracking by David

Usage

Default object

var inspect = require('eyespect').inspector()
var create = require('docparse-create-customer')
create(function(err, customer) {
  if (err) {
    inspect(err, 'error creating customer')
    return;
  }
  inspect(customer.toObject(), 'created customer');
});

With custom data

var create = require('docparse-create-customer')
var login1 = {
  supplier_code: 'FGS',
  username: 'fgsUsername1',
  password: 'fgsPassword1'
};

var login2 = {
  supplier_code: 'FGS',
  username: 'fgsUsername2',
  password: 'fgsPassword2'
};

var logins = [login1, login2];
var data = {
  customerName: 'customerName1',
  logins : logins
};
create(data, function(err, customer) {
  if (err) {
    inspect(err, 'error creating customer')
    return;
  }
  inspect(customer.toObject(), 'created customer');
});

Installation

npm install --save-dev docparse-create-customer

Readme

Keywords

none

Package Sidebar

Install

npm i docparse-create-customer

Weekly Downloads

2

Version

1.0.9

License

BSD

Last publish

Collaborators

  • clewfirst