From 16c59310df31e8d8591ac1f0205ea4f1be4506c9 Mon Sep 17 00:00:00 2001 From: zichun Date: Thu, 9 Apr 2026 10:33:43 +0800 Subject: [PATCH] feat(ref-plugin): printing-shop plug-in Tier 1 customization of core entities --- reference-customer/plugin-printing-shop/src/main/resources/META-INF/vibe-erp/metadata/printing-shop.yml | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+), 0 deletions(-) diff --git a/reference-customer/plugin-printing-shop/src/main/resources/META-INF/vibe-erp/metadata/printing-shop.yml b/reference-customer/plugin-printing-shop/src/main/resources/META-INF/vibe-erp/metadata/printing-shop.yml index fd8b1e0..3e6c1fd 100644 --- a/reference-customer/plugin-printing-shop/src/main/resources/META-INF/vibe-erp/metadata/printing-shop.yml +++ b/reference-customer/plugin-printing-shop/src/main/resources/META-INF/vibe-erp/metadata/printing-shop.yml @@ -40,3 +40,73 @@ menus: icon: palette section: Printing shop order: 510 + +# ───────────────────────────────────────────────────────────────── +# Tier 1 customization of CORE entities by a plug-in. +# +# This is the framework's most important capability demonstration: a +# printing-shop customer plug-in extends core entities (Partner, Item, +# SalesOrder, WorkOrder) with printing-specific fields WITHOUT touching +# any core code. The MetadataLoader reads this section at plug-in load, +# inserts rows into metadata__custom_field tagged +# source='plugin:printing-shop', and CustomFieldRegistry merges them +# with the core declarations. ExtJsonValidator then enforces the +# merged set on every save. +# +# When the plug-in is UNINSTALLED, the loader removes the +# plugin:printing-shop rows and the fields disappear from the UI and +# from validation. No database migration, no code change, no restart +# of anything but the plug-in load/unload lifecycle. +# +# Naming convention for plug-in-contributed custom field keys: +# prefix with the plug-in id (printing_shop_*) so two independent +# plug-ins cannot collide on the same entity. +# ───────────────────────────────────────────────────────────────── +customFields: + # ── Partner: printing shops care about which kind of customer this + # is (agency, in-house marketing, direct end-client). This adds a + # dimension that the core framework doesn't know about. + - key: printing_shop_customer_segment + targetEntity: Partner + type: + kind: enum + allowedValues: + - agency + - in_house + - end_client + - reseller + required: false + pii: false + labelTranslations: + en: Customer segment + zh-CN: 客户细分 + + # ── SalesOrder: a printing shop sales rep tracks a quote number + # that originated in a pre-ERP quoting tool. Storing it as a + # free-form string on the order keeps the lineage traceable without + # forcing the shop to use the framework's (future) quoting PBC. + - key: printing_shop_quote_number + targetEntity: SalesOrder + type: + kind: string + maxLength: 32 + required: false + pii: false + labelTranslations: + en: Quote number + zh-CN: 报价单号 + + # ── WorkOrder: the press the job was scheduled on. Core production + # has no notion of "press" — that's printing-specific equipment. A + # future shop-floor scheduling plug-in could also reference this + # field. + - key: printing_shop_press_id + targetEntity: WorkOrder + type: + kind: string + maxLength: 32 + required: false + pii: false + labelTranslations: + en: Press + zh-CN: 印刷机 -- libgit2 0.22.2