Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.
TypeScript ai-agentsbill-of-materialserpinventory-managementleanmanufacturingmanufacturing-execution-systemmcp-servermesmrpopen-source-erppostgresqlproduction-planningqmsquality-management-systemreact-routerself-hostedsupabasetraceabilitytypescript
feat: remove address fields from Customer Contact and Supplier Contact
Rob Carrington9be7bb58aebb
diff --git a/apps/carbon/app/components/Contact.tsx b/apps/carbon/app/components/Contact.tsxindex 9384adbb92..547ca0f485 100644--- a/apps/carbon/app/components/Contact.tsx+++ b/apps/carbon/app/components/Contact.tsx@@ -58,7 +58,7 @@ const Contact = ({ contact, url, user, actions }: ContactProps) => {)}{userStatus === UserStatus.Inactive && (<span- title="Inctive"+ title="Inactive"className="inline-block red-400 rounded-full w-3 h-3 ml-1.5"/>)}diff --git a/apps/carbon/app/modules/purchasing/purchasing.service.ts b/apps/carbon/app/modules/purchasing/purchasing.service.tsindex bf4456a40f..5ade1af080 100644--- a/apps/carbon/app/modules/purchasing/purchasing.service.ts+++ b/apps/carbon/app/modules/purchasing/purchasing.service.ts@@ -235,7 +235,7 @@ export async function getSupplierContact(return client.from("supplierContact").select(- "*, contact(id, firstName, lastName, email, mobilePhone, homePhone, workPhone, fax, title, addressLine1, addressLine2, city, state, postalCode, country(id, name), birthday, notes)"+ "*, contact(id, firstName, lastName, email, mobilePhone, homePhone, workPhone, fax, title, notes)").eq("id", supplierContactId).single();@@ -248,7 +248,7 @@ export async function getSupplierContacts(return client.from("supplierContact").select(- "*, contact(id, firstName, lastName, email, mobilePhone, homePhone, workPhone, fax, title, addressLine1, addressLine2, city, state, postalCode, country(id, name), birthday, notes), user(id, active)"+ "*, contact(id, firstName, lastName, email, mobilePhone, homePhone, workPhone, fax, title, notes), user(id, active)").eq("supplierId", supplierId);}diff --git a/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierContactForm.tsx b/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierContactForm.tsxindex 735238720b..8c49a360ac 100644--- a/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierContactForm.tsx+++ b/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierContactForm.tsx@@ -17,7 +17,6 @@ import { useEffect } from "react";import type { z } from "zod";import {CustomFormFields,- DatePicker,Hidden,Input,PhoneInput,@@ -100,13 +99,6 @@ const SupplierContactForm = ({<PhoneInput name="homePhone" label="Home Phone" /><PhoneInput name="workPhone" label="Work Phone" /><PhoneInput name="fax" label="Fax" />- <Input name="addressLine1" label="Address Line 1" />- <Input name="addressLine2" label="Address Line 2" />- <Input name="city" label="City" />- <Input name="state" label="State" />- <Input name="postalCode" label="Zip Code" />- {/* Country dropdown */}- <DatePicker name="birthday" label="Birthday" /><TextArea name="notes" label="Notes" /><CustomFormFields table="supplierContact" /></VStack>diff --git a/apps/carbon/app/modules/sales/sales.service.ts b/apps/carbon/app/modules/sales/sales.service.tsindex ca86c12662..8696e684d0 100644--- a/apps/carbon/app/modules/sales/sales.service.ts+++ b/apps/carbon/app/modules/sales/sales.service.ts@@ -206,7 +206,7 @@ export async function getCustomerContact(return client.from("customerContact").select(- "*, contact(id, firstName, lastName, email, mobilePhone, homePhone, workPhone, fax, title, addressLine1, addressLine2, city, state, postalCode, country(id, name), birthday, notes)"+ "*, contact(id, firstName, lastName, email, mobilePhone, homePhone, workPhone, fax, title, notes)").eq("id", customerContactId).single();@@ -219,7 +219,7 @@ export async function getCustomerContacts(return client.from("customerContact").select(- "*, contact(id, firstName, lastName, email, mobilePhone, homePhone, workPhone, fax, title, addressLine1, addressLine2, city, state, postalCode, country(id, name), birthday, notes), user(id, active)"+ "*, contact(id, firstName, lastName, email, mobilePhone, homePhone, workPhone, fax, title, notes), user(id, active)").eq("customerId", customerId);}diff --git a/apps/carbon/app/modules/sales/ui/Customer/CustomerContactForm.tsx b/apps/carbon/app/modules/sales/ui/Customer/CustomerContactForm.tsxindex d8b900d4fa..90290d9b31 100644--- a/apps/carbon/app/modules/sales/ui/Customer/CustomerContactForm.tsx+++ b/apps/carbon/app/modules/sales/ui/Customer/CustomerContactForm.tsx@@ -14,7 +14,6 @@ import { useFetcher } from "@remix-run/react";import type { z } from "zod";import {CustomFormFields,- DatePicker,Hidden,Input,PhoneInput,@@ -89,13 +88,6 @@ const CustomerContactForm = ({<PhoneInput name="homePhone" label="Home Phone" /><PhoneInput name="workPhone" label="Work Phone" /><PhoneInput name="fax" label="Fax" />- <Input name="addressLine1" label="Address Line 1" />- <Input name="addressLine2" label="Address Line 2" />- <Input name="city" label="City" />- <Input name="state" label="State" />- <Input name="postalCode" label="Zip Code" />- {/* Country dropdown */}- <DatePicker name="birthday" label="Birthday" /><TextArea name="notes" label="Notes" /><CustomFormFields table="customerContact" /></VStack>diff --git a/apps/carbon/app/types/validators.ts b/apps/carbon/app/types/validators.tsindex 2450d6eda1..7eee8b4c06 100644--- a/apps/carbon/app/types/validators.ts+++ b/apps/carbon/app/types/validators.ts@@ -34,8 +34,6 @@ export const contact = {mobilePhone: zfd.text(z.string().optional()),homePhone: zfd.text(z.string().optional()),workPhone: zfd.text(z.string().optional()),- birthday: zfd.text(z.string().optional()),- ...address,};export const favoriteSchema = z.object({diff --git a/packages/database/src/types.ts b/packages/database/src/types.tsindex c575b13158..05a495755b 100644--- a/packages/database/src/types.ts+++ b/packages/database/src/types.ts@@ -2173,12 +2173,7 @@ export type Database = {}contact: {Row: {- addressLine1: string | null- addressLine2: string | null- birthday: string | null- city: string | nullcompanyId: string- countryCode: number | nullemail: stringfax: string | nullfirstName: string@@ -2188,18 +2183,11 @@ export type Database = {lastName: stringmobilePhone: string | nullnotes: string | null- postalCode: string | null- state: string | nulltitle: string | nullworkPhone: string | null}Insert: {- addressLine1?: string | null- addressLine2?: string | null- birthday?: string | null- city?: string | nullcompanyId: string- countryCode?: number | nullemail: stringfax?: string | nullfirstName: string@@ -2209,18 +2197,11 @@ export type Database = {lastName: stringmobilePhone?: string | nullnotes?: string | null- postalCode?: string | null- state?: string | nulltitle?: string | nullworkPhone?: string | null}Update: {- addressLine1?: string | null- addressLine2?: string | null- birthday?: string | null- city?: string | nullcompanyId?: string- countryCode?: number | nullemail?: stringfax?: string | nullfirstName?: string@@ -2230,8 +2211,6 @@ export type Database = {lastName?: stringmobilePhone?: string | nullnotes?: string | null- postalCode?: string | null- state?: string | nulltitle?: string | nullworkPhone?: string | null}@@ -2264,13 +2243,6 @@ export type Database = {referencedRelation: "integrations"referencedColumns: ["companyId"]},- {- foreignKeyName: "contact_countryCode_fkey"- columns: ["countryCode"]- isOneToOne: false- referencedRelation: "country"- referencedColumns: ["id"]- },]}contractor: {diff --git a/packages/database/supabase/functions/lib/types.ts b/packages/database/supabase/functions/lib/types.tsindex c575b13158..05a495755b 100644--- a/packages/database/supabase/functions/lib/types.ts+++ b/packages/database/supabase/functions/lib/types.ts@@ -2173,12 +2173,7 @@ export type Database = {}contact: {Row: {- addressLine1: string | null- addressLine2: string | null- birthday: string | null- city: string | nullcompanyId: string- countryCode: number | nullemail: stringfax: string | nullfirstName: string@@ -2188,18 +2183,11 @@ export type Database = {lastName: stringmobilePhone: string | nullnotes: string | null- postalCode: string | null- state: string | nulltitle: string | nullworkPhone: string | null}Insert: {- addressLine1?: string | null- addressLine2?: string | null- birthday?: string | null- city?: string | nullcompanyId: string- countryCode?: number | nullemail: stringfax?: string | nullfirstName: string@@ -2209,18 +2197,11 @@ export type Database = {lastName: stringmobilePhone?: string | nullnotes?: string | null- postalCode?: string | null- state?: string | nulltitle?: string | nullworkPhone?: string | null}Update: {- addressLine1?: string | null- addressLine2?: string | null- birthday?: string | null- city?: string | nullcompanyId?: string- countryCode?: number | nullemail?: stringfax?: string | nullfirstName?: string@@ -2230,8 +2211,6 @@ export type Database = {lastName?: stringmobilePhone?: string | nullnotes?: string | null- postalCode?: string | null- state?: string | nulltitle?: string | nullworkPhone?: string | null}@@ -2264,13 +2243,6 @@ export type Database = {referencedRelation: "integrations"referencedColumns: ["companyId"]},- {- foreignKeyName: "contact_countryCode_fkey"- columns: ["countryCode"]- isOneToOne: false- referencedRelation: "country"- referencedColumns: ["id"]- },]}contractor: {diff --git a/packages/database/supabase/migrations/20240813152858_remove-contact-address-fields.sql b/packages/database/supabase/migrations/20240813152858_remove-contact-address-fields.sqlnew file mode 100644index 0000000000..8cd584e24a--- /dev/null+++ b/packages/database/supabase/migrations/20240813152858_remove-contact-address-fields.sql@@ -0,0 +1,8 @@+ALTER TABLE "contact"+ DROP COLUMN "addressLine1",+ DROP COLUMN "addressLine2",+ DROP COLUMN "city",+ DROP COLUMN "state",+ DROP COLUMN "postalCode",+ DROP COLUMN "countryCode",+ DROP COLUMN "birthday";\ No newline at end of file