diff --git a/client/src/containers/Items/ItemCategoriesList.js b/client/src/containers/Items/ItemCategoriesList.js index a7bf770ea..01c824262 100644 --- a/client/src/containers/Items/ItemCategoriesList.js +++ b/client/src/containers/Items/ItemCategoriesList.js @@ -59,7 +59,7 @@ const ItemCategoryList = ({ ); const fetchResourceFields = useQuery( - ['resource-fields', 'items_categories'], + ['resource-fields', 'item_category'], (key, resourceName) => requestFetchResourceFields(resourceName), ); diff --git a/server/src/api/controllers/Contacts/Contacts.ts b/server/src/api/controllers/Contacts/Contacts.ts index d9be41efe..0ac82f44a 100644 --- a/server/src/api/controllers/Contacts/Contacts.ts +++ b/server/src/api/controllers/Contacts/Contacts.ts @@ -7,6 +7,7 @@ export default class ContactsController extends BaseController { */ get contactDTOSchema(): ValidationChain[] { return [ + check('salutation').optional().trim().escape(), check('first_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('email').optional().isEmail().trim().escape(), + check('website').optional().trim().escape(), check('work_phone').optional().trim().escape(), check('personal_phone').optional().trim().escape(), diff --git a/server/src/database/migrations/20200104232644_create_contacts_table.js b/server/src/database/migrations/20200104232644_create_contacts_table.js index 9583f46db..09e0accde 100644 --- a/server/src/database/migrations/20200104232644_create_contacts_table.js +++ b/server/src/database/migrations/20200104232644_create_contacts_table.js @@ -12,6 +12,7 @@ exports.up = function(knex) { table.decimal('opening_balance', 13, 3).defaultTo(0); table.date('opening_balance_at'); + table.string('salutation').nullable(); table.string('first_name').nullable(); table.string('last_name').nullable(); table.string('company_name').nullable(); @@ -21,9 +22,10 @@ exports.up = function(knex) { table.string('email').nullable(); table.string('work_phone').nullable(); table.string('personal_phone').nullable(); + table.string('website').nullable(); - table.string('billing_address1').nullable(); - table.string('billing_address2').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(); diff --git a/server/src/interfaces/Contact.ts b/server/src/interfaces/Contact.ts index 502523bbe..dff2ff7ef 100644 --- a/server/src/interfaces/Contact.ts +++ b/server/src/interfaces/Contact.ts @@ -52,12 +52,14 @@ export interface IContact extends IContactAddress{ openingBalance: number, openingBalanceAt: Date, + salutation: string, firstName: string, lastName: string, companyName: string, displayName: string, email: string, + website: string, workPhone: string, personalPhone: string, @@ -72,26 +74,30 @@ export interface IContactNewDTO { openingBalance?: number, openingBalanceAt?: string, + salutation?: string, firstName?: string, lastName?: string, companyName?: string, displayName: string, + website?: string, email?: string, workPhone?: string, personalPhone?: string, note?: string, - active: boolean, + active: boolean, } export interface IContactEditDTO { contactType?: string, + salutation?: string, firstName?: string, lastName?: string, companyName?: string, displayName: string, + website?: string, email?: string, workPhone?: string, personalPhone?: string, @@ -113,11 +119,13 @@ export interface ICustomerNewDTO extends IContactAddressDTO { openingBalance?: number, openingBalanceAt?: string, + salutation?: string, firstName?: string, lastName?: string, companyName?: string, displayName: string, + website?: string, email?: string, workPhone?: string, personalPhone?: string, @@ -128,11 +136,13 @@ export interface ICustomerNewDTO extends IContactAddressDTO { export interface ICustomerEditDTO extends IContactAddressDTO { customerType: string, + salutation?: string, firstName?: string, lastName?: string, companyName?: string, displayName: string, + website?: string, email?: string, workPhone?: string, personalPhone?: string, @@ -152,11 +162,13 @@ export interface IVendorNewDTO extends IContactAddressDTO { openingBalance?: number, openingBalanceAt?: string, + salutation?: string, firstName?: string, lastName?: string, companyName?: string, displayName: string, + website?: string, email?: string, workPhone?: string, personalPhone?: string, @@ -165,11 +177,13 @@ export interface IVendorNewDTO extends IContactAddressDTO { active?: boolean, }; export interface IVendorEditDTO extends IContactAddressDTO { + salutation?: string, firstName?: string, lastName?: string, companyName?: string, displayName?: string, + website?: string, email?: string, workPhone?: string, personalPhone?: string,