feat: add missed salutation and website columns.

This commit is contained in:
Ahmed Bouhuolia
2020-11-09 11:29:28 +02:00
parent 63951f7071
commit 347bc672fe
4 changed files with 22 additions and 4 deletions

View File

@@ -59,7 +59,7 @@ const ItemCategoryList = ({
); );
const fetchResourceFields = useQuery( const fetchResourceFields = useQuery(
['resource-fields', 'items_categories'], ['resource-fields', 'item_category'],
(key, resourceName) => requestFetchResourceFields(resourceName), (key, resourceName) => requestFetchResourceFields(resourceName),
); );

View File

@@ -7,6 +7,7 @@ export default class ContactsController extends BaseController {
*/ */
get contactDTOSchema(): ValidationChain[] { get contactDTOSchema(): ValidationChain[] {
return [ return [
check('salutation').optional().trim().escape(),
check('first_name').optional().trim().escape(), check('first_name').optional().trim().escape(),
check('last_name').optional().trim().escape(), check('last_name').optional().trim().escape(),
@@ -14,6 +15,7 @@ export default class ContactsController extends BaseController {
check('display_name').exists().trim().escape(), check('display_name').exists().trim().escape(),
check('email').optional().isEmail().trim().escape(), check('email').optional().isEmail().trim().escape(),
check('website').optional().trim().escape(),
check('work_phone').optional().trim().escape(), check('work_phone').optional().trim().escape(),
check('personal_phone').optional().trim().escape(), check('personal_phone').optional().trim().escape(),

View File

@@ -12,6 +12,7 @@ exports.up = function(knex) {
table.decimal('opening_balance', 13, 3).defaultTo(0); table.decimal('opening_balance', 13, 3).defaultTo(0);
table.date('opening_balance_at'); table.date('opening_balance_at');
table.string('salutation').nullable();
table.string('first_name').nullable(); table.string('first_name').nullable();
table.string('last_name').nullable(); table.string('last_name').nullable();
table.string('company_name').nullable(); table.string('company_name').nullable();
@@ -21,9 +22,10 @@ exports.up = function(knex) {
table.string('email').nullable(); table.string('email').nullable();
table.string('work_phone').nullable(); table.string('work_phone').nullable();
table.string('personal_phone').nullable(); table.string('personal_phone').nullable();
table.string('website').nullable();
table.string('billing_address1').nullable(); table.string('billing_address_1').nullable();
table.string('billing_address2').nullable(); table.string('billing_address_2').nullable();
table.string('billing_address_city').nullable(); table.string('billing_address_city').nullable();
table.string('billing_address_country').nullable(); table.string('billing_address_country').nullable();
table.string('billing_address_email').nullable(); table.string('billing_address_email').nullable();

View File

@@ -52,12 +52,14 @@ export interface IContact extends IContactAddress{
openingBalance: number, openingBalance: number,
openingBalanceAt: Date, openingBalanceAt: Date,
salutation: string,
firstName: string, firstName: string,
lastName: string, lastName: string,
companyName: string, companyName: string,
displayName: string, displayName: string,
email: string, email: string,
website: string,
workPhone: string, workPhone: string,
personalPhone: string, personalPhone: string,
@@ -72,11 +74,13 @@ export interface IContactNewDTO {
openingBalance?: number, openingBalance?: number,
openingBalanceAt?: string, openingBalanceAt?: string,
salutation?: string,
firstName?: string, firstName?: string,
lastName?: string, lastName?: string,
companyName?: string, companyName?: string,
displayName: string, displayName: string,
website?: string,
email?: string, email?: string,
workPhone?: string, workPhone?: string,
personalPhone?: string, personalPhone?: string,
@@ -87,11 +91,13 @@ export interface IContactNewDTO {
export interface IContactEditDTO { export interface IContactEditDTO {
contactType?: string, contactType?: string,
salutation?: string,
firstName?: string, firstName?: string,
lastName?: string, lastName?: string,
companyName?: string, companyName?: string,
displayName: string, displayName: string,
website?: string,
email?: string, email?: string,
workPhone?: string, workPhone?: string,
personalPhone?: string, personalPhone?: string,
@@ -113,11 +119,13 @@ export interface ICustomerNewDTO extends IContactAddressDTO {
openingBalance?: number, openingBalance?: number,
openingBalanceAt?: string, openingBalanceAt?: string,
salutation?: string,
firstName?: string, firstName?: string,
lastName?: string, lastName?: string,
companyName?: string, companyName?: string,
displayName: string, displayName: string,
website?: string,
email?: string, email?: string,
workPhone?: string, workPhone?: string,
personalPhone?: string, personalPhone?: string,
@@ -128,11 +136,13 @@ export interface ICustomerNewDTO extends IContactAddressDTO {
export interface ICustomerEditDTO extends IContactAddressDTO { export interface ICustomerEditDTO extends IContactAddressDTO {
customerType: string, customerType: string,
salutation?: string,
firstName?: string, firstName?: string,
lastName?: string, lastName?: string,
companyName?: string, companyName?: string,
displayName: string, displayName: string,
website?: string,
email?: string, email?: string,
workPhone?: string, workPhone?: string,
personalPhone?: string, personalPhone?: string,
@@ -152,11 +162,13 @@ export interface IVendorNewDTO extends IContactAddressDTO {
openingBalance?: number, openingBalance?: number,
openingBalanceAt?: string, openingBalanceAt?: string,
salutation?: string,
firstName?: string, firstName?: string,
lastName?: string, lastName?: string,
companyName?: string, companyName?: string,
displayName: string, displayName: string,
website?: string,
email?: string, email?: string,
workPhone?: string, workPhone?: string,
personalPhone?: string, personalPhone?: string,
@@ -165,11 +177,13 @@ export interface IVendorNewDTO extends IContactAddressDTO {
active?: boolean, active?: boolean,
}; };
export interface IVendorEditDTO extends IContactAddressDTO { export interface IVendorEditDTO extends IContactAddressDTO {
salutation?: string,
firstName?: string, firstName?: string,
lastName?: string, lastName?: string,
companyName?: string, companyName?: string,
displayName?: string, displayName?: string,
website?: string,
email?: string, email?: string,
workPhone?: string, workPhone?: string,
personalPhone?: string, personalPhone?: string,