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(custom-fields): add a Link data type
Raul114ca9860d67
diff --git a/apps/erp/app/modules/people/types.ts b/apps/erp/app/modules/people/types.tsindex b248ea0132..a1b036b0ac 100644--- a/apps/erp/app/modules/people/types.ts+++ b/apps/erp/app/modules/people/types.ts@@ -36,6 +36,7 @@ export type AttributeDataType = {isList: boolean;isNumeric: boolean;isText: boolean;+ isLink: boolean;isUser: boolean;isCustomer: boolean;isSupplier: boolean;diff --git a/apps/erp/app/modules/shared/types.ts b/apps/erp/app/modules/shared/types.tsindex 2dc85a7beb..6ca6fff9d1 100644--- a/apps/erp/app/modules/shared/types.ts+++ b/apps/erp/app/modules/shared/types.ts@@ -50,7 +50,8 @@ export enum DataType {User = 6,Customer = 7,Supplier = 8,- File = 9+ File = 9,+ Link = 10}export type MethodItemType = (typeof methodItemType)[number];diff --git a/apps/erp/app/routes/api+/mcp+/lib/tool-manifest.digest.json b/apps/erp/app/routes/api+/mcp+/lib/tool-manifest.digest.jsonindex 191ab91754..46f6cb7469 100644--- a/apps/erp/app/routes/api+/mcp+/lib/tool-manifest.digest.json+++ b/apps/erp/app/routes/api+/mcp+/lib/tool-manifest.digest.json@@ -576,7 +576,7 @@{"name":"people_getAttribute","classification":"READ","paramCount":1,"schema":"437fb5c5c303","response":"9c635d811516","injectAuth":"companyId","permission":"people:view","paginates":false},{"name":"people_getAttributeCategories","classification":"READ","paramCount":1,"schema":"ed8b79d0644f","response":"64bbb296aaa1","injectAuth":"companyId","permission":"people:view","paginates":true,"defaults":"always"},{"name":"people_getAttributeCategory","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"a52b87433b3b","injectAuth":"companyId","permission":"people:view","paginates":false},- {"name":"people_getAttributeDataTypes","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"885ca485a3b9","injectAuth":"companyId","permission":"people:view","paginates":false},+ {"name":"people_getAttributeDataTypes","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"dd6f3a6f89d0","injectAuth":"companyId","permission":"people:view","paginates":false},{"name":"people_getClockedInEmployees","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"579660621675","injectAuth":"companyId","permission":"people:view","paginates":false},{"name":"people_getContacts","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"de41996ed14c","injectAuth":"companyId","permission":"people:view","paginates":true,"defaults":"always"},{"name":"people_getDepartment","classification":"READ","paramCount":1,"schema":"01883d2055a5","response":"10600fcaa49e","injectAuth":"companyId","permission":"people:view","paginates":false},diff --git a/packages/database/src/swagger-docs-schema.ts b/packages/database/src/swagger-docs-schema.tsindex 59290fbbe8..69a874d437 100644--- a/packages/database/src/swagger-docs-schema.ts+++ b/packages/database/src/swagger-docs-schema.ts@@ -73278,6 +73278,9 @@ export default {{$ref: "#/parameters/rowFilter.attributeDataType.isFile"},+ {+ $ref: "#/parameters/rowFilter.attributeDataType.isLink"+ },{$ref: "#/parameters/select"},@@ -73370,6 +73373,9 @@ export default {{$ref: "#/parameters/rowFilter.attributeDataType.isFile"},+ {+ $ref: "#/parameters/rowFilter.attributeDataType.isLink"+ },{$ref: "#/parameters/preferReturn"}@@ -73416,6 +73422,9 @@ export default {{$ref: "#/parameters/rowFilter.attributeDataType.isFile"},+ {+ $ref: "#/parameters/rowFilter.attributeDataType.isLink"+ },{$ref: "#/parameters/body.attributeDataType"},@@ -149155,7 +149164,8 @@ export default {"isUser","isCustomer","isSupplier",- "isFile"+ "isFile",+ "isLink"],properties: {id: {@@ -149211,6 +149221,11 @@ export default {default: false,format: "boolean",type: "boolean"+ },+ isLink: {+ default: false,+ format: "boolean",+ type: "boolean"}},type: "object"@@ -201652,6 +201667,12 @@ export default {in: "query",type: "string"},+ "rowFilter.attributeDataType.isLink": {+ name: "isLink",+ required: false,+ in: "query",+ type: "string"+ },"body.qualityDocuments": {name: "qualityDocuments",description: "qualityDocuments",diff --git a/packages/database/src/types.ts b/packages/database/src/types.tsindex 5dc5beb9f8..8a81d9eb40 100644--- a/packages/database/src/types.ts+++ b/packages/database/src/types.ts@@ -4858,6 +4858,7 @@ export type Database = {isCustomer: booleanisDate: booleanisFile: boolean+ isLink: booleanisList: booleanisNumeric: booleanisSupplier: boolean@@ -4871,6 +4872,7 @@ export type Database = {isCustomer?: booleanisDate?: booleanisFile?: boolean+ isLink?: booleanisList?: booleanisNumeric?: booleanisSupplier?: boolean@@ -4884,6 +4886,7 @@ export type Database = {isCustomer?: booleanisDate?: booleanisFile?: boolean+ isLink?: booleanisList?: booleanisNumeric?: booleanisSupplier?: booleandiff --git a/packages/database/supabase/migrations/20261009141827_link-custom-field-type.sql b/packages/database/supabase/migrations/20261009141827_link-custom-field-type.sqlnew file mode 100644index 0000000000..dd6cd15a45--- /dev/null+++ b/packages/database/supabase/migrations/20261009141827_link-custom-field-type.sql@@ -0,0 +1,29 @@+-- Link: a custom field whose value is a web address, shown as a clickable link.+ALTER TABLE "attributeDataType" ADD COLUMN "isLink" BOOLEAN NOT NULL DEFAULT false;++-- Exactly one flag per data type, now including isLink.+ALTER TABLE "attributeDataType" DROP CONSTRAINT "userAttributeDataType_singleDataType";++ALTER TABLE "attributeDataType" ADD CONSTRAINT "userAttributeDataType_singleDataType"+ CHECK (+ "isBoolean"::int ++ "isDate"::int ++ "isList"::int ++ "isNumeric"::int ++ "isText"::int ++ "isUser"::int ++ "isCustomer"::int ++ "isSupplier"::int ++ "isFile"::int ++ "isLink"::int = 1+ );++-- The app's DataType enum names ids, so the row takes its id explicitly rather+-- than whatever the sequence hands out next.+INSERT INTO "attributeDataType" ("id", "label", "isLink")+VALUES (10, 'Link', true);++SELECT setval(+ pg_get_serial_sequence('"attributeDataType"', 'id'),+ (SELECT MAX("id") FROM "attributeDataType")+);diff --git a/packages/ee/src/workflows/catalog/custom-fields.test.ts b/packages/ee/src/workflows/catalog/custom-fields.test.tsindex c6810d39fb..e2bfffb107 100644--- a/packages/ee/src/workflows/catalog/custom-fields.test.ts+++ b/packages/ee/src/workflows/catalog/custom-fields.test.ts@@ -44,7 +44,9 @@ describe("buildCatalogOverlay", () => {[7, t.entity("customer")],[8, t.entity("supplier")],// A File field is the stored path — printable, not a link.- [9, t.string]+ [9, t.string],+ // A Link field is the web address as stored.+ [10, t.string]];for (const [dataTypeId, expected] of cases) {const overlay = buildCatalogOverlay([field({ dataTypeId })]);diff --git a/packages/ee/src/workflows/catalog/custom-fields.ts b/packages/ee/src/workflows/catalog/custom-fields.tsindex c3edc19b4b..d4f729e9ce 100644--- a/packages/ee/src/workflows/catalog/custom-fields.ts+++ b/packages/ee/src/workflows/catalog/custom-fields.ts@@ -62,7 +62,7 @@ export const ENTITY_BY_TABLE: Record<string, string> = Object.fromEntries(/*** The ONE place `DataType` (`apps/erp/app/modules/shared/types.ts`) maps to a `ValueType`.* A File field is exposed as the stored path — comparable and printable, but not a link- * and not a record to drill into.+ * and not a record to drill into. A Link field is the web address as stored.*/function valueTypeFor(dataTypeId: number): ValueType | undefined {switch (dataTypeId) {@@ -86,6 +86,9 @@ function valueTypeFor(dataTypeId: number): ValueType | undefined {// File: the stored path.case 9:return t.string;+ // Link: the web address as stored.+ case 10:+ return t.string;default:return undefined;}diff --git a/packages/jobs/manifests/schema.json b/packages/jobs/manifests/schema.jsonindex 88988a7bec..f6eb0262f4 100644--- a/packages/jobs/manifests/schema.json+++ b/packages/jobs/manifests/schema.json@@ -1,11 +1,11 @@{"kind": "carbon-company-backup","version": 1,- "schemaVersion": "20261008163615",+ "schemaVersion": "20261009141827","sourceCompanyId": "schema-baseline","sourceCompanyGroupId": null,"sourceCompanyName": null,- "exportedAt": "2026-10-08T18:09:13.590Z",+ "exportedAt": "2026-10-09T07:45:39.064Z","exportedBy": "schema-baseline","label": "schema baseline","includeStorage": "none",@@ -6365,7 +6365,13 @@"createdBy","createdAt","updatedAt",- "updatedBy"+ "updatedBy",+ "rentalAgreementLineId",+ "meter",+ "notes",+ "takeOutOfService",+ "outOfServiceReason",+ "residualDestination"]},{@@ -6664,7 +6670,9 @@"createdBy","createdAt","updatedAt",- "updatedBy"+ "updatedBy",+ "rentalAgreementLineId",+ "meter"]},{diff --git a/packages/locale/locales/de/erp.po b/packages/locale/locales/de/erp.poindex e5d6f5f420..b131ce871f 100644--- a/packages/locale/locales/de/erp.po+++ b/packages/locale/locales/de/erp.po@@ -8329,6 +8329,9 @@ msgstr "Geben Sie eine Menge zwischen 1 und {0} ein."msgid "Enter a reason to take the unit out of service"msgstr "Geben Sie einen Grund an, um die Einheit außer Betrieb zu nehmen"+msgid "Enter a web address, such as https://example.com"+msgstr "Geben Sie eine Webadresse ein, z. B. https://example.com"+msgid "Enter an item and quantity yourself."msgstr "Geben Sie einen Artikel und eine Menge selbst ein."diff --git a/packages/locale/locales/en/erp.po b/packages/locale/locales/en/erp.poindex e0f6925bb7..b24f08fdc5 100644--- a/packages/locale/locales/en/erp.po+++ b/packages/locale/locales/en/erp.po@@ -8329,6 +8329,9 @@ msgstr "Enter a quantity between 1 and {0}."msgid "Enter a reason to take the unit out of service"msgstr "Enter a reason to take the unit out of service"+msgid "Enter a web address, such as https://example.com"+msgstr "Enter a web address, such as https://example.com"+msgid "Enter an item and quantity yourself."msgstr "Enter an item and quantity yourself."diff --git a/packages/locale/locales/es/erp.po b/packages/locale/locales/es/erp.poindex dbab0129cd..e1dab29e2d 100644--- a/packages/locale/locales/es/erp.po+++ b/packages/locale/locales/es/erp.po@@ -8329,6 +8329,9 @@ msgstr "Ingrese una cantidad entre 1 y {0}."msgid "Enter a reason to take the unit out of service"msgstr "Ingrese una razón para retirar la unidad del servicio"+msgid "Enter a web address, such as https://example.com"+msgstr "Ingrese una dirección web, por ejemplo https://example.com"+msgid "Enter an item and quantity yourself."msgstr "Ingrese un artículo y cantidad usted mismo."diff --git a/packages/locale/locales/fr/erp.po b/packages/locale/locales/fr/erp.poindex a9a10b02d8..b723e5ec66 100644--- a/packages/locale/locales/fr/erp.po+++ b/packages/locale/locales/fr/erp.po@@ -8329,6 +8329,9 @@ msgstr "Entrez une quantité entre 1 et {0}."msgid "Enter a reason to take the unit out of service"msgstr "Entrez une raison pour retirer l'unité du service"+msgid "Enter a web address, such as https://example.com"+msgstr "Entrez une adresse web, par exemple https://example.com"+msgid "Enter an item and quantity yourself."msgstr "Entrez un article et une quantité vous-même."diff --git a/packages/locale/locales/hi/erp.po b/packages/locale/locales/hi/erp.poindex 5b8227c804..eb404045be 100644--- a/packages/locale/locales/hi/erp.po+++ b/packages/locale/locales/hi/erp.po@@ -8329,6 +8329,9 @@ msgstr "1 और {0} के बीच मात्रा दर्ज करेmsgid "Enter a reason to take the unit out of service"msgstr "इकाई को सेवा से बाहर निकालने का कारण दर्ज करें"+msgid "Enter a web address, such as https://example.com"+msgstr "वेब पता दर्ज करें, जैसे https://example.com"+msgid "Enter an item and quantity yourself."msgstr "आइटम और मात्रा स्वयं दर्ज करें।"diff --git a/packages/locale/locales/it/erp.po b/packages/locale/locales/it/erp.poindex 616fa060ae..494ba8a03f 100644--- a/packages/locale/locales/it/erp.po+++ b/packages/locale/locales/it/erp.po@@ -8329,6 +8329,9 @@ msgstr "Inserisci una quantità tra 1 e {0}."msgid "Enter a reason to take the unit out of service"msgstr "Inserisci un motivo per mettere l'unità fuori servizio"+msgid "Enter a web address, such as https://example.com"+msgstr "Inserisci un indirizzo web, ad esempio https://example.com"+msgid "Enter an item and quantity yourself."msgstr "Inserisci un articolo e una quantità tu stesso."diff --git a/packages/locale/locales/ja/erp.po b/packages/locale/locales/ja/erp.poindex 3151bccdc6..7d3ec52ffd 100644--- a/packages/locale/locales/ja/erp.po+++ b/packages/locale/locales/ja/erp.po@@ -8329,6 +8329,9 @@ msgstr "1~{0}の数量を入力してください。"msgid "Enter a reason to take the unit out of service"msgstr "ユニットを使用停止にする理由を入力"+msgid "Enter a web address, such as https://example.com"+msgstr "Webアドレスを入力してください(例: https://example.com)"+msgid "Enter an item and quantity yourself."msgstr "品目と数量を手動で入力してください。"diff --git a/packages/locale/locales/ko/erp.po b/packages/locale/locales/ko/erp.poindex 65ce3ad4a4..75ee1c5a45 100644--- a/packages/locale/locales/ko/erp.po+++ b/packages/locale/locales/ko/erp.po@@ -8329,6 +8329,9 @@ msgstr "1과 {0} 사이의 수량을 입력하세요."msgid "Enter a reason to take the unit out of service"msgstr "장비를 운영 중단하는 이유를 입력하세요"+msgid "Enter a web address, such as https://example.com"+msgstr "웹 주소를 입력하세요(예: https://example.com)"+msgid "Enter an item and quantity yourself."msgstr "품목과 수량을 직접 입력하세요."diff --git a/packages/locale/locales/pl/erp.po b/packages/locale/locales/pl/erp.poindex 72ccaed99d..ecb142cff6 100644--- a/packages/locale/locales/pl/erp.po+++ b/packages/locale/locales/pl/erp.po@@ -8329,6 +8329,9 @@ msgstr "Wprowadź ilość między 1 a {0}."msgid "Enter a reason to take the unit out of service"msgstr "Podaj powód wycofania jednostki z eksploatacji"+msgid "Enter a web address, such as https://example.com"+msgstr "Wprowadź adres internetowy, np. https://example.com"+msgid "Enter an item and quantity yourself."msgstr "Wpisz artykuł i ilość samodzielnie."diff --git a/packages/locale/locales/pt/erp.po b/packages/locale/locales/pt/erp.poindex c22c93f1d4..e3a063f040 100644--- a/packages/locale/locales/pt/erp.po+++ b/packages/locale/locales/pt/erp.po@@ -8329,6 +8329,9 @@ msgstr "Digite uma quantidade entre 1 e {0}."msgid "Enter a reason to take the unit out of service"msgstr "Digite um motivo para remover a unidade do serviço"+msgid "Enter a web address, such as https://example.com"+msgstr "Insira um endereço web, por exemplo https://example.com"+msgid "Enter an item and quantity yourself."msgstr "Digite um item e quantidade você mesmo."diff --git a/packages/locale/locales/ru/erp.po b/packages/locale/locales/ru/erp.poindex 70f8a36e01..82f88677b3 100644--- a/packages/locale/locales/ru/erp.po+++ b/packages/locale/locales/ru/erp.po@@ -8329,6 +8329,9 @@ msgstr "Введите количество от 1 до {0}."msgid "Enter a reason to take the unit out of service"msgstr "Введите причину вывода единицы из эксплуатации"+msgid "Enter a web address, such as https://example.com"+msgstr "Введите веб-адрес, например https://example.com"+msgid "Enter an item and quantity yourself."msgstr "Введите номенклатуру и количество самостоятельно."diff --git a/packages/locale/locales/tr/erp.po b/packages/locale/locales/tr/erp.poindex aa4d3ab6ef..bb82a3dbbe 100644--- a/packages/locale/locales/tr/erp.po+++ b/packages/locale/locales/tr/erp.po@@ -8329,6 +8329,9 @@ msgstr "1 ile {0} arasında bir miktar girin."msgid "Enter a reason to take the unit out of service"msgstr "Üniteyi hizmet dışı bırakmak için bir neden girin"+msgid "Enter a web address, such as https://example.com"+msgstr "Bir web adresi girin, örneğin https://example.com"+msgid "Enter an item and quantity yourself."msgstr "Bir stok kartı ve miktar kendiniz girin."diff --git a/packages/locale/locales/zh/erp.po b/packages/locale/locales/zh/erp.poindex a2c35f0f18..d4e8292f3c 100644--- a/packages/locale/locales/zh/erp.po+++ b/packages/locale/locales/zh/erp.po@@ -8329,6 +8329,9 @@ msgstr "请输入 1 至 {0} 之间的数量。"msgid "Enter a reason to take the unit out of service"msgstr "输入停用该设备的原因"+msgid "Enter a web address, such as https://example.com"+msgstr "请输入网址,例如 https://example.com"+msgid "Enter an item and quantity yourself."msgstr "自己输入物料和数量。"