feat: Vendors resource.

This commit is contained in:
Ahmed Bouhuolia
2020-06-08 19:56:07 +02:00
parent d915813195
commit ec429887fc
7 changed files with 632 additions and 0 deletions

View File

@@ -300,5 +300,11 @@ export default (tenantDb) => {
};
});
factory.define('vendor', 'vendors', async () => {
return {
customer_type: 'business',
};
});
return factory;
}

View File

@@ -0,0 +1,42 @@
exports.up = function(knex) {
return knex.schema.createTable('vendors', table => {
table.increments();
table.string('customer_type');
table.string('first_name').nullable();
table.string('last_name').nullable();
table.string('company_name').nullable();
table.string('display_name');
table.string('email').nullable();
table.string('work_phone').nullable();
table.string('personal_phone').nullable();
table.string('billing_address_1').nullable();
table.string('billing_address_2').nullable();
table.string('billing_address_city').nullable();
table.string('billing_address_country').nullable();
table.string('billing_address_email').nullable();
table.string('billing_address_zipcode').nullable();
table.string('billing_address_phone').nullable();
table.string('billing_address_state').nullable(),
table.string('shipping_address_1').nullable();
table.string('shipping_address_2').nullable();
table.string('shipping_address_city').nullable();
table.string('shipping_address_country').nullable();
table.string('shipping_address_email').nullable();
table.string('shipping_address_zipcode').nullable();
table.string('shipping_address_phone').nullable();
table.string('shipping_address_state').nullable();
table.text('note');
table.boolean('active').defaultTo(true);
});
};
exports.down = function(knex) {
return knex.schema.dropTableIfExists('vendors');
};

View File

@@ -11,6 +11,7 @@ exports.seed = (knex) => {
{ id: 4, name: 'manual_journals' },
{ id: 5, name: 'items_categories' },
{ id: 6, name: 'customers' },
{ id: 7, name: 'vendors' },
]);
});
};