Skip to content

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.

feat(erp): Change Notices - rename, Implementation lock with reopen, and Linear task links (#1248)

Anshul sharmabc6978458d3b
diff --git a/.ai/plans/2026-07-28-change-notice-code-rename.md b/.ai/plans/2026-07-28-change-notice-code-rename.md
new file mode 100644
index 0000000000..47166c6eaa
--- /dev/null
+++ b/.ai/plans/2026-07-28-change-notice-code-rename.md
@@ -0,0 +1,417 @@
+
+# Change Notice code-layer rename — implementation plan
+
+**Spec:** none — explicit user decision (see Scope below)
+**Branch:** new branch off `feat/change-orders-iteration` (or off `main` once that merges)
+
+## Scope decision (already made — do not re-litigate)
+
+The feature was renamed "Change Order" → "Change Notice" for users in an earlier PR.
+This plan renames the **TypeScript layer only** so the code matches what users see.
+
+**RENAME:** exported functions, consts, validators, types, React components, file and
+directory names, local variables, props, and import paths.
+
+**DO NOT RENAME — this is the whole risk of the task:**
+
+1. **Database table names** in query strings: `changeOrder`, `changeOrders` (view),
+ `changeOrderType`, `changeOrderAffectedItem`, `changeOrderActionTask`,
+ `changeOrderRequiredAction`, `changeOrderSupersession`. These appear as
+ `.from("changeOrder")` etc.
+2. **Database column names** in query strings and object literals sent to the DB:
+ `changeOrderId`, `changeOrderTypeId`. A local variable *named* `changeOrderId` may be
+ renamed, but the object KEY in an insert/update/select and the string in `.eq("changeOrderId", …)`
+ must not.
+3. **Database enum type names**: `Database["public"]["Enums"]["changeOrderStatus"]`,
+ `changeOrderTaskStatus`, `changeOrderChangeType`.
+4. **Stored data values** — strings persisted in rows, not identifiers. Chiefly
+ `"changeOrderActionTask"` used as `externalIntegrationMapping.entityType` (36 occurrences).
+ Renaming these orphans every existing row. Also `sequence.table = 'changeOrder'` and the
+ `audit.config.ts` entity key + `tables:` keys.
+5. **Migrations** under `packages/database/supabase/migrations/` — never edit applied migrations.
+6. **Generated files**: `packages/database/src/types.ts`, `swagger-docs-schema.ts`,
+ `supabase/functions/lib/types.ts`, `apps/erp/app/routes/api+/mcp+/lib/tool-metadata.json`,
+ `apps/erp/app/modules/agent/kb/**`.
+7. **Glossary term ids**: `termId="change-order"`, `termId="change-order-change-type"`.
+8. **URL slugs already shipped**: the redirect shims under `routes/x+/items+/change-order*`
+ and docs URLs `/docs/reference/change-orders/...`, `/guides/change-order`.
+
+**Safety net:** Supabase's generated types make table and column names *literal* types, so
+renaming one of those strings by mistake fails `typecheck` loudly. The dangerous cases are the
+ones typecheck CANNOT catch: item 4 (plain strings) and item 7. Those must be checked by grep,
+not by the compiler.
+
+## Progress
+- [x] Task 1: Create the branch and record the pre-rename baseline
+- [x] Task 2: Rename the models layer (`items.models.ts`)
+- [x] Task 3: Rename the service + server layer
+- [x] Task 4: Rename the UI directories and component files
+- [x] Task 5: Rename component identifiers, props and local variables
+- [x] Task 6: Rename route file-internal identifiers and remaining call sites
+- [x] Task 7: Audit the do-not-rename list
+- [ ] Task 8: Full verification + browser check
+
+## Dependencies
+
+Tasks 2 → 3 → 4 → 5 → 6 run **strictly in order**: each one leaves the tree failing
+typecheck for the next to fix, and that failure list is the checklist. Do not parallelize.
+Task 7 needs 2–6. Task 8 needs everything.
+
+## Conventions that apply throughout
+
+- `pnpm` only, never `npm`.
+- ERP typecheck filter is **`erp`**, not `@carbon/erp` — the wrong filter silently passes.
+- Whole-repo typecheck OOMs. Always scope with `--filter`.
+- After any turbo run, `git status` and revert unintended regeneration under
+ `packages/database/`.
+- This is a **pure rename**. No behaviour change, no logic change, no reformatting beyond what
+ Biome does automatically. If you find yourself "improving" something, stop — it belongs in a
+ different PR and it destroys this PR's reviewability.
+- Commit after each task so a bad step can be reverted in isolation.
+
+---
+
+## Task 1: Create the branch and record the pre-rename baseline
+
+**Depends on:** none
+**Files:** none (git + a scratch file)
+
+**Steps:**
+
+1. Branch from the current head:
+ ```bash
+ git checkout -b refactor/change-notice-code-rename
+ ```
+2. Record the baseline so Task 8 can prove nothing changed behaviourally:
+ ```bash
+ pnpm exec turbo run typecheck --filter=erp --filter=@carbon/ee --filter=@carbon/jobs
+ pnpm run lint 2>&1 | grep -E "Found .* warnings" | tee /tmp/rename-baseline-lint.txt
+ pnpm run test 2>&1 | grep -E "Tasks:" | tee /tmp/rename-baseline-test.txt
+ ```
+3. Record the counts that must go to zero (identifiers) and the counts that must NOT change
+ (DB strings):
+ ```bash
+ grep -rl "changeOrder\|ChangeOrder" apps packages --include=*.ts --include=*.tsx | wc -l
+ grep -ro '\.from("changeOrder[A-Za-z]*")' apps packages --include=*.ts --include=*.tsx | wc -l
+ grep -ro '"changeOrderActionTask"' apps packages --include=*.ts --include=*.tsx | wc -l
+ ```
+ Write all three numbers into the plan file under this task before continuing.
+
+**Baseline recorded 2026-07-28** (branch cut from `feat/change-orders-iteration` @ `8ba77e911`):
+
+| Measure | Baseline | After the rename |
+|---|---|---|
+| Files containing `changeOrder`/`ChangeOrder` | 103 | must drop sharply |
+| `.from("changeOrder*")` DB strings | 49 | **must stay 49** |
+| `"changeOrderActionTask"` stored values | 36 | **must stay 36** |
+| `eq("changeOrderId"` DB filters | 8 | **must stay 8** |
+| `termId="change-order*"` glossary ids | 3 | **must stay 3** |
+| Lint warnings | 16 | must stay 16 |
+
+**Verify:**
+```bash
+git branch --show-current
+# Expected: refactor/change-notice-code-rename
+```
+
+**Out of scope:** any code change.
+
+---
+
+## Task 2: Rename the models layer
+
+**Depends on:** Task 1
+**Files:**
+- Modify: `apps/erp/app/modules/items/items.models.ts`
+
+**Steps:**
+
+1. Rename these exported identifiers (left → right). This is the complete list; if you find one
+ not on it, add it and say so in your report:
+
+ | Old | New |
+ | -------------------------------------------- | --------------------------------------------- |
+ | `changeOrderStatus` | `changeNoticeStatus` |
+ | `changeOrderStatusTransitions` | `changeNoticeStatusTransitions` |
+ | `changeOrderStatusValidator` | `changeNoticeStatusValidator` |
+ | `changeOrderOpenStatuses` | `changeNoticeOpenStatuses` |
+ | `changeOrderBroadcastStages` | `changeNoticeBroadcastStages` |
+ | `changeOrderChangeTypes` | `changeNoticeChangeTypes` |
+ | `changeOrderPriority` | `changeNoticePriority` |
+ | `changeOrderTaskStatus` | `changeNoticeTaskStatus` |
+ | `changeOrderType` | `changeNoticeType` |
+ | `changeOrderValidator` | `changeNoticeValidator` |
+ | `changeOrderTypeValidator` | `changeNoticeTypeValidator` |
+ | `changeOrderRequiredActionValidator` | `changeNoticeRequiredActionValidator` |
+ | `changeOrderActionStatusValidator` | `changeNoticeActionStatusValidator` |
+ | `changeOrderAffectedItemValidator` | `changeNoticeAffectedItemValidator` |
+ | `changeOrderAffectedItemChangeTypeValidator` | `changeNoticeAffectedItemChangeTypeValidator` |
+ | `changeOrderAffectedItemCutoverValidator` | `changeNoticeAffectedItemCutoverValidator` |
+ | `changeOrderNewPartValidator` | `changeNoticeNewPartValidator` |
+ | `changeOrderStageFlow` | `changeNoticeStageFlow` |
+ | `isChangeOrderLocked` | `isChangeNoticeLocked` |
+ | `isAllowedChangeOrderTransition` | `isAllowedChangeNoticeTransition` |
+ | `canEditChangeOrderEngineering` | `canEditChangeNoticeEngineering` |
+ | `canEditChangeOrderWorkflow` | `canEditChangeNoticeWorkflow` |
+ | `changeOrderLockedMessage` | `changeNoticeLockedMessage` |
+
+2. **`changeOrderStatus` is the dangerous one.** It is BOTH a TS const being renamed AND a
+ Postgres enum name. Anywhere the file references the DB enum type — e.g.
+ `Database["public"]["Enums"]["changeOrderStatus"]` — the **string inside the brackets must
+ stay `changeOrderStatus`**. Same for `changeOrderTaskStatus` and `changeOrderChangeType`.
+ Check every occurrence individually; do not sed this one.
+3. Likewise `changeOrderType` is both a TS const and a DB table name. The const renames; any
+ `.from("changeOrderType")` does not.
+4. Do NOT touch zod field names that map to DB columns (e.g. a validator field literally named
+ `changeOrderId` that is submitted as form data and written to that column).
+
+**Verify:**
+```bash
+pnpm exec turbo run typecheck --filter=erp 2>&1 | grep -c "error TS"
+# Expected: a NON-ZERO number — every consumer of the renamed exports now fails.
+# That failure list is the work inventory for Tasks 3-6. Record the count.
+grep -n 'Enums\["changeOrder' apps/erp/app/modules/items/items.models.ts
+# Expected: the DB enum references are still spelled changeOrder*.
+```
+
+**Out of scope:** every file other than `items.models.ts`. Do not start fixing the consumers yet.
+
+---
+
+## Task 3: Rename the service + server layer
+
+**Depends on:** Task 2
+**Files:**
+- Modify: `apps/erp/app/modules/items/items.service.ts`
+- Modify: `apps/erp/app/modules/items/items.server.ts`
+- Modify: `apps/erp/app/modules/items/types.ts`
+
+**Steps:**
+
+1. Update every import of the Task 2 identifiers.
+2. Rename these exported functions (`ChangeOrder` → `ChangeNotice` in each name):
+ `getChangeOrder`, `getChangeOrders`, `insertChangeOrder`, `updateChangeOrder`,
+ `deleteChangeOrder`, `updateChangeOrderStatus`, `applyChangeOrder`,
+ `getChangeOrderActions`, `setChangeOrderActionTasks`, `updateChangeOrderActionOrder`,
+ `updateChangeOrderActionStatus`, `deleteChangeOrderAction`,
+ `getChangeOrderAffectedItems`, `addChangeOrderAffectedItem`,
+ `removeChangeOrderAffectedItem`, `updateChangeOrderAffectedItemChangeType`,
+ `updateChangeOrderAffectedItemCutover`, `createChangeOrderDraftMethod`,
+ `getChangeOrderDiff`, `getChangeOrderType`, `getChangeOrderTypes`,
+ `getChangeOrderTypesList`, `upsertChangeOrderType`, `deleteChangeOrderType`,
+ `getChangeOrderRequiredAction`, `getChangeOrderRequiredActions`,
+ `getChangeOrderRequiredActionsList`, `upsertChangeOrderRequiredAction`,
+ `deleteChangeOrderRequiredAction`, `seedDefaultChangeOrderActions`,
+ `findChangeOrdersForItem`, `findOtherOpenChangeOrdersForItem`,
+ `getChangeOrdersForNonConformance`, `getItemChangeOrderData`,
+ `notifyChangeOrderTransition`, `changeOrderStageEvent`,
+ `requireChangeOrderEditable`, `requireEditableChangeOrderRoute`,
+ `requireChangeOrderChildRoute`.
+3. Rename exported types in `types.ts`: `ChangeOrder` → `ChangeNotice`,
+ `ChangeOrderListItem` → `ChangeNoticeListItem`, `ChangeOrderActionTask` →
+ `ChangeNoticeActionTask`, `ChangeOrderAffectedItem*` → `ChangeNoticeAffectedItem*`, and any
+ sibling type carrying the name.
+4. **Every `.from("…")`, `.eq("changeOrderId", …)`, `.select("changeOrderId, …")` and every
+ object key written to the database stays exactly as it is.** Rename the surrounding
+ function and variable names only.
+5. Local variables and parameters named `changeOrderId` may become `changeNoticeId`, but where
+ that variable is used as a DB object key you must write it explicitly, e.g.
+ `{ changeOrderId: changeNoticeId }`. Do not rely on shorthand property names.
+
+**Verify:**
+```bash
+pnpm exec turbo run typecheck --filter=erp 2>&1 | grep "error TS" | grep -c "items.service.ts\|items.server.ts\|items/types.ts"
+# Expected: 0 — these three files are internally consistent. Errors remain elsewhere.
+grep -c 'from("changeOrder' apps/erp/app/modules/items/items.service.ts
+# Expected: unchanged from the Task 1 baseline for this file.
+```
+
+**Out of scope:** UI components, routes.
+
+---
+
+## Task 4: Rename the UI directories and component files
+
+**Depends on:** Task 3
+**Files:**
+- Rename: `apps/erp/app/modules/items/ui/ChangeOrder/` → `ui/ChangeNotice/`
+- Rename: `apps/erp/app/modules/items/ui/ChangeOrderTypes/` → `ui/ChangeNoticeTypes/`
+- Rename: `apps/erp/app/modules/items/ui/ChangeOrderActions/` → `ui/ChangeNoticeActions/`
+- Rename: the 29 files whose names start `ChangeOrder`
+
+**Steps:**
+
+1. Use `git mv` for every directory and file so history is preserved:
+ ```bash
+ git mv apps/erp/app/modules/items/ui/ChangeOrder apps/erp/app/modules/items/ui/ChangeNotice
+ ```
+ then each file, e.g. `ChangeOrderHeader.tsx` → `ChangeNoticeHeader.tsx`.
+2. List the files first and rename them one by one; do not glob-rename blind:
+ ```bash
+ find apps packages -name "ChangeOrder*" -o -name "changeOrder*"
+ ```
+3. Update the barrel `apps/erp/app/modules/items/ui/ChangeNotice/index.ts` and every import
+ path that referenced the old directory or filename.
+4. Files whose name contains `ChangeOrder` but which are NOT part of this feature's UI (e.g.
+ `packages/documents/src/email/previews/ChangeOrderStarted.tsx`) — rename them too for
+ consistency, but check first that nothing imports them by a path built at runtime.
+
+**Verify:**
+```bash
+find apps packages -name "ChangeOrder*" -o -name "changeOrder*" | grep -v node_modules
+# Expected: no output.
+pnpm exec turbo run typecheck --filter=erp 2>&1 | grep -c "Cannot find module"
+# Expected: 0 — every import path resolves.
+```
+
+**Out of scope:** the migrations directory; the agent KB; anything under `docs/`.
+
+---
+
+## Task 5: Rename component identifiers, props and local variables
+
+**Depends on:** Task 4
+**Files:**
+- Modify: every file under `apps/erp/app/modules/items/ui/ChangeNotice*/`
+- Modify: the consumers the typecheck flags
+
+**Steps:**
+
+1. Rename the React component names to match their new filenames (`ChangeOrderHeader` →
+ `ChangeNoticeHeader`, and so on for all 29).
+2. Rename props, local state and helper functions inside those files.
+3. Fix every consumer the typecheck flags, including `ItemChangeOrders.tsx` →
+ `ItemChangeNotices.tsx`, `ItemOpenChangeOrderAlert.tsx`, `ItemChangeOrderLock.tsx`,
+ `CreateChangeOrderModal.tsx`, and the cross-module callers in
+ `modules/quality/ui/Issue/`, `modules/items/ui/Parts/`, `modules/items/ui/Tools/`,
+ `modules/items/ui/Item/MakeMethodTools.tsx`.
+4. `useRouteData<{ changeOrder: ChangeNotice }>(...)` — the KEY `changeOrder` here is the
+ loader's return-object key, not a DB column. Rename it, but rename it in the loader at the
+ same time or the lookup silently returns `undefined` at runtime. **Typecheck will not
+ always catch this.** Grep for `changeOrder:` object keys in loaders and their readers and
+ change them as a matched pair.
+
+**Verify:**
+```bash
+pnpm exec turbo run typecheck --filter=erp
+# Expected: clean.
+grep -rn "changeOrder:" apps/erp/app/routes/x+/items+/change-notice+/ apps/erp/app/modules/items/ui/ChangeNotice/
+# Expected: no output — loader keys and their readers renamed together.
+```
+
+**Out of scope:** DB strings.
+
+---
+
+## Task 6: Rename route file-internal identifiers and remaining call sites
+
+**Depends on:** Task 5
+**Files:**
+- Modify: every file under `apps/erp/app/routes/x+/items+/change-notice+/`,
+ `change-notices+/`, `x+/change-notice+/`, the flat `change-notice-types.*` /
+ `change-notice-actions.*` files
+- Modify: `packages/ee/src/lib/actionTaskEntity.ts`, `packages/jobs/src/inngest/functions/**`,
+ `packages/notifications/src/index.ts` — identifiers only
+
+**Steps:**
+
+1. Rename local variables, imported identifiers and helper functions inside the route files.
+2. **Route FILE names stay as they are** — they were already renamed to `change-notice` in the
+ previous PR and they determine the URL.
+3. In `packages/ee/src/lib/actionTaskEntity.ts`: the type `ActionTaskEntityType` and the map key
+ `changeOrderActionTask` are **stored data values** — do NOT rename them. Only rename
+ surrounding local identifiers if any.
+4. Sweep for any straggler:
+ ```bash
+ grep -rn "changeOrder\|ChangeOrder" apps packages --include=*.ts --include=*.tsx \
+ | grep -v node_modules | grep -v "packages/database/src/types.ts"
+ ```
+ Every remaining hit must be justifiable against the do-not-rename list. Put the surviving
+ list in your report grouped by reason.
+
+**Verify:**
+```bash
+pnpm exec turbo run typecheck --filter=erp --filter=@carbon/ee --filter=@carbon/jobs
+# Expected: clean.
+pnpm run lint
+# Expected: same warning count as /tmp/rename-baseline-lint.txt.
+```
+
+**Out of scope:** behaviour changes of any kind.
+
+---
+
+## Task 7: Audit the do-not-rename list
+
+**Depends on:** Tasks 2–6
+**Files:** none (verification only)
+
+**Steps:**
+
+1. Confirm the DB-bound strings are untouched, comparing to the Task 1 baseline numbers:
+ ```bash
+ grep -ro '\.from("changeOrder[A-Za-z]*")' apps packages --include=*.ts --include=*.tsx | wc -l
+ grep -ro '"changeOrderActionTask"' apps packages --include=*.ts --include=*.tsx | wc -l
+ grep -rn 'eq("changeOrderId"' apps packages --include=*.ts --include=*.tsx | wc -l
+ ```
+ All three must EQUAL the Task 1 baseline. A drop means a DB string was renamed — find it and
+ restore it before continuing.
+2. Confirm no migration was edited:
+ ```bash
+ git diff --name-only main...HEAD -- packages/database/supabase/migrations
+ # Expected: no output.
+ ```
+3. Confirm generated files were not hand-edited:
+ ```bash
+ git diff --name-only main...HEAD -- packages/database/src/types.ts packages/database/src/swagger-docs-schema.ts
+ # Expected: no output.
+ ```
+4. Confirm the glossary term ids survive:
+ ```bash
+ grep -rn 'termId="change-order' apps/erp/app | wc -l
+ # Expected: unchanged from baseline.
+ ```
+5. Confirm the sequence table value survives:
+ ```bash
+ grep -rn "'changeOrder'" packages/database/supabase/functions/lib/seed.data.ts
+ # Expected: the sequence entry still has table: "changeOrder".
+ ```
+
+**If ANY of these fails, STOP and report — do not improvise a fix.**
+
+**Out of scope:** everything else.
+
+---
+
+## Task 8: Full verification + browser check
+
+**Depends on:** all
+**Files:** none
+
+**Steps:**
+
+1. Full gate:
+ ```bash
+ pnpm exec turbo run typecheck --filter=erp --filter=@carbon/ee --filter=@carbon/jobs
+ pnpm run lint
+ pnpm run test
+ pnpm run build:erp
+ ```
+ Every result must match the Task 1 baseline. `build:erp` must exit 0.
+2. Confirm translations are untouched — this is a code rename, so the `.po` files must not
+ change:
+ ```bash
+ git diff --name-only main...HEAD -- packages/locale
+ # Expected: no output. If .po files changed, a user-visible string was renamed by mistake.
+ ```
+3. Browser verification via the `/test` skill. Because this is a pure rename, the check is that
+ nothing changed:
+ - the Change Notices list loads and shows existing records
+ - opening one shows its affected items, BOM/BOP, and action tasks
+ - adding an affected item still works
+ - advancing a stage still works, and the Implementation lock still locks
+ - an old `/x/items/change-order/{id}/details` link still redirects
+4. Report which flows you exercised and their result. Do not claim success for a flow you did
+ not run.
+
+**Out of scope:** fixing anything you find that is unrelated to the rename — report it instead.
diff --git a/apps/academy/app/config.tsx b/apps/academy/app/config.tsx
index df7bf31433..adeb9a2716 100644
--- a/apps/academy/app/config.tsx
+++ b/apps/academy/app/config.tsx
@@ -528,9 +528,9 @@ export const modules: Config = [
id: "engineering-change-orders",
loomUrl:
"https://www.loom.com/share/0aa0ab77ef014a52a3c617ff0939d4a2",
- name: "Engineering Change Orders",
+ name: "Change Notices",
description:
- "Learn how to use engineering change orders to manage and track changes to items, methods, and bills in a controlled, auditable way.",
+ "Learn how to use engineering change notices to manage and track changes to items, methods, and bills in a controlled, auditable way.",
duration: 260
}
],
diff --git a/apps/erp/app/components/ActionTasks/ActionTaskAddModal.tsx b/apps/erp/app/components/ActionTasks/ActionTaskAddModal.tsx
index 635d0b65b4..f1d98d559f 100644
--- a/apps/erp/app/components/ActionTasks/ActionTaskAddModal.tsx
+++ b/apps/erp/app/components/ActionTasks/ActionTaskAddModal.tsx
@@ -15,7 +15,7 @@ import { useCallback, useEffect, useRef, useState } from "react";
import { LuCirclePlus } from "react-icons/lu";
import type { ListItem } from "~/types";
-// The shared "Add Actions" affordance used by Quality issues and Change Orders:
+// The shared "Add Actions" affordance used by Quality issues and Change Notices:
// a dashed button opening a modal that picks from the entity's required-action
// templates. Submission is delegated to `onAdd` (each caller wires its route);
// `isSubmitting` drives the button state and closing on success is the caller's
diff --git a/apps/erp/app/components/ActionTasks/ActionTaskCard.tsx b/apps/erp/app/components/ActionTasks/ActionTaskCard.tsx
index 2db41f8295..f4024e0450 100644
--- a/apps/erp/app/components/ActionTasks/ActionTaskCard.tsx
+++ b/apps/erp/app/components/ActionTasks/ActionTaskCard.tsx
@@ -27,7 +27,7 @@ export type ActionTaskStatus =
| "Skipped";
// The Start/Complete/Reopen transition, shared by every action-task surface
-// (Quality issues + Change Orders).
+// (Quality issues + Change Notices).
export const actionTaskStatusActions: Record<
ActionTaskStatus,
{ action: string; icon: ReactElement; next: ActionTaskStatus }
@@ -43,7 +43,7 @@ export const actionTaskStatusActions: Record<
};
// The single, shared presentational card for an action task — used by both the
-// Quality issue actions and the Change Order actions so the two look identical.
+// Quality issue actions and the Change Notice actions so the two look identical.
// Purely presentational: persistence (notes save, status route, integrations)
// lives in the calling wrapper and is threaded in via callbacks + slots.
export function ActionTaskCard({
diff --git a/apps/erp/app/components/ActionTasks/ActionTaskList.tsx b/apps/erp/app/components/ActionTasks/ActionTaskList.tsx
index 3eb31e614c..787de5fc7c 100644
--- a/apps/erp/app/components/ActionTasks/ActionTaskList.tsx
+++ b/apps/erp/app/components/ActionTasks/ActionTaskList.tsx
@@ -23,7 +23,7 @@ type ActionTaskRow = {
status: ActionTaskStatus;
};
-// The shared action-task list shell used by Quality issues and Change Orders:
+// The shared action-task list shell used by Quality issues and Change Notices:
// a collapsible card with a progress header, a drag-to-reorder list, and the
// "Add Actions" template picker. Entity specifics — how a row renders and where
// reorder/add post — are injected, so both surfaces share one implementation.
@@ -42,7 +42,7 @@ export function ActionTaskList<T extends ActionTaskRow>({
renderItem: (task: T, dragControls: DragControls) => ReactNode;
reorderAction: string;
// Add-from-template is opt-in: pass `onAdd` (and its templates) to show the
- // "Add Actions" picker. Omit it — as Change Orders do — and there's no add
+ // "Add Actions" picker. Omit it — as Change Notices do — and there's no add
// affordance at all; the list is seeded elsewhere.
templates?: ListItem[];
onAdd?: (selectedIds: string[]) => void;
diff --git a/apps/erp/app/components/ActionTasks/ActionTaskProgress.tsx b/apps/erp/app/components/ActionTasks/ActionTaskProgress.tsx
index 465a0b1758..ad09cc6c65 100644
--- a/apps/erp/app/components/ActionTasks/ActionTaskProgress.tsx
+++ b/apps/erp/app/components/ActionTasks/ActionTaskProgress.tsx
@@ -2,7 +2,7 @@ import { BarProgress, cn } from "@carbon/react";
import type { ActionTaskStatus } from "./ActionTaskCard";
// Completed/skipped progress bar for an action-task list — shared by Quality
-// issues and Change Orders.
+// issues and Change Notices.
export function ActionTaskProgress({
tasks,
className
diff --git a/apps/erp/app/components/ActionTasks/ActionTaskStatusButton.tsx b/apps/erp/app/components/ActionTasks/ActionTaskStatusButton.tsx
index 870be48afc..3a4be1418d 100644
--- a/apps/erp/app/components/ActionTasks/ActionTaskStatusButton.tsx
+++ b/apps/erp/app/components/ActionTasks/ActionTaskStatusButton.tsx
@@ -18,7 +18,7 @@ const statuses = Object.keys(actionTaskStatusActions) as ActionTaskStatus[];
// Icon-only status control for an action-task card: the current status as an
// icon (with tooltip), opening a dropdown to jump to any status. Shared by
-// Quality issues and Change Orders so both read identically — and it renders an
+// Quality issues and Change Notices so both read identically — and it renders an
// icon, not the status word, so there's no text to truncate in the card footer.
export function ActionTaskStatusButton({
status,
diff --git a/apps/erp/app/modules/quality/ui/Issue/Jira/CreateIssue.tsx b/apps/erp/app/components/ActionTasks/Jira/CreateIssue.tsx
similarity index 92%
rename from apps/erp/app/modules/quality/ui/Issue/Jira/CreateIssue.tsx
rename to apps/erp/app/components/ActionTasks/Jira/CreateIssue.tsx
index d6973edd58..47c0f05e8f 100644
--- a/apps/erp/app/modules/quality/ui/Issue/Jira/CreateIssue.tsx
+++ b/apps/erp/app/components/ActionTasks/Jira/CreateIssue.tsx
@@ -1,3 +1,4 @@
+import type { ActionTaskEntityType } from "@carbon/ee/action-task-entity";
import type { JiraIssueType, JiraProject, JiraUser } from "@carbon/ee/jira";
import {
Hidden,
@@ -12,16 +13,18 @@ import { Trans, useLingui } from "@lingui/react/macro";
import { useEffect, useId, useMemo, useState } from "react";
import z from "zod";
import { useAsyncFetcher } from "~/hooks/useAsyncFetcher";
-import type { IssueActionTask } from "~/modules/quality";
import { path } from "~/utils/path";
type Props = {
- task: IssueActionTask;
+ entityType: ActionTaskEntityType;
+ taskId: string;
+ linkedIssue: unknown;
onClose: () => void;
};
const createIssueValidator = z.object({
actionId: z.string(),
+ entityType: z.string(),
projectKey: z.string().min(1, "Project is required"),
issueTypeId: z.string().min(1, "Issue type is required"),
title: z.string().min(1, "Title is required"),
@@ -70,7 +73,8 @@ export const CreateIssue = (props: Props) => {
onAfterSubmit={() => props.onClose()}
>
<VStack spacing={4}>
- <Hidden name="actionId" value={props.task.id} />
+ <Hidden name="actionId" value={props.taskId} />
+ <Hidden name="entityType" value={props.entityType} />
<Select
isLoading={isLoading}
label={t`Project`}
diff --git a/apps/erp/app/modules/quality/ui/Issue/Jira/IssueDialog.tsx b/apps/erp/app/components/ActionTasks/Jira/IssueDialog.tsx
similarity index 89%
rename from apps/erp/app/modules/quality/ui/Issue/Jira/IssueDialog.tsx
rename to apps/erp/app/components/ActionTasks/Jira/IssueDialog.tsx
index 75bf3acfbf..18faba2228 100644
--- a/apps/erp/app/modules/quality/ui/Issue/Jira/IssueDialog.tsx
+++ b/apps/erp/app/components/ActionTasks/Jira/IssueDialog.tsx
@@ -1,3 +1,4 @@
+import type { ActionTaskEntityType } from "@carbon/ee/action-task-entity";
import { JiraIssueMappingSchema } from "@carbon/ee/jira";
import {
Badge,
@@ -24,16 +25,17 @@ import { PiLinkBreak } from "react-icons/pi";
import { Link, useRevalidator } from "react-router";
import { JiraIcon, JiraIssueStatusBadge } from "~/components/Icons";
import { useAsyncFetcher } from "~/hooks/useAsyncFetcher";
-import type { IssueActionTask } from "~/modules/quality/types";
import { path } from "~/utils/path";
import { CreateIssue } from "./CreateIssue";
import { LinkIssue } from "./LinkIssue";
-interface Props {
- task: IssueActionTask;
-}
+type Props = {
+ entityType: ActionTaskEntityType;
+ taskId: string;
+ linkedIssue: unknown;
+};
-export const JiraIssueDialog = ({ task }: Props) => {
+export const JiraIssueDialog = ({ entityType, taskId, linkedIssue }: Props) => {
const { t } = useLingui();
const [tab, setTab] = useState("link");
const revalidator = useRevalidator();
@@ -45,12 +47,12 @@ export const JiraIssueDialog = ({ task }: Props) => {
}
});
- const { data: linked } = JiraIssueMappingSchema.safeParse(task.jiraIssue);
+ const { data: linked } = JiraIssueMappingSchema.safeParse(linkedIssue);
const fetcher = useAsyncFetcher();
const onUnlink = async () => {
await fetcher.submit(
- { actionId: task.id },
+ { actionId: taskId, entityType },
{ method: "DELETE", action: path.to.api.jiraLinkExistingIssue }
);
disclosure.onClose();
@@ -169,13 +171,19 @@ export const JiraIssueDialog = ({ task }: Props) => {
className="relative mt-0"
>
<LinkIssue
- task={task}
+ entityType={entityType}
+ taskId={taskId}
+ linkedIssue={linkedIssue}
onClose={disclosure.onClose}
- linked={linked}
/>
</TabsContent>
<TabsContent value="create" className="relative mt-0">
- <CreateIssue task={task} onClose={disclosure.onClose} />
+ <CreateIssue
+ entityType={entityType}
+ taskId={taskId}
+ linkedIssue={linkedIssue}
+ onClose={disclosure.onClose}
+ />
</TabsContent>
</ModalBody>
</Tabs>
diff --git a/apps/erp/app/modules/quality/ui/Issue/Jira/LinkIssue.tsx b/apps/erp/app/components/ActionTasks/Jira/LinkIssue.tsx
similarity index 90%
rename from apps/erp/app/modules/quality/ui/Issue/Jira/LinkIssue.tsx
rename to apps/erp/app/components/ActionTasks/Jira/LinkIssue.tsx
index 641ceee113..a686c77d2f 100644
--- a/apps/erp/app/modules/quality/ui/Issue/Jira/LinkIssue.tsx
+++ b/apps/erp/app/components/ActionTasks/Jira/LinkIssue.tsx
@@ -1,4 +1,5 @@
-import type { JiraIssueMapping } from "@carbon/ee/jira";
+import type { ActionTaskEntityType } from "@carbon/ee/action-task-entity";
+import { JiraIssueMappingSchema } from "@carbon/ee/jira";
import { Hidden, Submit, ValidatedForm } from "@carbon/form";
import {
Badge,
@@ -17,17 +18,18 @@ import { useId, useState } from "react";
import z from "zod";
import { JiraIssueStatusBadge } from "~/components/Icons";
import { useAsyncFetcher } from "~/hooks/useAsyncFetcher";
-import type { IssueActionTask } from "~/modules/quality";
import { path } from "~/utils/path";
type Props = {
- task: IssueActionTask;
- linked?: JiraIssueMapping | null;
+ entityType: ActionTaskEntityType;
+ taskId: string;
+ linkedIssue: unknown;
onClose: () => void;
};
const linkIssueValidator = z.object({
actionId: z.string(),
+ entityType: z.string(),
issueId: z.string()
});
@@ -55,6 +57,8 @@ export const LinkIssue = (props: Props) => {
const id = useId();
const [issueId, setIssueId] = useState<string | undefined>();
+ const { data: linked } = JiraIssueMappingSchema.safeParse(props.linkedIssue);
+
const { issues, fetcher } = useJiraIssues();
const onSearch = useDebounce((e: React.ChangeEvent<HTMLInputElement>) => {
@@ -62,7 +66,7 @@ export const LinkIssue = (props: Props) => {
fetcher.load(
path.to.api.jiraLinkExistingIssue +
- `?actionId=${props.task.id}&search=${e.target.value}`
+ `?actionId=${props.taskId}&entityType=${props.entityType}&search=${e.target.value}`
);
}, 300);
@@ -79,7 +83,8 @@ export const LinkIssue = (props: Props) => {
resetAfterSubmit
onAfterSubmit={() => props.onClose()}
>
- <Hidden name="actionId" value={props.task.id} />
+ <Hidden name="actionId" value={props.taskId} />
+ <Hidden name="entityType" value={props.entityType} />
<Hidden name="issueId" value={issueId} />
<VStack spacing={4}>
<div className="w-full flex items-center gap-x-2 relative">
@@ -108,7 +113,7 @@ export const LinkIssue = (props: Props) => {
key={issue.id}
name="issueId"
value={issue.id}
- disabled={issue.id === props.linked?.id}
+ disabled={issue.id === linked?.id}
variant={"outline"}
className={cn(
"w-full rounded-lg p-3 text-left transition-colors hover:bg-transparent block h-auto data-[state=on]:bg-transparent hover:data-[state=on]:bg-transparent data-[state=on]:border-primary hover:data-[state=on]:border-primary"
diff --git a/apps/erp/app/modules/quality/ui/Issue/Linear/CreateIssue.tsx b/apps/erp/app/components/ActionTasks/Linear/CreateIssue.tsx
similarity index 91%
rename from apps/erp/app/modules/quality/ui/Issue/Linear/CreateIssue.tsx
rename to apps/erp/app/components/ActionTasks/Linear/CreateIssue.tsx
index 6e10aa746c..a6ab3e37ee 100644
--- a/apps/erp/app/modules/quality/ui/Issue/Linear/CreateIssue.tsx
+++ b/apps/erp/app/components/ActionTasks/Linear/CreateIssue.tsx
@@ -1,3 +1,4 @@
+import type { ActionTaskEntityType } from "@carbon/ee/action-task-entity";
import type { LinearTeam, LinearUser } from "@carbon/ee/linear";
import {
Hidden,
@@ -12,16 +13,18 @@ import { Trans, useLingui } from "@lingui/react/macro";
import { useEffect, useId, useMemo, useState } from "react";
import z from "zod";
import { useAsyncFetcher } from "~/hooks/useAsyncFetcher";
-import type { IssueActionTask } from "~/modules/quality";
import { path } from "~/utils/path";
type Props = {
- task: IssueActionTask;
+ entityType: ActionTaskEntityType;
+ taskId: string;
+ linkedIssue: unknown;
onClose: () => void;
};
const createIssueValidator = z.object({
actionId: z.string(),
+ entityType: z.string(),
teamId: z.string(),
title: z.string().min(1, "Title is required"),
description: z.string().min(1, "Description is required")
@@ -57,7 +60,8 @@ export const CreateIssue = (props: Props) => {
onAfterSubmit={() => props.onClose()}
>
<VStack spacing={4}>
- <Hidden name="actionId" value={props.task.id} />
+ <Hidden name="actionId" value={props.taskId} />
+ <Hidden name="entityType" value={props.entityType} />
<Select
isLoading={isSearching}
label={t`Linear Team`}
diff --git a/apps/erp/app/modules/quality/ui/Issue/Linear/IssueDialog.tsx b/apps/erp/app/components/ActionTasks/Linear/IssueDialog.tsx
similarity index 88%
rename from apps/erp/app/modules/quality/ui/Issue/Linear/IssueDialog.tsx
rename to apps/erp/app/components/ActionTasks/Linear/IssueDialog.tsx
index 995015925c..7e5e30156d 100644
--- a/apps/erp/app/modules/quality/ui/Issue/Linear/IssueDialog.tsx
+++ b/apps/erp/app/components/ActionTasks/Linear/IssueDialog.tsx
@@ -1,3 +1,4 @@
+import type { ActionTaskEntityType } from "@carbon/ee/action-task-entity";
import { LinearIssueSchema } from "@carbon/ee/linear";
import {
Badge,
@@ -24,16 +25,21 @@ import { PiLinkBreak } from "react-icons/pi";
import { Link, useRevalidator } from "react-router";
import { LinearIcon, LinearIssueStateBadge } from "~/components/Icons";
import { useAsyncFetcher } from "~/hooks/useAsyncFetcher";
-import type { IssueActionTask } from "~/modules/quality/types";
import { path } from "~/utils/path";
import { CreateIssue } from "./CreateIssue";
import { LinkIssue } from "./LinkIssue";
-interface Props {
- task: IssueActionTask;
-}
+type Props = {
+ entityType: ActionTaskEntityType;
+ taskId: string;
+ linkedIssue: unknown;
+};
-export const LinearIssueDialog = ({ task }: Props) => {
+export const LinearIssueDialog = ({
+ entityType,
+ taskId,
+ linkedIssue
+}: Props) => {
const { t } = useLingui();
const [tab, setTab] = useState("link");
const revalidator = useRevalidator();
@@ -44,12 +50,12 @@ export const LinearIssueDialog = ({ task }: Props) => {
}
});
- const { data: linked } = LinearIssueSchema.safeParse(task.linearIssue);
+ const { data: linked } = LinearIssueSchema.safeParse(linkedIssue);
const fetcher = useAsyncFetcher();
const onUnlink = async () => {
await fetcher.submit(
- { actionId: task.id },
+ { actionId: taskId, entityType },
{ method: "DELETE", action: path.to.api.linearLinkExistingIssue }
);
revalidator.revalidate();
@@ -168,13 +174,19 @@ export const LinearIssueDialog = ({ task }: Props) => {
className="relative mt-0"
>
<LinkIssue
- task={task}
+ entityType={entityType}
+ taskId={taskId}
+ linkedIssue={linkedIssue}
onClose={disclosure.onClose}
- linked={linked}
/>
</TabsContent>
<TabsContent value="create" className="relative mt-0">
- <CreateIssue task={task} onClose={disclosure.onClose} />
+ <CreateIssue
+ entityType={entityType}
+ taskId={taskId}
+ linkedIssue={linkedIssue}
+ onClose={disclosure.onClose}
+ />
</TabsContent>
</ModalBody>
</Tabs>
diff --git a/apps/erp/app/modules/quality/ui/Issue/Linear/LinkIssue.tsx b/apps/erp/app/components/ActionTasks/Linear/LinkIssue.tsx
similarity index 90%
rename from apps/erp/app/modules/quality/ui/Issue/Linear/LinkIssue.tsx
rename to apps/erp/app/components/ActionTasks/Linear/LinkIssue.tsx
index c62b36936f..760aca5d1a 100644
--- a/apps/erp/app/modules/quality/ui/Issue/Linear/LinkIssue.tsx
+++ b/apps/erp/app/components/ActionTasks/Linear/LinkIssue.tsx
@@ -1,4 +1,6 @@
+import type { ActionTaskEntityType } from "@carbon/ee/action-task-entity";
import type { LinearIssue } from "@carbon/ee/linear";
+import { LinearIssueSchema } from "@carbon/ee/linear";
import { Hidden, Submit, ValidatedForm } from "@carbon/form";
import {
Badge,
@@ -19,17 +21,18 @@ import { Link } from "react-router";
import z from "zod";
import { LinearIssueStateBadge } from "~/components/Icons";
import { useAsyncFetcher } from "~/hooks/useAsyncFetcher";
-import type { IssueActionTask } from "~/modules/quality";
import { path } from "~/utils/path";
type Props = {
- task: IssueActionTask;
- linked?: LinearIssue;
+ entityType: ActionTaskEntityType;
+ taskId: string;
+ linkedIssue: unknown;
onClose: () => void;
};
const linkIssueValidator = z.object({
actionId: z.string(),
+ entityType: z.string(),
issueId: z.string()
});
@@ -38,6 +41,8 @@ export const LinkIssue = (props: Props) => {
const id = useId();
const [issueId, setIssueId] = useState<string | undefined>();
+ const { data: linked } = LinearIssueSchema.safeParse(props.linkedIssue);
+
const { issues, fetcher } = useLinearIssues();
const onSearch = useDebounce((e: React.ChangeEvent<HTMLInputElement>) => {
@@ -45,7 +50,7 @@ export const LinkIssue = (props: Props) => {
fetcher.load(
path.to.api.linearLinkExistingIssue +
- `?actionId=${props.task.id}&search=${e.target.value}`
+ `?actionId=${props.taskId}&entityType=${props.entityType}&search=${e.target.value}`
);
}, 300);
@@ -62,7 +67,8 @@ export const LinkIssue = (props: Props) => {
resetAfterSubmit
onAfterSubmit={() => props.onClose()}
>
- <Hidden name="actionId" value={props.task.id} />
+ <Hidden name="actionId" value={props.taskId} />
+ <Hidden name="entityType" value={props.entityType} />
<Hidden name="issueId" value={issueId} />
<VStack spacing={4}>
<div className="w-full flex items-center gap-x-2 relative">
@@ -91,7 +97,7 @@ export const LinkIssue = (props: Props) => {
key={issue.id}
name="issueId"
value={issue.id}
- disabled={issue.id === props.linked?.id}
+ disabled={issue.id === linked?.id}
variant={"outline"}
className={cn(
"w-full rounded-lg p-3 text-left transition-colors hover:bg-transparent block h-auto data-[state=on]:bg-transparent hover:data-[state=on]:bg-transparent data-[state=on]:border-primary hover:data-[state=on]:border-primary"
diff --git a/apps/erp/app/components/ActionTasks/syncNotes.ts b/apps/erp/app/components/ActionTasks/syncNotes.ts
new file mode 100644
index 0000000000..e38222e077
--- /dev/null
+++ b/apps/erp/app/components/ActionTasks/syncNotes.ts
@@ -0,0 +1,64 @@
+import type { ActionTaskEntityType } from "@carbon/ee/action-task-entity";
+import { getLogger } from "@carbon/logger";
+import type { JSONContent } from "@carbon/react";
+import { path } from "~/utils/path";
+
+const logger = getLogger("erp", "action-task-notes-sync");
+
+type NotesSyncTarget = "Linear" | "Jira";
+
+const endpoints: Record<NotesSyncTarget, string> = {
+ Linear: path.to.api.linearSyncNotes,
+ Jira: path.to.api.jiraSyncNotes
+};
+
+/**
+ * Best-effort push of an action task's notes to a linked Linear/Jira issue.
+ * The note is already persisted separately, so a failure is only logged — it
+ * never throws, toasts, or reverts the save.
+ */
+export async function syncActionTaskNotes(
+ target: NotesSyncTarget,
+ {
+ actionId,
+ entityType,
+ notes
+ }: {
+ actionId: string;
+ entityType: ActionTaskEntityType;
+ notes: JSONContent;
+ }
+) {
+ try {
+ const response = await fetch(endpoints[target], {
+ method: "POST",
+ headers: { "Content-Type": "application/x-www-form-urlencoded" },
+ body: new URLSearchParams({
+ actionId,
+ entityType,
+ notes: JSON.stringify(notes)
+ })
+ });
+
+ // fetch only rejects on network errors, so an HTTP or `success: false`
+ // response has to be checked explicitly or the failure is invisible.
+ const result = response.ok
+ ? ((await response.json()) as { success?: boolean; message?: string })
+ : null;
+
+ if (!result?.success) {
+ logger.error(`Failed to sync notes to ${target}`, {
+ actionId,
+ entityType,
+ status: response.status,
+ message: result?.message
+ });
+ }
+ } catch (e) {
+ logger.error(`Failed to sync notes to ${target}`, {
+ actionId,
+ entityType,
+ error: e
+ });
+ }
+}
diff --git a/apps/erp/app/components/CadModel.tsx b/apps/erp/app/components/CadModel.tsx
index 3d6da366a1..c11bf0c48e 100644
--- a/apps/erp/app/components/CadModel.tsx
+++ b/apps/erp/app/components/CadModel.tsx
@@ -26,6 +26,7 @@ import {
import { ModelPreview } from "@carbon/viewer/model-preview";
import { OptimizeProgress } from "@carbon/viewer/optimize-progress";
import { useOptimizedModel } from "@carbon/viewer/use-optimized-model";
+import { Trans } from "@lingui/react/macro";
import { nanoid } from "nanoid";
import { useState } from "react";
import { useDropzone } from "react-dropzone";
@@ -48,6 +49,8 @@ type CadModelProps = {
jobId?: string;
};
title?: string;
+ // Rendered beside the title when the embedding surface locked this card.
+ titleExtras?: React.ReactNode;
uploadClassName?: string;
viewerClassName?: string;
isReadOnly?: boolean;
@@ -58,6 +61,7 @@ const CadModel = ({
metadata,
modelPath,
title,
+ titleExtras,
uploadClassName,
viewerClassName
}: CadModelProps) => {
@@ -339,6 +343,8 @@ const CadModel = ({
className={uploadClassName}
file={file}
title={title}
+ isReadOnly={isReadOnly}
+ titleExtras={titleExtras}
onFileChange={onFileChange}
/>
);
@@ -351,6 +357,7 @@ export default CadModel;
type CadModelUploadProps = {
title?: string;
+ titleExtras?: React.ReactNode;
file: File | null;
className?: string;
isReadOnly?: boolean;
@@ -359,6 +366,7 @@ type CadModelUploadProps = {
const CadModelUpload = ({
title,
+ titleExtras,
file,
isReadOnly,
className,
@@ -401,8 +409,33 @@ const CadModelUpload = ({
}
});
+ // Read-only with no model yet: keep the section (and its title) so the reader
+ // knows it exists, but drop the drop zone entirely.
if (isReadOnly) {
- return null;
+ return (
+ <div
+ className={cn(
+ "flex h-full flex-col flex-grow rounded-lg border border-border bg-gradient-to-bl from-card from-50% via-card to-background dark:border-none dark:shadow-[inset_0_0.5px_0_rgb(255_255_255_/_0.08),_inset_0_0_1px_rgb(255_255_255_/_0.24),_0_0_0_0.5px_rgb(0,0,0,1),0px_0px_4px_rgba(0,_0,_0,_0.08)] text-card-foreground shadow-sm w-full min-h-[400px] ",
+ className
+ )}
+ >
+ <div className="relative flex flex-col flex-1 min-h-0 w-full p-4">
+ {title && (
+ <CardHeader className="absolute top-0 left-0 z-10">
+ <CardTitle className="flex flex-row items-center gap-2">
+ {title}
+ {titleExtras}
+ </CardTitle>
+ </CardHeader>
+ )}
+ <div className="flex flex-col flex-grow items-center justify-center gap-2 p-6">
+ <p className="text-base text-muted-foreground">
+ <Trans>No CAD model to preview.</Trans>
+ </p>
+ </div>
+ </div>
+ </div>
+ );
}
return (
diff --git a/apps/erp/app/components/Icons.tsx b/apps/erp/app/components/Icons.tsx
index 41ef9457c4..96a93aefd0 100644
--- a/apps/erp/app/components/Icons.tsx
+++ b/apps/erp/app/components/Icons.tsx
@@ -530,8 +530,12 @@ export const LinearIssueStateBadge = (props: {
break;
}
+ // Read-only mirror of Linear's state — no hover affordance, it isn't clickable.
return (
- <Badge variant={"secondary"} className="py-1 bg-transparent">
+ <Badge
+ variant={"secondary"}
+ className="py-1 bg-transparent hover:bg-transparent"
+ >
{icon}
<span className="ml-1">{props.state.name}</span>
</Badge>
@@ -701,8 +705,12 @@ export const JiraIssueStatusBadge = (props: {
break;
}
+ // Read-only mirror of Jira's status — no hover affordance, it isn't clickable.
return (
- <Badge variant={"secondary"} className="py-1 bg-transparent">
+ <Badge
+ variant={"secondary"}
+ className="py-1 bg-transparent hover:bg-transparent"
+ >
{icon}
<span className="ml-1">{props.status.name}</span>
</Badge>
diff --git a/apps/erp/app/components/Layout/Topbar/Notifications.tsx b/apps/erp/app/components/Layout/Topbar/Notifications.tsx
index ecd32dfdcc..ebe5029ff9 100644
--- a/apps/erp/app/components/Layout/Topbar/Notifications.tsx
+++ b/apps/erp/app/components/Layout/Topbar/Notifications.tsx
@@ -210,13 +210,13 @@ function GenericNotification({
{...props}
/>
);
- case NotificationEvent.ChangeOrderStarted:
- case NotificationEvent.ChangeOrderImplementation:
- case NotificationEvent.ChangeOrderDone:
+ case NotificationEvent.ChangeNoticeStarted:
+ case NotificationEvent.ChangeNoticeImplementation:
+ case NotificationEvent.ChangeNoticeDone:
return (
<Notification
icon={<LuGitPullRequestArrow />}
- to={path.to.changeOrderDetails(id)}
+ to={path.to.changeNoticeDetails(id)}
{...props}
/>
);
diff --git a/apps/erp/app/modules/agent/kb/docs/reference/audit-log.md b/apps/erp/app/modules/agent/kb/docs/reference/audit-log.md
index c374e8abdd..00d7d73cbc 100644
--- a/apps/erp/app/modules/agent/kb/docs/reference/audit-log.md
+++ b/apps/erp/app/modules/agent/kb/docs/reference/audit-log.md
@@ -29,7 +29,7 @@ Carbon tracks a fixed set of entities. Anything not on this list is not audited.
| Sales Invoice | Purchase Invoice |
| Quote | Supplier Quote |
| Job | Employee |
-| Non-Conformance | Change Order |
+| Non-Conformance | Change Notice |
| Gauge | Shipment |
| Receipt | Warehouse Transfer |
| Stock Transfer | Inventory Count |
diff --git a/apps/erp/app/modules/agent/kb/docs/reference/change-orders/change-types.md b/apps/erp/app/modules/agent/kb/docs/reference/change-orders/change-types.md
index 3cf4299b07..0b5f26339e 100644
--- a/apps/erp/app/modules/agent/kb/docs/reference/change-orders/change-types.md
+++ b/apps/erp/app/modules/agent/kb/docs/reference/change-orders/change-types.md
@@ -3,7 +3,7 @@
> Version, Revision, Replacement Part, and New Part — the per-affected-item choice that decides what you can edit and what release creates.
Change type is set per affected item (default **Version**) and is the most load-bearing field on the whole
-change order. It decides two things at once: what you're allowed to edit on the draft, and what release
+change notice. It decides two things at once: what you're allowed to edit on the draft, and what release
creates from it. Two axes tell the four types apart: is there a **predecessor** item, and does the result keep
the **same part number**.
@@ -14,7 +14,7 @@ the **same part number**.
| Version | BoM and BoP on the **same item** | A new **method version**; the prior Active version is archived | None |
| Revision | Attributes, documents, BoM and BoP | A new **item revision** (same Part ID, next revision) | Old revision → new revision |
| Replacement Part | Attributes, documents, BoM and BoP | A **new part number** derived from the affected part | Affected part → new part |
-| New Part | Attributes, documents, BoM and BoP | A **net-new part** minted under the change order | None — it has no predecessor |
+| New Part | Attributes, documents, BoM and BoP | A **net-new part** minted under the change notice | None — it has no predecessor |
Don't conflate them. A **Version** produces a new method version on the *same* item row, so existing stock and
item history are untouched and nothing is superseded. A **Revision** and a **Replacement Part** each mint a
@@ -49,7 +49,7 @@ Change type also controls the editable surface on the affected item:
top of BoM and BoP, because each is producing a genuinely new item, not just a new recipe.
The **Add Affected Item** picker accepts **Parts only** — the existing-item selector is filtered to Parts, and
-the New Part mini-form always mints a Part. There's no Tool path in the change-order UI.
+the New Part mini-form always mints a Part. There's no Tool path in the change-notice UI.
A purchased (**Buy**) item has no bill of materials or process, so a **Version** is meaningless for it. The
picker hides **Version** for Buy items and restricts a Version's item selector to **Make** parts; adding a Buy
@@ -64,7 +64,7 @@ Choosing **New Part** in the change-type selector swaps the affected-item modal
- **Replenishment System**: Buy, Make, or Buy and Make. Defaults to **Make**.
- **Tracking Type**: Inventory, Non-Inventory, Serial, or Batch. Defaults to **Inventory**.
-Submitting mints an inactive Part under the change order and adds it as a **New Part** affected item. It stays
+Submitting mints an inactive Part under the change notice and adds it as a **New Part** affected item. It stays
hidden until release reveals it.
## Supplier parts on a purchased line
@@ -78,10 +78,10 @@ here the same way you would on a live part.
A draft item starts with **no** supplier parts — the source item's suppliers aren't copied onto the draft. If a
purchased Revision, Replacement Part, or New Part releases with an empty grid, the new part is stocked but has
no way to buy it, so a purchase order can't reference it. Fill the grid on the line first. The suppliers you add
-show up in the change order's `docs/reference/change-orders/lifecycle`
+show up in the change notice's `docs/reference/change-orders/lifecycle`
as additions.
## Related
- Lifecycle & release What release does with each change type.
- - Methods & sourcing Method versions and the Draft/Active/Archived states a change order drives.
+ - Methods & sourcing Method versions and the Draft/Active/Archived states a change notice drives.
diff --git a/apps/erp/app/modules/agent/kb/docs/reference/change-orders/creating.md b/apps/erp/app/modules/agent/kb/docs/reference/change-orders/creating.md
index 16f86457ce..ac11059ac3 100644
--- a/apps/erp/app/modules/agent/kb/docs/reference/change-orders/creating.md
+++ b/apps/erp/app/modules/agent/kb/docs/reference/change-orders/creating.md
@@ -1,21 +1,21 @@
-# Create a change order
+# Create a change notice
-> The entry points that open a change order, the fields on the create form, and how change orders surface back on a part or tool page.
+> The entry points that open a change notice, the fields on the create form, and how change notices surface back on a part or tool page.
-There's no single "new change order" button tucked in one menu. Carbon lets you start a change order from
+There's no single "new change notice" button tucked in one menu. Carbon lets you start a change notice from
wherever you notice the change is needed — a standalone form, the part you're looking at, its method version
-menu, or a quality issue. Every path lands on the same change-order detail page.
+menu, or a quality issue. Every path lands on the same change-notice detail page.
## Entry points
- - **Items → Change Orders → New**: The standalone form. Start here when the change spans several parts or you haven't opened a specific one yet.
- - **Part or Tool header → Create Change Order**: Opens the create form as a modal with the current part or tool pre-attached as the first affected item.
- - **Parts table → row menu → Create Change Order**: A one-click start: mints the change order, attaches that part, and drops you on its detail page.
- - **Method version menu → New Change Order**: On a part's method, the same version menu that holds **New Version** offers **New Change Order** — the natural place to reach for a change while you're looking at the recipe.
- - **Quality issue → Create Change Order**: From a non-conformance, this opens a change order with the issue linked, so the engineering fix is traceable back to the problem that prompted it.
+ - **Items → Change Notices → New**: The standalone form. Start here when the change spans several parts or you haven't opened a specific one yet.
+ - **Part or Tool header → Create Change Notice**: Opens the create form as a modal with the current part or tool pre-attached as the first affected item.
+ - **Parts table → row menu → Create Change Notice**: A one-click start: mints the change notice, attaches that part, and drops you on its detail page.
+ - **Method version menu → New Change Notice**: On a part's method, the same version menu that holds **New Version** offers **New Change Notice** — the natural place to reach for a change while you're looking at the recipe.
+ - **Quality issue → Create Change Notice**: From a non-conformance, this opens a change notice with the issue linked, so the engineering fix is traceable back to the problem that prompted it.
The part-header, tool-header, parts-table, and method-version entry points all pre-select that part or tool as
-the change order's first affected item, so you land ready to pick a change type and edit. The standalone form
+the change notice's first affected item, so you land ready to pick a change type and edit. The standalone form
starts with no affected items — you add them on the detail page.
## The create form
@@ -23,7 +23,7 @@ starts with no affected items — you add them on the detail page.
The header form is short — the substance is in the affected items you edit later.
- **Name**: What this change is, in a line.
- - **Category**: The change-order type, drawn from your configured categories. See `docs/reference/change-orders/setup`.
+ - **Category**: The change-notice type, drawn from your configured categories. See `docs/reference/change-orders/setup`.
- **Reason for Change**: Why the change is needed. Rich text.
- **Description of Change**: What's changing, in narrative. Rich text.
- **Owner**: The employee responsible.
@@ -32,30 +32,35 @@ The header form is short — the substance is in the affected items you edit lat
- **Due Date**: Optional target.
The form has no affected-items field — you add those on the detail page after creating. When you start from a
-part, tool, or quality issue, that source is carried silently onto the new change order (the part or tool as a
-pre-attached affected item, the non-conformance as the linked issue). Submitting creates the change order,
+part, tool, or quality issue, that source is carried silently onto the new change notice (the part or tool as a
+pre-attached affected item, the non-conformance as the linked issue). Submitting creates the change notice,
attaches any pre-selected item, and redirects to its detail page at **"Draft"**.
-Change orders are gated by the **Parts** permission: creating one needs create access on Parts, and
-advancing or releasing needs update access. If someone can manage parts, they can manage change orders.
+Change notices are gated by the **Parts** permission: creating one needs create access on Parts, and
+advancing or releasing needs update access. If someone can manage parts, they can manage change notices.
-## Where change orders surface on a part
+## Where change notices surface on a part
-Change orders don't just live in their own list — they show up on the parts and tools they touch, so nobody
+Change notices don't just live in their own list — they show up on the parts and tools they touch, so nobody
edits a design that's mid-change without seeing it.
-- **Open change order alert.** When a part is on one or more change orders that haven't reached **"Done"**,
- its detail page shows a warning: *"This part is on 1 open change order"* (or *"…# open change orders"*),
- with each change order id linked. This is the guardrail against two people revising the same part blind.
+- **Open change notice alert.** When a part is on one or more change notices that haven't reached **"Done"**,
+ its detail page shows a warning: *"This part is on 1 open change notice"* (or *"…# open change notices"*),
+ with each change notice id linked. This is the guardrail against two people revising the same part blind.
It's informational, not a lock — `docs/reference/change-orders/lifecycle` are allowed.
-- **Change Orders history.** A card lists every change order that has touched the part, newest first, with
+- **Change Notices history.** A card lists every change notice that has touched the part, newest first, with
released ones de-emphasized — the full "why did this part change?" trail.
-- **Provenance back-link.** A revision or part created by a released change order carries a *"Created by
- ECO-…"* reference to the change order that made it.
+- **Provenance back-link.** A revision or part created by a released change notice carries a *"Created by
+ CN-…"* reference to the change notice that made it.
-Each change order gets a per-company readable id like **ECO-000001**. That's the id you'll see in the alert,
+Each change notice gets a per-company readable id like **CN-000001**. That's the id you'll see in the alert,
the history card, and the provenance link.
+The feature used to be called a change order and numbered **ECO-000001**. Only *new* records pick up the
+**CN-** prefix — existing ids are left exactly as they were, because they're audit trail and are quoted in
+drawings, emails, and customer correspondence. So a mature company will see both **ECO-000042** and
+**CN-000043** in the same list. They're the same kind of record.
+
## Related
- Change types What you set on each affected item once it's attached.
diff --git a/apps/erp/app/modules/agent/kb/docs/reference/change-orders/index.md b/apps/erp/app/modules/agent/kb/docs/reference/change-orders/index.md
index e6ae849350..948f9ba6e7 100644
--- a/apps/erp/app/modules/agent/kb/docs/reference/change-orders/index.md
+++ b/apps/erp/app/modules/agent/kb/docs/reference/change-orders/index.md
@@ -1,55 +1,56 @@
-# Change orders
+# Change notices
> How Carbon drafts an engineering change against real methods, reviews it as a diff, and releases it so downstream planning supersedes the versions it replaces.
-A **change order** groups the parts whose designs are changing, revises each one on a hidden draft, and
+A **change notice** groups the parts whose designs are changing, revises each one on a hidden draft, and
releases them together. It answers "what changed, who owns it, and what does the new version supersede?"
without touching a live method until you release.
The model is deliberately top-down. You pick the affected items first, then edit each item's real
-method (its bill of materials and bill of process) inside the change order. Nothing
-about the part moves for planning, jobs, or costing until release. Change orders live under **Items → Change
-Orders**, and every action is gated by the `parts` permission.
+method (its bill of materials and bill of process) inside the change notice. Nothing
+about the part moves for planning, jobs, or costing until release. Change notices live under **Items → Change
+Notices**, and every action is gated by the `parts` permission.
## The affected item is the unit of work
-A change order is a header plus a list of **affected items**. The picker accepts **Parts only** — materials,
-consumables, services, and tools have no path in the change-order UI, so they're excluded. Each affected item
+A change notice is a header plus a list of **affected items**. The picker accepts **Parts only** — materials,
+consumables, services, and tools have no path in the change-notice UI, so they're excluded. Each affected item
carries its own change type, its own edits, and its own cutover
configuration.
Adding an affected item snapshots the item's live **Active** method into a new **Draft** method stamped with
-the change order's id. That draft is hidden from every version switcher, copy-target picker, and MRP, job, or
+the change notice's id. That draft is hidden from every version switcher, copy-target picker, and MRP, job, or
cost read until release. You edit it with the same **Bill of Material**, **Bill of Process**, and **Part
Properties** editors you use anywhere else.
Carbon does not mirror your edits into shadow tables. An affected item's edits live on an actual make method
-whose change-order id is set, which is why the diff is exact and release is just an activation. The draft is
+whose change-notice id is set, which is why the diff is exact and release is just an activation. The draft is
invisible everywhere else precisely because that id is set — clearing it at release is what makes the draft
live.
## Find one in the list
-**Items → Change Orders** lists every change order. Because the affected item is the unit of work, each row
+**Items → Change Notices** lists every change notice. Because the affected item is the unit of work, each row
**expands** to reveal the parts it changes — one line per affected item, with its change type badge and, for a
Revision or Replacement Part, the old item number arrowed to the new one (**P000123 → P000124**). A New Part
-shows a single id — it's net-new, with no predecessor to arrow from. You see what a change order touches
+shows a single id — it's net-new, with no predecessor to arrow from. You see what a change notice touches
without opening it.
-To find the change orders that touch a specific part, use the **Item** filter. Pick one or more items and the
-list narrows to change orders that affect them. The **Items** column that backs the filter is hidden by
+To find the change notices that touch a specific part, use the **Item** filter. Pick one or more items and the
+list narrows to change notices that affect them. The **Items** column that backs the filter is hidden by
default; turn it on from the column toggle if you want it in view or in a CSV export.
## How the pieces fit
- - Create a change order Every entry point — the standalone form, a part header, the parts table, the method version menu, and a
- quality issue — plus how change orders surface back on a part.
+ - Create a change notice Every entry point — the standalone form, a part or tool header, the parts table, the method version
+ menu, and a quality issue — plus how change notices surface back on a part.
- Change types Version, Revision, Replacement Part, and New Part: what each lets you edit and what release creates.
- - Lifecycle & release The five stages, the diff review, the impact panel, and what release actually does.
+ - Lifecycle & release The five stages, the Implementation lock and Reopen, the diff review, the impact panel, and what release
+ actually does.
- Supersession & cutover How a released revision phases over, and how MRP and Get Method honor it downstream.
- - Categories & actions The change-order category lookup and the reusable action-task templates.
+ - Categories & actions The change-notice category lookup, the reusable action-task templates, and linking a task to Linear.
## Related
- Revise a part The narrative tour: draft a change, review the diff, release, and let supersession carry it downstream.
- - Methods & sourcing Method versions, Draft/Active/Archived, and Get Method — the machinery a change order drives.
+ - Methods & sourcing Method versions, Draft/Active/Archived, and Get Method — the machinery a change notice drives.
diff --git a/apps/erp/app/modules/agent/kb/docs/reference/change-orders/lifecycle.md b/apps/erp/app/modules/agent/kb/docs/reference/change-orders/lifecycle.md
index 16d88b6029..ab2796f018 100644
--- a/apps/erp/app/modules/agent/kb/docs/reference/change-orders/lifecycle.md
+++ b/apps/erp/app/modules/agent/kb/docs/reference/change-orders/lifecycle.md
@@ -1,30 +1,68 @@
# Lifecycle & release
-> The five change-order stages, the impact panel, the diff review, and exactly what release does when a change order reaches Done.
+> The five change-notice stages, the Implementation lock and Reopen, the impact panel, the diff review, and exactly what release does when a change notice reaches Done.
-A change order advances forward one stage at a time. There's no approval toggle and no going back — the
-stages *are* the workflow, and the change order is its own release gate. The one exit is **"Cancel"**,
-available from every open stage; a cancelled change order can later be reopened to **"Draft"**.
+A change notice advances forward one stage at a time. There's no approval toggle — the stages *are* the
+workflow, and the change notice is its own release gate. There are two ways back: **Reopen** at
+**"Implementation"** sends it one stage back to **"Engineering Complete"**, and **"Cancel"** — available from
+every open stage — closes it, after which **Reopen** returns it to **"Draft"**.
## The stages
- - **Draft**: The change order is being written. Pick affected items, set change types, and edit each draft method. Nothing is broadcast.
+ - **Draft**: The change notice is being written. Pick affected items, set change types, and edit each draft method. Nothing is broadcast.
- **Start**: Work is underway. Advancing to Start broadcasts a notification to the team.
- **Engineering Complete**: The design edits are finished and ready for implementation review. Silent, no broadcast.
- - **Implementation**: The release stage. The **"Release"** action is available here; it reviews every affected item's diff and applies the change. Advancing here broadcasts.
- - **Done**: Released and locked. The change order becomes a read-only historical record; broadcasts on entry.
- - **Cancelled**: The off-ramp. The header's **"Cancel"** action closes the change order from any open stage without releasing anything. Locked like **"Done"**, but reversible: **"Reopen"** returns it to **"Draft"**.
+ - **Implementation**: The release stage. The engineering content freezes here, and the **"Release"** action becomes available; it reviews every affected item's diff and applies the change. Advancing here broadcasts.
+ - **Done**: Released and locked. The change notice becomes a read-only historical record; broadcasts on entry.
+ - **Cancelled**: The off-ramp. The header's **"Cancel"** action closes the change notice from any open stage without releasing anything. Locked like **"Done"**, but reversible: **"Reopen"** returns it to **"Draft"**.
The **"Start"**, **"Implementation"**, and **"Done"** transitions each notify the team; **"Engineering
-Complete"** is silent. Once a change order reaches **"Done"** it is locked — every editor is read-only.
+Complete"** is silent. Once a change notice reaches **"Done"** it is locked — every editor is read-only.
**"Cancelled"** is locked too, but not lost: cancelling keeps every affected item's draft, and **"Reopen"**
-takes the change order back to **"Draft"** to pick up where it left off. Only **"Done"** is permanent.
-Deleting a change order is the destructive path — that discards each affected item's draft and any new
-items the change order minted, so nothing is orphaned.
+takes the change notice back to **"Draft"** to pick up where it left off. Only **"Done"** is permanent.
+Deleting a change notice is the destructive path — that discards each affected item's draft and any new
+items the change notice minted, so nothing is orphaned.
+
+## Implementation freezes the engineering content
+
+Advancing to **"Implementation"** means "we are now rolling this out." From that moment the *engineering*
+content is read-only, so what's being implemented can't shift underneath the people implementing it. The
+*workflow* content stays editable, because coordinating the rollout is exactly the work that happens at this
+stage.
+
+| Locked at Implementation (engineering) | Still editable at Implementation (workflow) |
+| --- | --- |
+| Adding or removing affected items | Action tasks — add, complete, skip, reorder, delete |
+| Changing an affected item's change type | Assignee |
+| The staged **Bill of Material** and **Bill of Process** drafts | Due date |
+| The cutover config (supersession mode, discontinuation date, successor effectivity date) | Priority |
+| **Reason for Change** and **Description of Change** | Category |
+
+The lock is enforced on the server, not just greyed out in the UI. If a stale tab tries to write a frozen
+field you get *"This change notice is being implemented, so its changes are locked. Reopen it to make
+changes."*
+
+Freezing only blocks writes. The **Changes** rollup, each affected item's diff, and the impact panel all stay
+visible at Implementation — you can read the whole change, you just can't edit it.
+
+## Reopen
+
+If review at Implementation turns up something that has to change, use **Reopen** in the **⋮** menu next to
+the change notice id. It sends the notice back one stage to **"Engineering Complete"**, which unfreezes the
+affected items, the drafts, the cutover config, and the narrative fields. Nothing you've already done is
+discarded — the drafts, diffs, and action tasks are exactly as you left them. Edit, then advance to
+Implementation again. (The same **Reopen** action appears on a **"Cancelled"** notice, where it returns it to
+**"Draft"** instead.)
+
+Reopen exists only at **"Implementation"** (before release) and at **"Cancelled"** (nothing was released).
+Releasing to **"Done"** has already activated the new method versions, revealed the new items, and written the
+supersessions that downstream MRP and Get Method are now acting on. Un-doing that would mean retracting live
+planning decisions, so Carbon doesn't offer it. To change the same parts again, raise a new change notice —
+the released methods and items are its starting point.
## The impact panel
-Alongside the affected items, a change order shows an **Impact** panel: a where-used tree for each affected
+Alongside the affected items, a change notice shows an **Impact** panel: a where-used tree for each affected
item across jobs, job materials, method materials, purchase orders, receipts, quotes, issues, maintenance,
and assembly instructions.
@@ -34,13 +72,13 @@ nothing here blocks releasing."*
## Review the changes, then release
-You don't have to wait for release to see what a change order does. The overview page carries a **Changes**
+You don't have to wait for release to see what a change notice does. The overview page carries a **Changes**
card, between the description and the action tasks, that rolls up **every** affected item's diff as you author
it — each item labeled with its change type, its diff rendered read-only. It's the same view the release dialog
shows, available the whole time so you can check your work before you commit. An item with nothing edited yet
reads *"No changes yet."*
-Release itself lives on the change order at **"Implementation"**. The **"Release change order"** dialog lays out
+Release itself lives on the change notice at **"Implementation"**. The **"Release change notice"** dialog lays out
that same per-item diff one more time before you commit — *"Review each item's changes, then confirm —
releasing can't be undone."*
@@ -64,21 +102,21 @@ On confirm, Carbon walks the affected items and, per `docs/reference/change-orde
1. **Activates the draft method** — it becomes the new **Active** version and the prior Active version is
**Archived** (kept as history, never deleted).
2. **Reveals the new item** — for a Revision, Replacement Part, or New Part, the newly created item is switched
- live and stamped with the change order id. A Version has no new item.
+ live and stamped with the change notice id. A Version has no new item.
3. **Writes the supersession** — for a Revision or Replacement Part only, from the old item to the new one,
using that affected item's cutover settings. A New Part has no predecessor, so it supersedes nothing. See
`docs/reference/change-orders/supersession`.
New Part items are released first, so a parent assembly whose draft BoM references a consolidated new part
-finds it already active. When every affected item is processed, the change order flips to **"Done"**.
+finds it already active. When every affected item is processed, the change notice flips to **"Done"**.
-Each affected item is marked done the moment its draft's change-order id is cleared, so a re-run skips items
+Each affected item is marked done the moment its draft's change-notice id is cleared, so a re-run skips items
already released and resumes at the first unreleased one. The final flip to **"Done"** is a compare-and-swap
on the **"Implementation"** status, so two people releasing at once can't double-apply.
-## Parallel change orders on the same part
+## Parallel change notices on the same part
-Two change orders can revise the same part at once. Each drafts its own method version, and Carbon steps
+Two change notices can revise the same part at once. Each drafts its own method version, and Carbon steps
around version collisions so they don't clobber each other. Whichever releases second activates on top of the
first, and the earlier version is archived as history rather than overwritten — so no work is lost. There's no
merge-conflict step to resolve.
@@ -90,8 +128,14 @@ merge-conflict step to resolve.
## Troubleshooting
-### "Cannot modify a completed change order."
-At **"Done"** the change order is a locked, read-only historical record — nothing reopens it. To make further changes to the same parts, raise a new change order; the released methods and items are its starting point. At **"Cancelled"** it is also locked, but the **"Reopen"** action returns it to **"Draft"** for further editing.
+### "This change notice is being implemented, so its changes are locked. Reopen it to make changes."
+The change notice is at **"Implementation"**, where the engineering content is frozen — affected items, the BoM/BoP drafts, the cutover config, and the Reason for Change / Description fields. Use **Reopen** in the **⋮** menu next to the change notice id to send it back to **"Engineering Complete"**, make the edit, then advance to Implementation again. Nothing is lost in the round trip. Action tasks, assignee, due date, and priority are *not* frozen — if one of those is refusing to save, the cause is something else (permissions, or the notice is closed).
+
+### "This change notice is closed, so its changes are read-only."
+The change notice is at **"Done"** or **"Cancelled"**. At **"Done"** it is a locked historical record and **Reopen is not available** — releasing already activated the new methods and wrote the supersessions that planning is acting on. To make further changes to the same parts, raise a new change notice; the released methods and items are its starting point. At **"Cancelled"** it is also locked, but the **"Reopen"** action returns it to **"Draft"** for further editing.
### Release button not available
-The **"Release"** action only appears at the **"Implementation"** stage. If the user can't find it, check the change order's current stage — it must be advanced (one stage at a time, no skipping) to Implementation first.
+The **"Release"** action only appears at the **"Implementation"** stage. If the user can't find it, check the change notice's current stage — it must be advanced (one stage at a time, no skipping) to Implementation first.
+
+### Can't find Reopen
+**Reopen** sits in the **⋮** menu beside the change notice id. It appears at **"Implementation"** (back to **"Engineering Complete"**) and at **"Cancelled"** (back to **"Draft"**). It is not offered at Draft, Start, or Engineering Complete — nothing is frozen at those stages, so there's nothing to unlock — nor at **"Done"**, which is terminal. Editing also requires the `parts` update permission.
diff --git a/apps/erp/app/modules/agent/kb/docs/reference/change-orders/setup.md b/apps/erp/app/modules/agent/kb/docs/reference/change-orders/setup.md
index 3ef865a63b..aa3519da85 100644
--- a/apps/erp/app/modules/agent/kb/docs/reference/change-orders/setup.md
+++ b/apps/erp/app/modules/agent/kb/docs/reference/change-orders/setup.md
@@ -1,23 +1,23 @@
# Categories & actions
-> The two company-scoped lookups that sit alongside change orders — the category list and the reusable action-task templates.
+> The two company-scoped lookups that sit alongside change notices — the category list and the reusable action-task templates — plus linking an action task to Linear.
-Two configuration lists live next to change orders in the Items nav. Both are company-scoped and edited by
+Two configuration lists live next to change notices in the Items nav. Both are company-scoped and edited by
employees with the `parts` permission.
-## Change order categories
+## Change notice categories
-**Items → Change Order Types** holds the values for a change order's **"Category"** field — the same idea as
+**Items → Change Notice Types** holds the values for a change notice's **"Category"** field — the same idea as
issue types in Quality. Carbon seeds eleven to start: *Design Improvement*, *Cost Reduction*, *Quality / Reliability Improvement*, *Supplier / Sourcing Change*, *Material or Component Change*, *Obsolescence / End-of-Life*, *Regulatory / Compliance*, *Safety*, *Manufacturing / Producibility*, *Customer Request*, and *Documentation Error / Correction*. Add,
rename, or remove them to match how your shop classifies changes.
-Category is descriptive: it groups and filters change orders, but it doesn't change how release behaves. That
+Category is descriptive: it groups and filters change notices, but it doesn't change how release behaves. That
job belongs to the `docs/reference/change-orders/change-types` on each affected item.
-## Change order actions
+## Change notice actions
-**Items → Change Order Actions** holds reusable **action-task templates** — the checklist items a change
-order commonly needs. Carbon seeds seven:
+**Items → Change Notice Actions** holds reusable **action-task templates** — the checklist items a change
+notice commonly needs. Carbon seeds seven:
- Engineering Review
- Update Drawings / CAD
@@ -27,14 +27,46 @@ order commonly needs. Carbon seeds seven:
- Inventory Disposition (rework / scrap / use-as-is)
- Notify Affected Parties
-A new change order can seed its task list from the active templates. On the change order, each task tracks a
+A new change notice can seed its task list from the active templates. On the change notice, each task tracks a
status — **Pending**, **In Progress**, **Completed**, or **Skipped** — plus an assignee, due date, and notes.
Tasks are a coordination checklist, not an approval workflow. A task's status never blocks a stage from
-advancing or a change order from releasing — the `docs/reference/change-orders/lifecycle` are the
+advancing or a change notice from releasing — the `docs/reference/change-orders/lifecycle` are the
only gate.
+Because tasks are the *workflow* side of a change notice rather than its engineering content, they stay
+editable at the **"Implementation"** stage, when the drafts and affected items are already frozen. See
+`docs/reference/change-orders/lifecycle`.
+
+## Link a task to Linear
+
+If engineering tracks its work in Linear, an action task can point at the ticket instead of duplicating it.
+This works exactly the way it does on a `docs/reference/quality` action tasks — same dialog,
+same behavior.
+
+The affordance is a Linear icon on the task row, and it only appears when your company has the `docs/integrations/project-management` connected. Once a task is linked, the icon is replaced by
+the ticket's identifier, so you can see at a glance which tasks are being worked outside Carbon.
+
+Opening the dialog gives you two tabs:
+
+ - **Link Existing**: Search your Linear issues and attach one to this task.
+ - **Create New**: Create a fresh ticket from the task and attach it in one step.
+
+A linked task shows the ticket's title, identifier, state, and assignee, with a link out to the ticket itself
+and an **Unlink** button to break the connection. A task holds at most one ticket per provider — the tabs are
+disabled while a link exists, so unlink first if you need to point somewhere else.
+
+Edits to the task's **notes** in Carbon are pushed to the linked ticket's description. In the other direction,
+when the ticket changes in Linear, a webhook syncs its **status**, **assignee**, **due date**, and
+**description** back onto the Carbon task — so completing the ticket in Linear marks the action task
+completed here. Whoever is doing the work never has to update two systems.
+
+The same task row also offers a Jira icon, with the identical Link Existing / Create New dialog and two-way
+sync. Jira only shows up when the integration is connected *and* the server has Jira OAuth credentials
+configured, so on most installs Linear is the one you'll see.
+
## Related
- - Create a change order Where the category is set and tasks are seeded.
- - Lifecycle & release The stages that actually gate a change order.
+ - Create a change notice Where the category is set and tasks are seeded.
+ - Lifecycle & release The stages that actually gate a change notice.
+ - Project management integrations Connecting Linear and Jira in the first place.
diff --git a/apps/erp/app/modules/agent/kb/docs/reference/issues.md b/apps/erp/app/modules/agent/kb/docs/reference/issues.md
index e054e54898..dd135fa87f 100644
--- a/apps/erp/app/modules/agent/kb/docs/reference/issues.md
+++ b/apps/erp/app/modules/agent/kb/docs/reference/issues.md
@@ -83,7 +83,7 @@ From the issue header you can also spin up a `docs/reference/change-orders` dire
- Quality The module overview: issues, inbound inspection, gauges, documents.
- Calibration Gauges and calibration-due tracking, the other side of quality.
- Risk register Risks and opportunities tracked by source, alongside non-conformances.
- - Change orders Turn an issue into an engineering change.
+ - Change notices Turn an issue into an engineering change.
## Troubleshooting
diff --git a/apps/erp/app/modules/agent/kb/docs/reference/notifications.md b/apps/erp/app/modules/agent/kb/docs/reference/notifications.md
index 47ec7e058e..cf84e53540 100644
--- a/apps/erp/app/modules/agent/kb/docs/reference/notifications.md
+++ b/apps/erp/app/modules/agent/kb/docs/reference/notifications.md
@@ -18,7 +18,7 @@ Every notification starts as a `carbon/notify` event with a specific type. The t
falls into one of three shapes:
- **Assignments**: Someone is put on a record: a job, job operation, sales order, purchase order, RFQ, purchase invoice, supplier quote, issue, risk, procedure, picking list, stock transfer, maintenance dispatch, or training. The assignee is the recipient.
- - **State changes & responses**: A record's state moved in a way someone should know about: an approval was **requested**, **approved**, or **rejected**; a job **completed**; a change order entered a new stage; a quote **expired**; a customer or supplier responded to a digital quote or supplier quote.
+ - **State changes & responses**: A record's state moved in a way someone should know about: an approval was **requested**, **approved**, or **rejected**; a job **completed**; a change notice entered a new stage; a quote **expired**; a customer or supplier responded to a digital quote or supplier quote.
- **Expirations & reminders**: Time-driven, raised by scheduled jobs rather than a user action: a **gauge calibration expired**, a **maintenance dispatch** was auto-created for a work center, or a weekly **training reminder** rolls up a person's outstanding trainings.
The full set of event types lives in `NotificationEvent` (`packages/notifications/src/index.ts:7`). Adding a
@@ -47,7 +47,7 @@ channel opt-outs. There are twelve, and the mapping is fixed in code
| Maintenance | Maintenance dispatch (assigned or created), gauge calibration expired |
| Training | Training and procedure assignments, resource training, training reminder |
| Suggestion | Suggestion response |
-| Items | Change order started / in implementation / complete |
+| Items | Change notice started / in implementation / complete |
| General | Anything without a specific bucket |
The topic string is **stored** on every notification (`notification.topic`). It's what a user's opt-out row
diff --git a/apps/erp/app/modules/agent/kb/docs/reference/sequences.md b/apps/erp/app/modules/agent/kb/docs/reference/sequences.md
index 64635c1c56..5a048ac2ff 100644
--- a/apps/erp/app/modules/agent/kb/docs/reference/sequences.md
+++ b/apps/erp/app/modules/agent/kb/docs/reference/sequences.md
@@ -1,14 +1,14 @@
# Numbering sequences
-> The per-company generator behind every readable document number — jobs, change orders, payments, and more.
+> The per-company generator behind every readable document number — jobs, change notices, payments, and more.
-Every document Carbon creates gets a human-readable number: a job is `J000001`, an engineering change order is `ECO-000001`, a payment is `PAY-2026-07-000001`. Those numbers come from sequences — one small counter per document type, per company. Each sequence knows its prefix, its suffix, how wide the number is, how much to step by, and what value comes next. When a document is created, Carbon reads the sequence, formats the next value, and advances the counter.
+Every document Carbon creates gets a human-readable number: a job is `J000001`, an engineering change notice is `CN-000001`, a payment is `PAY-2026-07-000001`. Those numbers come from sequences — one small counter per document type, per company. Each sequence knows its prefix, its suffix, how wide the number is, how much to step by, and what value comes next. When a document is created, Carbon reads the sequence, formats the next value, and advances the counter.
Sequences live under **Settings → Sequences**. Every company gets a full set seeded when it's created, and you can retune any of them — change the prefix, restart the counter, widen the padding — without touching code.
## What a sequence is
-A sequence is a row in the `sequence` table, keyed by `("table", "companyId")` — one counter per document type per company (`packages/database/supabase/migrations/20230525025310_sequences.sql:1`, primary key moved to `("table", "companyId")` in `20240704105128_rfq.sql:120`). The `table` column names the document type it counts (`"job"`, `"changeOrder"`, `"payment"`), and `name` is the label you see in the UI ("Job", "Change Order", "Payment").
+A sequence is a row in the `sequence` table, keyed by `("table", "companyId")` — one counter per document type per company (`packages/database/supabase/migrations/20230525025310_sequences.sql:1`, primary key moved to `("table", "companyId")` in `20240704105128_rfq.sql:120`). The `table` column names the document type it counts (`"job"`, `"changeOrder"`, `"payment"`), and `name` is the label you see in the UI ("Job", "Change Notice", "Payment").
When something needs a new number, Carbon assembles it from three parts:
@@ -66,7 +66,7 @@ A new company is seeded with a sequence for every numbered document type (`packa
| Stock transfer | `stockTransfer` | `ST` | `ST000001` |
| Picking list | `pickingList` | `PL` | `PL000001` |
| Inventory count | `inventoryCount` | `IC` | `IC000001` |
-| Change order | `changeOrder` | `ECO-` | `ECO-000001` |
+| Change notice | `changeOrder` | `CN-` | `CN-000001` |
| Issue (NCR) | `nonConformance` | `NCR` | `NCR000001` |
| Inbound inspection | `inboundInspection` | `II` | `II000001` |
| Gauge | `gauge` | `G` | `G00001` |
@@ -84,6 +84,8 @@ Payments are a good example of the pattern in action. A `payment`, a `creditMemo
The seed table above is what a brand-new company gets. When some sequences were added after launch, the migration that backfilled them for existing companies used a different prefix — jobs, for instance, were backfilled as `WO` for older companies (`packages/database/supabase/migrations/20240909194622_jobs.sql:363`) even though new companies seed as `J`. If a prefix on your company doesn't match the table above, it's likely one of these backfilled defaults. Either way, you can change it under **Settings → Sequences**.
+Change notices are the reverse case: their sequence was re-prefixed from `ECO-` to `CN-` for every company during the rename, so only *new* records get `CN-000001`. Ids already minted as `ECO-000001` are left exactly as they were.
+
## How a number gets assigned
The flow is the same everywhere a number is minted:
diff --git a/apps/erp/app/modules/agent/kb/guides/change-order.md b/apps/erp/app/modules/agent/kb/guides/change-order.md
index 731db0c9ff..e87a9ec4c5 100644
--- a/apps/erp/app/modules/agent/kb/guides/change-order.md
+++ b/apps/erp/app/modules/agent/kb/guides/change-order.md
@@ -4,46 +4,46 @@
The robot's arm bracket needs a thicker wall and one fewer fastener. In a lot of systems that means editing
the live part and hoping nothing in flight notices. Carbon makes you do it deliberately: you open a
-change order, edit a hidden draft of the part's method, review exactly what changed, and release
+change notice, edit a hidden draft of the part's method, review exactly what changed, and release
when it's ready. Until that moment, every job, plan, and cost calculation still sees the old bracket.
-> A change order is the paper trail and the workbench at once. You revise on a draft that no one else can
+> A change notice is the paper trail and the workbench at once. You revise on a draft that no one else can
> see, and release turns that draft into the new truth.
## Start with the parts, not the change
-You can start from **Items → Change Orders → New**, but you'll usually start from the bracket itself. Its part
-header has a **"Create Change Order"** action, its row in the parts table has the same, and the method's
-version menu — the one with **New Version** — offers **New Change Order** right where you're looking at the
+You can start from **Items → Change Notices → New**, but you'll usually start from the bracket itself. Its part
+header has a **"Create Change Notice"** action, its row in the parts table has the same, and the method's
+version menu — the one with **New Version** — offers **New Change Notice** right where you're looking at the
recipe. Each of those pre-attaches the bracket as the first affected item. A change can even start from a
-quality issue, which links the non-conformance to the change order so the fix traces back to the problem.
+quality issue, which links the non-conformance to the change notice so the fix traces back to the problem.
-However you start, the header form is short: a **"Name"**, a **"Category"** (your change-order types, seeded
+However you start, the header form is short: a **"Name"**, a **"Category"** (your change-notice types, seeded
with a starter set like *Design Improvement*, *Cost Reduction*, and *Obsolescence / End-of-Life*), a **"Reason for Change"** and **"Description
of Change"**, an **"Owner"**, **"Priority"**, and dates. If you started from a quality issue, that
non-conformance rides along as the linked issue. The affected item is the unit of work, and once you're on the
-change order the **Add Affected Item** picker is deliberately narrow: **Parts only**. A material, consumable,
+change notice the **Add Affected Item** picker is deliberately narrow: **Parts only**. A material, consumable,
or service doesn't carry an engineering revision, so it never appears.
Before you touch the bracket, though, its own page already warned you this was coming. A part that's on an
-open change order shows a heading right on its detail page — *"This part is on 1 open change order"* — with the
-change order linked, so nobody revises a design that's already mid-change. The alert informs rather than
-blocks: a second change order on the same part is allowed, and Carbon keeps their draft versions from
+open change notice shows a heading right on its detail page — *"This part is on 1 open change notice"* — with the
+change notice linked, so nobody revises a design that's already mid-change. The alert informs rather than
+blocks: a second change notice on the same part is allowed, and Carbon keeps their draft versions from
colliding, so a deliberate parallel change is fine.
Carbon doesn't ask you to describe a change as a list of add-this, delete-that rows. You select the affected
-part and then edit its actual bill of materials and bill of process inside the change order. The change is
+part and then edit its actual bill of materials and bill of process inside the change notice. The change is
whatever the finished draft says it is.
## Draft the change in place
Add the bracket and Carbon quietly snapshots its live method into a new **Draft**
-version stamped to this change order. That draft is invisible everywhere else — it won't show in a version
+version stamped to this change notice. That draft is invisible everywhere else — it won't show in a version
switcher, a copy-target list, or anything MRP, jobs, or costing read. You edit it with the same **Bill of
Material** and **Bill of Process** editors you'd use on the part directly.
Before you edit, pick a **change type** on the affected item. It's the most consequential choice on the whole
-change order, because it decides both what you can touch and what release will create. You can switch it
+change notice, because it decides both what you can touch and what release will create. You can switch it
later, but not for free: switching discards the draft and mints a fresh one from the live method, so any
edits you'd made are reset. Decide the type first, then edit.
@@ -73,12 +73,12 @@ supplier, part number, price, and order quantities on the line before you releas
## Review the diff
-Advance the change order through its stages: **Draft**, then **"Start"**, then **"Engineering Complete"**,
+Advance the change notice through its stages: **Draft**, then **"Start"**, then **"Engineering Complete"**,
then **"Implementation"**. It only moves forward, one step at a time, and **"Start"**, **"Implementation"**,
and **"Done"** each notify the team. There's no separate approval step to configure — the stages are the
-workflow, and the change order is its own gate. If the change doesn't pan out, you're not trapped in the
+workflow, and the change notice is its own gate. If the change doesn't pan out, you're not trapped in the
forward march either: a **"Cancel"** action sits in the header at every open stage. Cancelling locks the
-change order but keeps every draft, and **"Reopen"** takes it back to **Draft** later with your edits
+change notice but keeps every draft, and **"Reopen"** takes it back to **Draft** later with your edits
intact, so shelving a change costs nothing.
You don't have to reach Implementation to see what you've done. The overview page carries a **Changes** card
@@ -96,7 +96,7 @@ simply that draft compared against the live one it came from. What you review is
Confirm the release and Carbon walks the affected items. For the bracket revision it activates the draft
method, archives the prior version, reveals the new revision as a live item, and writes a
-supersession from the old revision to the new one. When every item is done, the change order
+supersession from the old revision to the new one. When every item is done, the change notice
flips to **"Done"** and locks as a read-only record.
You never wrote that supersession by hand. You only chose *how* it phases over, through the affected item's
@@ -113,6 +113,6 @@ the old revision keeps it, and nothing warns or rewrites it at release. Superses
planning — a job cut after the effectivity date picks up the new revision, one cut before it does not.
That's what makes releasing safe on a busy floor.
-Afterward the new revision carries a *"Created by ECO-…"* back-link to the change order that made it, and the
+Afterward the new revision carries a *"Created by CN-…"* back-link to the change notice that made it, and the
bracket's page shows its full change history. The trail from "the wall was too thin" to the released revision
is one click, and the floor never built a single bracket against a design that wasn't done.
diff --git a/apps/erp/app/modules/agent/kb/manifest.json b/apps/erp/app/modules/agent/kb/manifest.json
index f98b4ec5d5..1a15bbcde6 100644
--- a/apps/erp/app/modules/agent/kb/manifest.json
+++ b/apps/erp/app/modules/agent/kb/manifest.json
@@ -354,12 +354,12 @@
},
{
"slug": "docs/reference/change-orders/creating",
- "title": "Create a change order",
- "description": "The entry points that open a change order, the fields on the create form, and how change orders surface back on a part or tool page.",
+ "title": "Create a change notice",
+ "description": "The entry points that open a change notice, the fields on the create form, and how change notices surface back on a part or tool page.",
"keywords": [
"create",
"change",
- "order",
+ "notice",
"docs",
"reference",
"orders",
@@ -368,15 +368,15 @@
"headings": [
"Entry points",
"The create form",
- "Where change orders surface on a part",
+ "Where change notices surface on a part",
"Related"
]
},
{
"slug": "docs/reference/change-orders/index",
- "title": "Change orders",
+ "title": "Change notices",
"description": "How Carbon drafts an engineering change against real methods, reviews it as a diff, and releases it so downstream planning supersedes the versions it replaces.",
- "keywords": ["change", "orders", "docs", "reference", "index"],
+ "keywords": ["change", "notices", "docs", "reference", "orders", "index"],
"headings": [
"The affected item is the unit of work",
"Find one in the list",
@@ -387,7 +387,7 @@
{
"slug": "docs/reference/change-orders/lifecycle",
"title": "Lifecycle & release",
- "description": "The five change-order stages, the impact panel, the diff review, and exactly what release does when a change order reaches Done.",
+ "description": "The five change-notice stages, the Implementation lock and Reopen, the impact panel, the diff review, and exactly what release does when a change notice reaches Done.",
"keywords": [
"lifecycle",
"release",
@@ -398,20 +398,24 @@
],
"headings": [
"The stages",
+ "Implementation freezes the engineering content",
+ "Reopen",
"The impact panel",
"Review the changes, then release",
"What release does",
- "Parallel change orders on the same part",
+ "Parallel change notices on the same part",
"Related",
"Troubleshooting",
- "\"Cannot modify a completed change order.\"",
- "Release button not available"
+ "\"This change notice is being implemented, so its changes are locked. Reopen it to make changes.\"",
+ "\"This change notice is closed, so its changes are read-only.\"",
+ "Release button not available",
+ "Can't find Reopen"
]
},
{
"slug": "docs/reference/change-orders/setup",
"title": "Categories & actions",
- "description": "The two company-scoped lookups that sit alongside change orders — the category list and the reusable action-task templates.",
+ "description": "The two company-scoped lookups that sit alongside change notices — the category list and the reusable action-task templates — plus linking an action task to Linear.",
"keywords": [
"categories",
"actions",
@@ -421,7 +425,12 @@
"orders",
"setup"
],
- "headings": ["Change order categories", "Change order actions", "Related"]
+ "headings": [
+ "Change notice categories",
+ "Change notice actions",
+ "Link a task to Linear",
+ "Related"
+ ]
},
{
"slug": "docs/reference/change-orders/supersession",
@@ -1305,7 +1314,7 @@
{
"slug": "docs/reference/sequences",
"title": "Numbering sequences",
- "description": "The per-company generator behind every readable document number — jobs, change orders, payments, and more.",
+ "description": "The per-company generator behind every readable document number — jobs, change notices, payments, and more.",
"keywords": ["numbering", "sequences", "docs", "reference"],
"headings": [
"What a sequence is",
diff --git a/apps/erp/app/modules/items/AGENTS.md b/apps/erp/app/modules/items/AGENTS.md
index 664b9999d5..83fb0a8da9 100644
--- a/apps/erp/app/modules/items/AGENTS.md
+++ b/apps/erp/app/modules/items/AGENTS.md
@@ -80,53 +80,54 @@ import { itemValidator, itemTrackingTypes, itemReplenishmentSystems } from "~/mo
## Change Orders (sub-area)
-Engineering-change-order (ECO) workflow — a **top-to-bottom**, affected-items-first process: the user picks the parts/tools to change, sets a **per-item change type** (`Version` / `Revision` / `Replacement Part` / `New Part`), edits each item's BOM/BOP/attributes directly on a **real CO-owned Draft `makeMethod`** (via the normal embedded editors), and releases the CO — which activates each draft and propagates via supersession (except a net-new `New Part`, which has no predecessor). Lives **inside** the Items module (not a standalone module). Permission key is `parts` — loaders/actions use `requirePermissions(request, { view | update | delete | create: "parts" })`. Routes live under `apps/erp/app/routes/x+/items+/change-order+/` (detail + `affected`/`action` child mutations) and `x+/items+/change-orders+/` (list + Types config); URLs are `/x/items/change-order(s)…`. The **create form is the exception**: it lives at a top-level `apps/erp/app/routes/x+/change-order+/new.tsx` (URL `/x/change-order/new`, path helper `path.to.newChangeOrder`) so it renders with the app sidebar like `/x/part/new` and `/x/sales-order/new`, not nested under the Items module layout. Navigation is a "Change Orders" group in the Items sidebar (`useItemsSubmodules`). The `$id` **detail page uses the standard 3-pane detail convention** (`PanelProvider` + `ResizablePanels` from `~/components/Layout/Panels`, like sales-order / job): `ChangeOrderExplorer` (affected-items list) is the explorer, the content is a URL-addressed `Outlet`, and `ChangeOrderProperties` (header fields + affected assemblies + impact + release dialog, self-contained via `useRouteData`) is the properties panel. `$id.tsx` keeps `hideModuleSidebar: true` so the Items grouped sidebar doesn't stack next to the explorer. **The content follows the sales-order top-level-detail + line-route split:** `$id.details.tsx` is the **CO overview** (the `ChangeOrderStatusFlow` state bar + the two rich-text narrative fields `reasonForChange` / `description` via `ChangeOrderContent`, edited exactly like the quality issue's description — debounced direct `carbon.from("changeOrder").update` of tiptap JSON — plus the **CO-wide Changes rollup** (`ChangeOrderChanges` — every affected item's authoring diff, rendered between the description and the actions, same label+`ChangeOrderDiffViewer` list as the release dialog) and the action tasks via the shared `ActionTaskList` + "Add Actions" modal, reconciled through `$id.action`); each affected item is its own **line route** `$id.$affectedId.details.tsx` (URL `/x/items/change-order/$id/$affectedId/details`, `path.to.changeOrderAffectedItem`, rendering `AffectedItemDetail`), linked from the explorer (Revision / Replacement Part rows show "OLD → NEW" with the minted item's number, resolved from the items store; a **New Part shows a single id** — it is net-new, so its `newItemId` equals its `itemId` and there is no predecessor to arrow from, guarded by `newItemId !== itemId`). **Purchasable draft items get supplier-part management on the line**: a Revision/New Part line whose draft part is `Buy`/`Buy and Make` renders the embedded `SupplierParts` grid (data from `partData.supplierParts`, already in the `$id` loader); its create/edit drawers are child routes `$id.$affectedId.details.new.tsx` / `$id.$affectedId.details.$supplierPartId.tsx` (the `SupplierPartForm` posts to the PART purchasing actions — the part edit action returns `{ success }` instead of redirecting so embedded callers stay put), and delete is the action-only `$id.$affectedId.details.$supplierPartId.delete.tsx` (`path.to.changeOrderDeleteSupplierPart`). `$id._index` redirects to the overview; the header CO-id links back to it. Plain-text reason/description entered on the create form are converted to tiptap JSON on insert (`toRichText` in `x+/change-order+/new.tsx`).
+Engineering-change-order (ECO) workflow — a **top-to-bottom**, affected-items-first process: the user picks the parts/tools to change, sets a **per-item change type** (`Version` / `Revision` / `Replacement Part` / `New Part`), edits each item's BOM/BOP/attributes directly on a **real CO-owned Draft `makeMethod`** (via the normal embedded editors), and releases the CO — which activates each draft and propagates via supersession (except a net-new `New Part`, which has no predecessor). Lives **inside** the Items module (not a standalone module). Permission key is `parts` — loaders/actions use `requirePermissions(request, { view | update | delete | create: "parts" })`. Routes live under `apps/erp/app/routes/x+/items+/change-notice+/` (detail + `affected`/`action` child mutations) and `x+/items+/change-notices+/` (list + Types config); URLs are `/x/items/change-notice(s)…`. The **create form is the exception**: it lives at a top-level `apps/erp/app/routes/x+/change-notice+/new.tsx` (URL `/x/change-notice/new`, path helper `path.to.newChangeNotice`) so it renders with the app sidebar like `/x/part/new` and `/x/sales-order/new`, not nested under the Items module layout. Navigation is a "Change Notices" group in the Items sidebar (`useItemsSubmodules`). The `$id` **detail page uses the standard 3-pane detail convention** (`PanelProvider` + `ResizablePanels` from `~/components/Layout/Panels`, like sales-order / job): `ChangeNoticeExplorer` (affected-items list) is the explorer, the content is a URL-addressed `Outlet`, and `ChangeNoticeProperties` (header fields + affected assemblies + impact + release dialog, self-contained via `useRouteData`) is the properties panel. `$id.tsx` keeps `hideModuleSidebar: true` so the Items grouped sidebar doesn't stack next to the explorer. **The content follows the sales-order top-level-detail + line-route split:** `$id.details.tsx` is the **CO overview** (the `ChangeNoticeStatusFlow` state bar + the two rich-text narrative fields `reasonForChange` / `description` via `ChangeNoticeContent`, debounced 2.5s then POSTed to the `$id.content` action (NOT a direct `carbon.from("changeOrder").update` like the quality issue — that had no server-side place to enforce the engineering lock) — plus the **CO-wide Changes rollup** (`ChangeNoticeChanges` — every affected item's authoring diff, rendered between the description and the actions, same label+`ChangeNoticeDiffViewer` list as the release dialog) and the action tasks via the shared `ActionTaskList` + "Add Actions" modal, reconciled through `$id.action`); each affected item is its own **line route** `$id.$affectedId.details.tsx` (URL `/x/items/change-notice/$id/$affectedId/details`, `path.to.changeNoticeAffectedItem`, rendering `AffectedItemDetail`), linked from the explorer (Revision / Replacement Part rows show "OLD → NEW" with the minted item's number, resolved from the items store; a **New Part shows a single id** — it is net-new, so its `newItemId` equals its `itemId` and there is no predecessor to arrow from, guarded by `newItemId !== itemId`). **Purchasable draft items get supplier-part management on the line**: a Revision/New Part line whose draft part is `Buy`/`Buy and Make` renders the embedded `SupplierParts` grid (data from `partData.supplierParts`, already in the `$id` loader); its create/edit drawers are child routes `$id.$affectedId.details.new.tsx` / `$id.$affectedId.details.$supplierPartId.tsx` (the `SupplierPartForm` posts to the PART purchasing actions — the part edit action returns `{ success }` instead of redirecting so embedded callers stay put), and delete is the action-only `$id.$affectedId.details.$supplierPartId.delete.tsx` (`path.to.changeNoticeDeleteSupplierPart`). `$id._index` redirects to the overview; the header CO-id links back to it. Plain-text reason/description entered on the create form are converted to tiptap JSON on insert (`toRichText` in `x+/change-notice+/new.tsx`).
**No staged mirror tables.** The v1 `changeOrderStaged*` tables were deleted. A CO's per-affected-item edits now live on a **real Draft `makeMethod`** whose `makeMethod.changeOrderId` points at the CO, edited via the embedded real `BillOfMaterial` / `BillOfProcess` editors on the CO detail page. The **same** draft method also surfaces on the affected item's own master page (`/x/part|tool/$itemId/details`): the item-detail loaders (`x+/part+/$itemId{.,}.tsx`, `x+/tool+/$itemId.details.tsx`) select it like any other method and **no longer exclude `changeOrderId`-stamped drafts**, so a revision/new-part item created by an open CO shows its BOM/BOP on the item master too — the two surfaces edit the same rows and stay in sync. (`Active` is still preferred as the default selection, so a `Version` CO's existing item keeps its live method by default.) `changeOrderId` is cleared at release.
-Change-order code follows the one-service/models/server-per-module convention — it lives in the module's canonical files, NOT separate `changeOrder.*` files: `items.service.ts` holds header CRUD + guarded stage transition + Types config + affected-item CRUD + the CO-owned Draft orchestration (`createChangeOrderDraftMethod` / `addChangeOrderAffectedItem` / `updateChangeOrderAffectedItemChangeType` / cutover + `mintPlaceholderPart` + `getTopLevelProductsForItems` rollup) + the `diffMethod` pure engine + `getChangeOrderDiff` authoring-diff wrapper + item↔CO traceability reads (`findChangeOrdersForItem`, linked-NCR reverse) + freeform action-task CRUD; `items.server.ts` holds the server-only release path (`applyChangeOrder` orchestration + `releaseAffectedItem` + notifications); `items.models.ts` holds the validators + state machine + `changeOrderChangeTypes` + diff types. Non-server exports come through the Items barrel — import from `~/modules/items`; the server file is imported directly from `~/modules/items/items.server`.
+Change-order code follows the one-service/models/server-per-module convention — it lives in the module's canonical files, NOT separate `changeNotice.*` files: `items.service.ts` holds header CRUD + guarded stage transition + Types config + affected-item CRUD + the CO-owned Draft orchestration (`createChangeNoticeDraftMethod` / `addChangeNoticeAffectedItem` / `updateChangeNoticeAffectedItemChangeType` / cutover + `mintPlaceholderPart` + `getTopLevelProductsForItems` rollup) + the `diffMethod` pure engine + `getChangeNoticeDiff` authoring-diff wrapper + item↔CO traceability reads (`findChangeNoticesForItem`, linked-NCR reverse) + freeform action-task CRUD; `items.server.ts` holds the server-only release path (`applyChangeNotice` orchestration + `releaseAffectedItem` + notifications); `items.models.ts` holds the validators + state machine + `changeNoticeChangeTypes` + diff types. Non-server exports come through the Items barrel — import from `~/modules/items`; the server file is imported directly from `~/modules/items/items.server`.
-**Approvals are not in V1.** No approval gate, reviewer/approval-task machinery, or toggle — stages advance freely; a CO reaches Done via `applyChangeOrder`. **Same-part parallel COs are now allowed** — the one-open-CO-per-part guard was dropped; `findOtherOpenChangeOrdersForItem` still exists but is advisory (no route/service enforces it).
+**Approvals are not in V1.** No approval gate, reviewer/approval-task machinery, or toggle — stages advance freely; a CO reaches Done via `applyChangeNotice`. **Same-part parallel COs are now allowed** — the one-open-CO-per-part guard was dropped; `findOtherOpenChangeNoticesForItem` still exists but is advisory (no route/service enforces it).
### Key CO concepts
-- **Stage flow** — `changeOrderStatus`: `Draft` → `Start` → `Engineering Complete` → `Implementation` → `Done`. Forward-only, one step (`changeOrderStatusTransitions` / `isAllowedChangeOrderTransition`). `isChangeOrderLocked(status)` is true at `Done` **or `Cancelled`** (closed, read-only); `canEditChangeOrder` is its inverse. `changeOrderOpenStatuses` = every stage before Done. `Start`/`Implementation`/`Done` broadcast a team notification (`changeOrderBroadcastStages`).
-- **Change type (capability matrix)** — `changeOrderAffectedItem.changeType` ∈ `Version | Revision | Replacement Part | New Part` (`changeOrderChangeTypes`) drives both the editable surface and the release action. Two axes: *is there a predecessor* and *same part number*. The **Add Affected Item** modal (`AffectedItemForm`) is **Parts-only**: the existing-item picker filters to `validItemTypes={["Part"]}` and the New Part mini-form always mints a Part — no Tool path in the UI (the service's `addChangeOrderAffectedItem`/`createChangeOrderDraftMethod` still technically accept Tools, but no route surfaces them). The modal's two branches (New Part vs existing-item) are separate `ValidatedForm`s that MUST carry distinct `key` props — same-slot same-type reconciliation would otherwise share one RVF store, hydrating controlled-field defaults only for whichever branch mounts first (New Part's replenishment/tracking Selects would then submit `""` → enum error).
+- **Stage flow** — `changeOrderStatus`: `Draft` → `Start` → `Engineering Complete` → `Implementation` → `Done`, plus a `Cancelled` off-ramp. Table-driven, one step forward (`changeNoticeStatusTransitions` / `isAllowedChangeNoticeTransition` — the check is purely `allowed.includes(to)`, NOT directional), with two backward **reopen** edges: `Implementation → Engineering Complete` and `Cancelled → Draft`. Both are ⋮-menu items in `ChangeNoticeHeader`. `Done` is terminal — releasing already activated methods and wrote supersessions, so it cannot be reopened. **The reopen edge must stay LAST in the `Implementation` array**: the header reads `transitions[status]?.[0]` for its advance/release action. `changeNoticeOpenStatuses` = every stage before Done. `Start`/`Implementation`/`Done` broadcast a team notification (`changeNoticeBroadcastStages`).
+- **Two lock scopes** (`items.models.ts`) — `isChangeNoticeLocked(status)` is true at `Done`/`Cancelled` (fully closed). On top of that: `canEditChangeNoticeEngineering(status)` additionally excludes `Implementation` and gates affected items (add/remove/change-type), the staged BOM/BOP drafts, cutover config, and `reasonForChange`/`description`; `canEditChangeNoticeWorkflow(status)` is the closed-only test and gates action tasks, assignee, dates and priority — those stay editable at `Implementation`, which is the whole point of that stage. (`canEditChangeNotice` was split into these two and no longer exists.) Server enforcement is `requireChangeNoticeEditable(client, { changeNoticeId, companyId, scope })` in `items.server.ts`; the UI `isDisabled` is cosmetic on top of it. BOM/BOP mutations are covered centrally — `checkRevisionLock` also resolves the owning CO's status, so all ~17 `methods+/` routes inherit the lock without their own guard. Note `item.changeOrderId` is a PERMANENT back-link (unlike `makeMethod.changeOrderId`, cleared at release), so it must never be used to resolve ownership.
+- **Change type (capability matrix)** — `changeOrderAffectedItem.changeType` ∈ `Version | Revision | Replacement Part | New Part` (`changeNoticeChangeTypes`) drives both the editable surface and the release action. Two axes: *is there a predecessor* and *same part number*. The **Add Affected Item** modal (`AffectedItemForm`) is **Parts-only**: the existing-item picker filters to `validItemTypes={["Part"]}` and the New Part mini-form always mints a Part — no Tool path in the UI (the service's `addChangeNoticeAffectedItem`/`createChangeNoticeDraftMethod` still technically accept Tools, but no route surfaces them). The modal's two branches (New Part vs existing-item) are separate `ValidatedForm`s that MUST carry distinct `key` props — same-slot same-type reconciliation would otherwise share one RVF store, hydrating controlled-field defaults only for whichever branch mounts first (New Part's replenishment/tracking Selects would then submit `""` → enum error).
- `Version` — a new Draft method version on the **same item** (BoM/BoP edits); **no** supersession.
- - `Revision` — a new inactive revision item (same #, new rev) with **both BoM/BoP and attributes/docs**; the draft method is edited via the embedded `BillOfMaterial`/`BillOfProcess`, and the draft item's attributes + files via the embedded `PartProperties` (`embedded` variant) on the CO card; auto oldRev→newRev supersession at release. (BoM/BoP on a Revision was a client ask — a revision can carry a manufacturing change, not just a doc/spec change.) The **Add Affected Item** modal shows a `revision` text input for a Revision change so the user can name the revision (e.g. `A`); blank → `createChangeOrderDraftMethod` auto-computes the next revision via `getNextRevision`. (The optional `revision` threads validator → `$id.affected` route → `addChangeOrderAffectedItem` → `createChangeOrderDraftMethod`.)
+ - `Revision` — a new inactive revision item (same #, new rev) with **both BoM/BoP and attributes/docs**; the draft method is edited via the embedded `BillOfMaterial`/`BillOfProcess`, and the draft item's attributes + files via the embedded `PartProperties` (`embedded` variant) on the CO card; auto oldRev→newRev supersession at release. (BoM/BoP on a Revision was a client ask — a revision can carry a manufacturing change, not just a doc/spec change.) The **Add Affected Item** modal shows a `revision` text input for a Revision change so the user can name the revision (e.g. `A`); blank → `createChangeNoticeDraftMethod` auto-computes the next revision via `getNextRevision`. (The optional `revision` threads validator → `$id.affected` route → `addChangeNoticeAffectedItem` → `createChangeNoticeDraftMethod`.)
- `Replacement Part` — a new part **number** derived from the affected part, BoM/BoP **and** attributes (embedded `PartProperties`); auto affected→new supersession at release. The 1:1 replacement (renamed from the old "New Part"). Restricted to Parts. Embedded attribute editing is currently wired for **Parts** only.
- - `New Part` — a **net-new** part (no predecessor, **no supersession**) minted + released under the CO (Make or Buy). Used to introduce a part under change control, including the consolidated "1" in an N→1 assembly BOM change. Added via the "Add Affected Item" modal's change-type Select → create-new-part mini-form (`changeOrderNewPartValidator` — Part Number, Name, Replenishment System, Tracking Type; **no Part/Tool choice — always a Part**; `addChangeOrderAffectedItem`'s `newPart` path mints the item with the chosen `itemTrackingType`). Its type **cannot** be switched (net-new by construction), and it shows no cutover card. Restricted to Parts.
- - **Buy (purchased) items have no BoM/BoP** — `isManufactured = replenishmentSystem !== "Buy"` gates the embedded editors (mirrors the part page). `Version` is hidden from the change-type picker for Buy items, and `addChangeOrderAffectedItem` coerces a Buy item's default `Version` → `Revision` on add. Complementarily, the Add Affected Item item picker restricts to **Make parts** (`Item` `replenishmentSystem="Make"` → `Make` or `Buy and Make`) whenever the selected change type is `Version`, so a Buy part can't be picked for a Version in the first place; other change types show all Parts.
-- **Draft creation (`createChangeOrderDraftMethod`, called by `addChangeOrderAffectedItem`)** — per change type: `Version` → `upsertMakeMethodVersion` + `copyMakeMethod` on the same item; `Revision` → `createRevision(active:false)`; `Replacement Part` → mint a new numeric `readableId` derived from the source (`getNextItemIdFromSource`) + `copyItem`; `New Part` → the item is minted by `addChangeOrderAffectedItem`'s `newPart` path (net-new, no source copy), and this just stamps its trigger-created Draft method CO-owned (`baseMakeMethodId` null). The resulting Draft method's `changeOrderId` is stamped to the CO (and the new item's, for Revision/Replacement Part/New Part). The draft refs (`draftMakeMethodId`, `baseMakeMethodId`, `newItemId`) are written back onto the affected-item row. **The Version draft is numbered `max(all versions)+1`, not `active+1`** (with a unique-violation retry) so parallel COs on the same part get distinct versions instead of colliding on `makeMethod (itemId, version)`. **Switching change type discards + recreates the draft** (`updateChangeOrderAffectedItemChangeType`), resetting edits — but a `New Part` cannot be switched to/from. Removing an affected item discards its draft. (`mintPlaceholderPart` exists but is **not wired** into any current path — the old G3 forward-reference claim is stale.)
-- **Authoring diff (git-style end-state)** — `getChangeOrderDiff` + pure `diffMethod` (unit-tested in `changeOrder.diff.test.ts`) diffs the CO-owned Draft method against the **base Active method** the draft was copied from (both real methods), correlating rows by natural key (material → component `itemId`, operation → `order`, operation children → `name`/`key`/`toolId`) since the copied draft carries no back-pointer ids. Classifies each material/operation/attribute added/removed/modified/unchanged. For a Revision/Replacement Part/New Part draft item it also surfaces the draft's **supplier parts** as additions — the source item's suppliers are NOT copied to the draft, so `getChangeOrderDiff` (via `readDraftSupplierParts`) emits each `supplierPart` row as `added`; a `Version` shares the live item's suppliers and shows none. Rendered **read-only** by `ChangeOrderDiffViewer` — the single diff renderer, reused by the affected-item "Changes" card (`AffectedItemDetail`), the CO-wide `ChangeOrderChanges` rollup on the overview, and the release dialog (shown during authoring, not just at release).
-- **Release confirmation** — `ChangeOrderReleaseMerge` (properties panel, at Implementation) is a plain review-then-confirm dialog: it shows each affected item's authoring diff (`getChangeOrderDiff`) and posts Implementation → Done. **No merge/conflict step** — releasing a Version just appends a new Active version and archives the prior one, so a same-part parallel CO that released first is not clobbered (its version stays as method history). The old 2-way merge / conflict-resolver UI + `getChangeOrderReleaseDiff` / `reconcileDraftWithLive` were removed.
-- **Release (`applyChangeOrder` → `releaseAffectedItem`)** — the Implementation → Done action. Dispatch by change type per affected item: `Version` activates the Draft (prior Active → Archived), no new item, no supersession; `Revision`/`Replacement Part` activate the Draft, reveal the new item (`item.active = true`, stamp `item.changeOrderId`), and auto-write the affected→new `itemSupersession`; `New Part` activates the Draft + reveals the net-new item but writes **no** supersession (no predecessor). `applyChangeOrder` releases **New Part items first** (stable sort) so a parent assembly's BOM line resolves to an already-active new part. Final Kysely CAS flip to Done. Idempotent: a released draft has its `makeMethod.changeOrderId` cleared, so a re-run skips it.
+ - `New Part` — a **net-new** part (no predecessor, **no supersession**) minted + released under the CO (Make or Buy). Used to introduce a part under change control, including the consolidated "1" in an N→1 assembly BOM change. Added via the "Add Affected Item" modal's change-type Select → create-new-part mini-form (`changeNoticeNewPartValidator` — Part Number, Name, Replenishment System, Tracking Type; **no Part/Tool choice — always a Part**; `addChangeNoticeAffectedItem`'s `newPart` path mints the item with the chosen `itemTrackingType`). Its type **cannot** be switched (net-new by construction), and it shows no cutover card. Restricted to Parts.
+ - **Buy (purchased) items have no BoM/BoP** — `isManufactured = replenishmentSystem !== "Buy"` gates the embedded editors (mirrors the part page). `Version` is hidden from the change-type picker for Buy items, and `addChangeNoticeAffectedItem` coerces a Buy item's default `Version` → `Revision` on add. Complementarily, the Add Affected Item item picker restricts to **Make parts** (`Item` `replenishmentSystem="Make"` → `Make` or `Buy and Make`) whenever the selected change type is `Version`, so a Buy part can't be picked for a Version in the first place; other change types show all Parts.
+- **Draft creation (`createChangeNoticeDraftMethod`, called by `addChangeNoticeAffectedItem`)** — per change type: `Version` → `upsertMakeMethodVersion` + `copyMakeMethod` on the same item; `Revision` → `createRevision(active:false)`; `Replacement Part` → mint a new numeric `readableId` derived from the source (`getNextItemIdFromSource`) + `copyItem`; `New Part` → the item is minted by `addChangeNoticeAffectedItem`'s `newPart` path (net-new, no source copy), and this just stamps its trigger-created Draft method CO-owned (`baseMakeMethodId` null). The resulting Draft method's `changeOrderId` is stamped to the CO (and the new item's, for Revision/Replacement Part/New Part). The draft refs (`draftMakeMethodId`, `baseMakeMethodId`, `newItemId`) are written back onto the affected-item row. **The Version draft is numbered `max(all versions)+1`, not `active+1`** (with a unique-violation retry) so parallel COs on the same part get distinct versions instead of colliding on `makeMethod (itemId, version)`. **Switching change type discards + recreates the draft** (`updateChangeNoticeAffectedItemChangeType`), resetting edits — but a `New Part` cannot be switched to/from. Removing an affected item discards its draft. (`mintPlaceholderPart` exists but is **not wired** into any current path — the old G3 forward-reference claim is stale.)
+- **Authoring diff (git-style end-state)** — `getChangeNoticeDiff` + pure `diffMethod` (unit-tested in `items.service.test.ts`) diffs the CO-owned Draft method against the **base Active method** the draft was copied from (both real methods), correlating rows by natural key (material → component `itemId`, operation → `order`, operation children → `name`/`key`/`toolId`) since the copied draft carries no back-pointer ids. Classifies each material/operation/attribute added/removed/modified/unchanged. For a Revision/Replacement Part/New Part draft item it also surfaces the draft's **supplier parts** as additions — the source item's suppliers are NOT copied to the draft, so `getChangeNoticeDiff` (via `readDraftSupplierParts`) emits each `supplierPart` row as `added`; a `Version` shares the live item's suppliers and shows none. Rendered **read-only** by `ChangeNoticeDiffViewer` — the single diff renderer, reused by the affected-item "Changes" card (`AffectedItemDetail`), the CO-wide `ChangeNoticeChanges` rollup on the overview, and the release dialog (shown during authoring, not just at release).
+- **Release confirmation** — `ChangeNoticeReleaseMerge` (properties panel, at Implementation) is a plain review-then-confirm dialog: it shows each affected item's authoring diff (`getChangeNoticeDiff`) and posts Implementation → Done. **No merge/conflict step** — releasing a Version just appends a new Active version and archives the prior one, so a same-part parallel CO that released first is not clobbered (its version stays as method history). The old 2-way merge / conflict-resolver UI + `getChangeNoticeReleaseDiff` / `reconcileDraftWithLive` were removed.
+- **Release (`applyChangeNotice` → `releaseAffectedItem`)** — the Implementation → Done action. Dispatch by change type per affected item: `Version` activates the Draft (prior Active → Archived), no new item, no supersession; `Revision`/`Replacement Part` activate the Draft, reveal the new item (`item.active = true`, stamp `item.changeOrderId`), and auto-write the affected→new `itemSupersession`; `New Part` activates the Draft + reveals the net-new item but writes **no** supersession (no predecessor). `applyChangeNotice` releases **New Part items first** (stable sort) so a parent assembly's BOM line resolves to an already-active new part. Final Kysely CAS flip to Done. Idempotent: a released draft has its `makeMethod.changeOrderId` cleared, so a re-run skips it.
- **Supersession propagation (no parent cascade)** — changing a component does **not** re-BOM its parents. Propagation is via supersession chains (`itemSupersession`): the auto affected→new cutover per Revision/Replacement Part affected item (a net-new New Part has no predecessor, so no supersession). **N→1 consolidation** ("3 parts become 1") is modeled as a parent-assembly `Version`/`Revision` change whose draft BOM removes the old component lines and adds a `New Part` line — surfaced by `diffMethod` as removed + added, **not** as supersessions. `item.changeOrderId` is the revision→CO back-link powering the "Created by CO-…" chip and part-side change history.
-- **Impact panel** — read-only "where used" view: for each affected item, where it is referenced across the system (jobs, job materials, POs, receipts, sales orders, shipments, quotes, methods, NCRs, …), reusing the part detail page's `getPartUsedIn` data + the shared `UsedInItem` tree rows (`ImpactPanel` maps one where-used group per affected item; empty categories are dropped). Always shown in the properties panel. Loaded per affected item in the CO `$id` loader via `getPartUsedIn(client, affectedItem.itemId, companyId)` → `impactUsedIn`. (The old `getChangeOrderImpact` open-PO/jobs/sales table was removed.)
+- **Impact panel** — read-only "where used" view: for each affected item, where it is referenced across the system (jobs, job materials, POs, receipts, sales orders, shipments, quotes, methods, NCRs, …), reusing the part detail page's `getPartUsedIn` data + the shared `UsedInItem` tree rows (`ImpactPanel` maps one where-used group per affected item; empty categories are dropped). Always shown in the properties panel. Loaded per affected item in the CO `$id` loader via `getPartUsedIn(client, affectedItem.itemId, companyId)` → `impactUsedIn`. (The old `getChangeNoticeImpact` open-PO/jobs/sales table was removed.)
- **Linked NCR** — a CO may reference a non-conformance (`changeOrder.nonConformanceId`), cross-linked both ways with the Issue detail.
-- **Change-orders list** (`ChangeOrdersTable`, `x+/items+/change-orders+/_index.tsx`) — reads the `changeOrders` view. Rows are **expandable** (`renderExpandedRow`/`canExpandRow`, storage-units spine style) to reveal each affected item (readableId + `ChangeTypeBadge` + OLD→NEW for Revision/Replacement Part; a New Part shows a single id — net-new, `newItemId === itemId`), and an **Item** filter (`isArray` static filter → `filter=itemIds:contains:<id>` → `.overlaps("itemIds", …)`) narrows COs to those affecting the selected items. The `itemIds` column is hidden by default (`defaultColumnVisibility`) — it still drives the filter and CSV export.
+- **Change-orders list** (`ChangeNoticesTable`, `x+/items+/change-notices+/_index.tsx`) — reads the `changeOrders` view. Rows are **expandable** (`renderExpandedRow`/`canExpandRow`, storage-units spine style) to reveal each affected item (readableId + `ChangeTypeBadge` + OLD→NEW for Revision/Replacement Part; a New Part shows a single id — net-new, `newItemId === itemId`), and an **Item** filter (`isArray` static filter → `filter=itemIds:contains:<id>` → `.overlaps("itemIds", …)`) narrows COs to those affecting the selected items. The `itemIds` column is hidden by default (`defaultColumnVisibility`) — it still drives the filter and CSV export.
**Deferred (not yet built):** Tool affected items — the Add Affected Item modal is Parts-only, so there is no UI path to add a Tool (or edit Tool attributes) under a CO today, even though the service layer still accepts Tools.
### CO Safety
-- MUST advance stages only through `updateChangeOrderStatus` — the single guarded writer (forward-only + compare-and-swap on `fromStatus`).
-- MUST check `isChangeOrderLocked(status)` (Done) before editing header/content.
-- MUST add affected items through `addChangeOrderAffectedItem` — it spins the CO-owned Draft method and writes the draft refs back; a bare `changeOrderAffectedItem` insert leaves the diff/release with no draft to activate.
-- MUST use `applyChangeOrder` (the Implementation → Done "release") for the release lifecycle — never re-implement `activateMethodVersion`/`itemSupersession` inline. It orchestrates canonical helpers via edge-function calls, so it is **not** one transaction (G2); only the final flip to Done is a Kysely CAS. It is idempotent per affected item (a Draft whose `changeOrderId` is already cleared is skipped) and CO-wide (the closing CAS on `status='Implementation'`).
-- `findChangeOrdersForItem` (in `items.service.ts`) is G6 — the single canonical "change orders referencing this item" query (spans affected items, BOM components on CO-owned draft methods, manual supersession predecessor/successor, and the `item.changeOrderId` reverse link on released revisions), scoped by `readableId`. Flat queries + JS union (no PostgREST embeds — TS2589 budget). Powers the part/tool detail history + open-CO alert. Do not add a second query for this.
-- Never split CO code into separate `changeOrder.*` service/models/server files — it lives in the module's canonical `items.service.ts` / `items.models.ts` / `items.server.ts` (the one-service/models/server-per-module convention). Add CO functions there, alongside the rest of the items module.
+- MUST advance stages only through `updateChangeNoticeStatus` — the single guarded writer (forward-only + compare-and-swap on `fromStatus`).
+- MUST gate every CO mutation route with `requireChangeNoticeEditable(client, { changeNoticeId, companyId, scope })` from `items.server.ts` — `scope: "engineering"` for affected items / BOM / BOP / cutover / reason / description, `scope: "workflow"` for action tasks and header fields. A UI-only `isDisabled` is not a lock.
+- MUST add affected items through `addChangeNoticeAffectedItem` — it spins the CO-owned Draft method and writes the draft refs back; a bare `changeOrderAffectedItem` insert leaves the diff/release with no draft to activate.
+- MUST use `applyChangeNotice` (the Implementation → Done "release") for the release lifecycle — never re-implement `activateMethodVersion`/`itemSupersession` inline. It orchestrates canonical helpers via edge-function calls, so it is **not** one transaction (G2); only the final flip to Done is a Kysely CAS. It is idempotent per affected item (a Draft whose `changeOrderId` is already cleared is skipped) and CO-wide (the closing CAS on `status='Implementation'`).
+- `findChangeNoticesForItem` (in `items.service.ts`) is G6 — the single canonical "change orders referencing this item" query (spans affected items, BOM components on CO-owned draft methods, manual supersession predecessor/successor, and the `item.changeOrderId` reverse link on released revisions), scoped by `readableId`. Flat queries + JS union (no PostgREST embeds — TS2589 budget). Powers the part/tool detail history + open-CO alert. Do not add a second query for this.
+- Never split CO code into separate `changeNotice.*` service/models/server files — it lives in the module's canonical `items.service.ts` / `items.models.ts` / `items.server.ts` (the one-service/models/server-per-module convention). Add CO functions there, alongside the rest of the items module.
### CO data model
| Table / Column | Purpose |
|---|---|
| `changeOrder` | Header: `changeOrderId`, `name`, `status`, `changeOrderTypeId`, `type` (legacy), `priority`, `nonConformanceId`, dates, `assignee`, `reasonForChange`/`description` |
-| `changeOrders` (view) | List-view rollup of `changeOrder` + `itemIds` (text[] of affected item ids — powers the list's **Item** filter via `.overlaps`) + `affectedItems` (jsonb `{id,itemId,changeType,newItemId}[]` — powers the list's **expandable rows**). `getChangeOrders` reads this view (not the base table); the single-CO `getChangeOrder` still reads the base table, so `ChangeOrder` (list, nullable view cols) and the detail shape are distinct types (`ChangeOrderListItem` vs `ChangeOrder`) |
+| `changeOrders` (view) | List-view rollup of `changeOrder` + `itemIds` (text[] of affected item ids — powers the list's **Item** filter via `.overlaps`) + `affectedItems` (jsonb `{id,itemId,changeType,newItemId}[]` — powers the list's **expandable rows**). `getChangeNotices` reads this view (not the base table); the single-CO `getChangeNotice` still reads the base table, so the list shape (nullable view cols) and the detail shape are distinct types (`ChangeNoticeListItem` vs `ChangeNotice`) |
| `changeOrderType` | The "Category" lookup (configured like Issue Types) |
| `changeOrderAffectedItem` | The items the CO changes — user-selected first (or minted, for a net-new `New Part`). Carries `changeType` (`Version`/`Revision`/`Replacement Part`/`New Part`), the CO-owned Draft refs `draftMakeMethodId` + `baseMakeMethodId` (the source Active method; null for a net-new `New Part`), the revealed item `newItemId` (Revision/Replacement Part/New Part; also the release idempotency marker), and cutover config (`supersessionMode`, `discontinuationDate`, `successorEffectivityDate` — not used by `New Part`) |
| `makeMethod.changeOrderId` | Draft-method → CO link: a Draft `makeMethod` with a non-null `changeOrderId` is CO-owned. Shown/edited both in the CO workspace and on the affected item's own master page (item-detail loaders select it in sync — they do **not** exclude `changeOrderId` drafts); cleared at release |
-| `changeOrderSupersession` | MANUAL different-part obsolescence declarations (`predecessorItemId` → `successorItemId`). **Table retained** (still read by `findChangeOrdersForItem`) but the create UI + CRUD were removed — no v2 path writes rows; the auto affected→new cutover covers same-part supersession |
+| `changeOrderSupersession` | MANUAL different-part obsolescence declarations (`predecessorItemId` → `successorItemId`). **Table retained** (still read by `findChangeNoticesForItem`) but the create UI + CRUD were removed — no v2 path writes rows; the auto affected→new cutover covers same-part supersession |
| `changeOrderActionTask` | Freeform non-gating tasks (Actions) |
| `item.changeOrderId` | Revision/new-part → CO back-link, stamped at release; powers change history + revision-centric audit |
diff --git a/apps/erp/app/modules/items/items.models.ts b/apps/erp/app/modules/items/items.models.ts
index 38b64fccd6..f5a235fc3f 100644
--- a/apps/erp/app/modules/items/items.models.ts
+++ b/apps/erp/app/modules/items/items.models.ts
@@ -988,13 +988,13 @@ export const itemRevisionStatus = [
// companySettings.plmReleaseControl
export const plmReleaseControl = ["off", "warn", "enforce"] as const;
-// Error shape returned by the change order service functions: either a real
+// Error shape returned by the change notice service functions: either a real
// Supabase PostgrestError or a hand-built message (sequence/lookup failures that
// don't originate from a query). One alias so callers get a consistent contract.
-export type ChangeOrderError = PostgrestError | { message: string };
+export type ChangeNoticeError = PostgrestError | { message: string };
// =============================================================================
-// Change Orders — validators, enums, and the stage state machine.
+// Change Notices — validators, enums, and the stage state machine.
//
// A sub-area of the Items module, modeled on Quality. The header evolves the
// existing `changeOrder` table. v2: a CO's per-affected-item edits live on a
@@ -1005,9 +1005,9 @@ export type ChangeOrderError = PostgrestError | { message: string };
// changeOrder.type — the legacy category enum on the header. Retained (the
// column still exists); the primary "Category" is `changeOrderTypeId` (a row in
-// the changeOrderType lookup, reseeded to Design improvement / Obsolescence /
+// the changeNoticeType lookup, reseeded to Design improvement / Obsolescence /
// Cost reduction).
-export const changeOrderType = [
+export const changeNoticeType = [
"Engineering",
"Manufacturing",
"Documentation"
@@ -1016,7 +1016,7 @@ export const changeOrderType = [
// V1 stage flow (forward, one step at a time). Broadcast on Start /
// Implementation / Done; silent on Draft / Engineering Complete. "Cancelled" is
// the off-ramp: a CO can be closed from any open stage and reopened to Draft.
-export const changeOrderStatus = [
+export const changeNoticeStatus = [
"Draft",
"Start",
"Engineering Complete",
@@ -1028,7 +1028,7 @@ export const changeOrderStatus = [
// The forward progress stages only (excludes the "Cancelled" off-ramp). Drives
// the read-only status-flow progress bar so a cancelled CO doesn't render as a
// sixth step.
-export const changeOrderStageFlow: (typeof changeOrderStatus)[number][] = [
+export const changeNoticeStageFlow: (typeof changeNoticeStatus)[number][] = [
"Draft",
"Start",
"Engineering Complete",
@@ -1036,7 +1036,7 @@ export const changeOrderStageFlow: (typeof changeOrderStatus)[number][] = [
"Done"
];
-export const changeOrderTaskStatus = [
+export const changeNoticeTaskStatus = [
"Pending",
"In Progress",
"Completed",
@@ -1057,16 +1057,16 @@ export const changeOrderTaskStatus = [
// change.
// BoM/BoP is editable on ANY change type for a manufactured (non-Buy) draft; only
// Version's extra editing scope differs (no attributes/docs/cutover surface).
-export const changeOrderChangeTypes = [
+export const changeNoticeChangeTypes = [
"Version",
"Revision",
"Replacement Part",
"New Part"
] as const;
-export type ChangeOrderChangeType = (typeof changeOrderChangeTypes)[number];
+export type ChangeNoticeChangeType = (typeof changeNoticeChangeTypes)[number];
// changeOrder.priority reuses quality's nonConformancePriority DB enum.
-export const changeOrderPriority = nonConformancePriority;
+export const changeNoticePriority = nonConformancePriority;
// -----------------------------------------------------------------------------
// Stage state machine (G8 — one place). Forward, single step, plus the Cancel /
@@ -1074,37 +1074,38 @@ export const changeOrderPriority = nonConformancePriority;
// IMPORTANT: the forward stage is always index 0 — the header's "Advance" action
// reads `transitions[status][0]`, so "Cancelled" must never be first.
// -----------------------------------------------------------------------------
-export const changeOrderStatusTransitions: Record<
- (typeof changeOrderStatus)[number],
- (typeof changeOrderStatus)[number][]
+export const changeNoticeStatusTransitions: Record<
+ (typeof changeNoticeStatus)[number],
+ (typeof changeNoticeStatus)[number][]
> = {
Draft: ["Start", "Cancelled"],
Start: ["Engineering Complete", "Cancelled"],
"Engineering Complete": ["Implementation", "Cancelled"],
- Implementation: ["Done", "Cancelled"],
+ // Last entry is the reopen edge — "Done" stays first so the header still advances/releases.
+ Implementation: ["Done", "Cancelled", "Engineering Complete"],
Done: [],
// Reopen a closed CO back to Draft (fully editable). Done stays terminal.
Cancelled: ["Draft"]
};
-export function isAllowedChangeOrderTransition(
+export function isAllowedChangeNoticeTransition(
from: string | null | undefined,
to: string | null | undefined
): boolean {
if (!from || !to || from === to) return false;
const allowed =
- changeOrderStatusTransitions[from as (typeof changeOrderStatus)[number]];
+ changeNoticeStatusTransitions[from as (typeof changeNoticeStatus)[number]];
if (!allowed) return false;
return (allowed as readonly string[]).includes(to);
}
// The stages that broadcast a team notification on entry.
-export const changeOrderBroadcastStages: (typeof changeOrderStatus)[number][] =
+export const changeNoticeBroadcastStages: (typeof changeNoticeStatus)[number][] =
["Start", "Implementation", "Done"];
// "Open" = every stage before the record is closed at Done. Used by the item
// open-CO alert and the single-open-CO guard.
-export const changeOrderOpenStatuses: (typeof changeOrderStatus)[number][] = [
+export const changeNoticeOpenStatuses: (typeof changeNoticeStatus)[number][] = [
"Draft",
"Start",
"Engineering Complete",
@@ -1113,28 +1114,46 @@ export const changeOrderOpenStatuses: (typeof changeOrderStatus)[number][] = [
// Locked once closed — Done (released, part of the audit trail) or Cancelled
// (abandoned). Reopen a Cancelled CO to Draft to edit it again.
-export function isChangeOrderLocked(
+export function isChangeNoticeLocked(
status: string | null | undefined
): boolean {
return status === "Done" || status === "Cancelled";
}
-// Content (reason/description/products/BOM changes/actions) is editable until
-// the CO is closed.
-export function canEditChangeOrder(status: string | null | undefined): boolean {
- return !isChangeOrderLocked(status);
+// Engineering content — affected items, BOM/BOP drafts, cutover, reason/description.
+// Frozen from Implementation onward: what is being implemented must not shift underneath.
+export function canEditChangeNoticeEngineering(
+ status: string | null | undefined
+): boolean {
+ return !isChangeNoticeLocked(status) && status !== "Implementation";
+}
+
+// Why a change notice is locked, for whichever surface is asking: server guards
+// flash it, the affected-item UI shows it in the read-only tooltip. One wording,
+// so the two never drift.
+export function changeNoticeLockedMessage(status: string | null | undefined) {
+ return status === "Implementation"
+ ? "This change notice is being implemented, so its changes are locked. Reopen it to make changes."
+ : "This change notice is closed, so its changes are read-only.";
+}
+
+// Workflow content — action tasks, assignee, dates, priority. Editable until closed.
+export function canEditChangeNoticeWorkflow(
+ status: string | null | undefined
+): boolean {
+ return !isChangeNoticeLocked(status);
}
// -----------------------------------------------------------------------------
// Header
// -----------------------------------------------------------------------------
-export const changeOrderValidator = z.object({
+export const changeNoticeValidator = z.object({
id: zfd.text(z.string().optional()),
changeOrderId: zfd.text(z.string().optional()),
name: z.string().min(1, { message: "Name is required" }),
reasonForChange: zfd.text(z.string().optional()),
description: zfd.text(z.string().optional()),
- type: z.enum(changeOrderType).optional(),
+ type: z.enum(changeNoticeType).optional(),
priority: z.enum(nonConformancePriority).optional(),
changeOrderTypeId: zfd.text(z.string().optional()),
nonConformanceId: zfd.text(z.string().optional()),
@@ -1149,10 +1168,10 @@ export const changeOrderValidator = z.object({
// Status transition (used by the $id.status route). fromStatus drives a
// compare-and-swap so a stale/concurrent transition is rejected.
-export const changeOrderStatusValidator = z.object({
+export const changeNoticeStatusValidator = z.object({
id: z.string().min(1, { message: "Id is required" }),
- fromStatus: z.enum(changeOrderStatus),
- status: z.enum(changeOrderStatus),
+ fromStatus: z.enum(changeNoticeStatus),
+ status: z.enum(changeNoticeStatus),
assignee: zfd.text(z.string().optional())
});
@@ -1167,24 +1186,24 @@ export const changeOrderStatusValidator = z.object({
// Affected item — the part the user selects to change. Adding one creates a
// CO-owned Draft make method per the change type (service side).
-export const changeOrderAffectedItemValidator = z.object({
+export const changeNoticeAffectedItemValidator = z.object({
id: zfd.text(z.string().optional()),
- changeOrderId: z.string().min(1, { message: "Change order is required" }),
+ changeOrderId: z.string().min(1, { message: "Change notice is required" }),
itemId: z.string().min(1, { message: "Item is required" }),
- changeType: z.enum(changeOrderChangeTypes).default("Version"),
+ changeType: z.enum(changeNoticeChangeTypes).default("Version"),
// Optional revision label for a Revision change (e.g. "A"). Blank → the next
- // revision is auto-computed server-side (createChangeOrderDraftMethod).
+ // revision is auto-computed server-side (createChangeNoticeDraftMethod).
revision: zfd.text(z.string().optional())
});
// Add-affected-item path for a net-new "New Part" (no existing itemId): the CO
// mints a brand-new inactive Part and adds it as a New Part affected item. Always
// a Part (no Part/Tool choice in the modal).
-export const changeOrderNewPartValidator = z.object({
- changeOrderId: z.string().min(1, { message: "Change order is required" }),
+export const changeNoticeNewPartValidator = z.object({
+ changeOrderId: z.string().min(1, { message: "Change notice is required" }),
// The route branches on this raw FormData value; also seeds the change-type
// Select so it reads "New Part" after the form remounts (see AffectedItemForm).
- changeType: z.enum(changeOrderChangeTypes).default("New Part"),
+ changeType: z.enum(changeNoticeChangeTypes).default("New Part"),
readableId: z.string().min(1, { message: "Part number is required" }),
name: z.string().min(1, { message: "Name is required" }),
replenishmentSystem: z.enum(["Buy", "Make", "Buy and Make"]).default("Make"),
@@ -1192,15 +1211,15 @@ export const changeOrderNewPartValidator = z.object({
});
// Switch the change type on an existing affected item (rebuilds its CO-owned
-// Draft make method for the new type — see updateChangeOrderAffectedItemChangeType).
-export const changeOrderAffectedItemChangeTypeValidator = z.object({
+// Draft make method for the new type — see updateChangeNoticeAffectedItemChangeType).
+export const changeNoticeAffectedItemChangeTypeValidator = z.object({
id: z.string().min(1, { message: "Id is required" }),
- changeType: z.enum(changeOrderChangeTypes)
+ changeType: z.enum(changeNoticeChangeTypes)
});
// Per-item revision cutover config (Q3): existence of the oldRev→newRev
// supersession is automatic at release; the user only tunes mode + dates here.
-export const changeOrderAffectedItemCutoverValidator = z.object({
+export const changeNoticeAffectedItemCutoverValidator = z.object({
id: z.string().min(1, { message: "Id is required" }),
supersessionMode: z.enum(supersessionModes),
discontinuationDate: zfd.text(z.string().optional()),
@@ -1210,14 +1229,14 @@ export const changeOrderAffectedItemCutoverValidator = z.object({
// Action task status transition (Start / Complete / Reopen). Actions are
// instantiated from templates (see changeOrderRequiredAction); there's no
// freeform-create validator.
-export const changeOrderActionStatusValidator = z.object({
+export const changeNoticeActionStatusValidator = z.object({
id: z.string().min(1, { message: "Id is required" }),
- status: z.enum(changeOrderTaskStatus)
+ status: z.enum(changeNoticeTaskStatus)
});
// Configurable default actions (changeOrderRequiredAction templates) — the
-// per-company set a new change order is seeded from. Configured like Issue Types.
-export const changeOrderRequiredActionValidator = z.object({
+// per-company set a new change notice is seeded from. Configured like Issue Types.
+export const changeNoticeRequiredActionValidator = z.object({
id: zfd.text(z.string().optional()),
name: z.string().min(1, { message: "Name is required" }),
active: zfd.checkbox()
@@ -1239,8 +1258,8 @@ export type MethodDiffEntry<T> = {
// One operation's child-level diff (steps / parameters / tools), each bucket
// classified added/removed/modified/unchanged. Defined here (not in
-// changeOrder.diff.ts) so ChangeOrderItemDiff can carry the operation tree
-// without a circular import; changeOrder.diff.ts re-exports these for its own
+// items.service.ts) so ChangeNoticeItemDiff can carry the operation tree
+// without a circular import; items.service.ts re-exports these for its own
// callers.
export type OperationChildrenDiff = {
steps: MethodDiffEntry<Record<string, unknown>>[];
@@ -1254,7 +1273,7 @@ export type OperationDiffEntry = MethodDiffEntry<Record<string, unknown>> & {
children?: OperationChildrenDiff;
};
-export type ChangeOrderItemDiff = {
+export type ChangeNoticeItemDiff = {
affectedItemId: string;
itemId: string;
materials: MethodDiffEntry<Record<string, unknown>>[];
@@ -1268,9 +1287,9 @@ export type ChangeOrderItemDiff = {
};
// -----------------------------------------------------------------------------
-// Change Order Types (the "Category" lookup — configured like Issue Types)
+// Change Notice Types (the "Category" lookup — configured like Issue Types)
// -----------------------------------------------------------------------------
-export const changeOrderTypeValidator = z.object({
+export const changeNoticeTypeValidator = z.object({
id: zfd.text(z.string().optional()),
name: z.string().min(1, { message: "Name is required" })
});
diff --git a/apps/erp/app/modules/items/items.server.ts b/apps/erp/app/modules/items/items.server.ts
index 0e7619c03f..d20bead040 100644
--- a/apps/erp/app/modules/items/items.server.ts
+++ b/apps/erp/app/modules/items/items.server.ts
@@ -1,19 +1,28 @@
+import { error } from "@carbon/auth";
+import { flash } from "@carbon/auth/session.server";
import type { Database } from "@carbon/database";
import type { Kysely, KyselyDatabase } from "@carbon/database/client";
import { trigger } from "@carbon/jobs";
import { getLogger } from "@carbon/logger";
import { NotificationEvent } from "@carbon/notifications";
import type { SupabaseClient } from "@supabase/supabase-js";
+import { data } from "react-router";
import { activateMethodVersion, upsertItemSupersession } from "~/modules/items";
import { getCompanySettings } from "~/modules/settings";
+import { requireUnlockedBulk } from "~/utils/lockedGuard.server";
import type { plmReleaseControl } from "./items.models";
-import { supersessionModes } from "./items.models";
+import {
+ canEditChangeNoticeEngineering,
+ canEditChangeNoticeWorkflow,
+ changeNoticeLockedMessage,
+ supersessionModes
+} from "./items.models";
const logger = getLogger("erp", "change-orders");
// Release-lock helpers — gate BOM/BOP mutations on a released (Production)
// revision. A Production revision is the controlled, released make method;
-// changes must flow through a change order. The pending revision an ECO creates
+// changes must flow through a change notice. The pending revision an ECO creates
// is Design/Prototype (NOT Production), so it stays editable.
export type ReleaseControl = (typeof plmReleaseControl)[number];
@@ -21,7 +30,7 @@ export type ReleaseControl = (typeof plmReleaseControl)[number];
type ItemRevisionStatus = Database["public"]["Enums"]["itemRevisionStatus"];
export const LOCKED_REVISION_MESSAGE =
- "This revision is released (Production). Open a change order to modify it.";
+ "This revision is released (Production). Open a change notice to modify it.";
export type LockKind =
| "item"
@@ -55,81 +64,101 @@ export function getLockVerdict(lock: {
return { ok: false, warn: false, message: LOCKED_REVISION_MESSAGE };
}
-// Each kind resolves entity -> item.revisionStatus in a single nested PostgREST
-// select instead of walking the FK chain with sequential single-row queries.
+type MethodLock = {
+ revisionStatus: ItemRevisionStatus | null;
+ changeNoticeStatus: string | null;
+};
+
+const NO_LOCK: MethodLock = { revisionStatus: null, changeNoticeStatus: null };
+
+// The FK chain from each lock kind up to its owning make method, expressed once.
+// The two lock inputs (the item's revisionStatus and the owning change notice's
+// status) hang off that method, so one nested select answers both — walking the
+// chain twice would double a query that runs on every BOM/BOP mutation.
+// `methodMaterial` has two FKs to `makeMethod` (makeMethodId and
+// materialMakeMethodId); the parent method is methodMaterial_methodId_fkey.
+const METHOD_LOCK_SOURCE = "changeOrder(status), item(revisionStatus)";
+
+const methodLockQueries = {
+ makeMethod: ["makeMethod", METHOD_LOCK_SOURCE],
+ material: [
+ "methodMaterial",
+ `makeMethod!methodMaterial_methodId_fkey(${METHOD_LOCK_SOURCE})`
+ ],
+ operation: ["methodOperation", `makeMethod(${METHOD_LOCK_SOURCE})`],
+ tool: [
+ "methodOperationTool",
+ `methodOperation(makeMethod(${METHOD_LOCK_SOURCE}))`
+ ],
+ parameter: [
+ "methodOperationParameter",
+ `methodOperation(makeMethod(${METHOD_LOCK_SOURCE}))`
+ ]
+} as const satisfies Partial<Record<LockKind, readonly [string, string]>>;
+
// Every base query is scoped by companyId (defense-in-depth; the id is a global
// UUID but tenant scoping is a golden rule). The lock is advisory — RLS +
// requirePermissions are the real boundary — so a null/unresolvable status
// leaves the gate open by design (see checkRevisionLock).
-async function resolveRevisionStatus(
+async function resolveMethodLock(
client: SupabaseClient<Database>,
kind: LockKind,
id: string,
companyId: string
-): Promise<ItemRevisionStatus | null> {
- switch (kind) {
- case "item": {
- const item = await client
- .from("item")
- .select("revisionStatus")
- .eq("id", id)
- .eq("companyId", companyId)
- .maybeSingle();
- return item.data?.revisionStatus ?? null;
- }
- case "makeMethod": {
- const makeMethod = await client
- .from("makeMethod")
- .select("item(revisionStatus)")
- .eq("id", id)
- .eq("companyId", companyId)
- .maybeSingle();
- return makeMethod.data?.item?.revisionStatus ?? null;
- }
- case "material": {
- // methodMaterial has two FKs to makeMethod (makeMethodId and
- // materialMakeMethodId) — the parent method is methodMaterial_methodId_fkey
- const material = await client
- .from("methodMaterial")
- .select("makeMethod!methodMaterial_methodId_fkey(item(revisionStatus))")
- .eq("id", id)
- .eq("companyId", companyId)
- .maybeSingle();
- return material.data?.makeMethod?.item?.revisionStatus ?? null;
- }
- case "operation": {
- const operation = await client
- .from("methodOperation")
- .select("makeMethod(item(revisionStatus))")
- .eq("id", id)
- .eq("companyId", companyId)
- .maybeSingle();
- return operation.data?.makeMethod?.item?.revisionStatus ?? null;
- }
- case "tool": {
- const tool = await client
- .from("methodOperationTool")
- .select("methodOperation(makeMethod(item(revisionStatus)))")
- .eq("id", id)
- .eq("companyId", companyId)
- .maybeSingle();
- return (
- tool.data?.methodOperation?.makeMethod?.item?.revisionStatus ?? null
- );
- }
- case "parameter": {
- const parameter = await client
- .from("methodOperationParameter")
- .select("methodOperation(makeMethod(item(revisionStatus)))")
- .eq("id", id)
- .eq("companyId", companyId)
- .maybeSingle();
- return (
- parameter.data?.methodOperation?.makeMethod?.item?.revisionStatus ??
- null
- );
- }
+): Promise<MethodLock> {
+ if (kind === "item") {
+ const item = await client
+ .from("item")
+ .select("revisionStatus")
+ .eq("id", id)
+ .eq("companyId", companyId)
+ .maybeSingle();
+ // item.changeOrderId is a PERMANENT back-link stamped at release (not cleared
+ // like makeMethod's), so it means "was created by" — never "is owned by".
+ // Resolving it would lock every CO-created item forever once its CO hit Done.
+ return { ...NO_LOCK, revisionStatus: item.data?.revisionStatus ?? null };
}
+
+ const [table, select] = methodLockQueries[kind];
+ const result = await client
+ .from(table)
+ .select(select)
+ .eq("id", id)
+ .eq("companyId", companyId)
+ .maybeSingle();
+
+ // The select is built from a lookup, so PostgREST's row typing degrades to a
+ // generic shape — narrow it once, here, rather than at each read below.
+ const method = unwrapMakeMethod(result.data as MethodLockRow | null, kind);
+ return {
+ revisionStatus: method?.item?.revisionStatus ?? null,
+ changeNoticeStatus: method?.changeOrder?.status ?? null
+ };
+}
+
+type MakeMethodLockRow = {
+ changeOrder: { status: string | null } | null;
+ item: { revisionStatus: ItemRevisionStatus | null } | null;
+};
+
+type MethodLockRow =
+ | MakeMethodLockRow
+ | { makeMethod: MakeMethodLockRow | null }
+ | { methodOperation: { makeMethod: MakeMethodLockRow | null } | null };
+
+function unwrapMakeMethod(
+ row: MethodLockRow | null,
+ kind: LockKind
+): MakeMethodLockRow | null {
+ if (!row) return null;
+ if (kind === "makeMethod") return row as MakeMethodLockRow;
+ if (kind === "tool" || kind === "parameter") {
+ return (
+ (row as { methodOperation: { makeMethod: MakeMethodLockRow | null } })
+ .methodOperation?.makeMethod ?? null
+ );
+ }
+ return (row as { makeMethod: MakeMethodLockRow | null }).makeMethod ?? null;
}
async function getReleaseControl(
@@ -147,17 +176,17 @@ export async function getRevisionLock(
client: SupabaseClient<Database>,
args: { itemId: string | null; companyId: string }
): Promise<RevisionLock> {
- const [revisionStatus, releaseControl] = await Promise.all([
+ const [lock, releaseControl] = await Promise.all([
args.itemId
- ? resolveRevisionStatus(client, "item", args.itemId, args.companyId)
- : Promise.resolve(null),
+ ? resolveMethodLock(client, "item", args.itemId, args.companyId)
+ : Promise.resolve(NO_LOCK),
getReleaseControl(client, args.companyId)
]);
return {
- isLocked: revisionStatus === "Production",
+ isLocked: lock.revisionStatus === "Production",
releaseControl,
- revisionStatus
+ revisionStatus: lock.revisionStatus
};
}
@@ -168,39 +197,148 @@ export async function checkRevisionLock(
client: SupabaseClient<Database>,
args: { kind: LockKind; id: string | null | undefined; companyId: string }
): Promise<LockCheck> {
- const [revisionStatus, releaseControl] = await Promise.all([
+ const [lock, releaseControl] = await Promise.all([
args.id
- ? resolveRevisionStatus(client, args.kind, args.id, args.companyId)
- : Promise.resolve(null),
+ ? resolveMethodLock(client, args.kind, args.id, args.companyId)
+ : Promise.resolve(NO_LOCK),
getReleaseControl(client, args.companyId)
]);
+ // Hard block, independent of releaseControl — releaseControl only governs the
+ // revision lock.
+ if (
+ lock.changeNoticeStatus &&
+ !canEditChangeNoticeEngineering(lock.changeNoticeStatus)
+ ) {
+ return {
+ ok: false,
+ warn: false,
+ message: changeNoticeLockedMessage(lock.changeNoticeStatus)
+ };
+ }
+
return getLockVerdict({
- isLocked: revisionStatus === "Production",
+ isLocked: lock.revisionStatus === "Production",
releaseControl
});
}
// =============================================================================
-// Change Orders — server-only helpers (imports @carbon/jobs).
+// Change Notices — server-only helpers (imports @carbon/jobs).
// =============================================================================
+type ChangeNoticeEditScope = "engineering" | "workflow";
+
+// One status read + predicate. Mutation routes call this before writing; the
+// UI disable is cosmetic on top of it.
+export async function requireChangeNoticeEditable(
+ client: SupabaseClient<Database>,
+ args: {
+ changeNoticeId: string;
+ companyId: string;
+ scope: ChangeNoticeEditScope;
+ }
+): Promise<{ error: { message: string }; data: null } | null> {
+ const existing = await client
+ .from("changeOrder")
+ .select("status")
+ .eq("id", args.changeNoticeId)
+ .eq("companyId", args.companyId)
+ .maybeSingle();
+
+ if (existing.error || !existing.data) {
+ return { error: { message: "Could not find change notice" }, data: null };
+ }
+
+ const canEdit =
+ args.scope === "engineering"
+ ? canEditChangeNoticeEngineering
+ : canEditChangeNoticeWorkflow;
+
+ return requireUnlockedBulk({
+ statuses: [existing.data.status],
+ checkFn: (status) => !canEdit(status),
+ message: changeNoticeLockedMessage(existing.data.status)
+ });
+}
+
+// Child rows (affected items, action tasks) are addressed by their own id, so
+// authorizing the change notice in the URL proves nothing about the row being
+// mutated — an editable notice's URL would otherwise let a user mutate a frozen
+// notice's rows. Same failure contract as requireEditableChangeNoticeRoute;
+// null means the route may proceed.
+export async function requireChangeNoticeChildRoute(
+ request: Request,
+ args: {
+ client: SupabaseClient<Database>;
+ table: "changeOrderAffectedItem" | "changeOrderActionTask";
+ id: string;
+ changeNoticeId: string;
+ companyId: string;
+ }
+) {
+ const row = await args.client
+ .from(args.table)
+ .select("id")
+ .eq("id", args.id)
+ .eq("changeOrderId", args.changeNoticeId)
+ .eq("companyId", args.companyId)
+ .maybeSingle();
+
+ if (row.error || !row.data) {
+ const message = "Record does not belong to this change notice";
+ return data(
+ { success: false },
+ await flash(request, error(row.error, message))
+ );
+ }
+
+ return null;
+}
+
+// The route-level guard: resolves the change notice from the URL, checks the
+// scope, and returns the flashed failure response so all eight mutation routes
+// share one failure contract. Returns null when the route may proceed.
+export async function requireEditableChangeNoticeRoute(
+ request: Request,
+ args: {
+ client: SupabaseClient<Database>;
+ changeNoticeId: string | undefined;
+ companyId: string;
+ scope: ChangeNoticeEditScope;
+ }
+) {
+ if (!args.changeNoticeId) throw new Error("Could not find id");
+
+ const locked = await requireChangeNoticeEditable(args.client, {
+ changeNoticeId: args.changeNoticeId,
+ companyId: args.companyId,
+ scope: args.scope
+ });
+ if (!locked) return null;
+
+ return data(
+ { success: false },
+ await flash(request, error(locked.error, locked.error.message))
+ );
+}
+
// Maps a broadcast stage to its notification event. Only Start / Implementation
// / Done broadcast (PRD §3.1); Draft / Engineering Complete are silent, so
// callers simply don't invoke this for those stages.
-export const changeOrderStageEvent: Record<string, NotificationEvent> = {
- Start: NotificationEvent.ChangeOrderStarted,
- Implementation: NotificationEvent.ChangeOrderImplementation,
- Done: NotificationEvent.ChangeOrderDone
+export const changeNoticeStageEvent: Record<string, NotificationEvent> = {
+ Start: NotificationEvent.ChangeNoticeStarted,
+ Implementation: NotificationEvent.ChangeNoticeImplementation,
+ Done: NotificationEvent.ChangeNoticeDone
};
// Broadcasts a CO stage to the whole team (best-effort). Recipient is the seeded
// "All Employees" group — NOT companyGroupId, which is the currency/subsidiary
// grouping and has no user members.
-export async function notifyChangeOrderTransition(args: {
+export async function notifyChangeNoticeTransition(args: {
client: SupabaseClient<Database>;
event: NotificationEvent;
- changeOrderId: string;
+ changeNoticeId: string;
companyId: string;
userId: string;
}): Promise<void> {
@@ -227,17 +365,17 @@ export async function notifyChangeOrderTransition(args: {
await trigger("notify", {
event: args.event,
companyId: args.companyId,
- documentId: args.changeOrderId,
+ documentId: args.changeNoticeId,
recipient: { type: "group", groupIds: [employeeGroup.data.id] },
from: args.userId
});
} catch (e) {
- logger.error("Failed to trigger change order notification", { error: e });
+ logger.error("Failed to trigger change notice notification", { error: e });
}
}
// =============================================================================
-// applyChangeOrder — the top-to-bottom "release", run on the Implementation →
+// applyChangeNotice — the top-to-bottom "release", run on the Implementation →
// Done transition (this function IS that transition). It materializes each
// affected item's CO-staged end-state onto a NEW inactive revision, activates
// it, then auto-writes the oldRev → newRev supersession (Q1/Q2/Q5).
@@ -254,30 +392,30 @@ export async function notifyChangeOrderTransition(args: {
// status='Implementation', so a re-run can't double-transition the CO; only
// the closing status flip is transactional.
// =============================================================================
-export async function applyChangeOrder(
+export async function applyChangeNotice(
client: SupabaseClient<Database>,
db: Kysely<KyselyDatabase>,
args: {
- changeOrderId: string;
+ changeNoticeId: string;
userId: string;
companyId: string;
}
): Promise<{ data: { id: string } | null; error: { message: string } | null }> {
- const { changeOrderId, userId, companyId } = args;
+ const { changeNoticeId, userId, companyId } = args;
- const co = await client
+ const cn = await client
.from("changeOrder")
.select("id, status")
- .eq("id", changeOrderId)
+ .eq("id", changeNoticeId)
.eq("companyId", companyId)
.single();
- if (co.error || !co.data) {
- return { data: null, error: { message: "Change order not found" } };
+ if (cn.error || !cn.data) {
+ return { data: null, error: { message: "Change notice not found" } };
}
- if (co.data.status !== "Implementation") {
+ if (cn.data.status !== "Implementation") {
return {
data: null,
- error: { message: "Change order must be at Implementation to apply" }
+ error: { message: "Change notice must be at Implementation to apply" }
};
}
@@ -291,7 +429,7 @@ export async function applyChangeOrder(
.select(
"id, itemId, changeType, draftMakeMethodId, baseMakeMethodId, newItemId, supersessionMode, discontinuationDate, successorEffectivityDate"
)
- .eq("changeOrderId", changeOrderId)
+ .eq("changeOrderId", changeNoticeId)
.eq("companyId", companyId)
.order("sortOrder", { ascending: true })
.order("createdAt", { ascending: true });
@@ -310,7 +448,7 @@ export async function applyChangeOrder(
for (const affected of ordered) {
const result = await releaseAffectedItem(client, {
- changeOrderId,
+ changeNoticeId,
companyId,
userId,
affected
@@ -324,7 +462,7 @@ export async function applyChangeOrder(
const res = await trx
.updateTable("changeOrder")
.set({ status: "Done", updatedBy: userId })
- .where("id", "=", changeOrderId)
+ .where("id", "=", changeNoticeId)
.where("companyId", "=", companyId)
.where("status", "=", "Implementation")
.executeTakeFirst();
@@ -333,7 +471,7 @@ export async function applyChangeOrder(
if (updated === 0) {
return {
data: null,
- error: { message: "Change order has already been applied" }
+ error: { message: "Change notice has already been applied" }
};
}
} catch (err) {
@@ -343,7 +481,7 @@ export async function applyChangeOrder(
};
}
- return { data: { id: changeOrderId }, error: null };
+ return { data: { id: changeNoticeId }, error: null };
}
// -----------------------------------------------------------------------------
@@ -362,7 +500,7 @@ export async function applyChangeOrder(
async function releaseAffectedItem(
client: SupabaseClient<Database>,
input: {
- changeOrderId: string;
+ changeNoticeId: string;
companyId: string;
userId: string;
affected: {
@@ -378,7 +516,7 @@ async function releaseAffectedItem(
};
}
): Promise<{ error: { message: string } | null }> {
- const { changeOrderId, companyId, userId, affected } = input;
+ const { changeNoticeId, companyId, userId, affected } = input;
const { changeType, draftMakeMethodId, newItemId } = affected;
const sourceItemId = affected.itemId;
@@ -418,7 +556,7 @@ async function releaseAffectedItem(
.from("item")
.update({
active: true,
- changeOrderId,
+ changeOrderId: changeNoticeId,
updatedBy: userId,
updatedAt: new Date().toISOString()
})
diff --git a/apps/erp/app/modules/items/items.service.ts b/apps/erp/app/modules/items/items.service.ts
index 79f51e1630..26ff165b89 100644
--- a/apps/erp/app/modules/items/items.service.ts
+++ b/apps/erp/app/modules/items/items.service.ts
@@ -30,13 +30,13 @@ import {
type SupplierPriceMap
} from "../shared";
import {
- type ChangeOrderChangeType,
- type ChangeOrderError,
- type ChangeOrderItemDiff,
- changeOrderOpenStatuses,
- type changeOrderStatus,
- type changeOrderTaskStatus,
- type changeOrderType,
+ type ChangeNoticeChangeType,
+ type ChangeNoticeError,
+ type ChangeNoticeItemDiff,
+ changeNoticeOpenStatuses,
+ type changeNoticeStatus,
+ type changeNoticeTaskStatus,
+ type changeNoticeType,
type configurationParameterGroupOrderValidator,
type configurationParameterGroupValidator,
type configurationParameterOrderValidator,
@@ -46,7 +46,7 @@ import {
type customerPartValidator,
type getMethodValidator,
ItemTrackingType,
- isAllowedChangeOrderTransition,
+ isAllowedChangeNoticeTransition,
type itemCostValidator,
type itemManufacturingValidator,
type itemPlanningValidator,
@@ -182,7 +182,7 @@ export async function createRevision(
revision: string;
createdBy: string;
// Change-order draft revisions are created inactive so they don't surface
- // in item pickers/production until the change order is released. Manual
+ // in item pickers/production until the change notice is released. Manual
// "New Revision" keeps the default (active).
active?: boolean;
}
@@ -5155,26 +5155,26 @@ export async function getSupplierPartPriceBreaks(
}));
}
// =============================================================================
-// Change Orders — header CRUD, stage transitions, list, and CO Types config.
+// Change Notices — header CRUD, stage transitions, list, and CO Types config.
// =============================================================================
// -----------------------------------------------------------------------------
// Reads
// -----------------------------------------------------------------------------
-export async function getChangeOrder(
+export async function getChangeNotice(
client: SupabaseClient<Database>,
- changeOrderId: string,
+ changeNoticeId: string,
companyId: string
) {
return client
.from("changeOrder")
.select("*")
- .eq("id", changeOrderId)
+ .eq("id", changeNoticeId)
.eq("companyId", companyId)
.single();
}
-export async function getChangeOrders(
+export async function getChangeNotices(
client: SupabaseClient<Database>,
companyId: string,
args?: GenericQueryFilters & { search: string | null }
@@ -5202,16 +5202,16 @@ export async function getChangeOrders(
// -----------------------------------------------------------------------------
// Header CRUD
// -----------------------------------------------------------------------------
-export async function insertChangeOrder(
+export async function insertChangeNotice(
client: SupabaseClient<Database>,
input: {
companyId: string;
createdBy: string;
- changeOrderId?: string;
+ changeNoticeId?: string;
name: string;
- type?: (typeof changeOrderType)[number];
+ type?: (typeof changeNoticeType)[number];
priority?: (typeof nonConformancePriority)[number];
- changeOrderTypeId?: string;
+ changeNoticeTypeId?: string;
nonConformanceId?: string;
openDate: string;
reasonForChange?: Json;
@@ -5221,12 +5221,12 @@ export async function insertChangeOrder(
customFields?: Json;
}
): Promise<{
- data: { id: string; changeOrderId: string } | null;
- error: ChangeOrderError | null;
+ data: { id: string; changeNoticeId: string } | null;
+ error: ChangeNoticeError | null;
}> {
- let changeOrderId: string;
- if (input.changeOrderId) {
- changeOrderId = input.changeOrderId;
+ let changeNoticeId: string;
+ if (input.changeNoticeId) {
+ changeNoticeId = input.changeNoticeId;
} else {
const seq = await client.rpc("get_next_sequence", {
sequence_name: "changeOrder",
@@ -5240,17 +5240,17 @@ export async function insertChangeOrder(
}
};
}
- changeOrderId = seq.data;
+ changeNoticeId = seq.data;
}
const result = await client
.from("changeOrder")
.insert({
- changeOrderId,
+ changeOrderId: changeNoticeId,
name: input.name,
type: input.type ?? "Engineering",
priority: input.priority ?? null,
- changeOrderTypeId: input.changeOrderTypeId ?? null,
+ changeOrderTypeId: input.changeNoticeTypeId ?? null,
nonConformanceId: input.nonConformanceId ?? null,
openDate: input.openDate,
reasonForChange: input.reasonForChange ?? {},
@@ -5270,22 +5270,22 @@ export async function insertChangeOrder(
// No default actions are seeded on create — the CO starts with zero required
// actions selected; the user picks them afterward from the rail's Required
- // Actions multiselect (reconciled by setChangeOrderActionTasks).
+ // Actions multiselect (reconciled by setChangeNoticeActionTasks).
return {
- data: { id: result.data.id, changeOrderId: result.data.changeOrderId },
+ data: { id: result.data.id, changeNoticeId: result.data.changeOrderId },
error: null
};
}
-export async function updateChangeOrder(
+export async function updateChangeNotice(
client: SupabaseClient<Database>,
input: {
id: string;
updatedBy: string;
changeOrderId?: string;
name?: string;
- type?: (typeof changeOrderType)[number];
+ type?: (typeof changeNoticeType)[number];
priority?: (typeof nonConformancePriority)[number] | null;
changeOrderTypeId?: string | null;
nonConformanceId?: string | null;
@@ -5298,7 +5298,7 @@ export async function updateChangeOrder(
}
): Promise<{
data: { id: string } | null;
- error: ChangeOrderError | null;
+ error: ChangeNoticeError | null;
}> {
const { id, ...rest } = input;
const result = await client
@@ -5312,24 +5312,24 @@ export async function updateChangeOrder(
return { data: { id: result.data.id }, error: null };
}
-export async function deleteChangeOrder(
+export async function deleteChangeNotice(
client: SupabaseClient<Database>,
- changeOrderId: string,
+ changeNoticeId: string,
companyId: string
) {
// Discard each affected item's CO-owned Draft first (the Draft make method for
// a Version, or the revealed inactive item for a Revision/New Part). These are
- // NOT FK children of the change order, so the cascade below won't remove them —
+ // NOT FK children of the change notice, so the cascade below won't remove them —
// only the changeOrderAffectedItem rows cascade. Without this, deleting a CO
- // orphans its drafts (mirrors removeChangeOrderAffectedItem's cleanup).
+ // orphans its drafts (mirrors removeChangeNoticeAffectedItem's cleanup).
const affected = await client
.from("changeOrderAffectedItem")
.select("draftMakeMethodId, newItemId")
- .eq("changeOrderId", changeOrderId)
+ .eq("changeOrderId", changeNoticeId)
.eq("companyId", companyId);
if (!affected.error && affected.data) {
for (const item of affected.data) {
- await discardChangeOrderDraft(client, item, companyId);
+ await discardChangeNoticeDraft(client, item, companyId);
}
}
@@ -5337,31 +5337,31 @@ export async function deleteChangeOrder(
return client
.from("changeOrder")
.delete()
- .eq("id", changeOrderId)
+ .eq("id", changeNoticeId)
.eq("companyId", companyId);
}
// -----------------------------------------------------------------------------
// Stage transition — the single guarded writer (G8), a compare-and-swap (G2).
-// Forward-only (isAllowedChangeOrderTransition).
+// Forward-only (isAllowedChangeNoticeTransition).
// -----------------------------------------------------------------------------
-export async function updateChangeOrderStatus(
+export async function updateChangeNoticeStatus(
client: SupabaseClient<Database>,
update: {
id: string;
companyId: string;
- fromStatus: (typeof changeOrderStatus)[number];
- toStatus: (typeof changeOrderStatus)[number];
+ fromStatus: (typeof changeNoticeStatus)[number];
+ toStatus: (typeof changeNoticeStatus)[number];
assignee?: string | null;
updatedBy: string;
}
): Promise<{
- data: { id: string; status: (typeof changeOrderStatus)[number] } | null;
+ data: { id: string; status: (typeof changeNoticeStatus)[number] } | null;
error: { message: string } | null;
}> {
const { id, companyId, fromStatus, toStatus, ...rest } = update;
- if (!isAllowedChangeOrderTransition(fromStatus, toStatus)) {
+ if (!isAllowedChangeNoticeTransition(fromStatus, toStatus)) {
return {
data: null,
error: {
@@ -5375,7 +5375,7 @@ export async function updateChangeOrderStatus(
// transition where the caller passes it as undefined. Only set an optional
// field when the caller provided a value.
const payload: {
- status: (typeof changeOrderStatus)[number];
+ status: (typeof changeNoticeStatus)[number];
updatedBy: string;
assignee?: string | null;
} = { status: toStatus, updatedBy: rest.updatedBy };
@@ -5396,7 +5396,7 @@ export async function updateChangeOrderStatus(
data: null,
error: {
message:
- "The change order was updated by someone else. Refresh and try again."
+ "The change notice was updated by someone else. Refresh and try again."
}
};
}
@@ -5404,9 +5404,9 @@ export async function updateChangeOrderStatus(
}
// -----------------------------------------------------------------------------
-// Change Order Types (the "Category" lookup — configured like Issue Types)
+// Change Notice Types (the "Category" lookup — configured like Issue Types)
// -----------------------------------------------------------------------------
-export async function getChangeOrderTypes(
+export async function getChangeNoticeTypes(
client: SupabaseClient<Database>,
companyId: string,
args?: GenericQueryFilters & { search: string | null }
@@ -5429,7 +5429,7 @@ export async function getChangeOrderTypes(
return query;
}
-export async function getChangeOrderTypesList(
+export async function getChangeNoticeTypesList(
client: SupabaseClient<Database>,
companyId: string
) {
@@ -5440,16 +5440,22 @@ export async function getChangeOrderTypesList(
.order("name", { ascending: true });
}
-export async function getChangeOrderType(
+export async function getChangeNoticeType(
client: SupabaseClient<Database>,
- id: string
+ id: string,
+ companyId: string
) {
- return client.from("changeOrderType").select("*").eq("id", id).single();
+ return client
+ .from("changeOrderType")
+ .select("*")
+ .eq("id", id)
+ .eq("companyId", companyId)
+ .single();
}
-export async function upsertChangeOrderType(
+export async function upsertChangeNoticeType(
client: SupabaseClient<Database>,
- changeOrderType:
+ changeNoticeType:
| {
name: string;
companyId: string;
@@ -5459,30 +5465,39 @@ export async function upsertChangeOrderType(
| {
id: string;
name: string;
+ companyId: string;
updatedBy: string;
customFields?: Json;
}
) {
- if ("createdBy" in changeOrderType) {
+ if ("createdBy" in changeNoticeType) {
return client
.from("changeOrderType")
- .insert([changeOrderType])
+ .insert([changeNoticeType])
.select("id")
.single();
}
+ // companyId scopes the row, it is not part of the payload (it's in the PK).
+ const { companyId, ...update } = changeNoticeType;
return client
.from("changeOrderType")
- .update(sanitize(changeOrderType))
- .eq("id", changeOrderType.id)
+ .update(sanitize(update))
+ .eq("id", changeNoticeType.id)
+ .eq("companyId", companyId)
.select("id")
.single();
}
-export async function deleteChangeOrderType(
+export async function deleteChangeNoticeType(
client: SupabaseClient<Database>,
- id: string
+ id: string,
+ companyId: string
) {
- return client.from("changeOrderType").delete().eq("id", id);
+ return client
+ .from("changeOrderType")
+ .delete()
+ .eq("id", id)
+ .eq("companyId", companyId);
}
// =============================================================================
@@ -5613,7 +5628,7 @@ export async function mintPlaceholderPart(
}
): Promise<{
data: { id: string } | null;
- error: ChangeOrderError | null;
+ error: ChangeNoticeError | null;
}> {
const item = await client
.from("item")
@@ -5658,7 +5673,7 @@ export async function mintPlaceholderPart(
// Revision → new inactive revision item + its Draft method (attrs/docs).
// New Part → new inactive part number (new readableId) + copied Draft method.
// All three keep the user client (the release path uses the same client for the
-// same privileged method helpers — see applyChangeOrder / changeOrder.server).
+// same privileged method helpers — see applyChangeNotice / items.server).
// =============================================================================
// Mint the next readableId for a CO-derived New Part, following the SAME numbering
@@ -5763,16 +5778,16 @@ type DraftMethodResult = {
baseMakeMethodId: string | null;
newItemId: string | null;
} | null;
- error: ChangeOrderError | null;
+ error: ChangeNoticeError | null;
};
// Create the CO-owned Draft make method for an affected item per its change type.
-export async function createChangeOrderDraftMethod(
+export async function createChangeNoticeDraftMethod(
client: SupabaseClient<Database>,
input: {
- changeOrderId: string;
+ changeNoticeId: string;
itemId: string;
- changeType: ChangeOrderChangeType;
+ changeType: ChangeNoticeChangeType;
// Optional revision label for the Revision path — when the caller already
// knows the target revision (e.g. the value typed in the new-revision
// modal). Omitted → the next revision is auto-computed.
@@ -5781,7 +5796,7 @@ export async function createChangeOrderDraftMethod(
userId: string;
}
): Promise<DraftMethodResult> {
- const { changeOrderId, itemId, changeType, revision, companyId, userId } =
+ const { changeNoticeId, itemId, changeType, revision, companyId, userId } =
input;
const base = await getActiveMakeMethodId(client, itemId, companyId);
@@ -5851,7 +5866,7 @@ export async function createChangeOrderDraftMethod(
}
const stamp = await client
.from("makeMethod")
- .update({ changeOrderId })
+ .update({ changeOrderId: changeNoticeId })
.eq("id", draftId)
.eq("companyId", companyId);
if (stamp.error) return { data: null, error: stamp.error };
@@ -5903,14 +5918,14 @@ export async function createChangeOrderDraftMethod(
);
const stampItem = await client
.from("item")
- .update({ changeOrderId })
+ .update({ changeOrderId: changeNoticeId })
.eq("id", newItemId)
.eq("companyId", companyId);
if (stampItem.error) return { data: null, error: stampItem.error };
if (draftId) {
await client
.from("makeMethod")
- .update({ changeOrderId })
+ .update({ changeOrderId: changeNoticeId })
.eq("id", draftId)
.eq("companyId", companyId);
}
@@ -5925,7 +5940,7 @@ export async function createChangeOrderDraftMethod(
}
if (changeType === "New Part") {
- // Net-new part — no predecessor, no supersession. addChangeOrderAffectedItem
+ // Net-new part — no predecessor, no supersession. addChangeNoticeAffectedItem
// already minted the item (inactive, CO-stamped); here `itemId` IS that new
// item. Its insert trigger created a Draft makeMethod (status default 'Draft');
// stamp it CO-owned so it hides from version lists until release (parity with
@@ -5938,7 +5953,7 @@ export async function createChangeOrderDraftMethod(
if (draftId) {
const stamp = await client
.from("makeMethod")
- .update({ changeOrderId })
+ .update({ changeOrderId: changeNoticeId })
.eq("id", draftId)
.eq("companyId", companyId);
if (stamp.error) return { data: null, error: stamp.error };
@@ -5995,7 +6010,7 @@ export async function createChangeOrderDraftMethod(
mpn: source.data.mpn,
active: false,
revisionStatus: "Design",
- changeOrderId,
+ changeOrderId: changeNoticeId,
companyId,
createdBy: userId
})
@@ -6037,7 +6052,7 @@ export async function createChangeOrderDraftMethod(
if (draftId) {
await client
.from("makeMethod")
- .update({ changeOrderId })
+ .update({ changeOrderId: changeNoticeId })
.eq("id", draftId)
.eq("companyId", companyId);
}
@@ -6054,7 +6069,7 @@ export async function createChangeOrderDraftMethod(
// Discard an affected item's CO-owned Draft (used on change-type switch + when
// removing the affected item). Deletes the new item for Revision/New Part
// (cascades its method rows) or the Draft method for Version.
-async function discardChangeOrderDraft(
+async function discardChangeNoticeDraft(
client: SupabaseClient<Database>,
affected: {
draftMakeMethodId: string | null;
@@ -6082,15 +6097,15 @@ async function discardChangeOrderDraft(
// Add an affected item to a CO: insert the row, then spin its CO-owned Draft
// make method per the change type and write the draft refs back. Rolls the row
// back if draft creation fails (edge-fn calls can't share one txn — G2).
-export async function addChangeOrderAffectedItem(
+export async function addChangeNoticeAffectedItem(
client: SupabaseClient<Database>,
input: {
- changeOrderId: string;
+ changeNoticeId: string;
// The existing affected item (Version / Revision / Replacement Part). Omitted
// for the net-new New Part path, where `newPart` is supplied and the item is
// minted here.
itemId?: string;
- changeType: ChangeOrderChangeType;
+ changeType: ChangeNoticeChangeType;
// Forwarded to the Revision draft path so a Revision affected item can take
// an explicit revision label (e.g. from the new-revision modal).
revision?: string;
@@ -6108,12 +6123,12 @@ export async function addChangeOrderAffectedItem(
}
): Promise<{
data: { id: string; draftMakeMethodId: string | null } | null;
- error: ChangeOrderError | null;
+ error: ChangeNoticeError | null;
}> {
- const { changeOrderId, changeType, revision, newPart, companyId, userId } =
+ const { changeNoticeId, changeType, revision, newPart, companyId, userId } =
input;
let itemId = input.itemId;
- let effectiveChangeType: ChangeOrderChangeType = changeType;
+ let effectiveChangeType: ChangeNoticeChangeType = changeType;
if (newPart) {
// Net-new part introduced by the CO — mint an inactive Part/Tool + its type
@@ -6143,7 +6158,7 @@ export async function addChangeOrderAffectedItem(
unitOfMeasureCode: "EA",
active: false,
revisionStatus: "Design",
- changeOrderId,
+ changeOrderId: changeNoticeId,
companyId,
createdBy: userId
})
@@ -6182,7 +6197,7 @@ export async function addChangeOrderAffectedItem(
const last = await client
.from("changeOrderAffectedItem")
.select("sortOrder")
- .eq("changeOrderId", changeOrderId)
+ .eq("changeOrderId", changeNoticeId)
.eq("companyId", companyId)
.order("sortOrder", { ascending: false })
.limit(1)
@@ -6192,7 +6207,7 @@ export async function addChangeOrderAffectedItem(
const inserted = await client
.from("changeOrderAffectedItem")
.insert({
- changeOrderId,
+ changeOrderId: changeNoticeId,
itemId,
changeType: effectiveChangeType,
sortOrder,
@@ -6206,8 +6221,8 @@ export async function addChangeOrderAffectedItem(
}
const affectedItemId = inserted.data.id;
- const draft = await createChangeOrderDraftMethod(client, {
- changeOrderId,
+ const draft = await createChangeNoticeDraftMethod(client, {
+ changeNoticeId,
itemId,
changeType: effectiveChangeType,
revision,
@@ -6245,15 +6260,15 @@ export async function addChangeOrderAffectedItem(
// Switch an affected item's change type: discard its current draft and rebuild
// for the new type (Q2 — the editable surface differs per type, so edits reset).
-export async function updateChangeOrderAffectedItemChangeType(
+export async function updateChangeNoticeAffectedItemChangeType(
client: SupabaseClient<Database>,
input: {
id: string;
- changeType: ChangeOrderChangeType;
+ changeType: ChangeNoticeChangeType;
companyId: string;
userId: string;
}
-): Promise<{ data: { id: string } | null; error: ChangeOrderError | null }> {
+): Promise<{ data: { id: string } | null; error: ChangeNoticeError | null }> {
const { id, changeType, companyId, userId } = input;
const affected = await client
@@ -6289,8 +6304,8 @@ export async function updateChangeOrderAffectedItemChangeType(
newItemId: affected.data.newItemId
};
- const draft = await createChangeOrderDraftMethod(client, {
- changeOrderId: affected.data.changeOrderId,
+ const draft = await createChangeNoticeDraftMethod(client, {
+ changeNoticeId: affected.data.changeOrderId,
itemId: affected.data.itemId,
changeType,
companyId,
@@ -6314,13 +6329,13 @@ export async function updateChangeOrderAffectedItemChangeType(
if (updated.error) return { data: null, error: updated.error };
// Swap succeeded — now safe to discard the superseded draft.
- await discardChangeOrderDraft(client, previousDraft, companyId);
+ await discardChangeNoticeDraft(client, previousDraft, companyId);
return { data: { id }, error: null };
}
// Update the per-item revision cutover config (mode + dates). The existence of
// the oldRev→newRev supersession is automatic at release; this only tunes it.
-export async function updateChangeOrderAffectedItemCutover(
+export async function updateChangeNoticeAffectedItemCutover(
client: SupabaseClient<Database>,
input: {
id: string;
@@ -6349,7 +6364,7 @@ export async function updateChangeOrderAffectedItemCutover(
// =============================================================================
// The minimal item label rendered next to each affected item / supersession.
-export type ChangeOrderStagingItemLabel = {
+export type ChangeNoticeStagingItemLabel = {
id: string;
readableId: string;
readableIdWithRevision: string | null;
@@ -6360,11 +6375,11 @@ export type ChangeOrderStagingItemLabel = {
replenishmentSystem: Database["public"]["Enums"]["itemReplenishmentSystem"];
};
-type ChangeOrderAffectedItemRow =
+type ChangeNoticeAffectedItemRow =
Database["public"]["Tables"]["changeOrderAffectedItem"]["Row"];
-export type ChangeOrderAffectedItemWithLabel = ChangeOrderAffectedItemRow & {
- item: ChangeOrderStagingItemLabel | null;
+export type ChangeNoticeAffectedItemWithLabel = ChangeNoticeAffectedItemRow & {
+ item: ChangeNoticeStagingItemLabel | null;
};
const ITEM_LABEL_COLUMNS =
@@ -6376,11 +6391,11 @@ async function stitchItemLabels(
itemIds: string[],
companyId: string
): Promise<{
- labels: Map<string, ChangeOrderStagingItemLabel>;
+ labels: Map<string, ChangeNoticeStagingItemLabel>;
error: { message: string } | null;
}> {
const uniqueIds = [...new Set(itemIds)];
- const labels = new Map<string, ChangeOrderStagingItemLabel>();
+ const labels = new Map<string, ChangeNoticeStagingItemLabel>();
if (uniqueIds.length === 0) return { labels, error: null };
const items = await client
@@ -6391,24 +6406,24 @@ async function stitchItemLabels(
if (items.error) return { labels, error: items.error };
for (const it of items.data ?? [])
- labels.set(it.id, it as ChangeOrderStagingItemLabel);
+ labels.set(it.id, it as ChangeNoticeStagingItemLabel);
return { labels, error: null };
}
// The affected items of a CO, each stitched to a minimal item label.
-export async function getChangeOrderAffectedItems(
+export async function getChangeNoticeAffectedItems(
client: SupabaseClient<Database>,
- changeOrderId: string,
+ changeNoticeId: string,
companyId: string
): Promise<{
- data: ChangeOrderAffectedItemWithLabel[];
+ data: ChangeNoticeAffectedItemWithLabel[];
error: { message: string } | null;
}> {
const affected = await client
.from("changeOrderAffectedItem")
.select("*")
- .eq("changeOrderId", changeOrderId)
+ .eq("changeOrderId", changeNoticeId)
.eq("companyId", companyId)
.order("sortOrder", { ascending: true })
.order("createdAt", { ascending: true });
@@ -6432,7 +6447,7 @@ export async function getChangeOrderAffectedItems(
// Remove an affected item + discard its CO-owned Draft (delete the new item for
// Revision/New Part, or the Draft method for Version) so no orphan draft leaks.
-export async function removeChangeOrderAffectedItem(
+export async function removeChangeNoticeAffectedItem(
client: SupabaseClient<Database>,
id: string,
companyId: string
@@ -6444,7 +6459,7 @@ export async function removeChangeOrderAffectedItem(
.eq("companyId", companyId)
.maybeSingle();
if (!affected.error && affected.data) {
- await discardChangeOrderDraft(client, affected.data, companyId);
+ await discardChangeNoticeDraft(client, affected.data, companyId);
}
return client
.from("changeOrderAffectedItem")
@@ -6454,12 +6469,12 @@ export async function removeChangeOrderAffectedItem(
}
// =============================================================================
-// Change Orders — item traceability reads (part/tool ↔ CO) and the linked-NCR
-// reverse view. Split out of changeOrder.service.ts to keep each file focused
-// and under the module's 1000-line budget (G4).
+// Change Notices — item traceability reads (part/tool ↔ CO) and the linked-NCR
+// reverse view. Kept as its own section of items.service.ts to keep each area
+// focused and under the module's 1000-line budget (G4).
// =============================================================================
-// G6 — the SINGLE canonical "change orders referencing this item" query,
+// G6 — the SINGLE canonical "change notices referencing this item" query,
// parameterized by status. The item-detail history (all COs), the open-CO alert
// (open statuses), and the single-open-CO guard all call this — no forked
// implementations. Spans every way a CO references an item in the top-to-bottom
@@ -6468,7 +6483,7 @@ export async function removeChangeOrderAffectedItem(
// released revision (`item.changeOrderId`). Scoped by readableId so it matches
// the part across all its revisions. Flat queries + JS union (no embeds —
// TS2589 budget).
-export type ChangeOrderForItem = {
+export type ChangeNoticeForItem = {
id: string;
changeOrderId: string;
name: string;
@@ -6477,14 +6492,14 @@ export type ChangeOrderForItem = {
createdAt: string;
};
-export async function findChangeOrdersForItem(
+export async function findChangeNoticesForItem(
client: SupabaseClient<Database>,
args: {
itemId: string;
companyId: string;
statuses?: Database["public"]["Enums"]["changeOrderStatus"][];
}
-): Promise<{ data: ChangeOrderForItem[]; error: { message: string } | null }> {
+): Promise<{ data: ChangeNoticeForItem[]; error: { message: string } | null }> {
const { itemId, companyId, statuses } = args;
// Resolve every revision (item row) sharing this part's readableId.
@@ -6583,10 +6598,10 @@ export async function findChangeOrdersForItem(
return { data: result.data ?? [], error: null };
}
-// Reverse of the Linked-NCR cross-link (4a): every change order that references
+// Reverse of the Linked-NCR cross-link (4a): every change notice that references
// a given non-conformance. Read-only, minimal columns; rendered on the Issue
// detail. Flat select (no embeds — TS2589 budget).
-export async function getChangeOrdersForNonConformance(
+export async function getChangeNoticesForNonConformance(
client: SupabaseClient<Database>,
nonConformanceId: string,
companyId: string
@@ -6599,66 +6614,109 @@ export async function getChangeOrdersForNonConformance(
.order("createdAt", { ascending: false });
}
-// Single-open-CO-per-part guard (V1 — no parallel change orders): the OTHER
-// open change orders that already reference a part, excluding the current CO.
+// Single-open-CO-per-part guard (V1 — no parallel change notices): the OTHER
+// open change notices that already reference a part, excluding the current CO.
// Reuses the canonical G6 query at the open-status filter. A non-empty result
// means adding the part here would create a parallel open CO — the routes (and
// the staging service) reject it.
-export async function findOtherOpenChangeOrdersForItem(
+export async function findOtherOpenChangeNoticesForItem(
client: SupabaseClient<Database>,
- args: { itemId: string; companyId: string; excludeChangeOrderId: string }
-): Promise<ChangeOrderForItem[]> {
- const { data } = await findChangeOrdersForItem(client, {
+ args: { itemId: string; companyId: string; excludeChangeNoticeId: string }
+): Promise<ChangeNoticeForItem[]> {
+ const { data } = await findChangeNoticesForItem(client, {
itemId: args.itemId,
companyId: args.companyId,
- statuses: changeOrderOpenStatuses
+ statuses: changeNoticeOpenStatuses
});
- return data.filter((co) => co.id !== args.excludeChangeOrderId);
+ return data.filter((cn) => cn.id !== args.excludeChangeNoticeId);
}
-// Loader data for the "Change Orders" history section + open-CO alert on an
+// Loader data for the "Change Notices" history section + open-CO alert on an
// item detail page (part/tool/material) — the CO history for the item plus the
// type lookup used to label rows. One shared source so the detail routes don't
// each re-implement the pair of reads.
-export async function getItemChangeOrderData(
+export async function getItemChangeNoticeData(
client: SupabaseClient<Database>,
itemId: string,
companyId: string
) {
- const [changeOrders, changeOrderTypes] = await Promise.all([
- findChangeOrdersForItem(client, { itemId, companyId }),
- getChangeOrderTypesList(client, companyId)
+ const [changeNotices, changeNoticeTypes] = await Promise.all([
+ findChangeNoticesForItem(client, { itemId, companyId }),
+ getChangeNoticeTypesList(client, companyId)
]);
return {
- changeOrders: changeOrders.data,
- changeOrderTypes: changeOrderTypes.data ?? []
+ changeNotices: changeNotices.data,
+ changeNoticeTypes: changeNoticeTypes.data ?? []
};
}
// =============================================================================
-// Change Orders — Actions (freeform tasks; reuse changeOrderActionTask). Any
-// user, any stage; non-gating. Split out of changeOrder.service.ts to keep
-// each file focused and under the module's 1000-line budget (G4).
+// Change Notices — Actions (freeform tasks; reuse changeOrderActionTask). Any
+// user, any stage; non-gating. Kept as its own section of items.service.ts to
+// keep each area focused and under the module's 1000-line budget (G4).
// =============================================================================
-export async function getChangeOrderActions(
+export async function getChangeNoticeActions(
client: SupabaseClient<Database>,
- changeOrderId: string,
+ changeNoticeId: string,
companyId: string
) {
- return client
+ const result = await client
.from("changeOrderActionTask")
.select("*")
- .eq("changeOrderId", changeOrderId)
+ .eq("changeOrderId", changeNoticeId)
.eq("companyId", companyId)
.order("sortOrder", { ascending: true })
.order("createdAt", { ascending: true });
+
+ if (result.error || !result.data) {
+ return result;
+ }
+
+ const taskIds = result.data.map((t) => t.id);
+ let linearMappings: Map<string, unknown> = new Map();
+ let jiraMappings: Map<string, unknown> = new Map();
+
+ if (taskIds.length > 0) {
+ const [{ data: linearData }, { data: jiraData }] = await Promise.all([
+ client
+ .from("externalIntegrationMapping")
+ .select("entityId, metadata")
+ .eq("entityType", "changeOrderActionTask")
+ .eq("integration", "linear")
+ .eq("companyId", companyId)
+ .in("entityId", taskIds),
+ client
+ .from("externalIntegrationMapping")
+ .select("entityId, metadata")
+ .eq("entityType", "changeOrderActionTask")
+ .eq("integration", "jira")
+ .eq("companyId", companyId)
+ .in("entityId", taskIds)
+ ]);
+
+ linearMappings = new Map(
+ (linearData ?? []).map((m) => [m.entityId, m.metadata])
+ );
+ jiraMappings = new Map(
+ (jiraData ?? []).map((m) => [m.entityId, m.metadata])
+ );
+ }
+
+ return {
+ ...result,
+ data: result.data.map((task) => ({
+ ...task,
+ linearIssue: linearMappings.get(task.id) ?? null,
+ jiraIssue: jiraMappings.get(task.id) ?? null
+ }))
+ };
}
-export async function updateChangeOrderActionStatus(
+export async function updateChangeNoticeActionStatus(
client: SupabaseClient<Database>,
input: {
id: string;
- status: (typeof changeOrderTaskStatus)[number];
+ status: (typeof changeNoticeTaskStatus)[number];
userId: string;
}
) {
@@ -6675,7 +6733,7 @@ export async function updateChangeOrderActionStatus(
.single();
}
-export async function deleteChangeOrderAction(
+export async function deleteChangeNoticeAction(
client: SupabaseClient<Database>,
id: string
) {
@@ -6683,27 +6741,35 @@ export async function deleteChangeOrderAction(
}
// Bulk reorder (drag-sort) — a multi-row write, so Kysely (route passes
-// getDatabaseClient()).
-export async function updateChangeOrderActionOrder(
+// getDatabaseClient()). Kysely bypasses RLS and the ids come from the request
+// body, so every update is scoped to the owning change notice + company.
+export async function updateChangeNoticeActionOrder(
db: Kysely<KyselyDatabase>,
- updates: { id: string; sortOrder: number; updatedBy: string }[]
+ args: {
+ changeNoticeId: string;
+ companyId: string;
+ updates: { id: string; sortOrder: number; updatedBy: string }[];
+ }
) {
+ const { changeNoticeId, companyId, updates } = args;
return db.transaction().execute(async (trx) => {
for (const { id, sortOrder, updatedBy } of updates) {
await trx
.updateTable("changeOrderActionTask")
.set({ sortOrder, updatedBy })
.where("id", "=", id)
+ .where("changeOrderId", "=", changeNoticeId)
+ .where("companyId", "=", companyId)
.execute();
}
});
}
// =============================================================================
-// Change Order Required Actions (the configurable default-action templates the
-// config CRUD page manages, and the source new change orders are seeded from).
+// Change Notice Required Actions (the configurable default-action templates the
+// config CRUD page manages, and the source new change notices are seeded from).
// =============================================================================
-export async function getChangeOrderRequiredActions(
+export async function getChangeNoticeRequiredActions(
client: SupabaseClient<Database>,
companyId: string,
args?: GenericQueryFilters & { search: string | null }
@@ -6726,7 +6792,7 @@ export async function getChangeOrderRequiredActions(
return query;
}
-export async function getChangeOrderRequiredActionsList(
+export async function getChangeNoticeRequiredActionsList(
client: SupabaseClient<Database>,
companyId: string
) {
@@ -6738,18 +6804,20 @@ export async function getChangeOrderRequiredActionsList(
.order("name", { ascending: true });
}
-export async function getChangeOrderRequiredAction(
+export async function getChangeNoticeRequiredAction(
client: SupabaseClient<Database>,
- id: string
+ id: string,
+ companyId: string
) {
return client
.from("changeOrderRequiredAction")
.select("*")
.eq("id", id)
+ .eq("companyId", companyId)
.single();
}
-export async function upsertChangeOrderRequiredAction(
+export async function upsertChangeNoticeRequiredAction(
client: SupabaseClient<Database>,
input: {
id?: string;
@@ -6768,6 +6836,7 @@ export async function upsertChangeOrderRequiredAction(
updatedBy: input.userId
})
.eq("id", input.id)
+ .eq("companyId", input.companyId)
.select("id")
.single();
}
@@ -6784,22 +6853,27 @@ export async function upsertChangeOrderRequiredAction(
.single();
}
-export async function deleteChangeOrderRequiredAction(
+export async function deleteChangeNoticeRequiredAction(
client: SupabaseClient<Database>,
- id: string
+ id: string,
+ companyId: string
) {
- return client.from("changeOrderRequiredAction").delete().eq("id", id);
+ return client
+ .from("changeOrderRequiredAction")
+ .delete()
+ .eq("id", id)
+ .eq("companyId", companyId);
}
-// Reconcile a change order's action tasks to a chosen set of required-action
+// Reconcile a change notice's action tasks to a chosen set of required-action
// templates — the sidebar's editable "Required Actions" multiselect (mirrors
// Quality's requiredActionIds field). Templates newly selected are instantiated
// (appended); templates deselected have their task removed. Tasks with no
// template link (actionTypeId IS NULL) are left untouched.
-export async function setChangeOrderActionTasks(
+export async function setChangeNoticeActionTasks(
client: SupabaseClient<Database>,
input: {
- changeOrderId: string;
+ changeNoticeId: string;
requiredActionIds: string[];
companyId: string;
userId: string;
@@ -6808,7 +6882,7 @@ export async function setChangeOrderActionTasks(
const existing = await client
.from("changeOrderActionTask")
.select("id, actionTypeId, sortOrder")
- .eq("changeOrderId", input.changeOrderId)
+ .eq("changeOrderId", input.changeNoticeId)
.eq("companyId", input.companyId);
if (existing.error) return existing;
@@ -6841,7 +6915,7 @@ export async function setChangeOrderActionTasks(
const base = rows.reduce((max, r) => Math.max(max, r.sortOrder ?? 0), 0);
const ins = await client.from("changeOrderActionTask").insert(
(templates.data ?? []).map((template, index) => ({
- changeOrderId: input.changeOrderId,
+ changeOrderId: input.changeNoticeId,
actionTypeId: template.id,
name: template.name,
status: "Pending" as const,
@@ -6857,13 +6931,13 @@ export async function setChangeOrderActionTasks(
}
// Instantiate one changeOrderActionTask per active template onto a new change
-// order. Called by insertChangeOrder; non-gating, so callers ignore a soft
-// failure rather than roll back the change order.
-export async function seedDefaultChangeOrderActions(
+// notice. Called by insertChangeNotice; non-gating, so callers ignore a soft
+// failure rather than roll back the change notice.
+export async function seedDefaultChangeNoticeActions(
client: SupabaseClient<Database>,
- input: { changeOrderId: string; companyId: string; userId: string }
+ input: { changeNoticeId: string; companyId: string; userId: string }
) {
- const templates = await getChangeOrderRequiredActionsList(
+ const templates = await getChangeNoticeRequiredActionsList(
client,
input.companyId
);
@@ -6871,7 +6945,7 @@ export async function seedDefaultChangeOrderActions(
return client.from("changeOrderActionTask").insert(
templates.data.map((template, index) => ({
- changeOrderId: input.changeOrderId,
+ changeOrderId: input.changeNoticeId,
actionTypeId: template.id,
name: template.name,
status: "Pending" as const,
@@ -6883,7 +6957,7 @@ export async function seedDefaultChangeOrderActions(
}
// =============================================================================
-// Change Orders — the reusable method-diff engine (Q5 git-style end-state).
+// Change Notices — the reusable method-diff engine (Q5 git-style end-state).
//
// `diffMethod` is a PURE function (no DB access, unit-testable): it compares two
// method snapshots (a `base` = the current live method, a `target` = the CO's
@@ -6892,7 +6966,7 @@ export async function seedDefaultChangeOrderActions(
// The same shape is reused for the pre-release "tips" (staged-vs-live) and the
// post-release oldRev↔newRev redline (Task 17).
//
-// `getChangeOrderDiff` is the DB-facing wrapper: for each affected item it reads
+// `getChangeNoticeDiff` is the DB-facing wrapper: for each affected item it reads
// the current source method live + the staged rows, runs `diffMethod`, and also
// returns the manual supersession declarations. Reads are flat selects + JS
// stitch (no composite-FK PostgREST embeds — the erp TS2589 budget; see lessons).
@@ -7050,8 +7124,8 @@ export type OperationChildren = {
tools: Row[];
};
-// OperationChildrenDiff and OperationDiffEntry now live in changeOrder.models
-// (imported + re-exported above) so ChangeOrderItemDiff can reference them
+// OperationChildrenDiff and OperationDiffEntry now live in items.models
+// (imported + re-exported above) so ChangeNoticeItemDiff can reference them
// without a circular import. Their shape is unchanged (Row = Record<string,
// unknown>, the same as MethodDiffEntry's generic here).
@@ -7208,8 +7282,8 @@ export function diffMethod(input: DiffMethodInput): DiffMethodResult {
// DB-facing wrapper
// -----------------------------------------------------------------------------
-export type ChangeOrderDiff = {
- items: ChangeOrderItemDiff[];
+export type ChangeNoticeDiff = {
+ items: ChangeNoticeItemDiff[];
};
// Editable item attribute columns compared for the attribute diff. `mpn` lives on
@@ -7585,19 +7659,19 @@ async function stampOperationRefNames(
// CO-owned Draft method as `target` (both REAL method tables), correlate by
// natural keys, run the pure `diffMethod`, and collect. Also returns the manual
// supersession declarations. Flat selects scoped by companyId (no embeds).
-export async function getChangeOrderDiff(
+export async function getChangeNoticeDiff(
client: SupabaseClient<Database>,
- changeOrderId: string,
+ changeNoticeId: string,
companyId: string
-): Promise<{ data: ChangeOrderDiff; error: { message: string } | null }> {
- const affected = await getChangeOrderAffectedItems(
+): Promise<{ data: ChangeNoticeDiff; error: { message: string } | null }> {
+ const affected = await getChangeNoticeAffectedItems(
client,
- changeOrderId,
+ changeNoticeId,
companyId
);
if (affected.error) return { data: { items: [] }, error: affected.error };
- const items: ChangeOrderItemDiff[] = [];
+ const items: ChangeNoticeItemDiff[] = [];
for (const affectedItem of affected.data) {
const base = await readMethodRows(
diff --git a/apps/erp/app/modules/items/types.ts b/apps/erp/app/modules/items/types.ts
index 4537f72fc9..41b930c6c8 100644
--- a/apps/erp/app/modules/items/types.ts
+++ b/apps/erp/app/modules/items/types.ts
@@ -1,8 +1,9 @@
import type { Database } from "@carbon/database";
import type {
- getChangeOrder,
- getChangeOrders,
- getChangeOrderTypes,
+ getChangeNotice,
+ getChangeNoticeActions,
+ getChangeNotices,
+ getChangeNoticeTypes,
getConfigurationParameters,
getConfigurationRules,
getConsumable,
@@ -42,30 +43,32 @@ import type {
export type ItemRevisionStatus =
Database["public"]["Enums"]["itemRevisionStatus"];
-// The single change order (base table, NOT-NULL columns) — the shape detail
+// The single change notice (base table, NOT-NULL columns) — the shape detail
// routes and the properties/header/explorer components consume via useRouteData.
-export type ChangeOrder = NonNullable<
- Awaited<ReturnType<typeof getChangeOrder>>["data"]
+export type ChangeNotice = NonNullable<
+ Awaited<ReturnType<typeof getChangeNotice>>["data"]
>;
-// A row of the change-orders LIST — the `changeOrders` view, which additionally
-// rolls up `itemIds` (text[]) and `affectedItems` (jsonb) per CO. View columns are
-// all nullable, so this is a distinct type from the single-CO `ChangeOrder`.
-export type ChangeOrderListItem = NonNullable<
- Awaited<ReturnType<typeof getChangeOrders>>["data"]
+// A row of the change-notices LIST — the `changeOrders` view, which additionally
+// rolls up `itemIds` (text[]) and `affectedItems` (jsonb) per CN. View columns are
+// all nullable, so this is a distinct type from the single-CN `ChangeNotice`.
+export type ChangeNoticeListItem = NonNullable<
+ Awaited<ReturnType<typeof getChangeNotices>>["data"]
>[number];
-export type ChangeOrderType = NonNullable<
- Awaited<ReturnType<typeof getChangeOrderTypes>>["data"]
+export type ChangeNoticeType = NonNullable<
+ Awaited<ReturnType<typeof getChangeNoticeTypes>>["data"]
>[number];
-export type ChangeOrderStatus =
+export type ChangeNoticeStatus =
Database["public"]["Enums"]["changeOrderStatus"];
-export type ChangeOrderActionTask =
- Database["public"]["Tables"]["changeOrderActionTask"]["Row"];
+// Includes the `linearIssue` / `jiraIssue` mappings that `getChangeNoticeActions` hydrates.
+export type ChangeNoticeActionTask = NonNullable<
+ Awaited<ReturnType<typeof getChangeNoticeActions>>["data"]
+>[number];
-export type ChangeOrderRequiredAction =
+export type ChangeNoticeRequiredAction =
Database["public"]["Tables"]["changeOrderRequiredAction"]["Row"];
export type MaterialConfigurationData = {
diff --git a/apps/erp/app/modules/items/ui/ChangeOrder/AffectedItemDetail.tsx b/apps/erp/app/modules/items/ui/ChangeNotice/AffectedItemDetail.tsx
similarity index 89%
rename from apps/erp/app/modules/items/ui/ChangeOrder/AffectedItemDetail.tsx
rename to apps/erp/app/modules/items/ui/ChangeNotice/AffectedItemDetail.tsx
index 5bcf57991e..aec67f84c5 100644
--- a/apps/erp/app/modules/items/ui/ChangeOrder/AffectedItemDetail.tsx
+++ b/apps/erp/app/modules/items/ui/ChangeNotice/AffectedItemDetail.tsx
@@ -16,13 +16,13 @@ import { DatePicker, Hidden, Select, Submit } from "~/components/Form";
import { path } from "~/utils/path";
import type { SupersessionMode } from "../../items.models";
import {
- changeOrderAffectedItemChangeTypeValidator,
- changeOrderAffectedItemCutoverValidator,
- changeOrderChangeTypes,
+ changeNoticeAffectedItemChangeTypeValidator,
+ changeNoticeAffectedItemCutoverValidator,
+ changeNoticeChangeTypes,
supersessionModeMeta,
supersessionModes
} from "../../items.models";
-import type { ChangeOrderAffectedItemWithLabel } from "../../items.service";
+import type { ChangeNoticeAffectedItemWithLabel } from "../../items.service";
import {
BillOfMaterial,
BillOfProcess,
@@ -31,16 +31,17 @@ import {
} from "../Item";
import PartProperties from "../Parts/PartProperties";
import type { AffectedItemDraft } from "./affectedItem.types";
-import ChangeOrderDiffViewer from "./ChangeOrderDiffViewer";
+import ChangeNoticeDiffViewer from "./ChangeNoticeDiffViewer";
import ChangeTypeBadge from "./ChangeTypeBadge";
import ItemLink from "./ItemLink";
+import { LockedHint } from "./lock-ui";
const supersessionModeOptions = supersessionModes.map((value) => ({
value,
label: <Status color={supersessionModeMeta[value].color}>{value}</Status>
}));
-const changeTypeOptions = changeOrderChangeTypes.map((c) => ({
+const changeTypeOptions = changeNoticeChangeTypes.map((c) => ({
value: c,
label: c
}));
@@ -55,11 +56,14 @@ const changeTypeOptions = changeOrderChangeTypes.map((c) => ({
export default function AffectedItemDetail({
changeOrderId,
affected,
- isDisabled
+ isDisabled,
+ disabledReason
}: {
changeOrderId: string;
affected: AffectedItemDraft;
isDisabled: boolean;
+ // Why the change notice is locked, surfaced by the read-only affordances.
+ disabledReason?: string;
}) {
const { t } = useLingui();
@@ -116,7 +120,7 @@ export default function AffectedItemDetail({
<Card>
<CardHeader>
<HStack className="justify-between w-full">
- <CardTitle>
+ <CardTitle className="flex flex-row items-center gap-2">
<ItemLink
itemId={affectedItem.itemId}
type={label?.type}
@@ -126,6 +130,7 @@ export default function AffectedItemDetail({
label?.readableId ??
affectedItem.itemId}
</ItemLink>
+ {isDisabled && <LockedHint reason={disabledReason} />}
</CardTitle>
{/* Single combined change-type + draft-version badge (e.g. "Version 2"
/ "Revision 2" / "New"), replacing the old delete icon here.
@@ -164,8 +169,9 @@ export default function AffectedItemDetail({
{showCutover && (
<Card>
<CardHeader>
- <CardTitle>
+ <CardTitle className="flex flex-row items-center gap-2">
<Trans>Part Supersession</Trans>
+ {isDisabled && <LockedHint reason={disabledReason} />}
</CardTitle>
</CardHeader>
<CardContent>
@@ -187,7 +193,7 @@ export default function AffectedItemDetail({
</CardTitle>
</CardHeader>
<CardContent>
- <ChangeOrderDiffViewer bare diff={affected.diff} />
+ <ChangeNoticeDiffViewer bare diff={affected.diff} />
</CardContent>
</Card>
@@ -195,8 +201,9 @@ export default function AffectedItemDetail({
{showAttributes && (
<Card>
<CardHeader>
- <CardTitle>
+ <CardTitle className="flex flex-row items-center gap-2">
<Trans>Properties</Trans>
+ {isDisabled && <LockedHint reason={disabledReason} />}
</CardTitle>
</CardHeader>
<CardContent>
@@ -224,8 +231,11 @@ export default function AffectedItemDetail({
<SupplierParts
supplierParts={affected.partData.supplierParts}
isReadOnly={isDisabled}
+ titleExtras={
+ isDisabled ? <LockedHint reason={disabledReason} /> : undefined
+ }
deleteSupplierPath={(supplierPartId) =>
- path.to.changeOrderDeleteSupplierPart(
+ path.to.changeNoticeDeleteSupplierPart(
changeOrderId,
affectedItem.id,
supplierPartId
@@ -251,6 +261,8 @@ export default function AffectedItemDetail({
replenishmentSystem={label?.replenishmentSystem ?? undefined}
revisionStatus={affected.revisionStatus}
releaseControl={affected.releaseControl ?? undefined}
+ isDisabled={isDisabled}
+ disabledReason={disabledReason}
/>
<BillOfProcess
key={`bop:${affected.makeMethod.id}`}
@@ -264,6 +276,8 @@ export default function AffectedItemDetail({
tags={affected.tags}
revisionStatus={affected.revisionStatus}
releaseControl={affected.releaseControl ?? undefined}
+ isDisabled={isDisabled}
+ disabledReason={disabledReason}
/>
</>
) : (
@@ -291,11 +305,19 @@ export default function AffectedItemDetail({
modelUpload={partData.partSummary ?? undefined}
type="Part"
isReadOnly={isDisabled}
+ titleExtras={
+ isDisabled ? (
+ <LockedHint reason={disabledReason} />
+ ) : undefined
+ }
/>
)}
</DeferredFiles>
<CadModel
isReadOnly={isDisabled}
+ titleExtras={
+ isDisabled ? <LockedHint reason={disabledReason} /> : undefined
+ }
metadata={{ itemId: partData.itemId }}
modelPath={partData.partSummary?.modelPath ?? null}
title={t`CAD Model`}
@@ -328,7 +350,7 @@ function ChangeTypeControl({
isDisabled
}: {
changeOrderId: string;
- affected: ChangeOrderAffectedItemWithLabel;
+ affected: ChangeNoticeAffectedItemWithLabel;
isManufactured: boolean;
isDisabled: boolean;
}) {
@@ -355,8 +377,11 @@ function ChangeTypeControl({
<ValidatedForm
fetcher={fetcher}
method="post"
- action={path.to.changeOrderAffectedChangeType(changeOrderId, affected.id)}
- validator={changeOrderAffectedItemChangeTypeValidator}
+ action={path.to.changeNoticeAffectedChangeType(
+ changeOrderId,
+ affected.id
+ )}
+ validator={changeNoticeAffectedItemChangeTypeValidator}
defaultValues={{ id: affected.id, changeType: affected.changeType }}
className="w-full"
>
@@ -395,7 +420,7 @@ function CutoverControl({
isDisabled
}: {
changeOrderId: string;
- affected: ChangeOrderAffectedItemWithLabel;
+ affected: ChangeNoticeAffectedItemWithLabel;
isDisabled: boolean;
}) {
const { t } = useLingui();
@@ -410,8 +435,8 @@ function CutoverControl({
<ValidatedForm
fetcher={fetcher}
method="post"
- action={path.to.changeOrderAffectedCutover(changeOrderId, affected.id)}
- validator={changeOrderAffectedItemCutoverValidator}
+ action={path.to.changeNoticeAffectedCutover(changeOrderId, affected.id)}
+ validator={changeNoticeAffectedItemCutoverValidator}
defaultValues={{
id: affected.id,
supersessionMode: affected.supersessionMode,
diff --git a/apps/erp/app/modules/items/ui/ChangeOrder/AffectedItemForm.tsx b/apps/erp/app/modules/items/ui/ChangeNotice/AffectedItemForm.tsx
similarity index 93%
rename from apps/erp/app/modules/items/ui/ChangeOrder/AffectedItemForm.tsx
rename to apps/erp/app/modules/items/ui/ChangeNotice/AffectedItemForm.tsx
index e2b9c344f1..d97e96d827 100644
--- a/apps/erp/app/modules/items/ui/ChangeOrder/AffectedItemForm.tsx
+++ b/apps/erp/app/modules/items/ui/ChangeNotice/AffectedItemForm.tsx
@@ -31,10 +31,10 @@ import { ReplenishmentSystemIcon } from "~/components/Icons";
import { useNextItemId } from "~/hooks";
import { path } from "~/utils/path";
import {
- type ChangeOrderChangeType,
- changeOrderAffectedItemValidator,
- changeOrderChangeTypes,
- changeOrderNewPartValidator,
+ type ChangeNoticeChangeType,
+ changeNoticeAffectedItemValidator,
+ changeNoticeChangeTypes,
+ changeNoticeNewPartValidator,
itemReplenishmentSystems,
itemTrackingTypes
} from "../../items.models";
@@ -45,7 +45,7 @@ import {
//
// A single change-type Select drives the body: Version / Revision / Replacement
// Part pick an EXISTING Part; New Part reveals a create-new-part mini-form (mints
-// a brand-new part under the change order). Change orders operate on Parts only —
+// a brand-new part under the change notice). Change notices operate on Parts only —
// no Tool selection. The two modes are separate ValidatedForms (each with its own
// validator); the Select carries `changeType` so the route action can tell them
// apart.
@@ -67,7 +67,7 @@ export default function AffectedItemForm({
const fetcher = useFetcher<{ success: boolean; id?: string }>();
const [changeType, setChangeType] =
- useState<ChangeOrderChangeType>("Version");
+ useState<ChangeNoticeChangeType>("Version");
// A net-new affected item is always a Part (no Part/Tool choice) — mint under
// the Part sequence.
const { id: nextId, onIdChange, loading } = useNextItemId("Part");
@@ -102,13 +102,13 @@ export default function AffectedItemForm({
onClose();
if (fetcher.data.id) {
navigate(
- path.to.changeOrderAffectedItem(changeOrderId, fetcher.data.id)
+ path.to.changeNoticeAffectedItem(changeOrderId, fetcher.data.id)
);
}
}
}, [fetcher.state, fetcher.data, onClose, navigate, changeOrderId]);
- const changeTypeOptions = changeOrderChangeTypes.map((c) => ({
+ const changeTypeOptions = changeNoticeChangeTypes.map((c) => ({
label: c,
value: c
}));
@@ -153,7 +153,7 @@ export default function AffectedItemForm({
termId="change-order-change-type"
options={changeTypeOptions}
onChange={(o) =>
- setChangeType((o?.value as ChangeOrderChangeType) ?? "Version")
+ setChangeType((o?.value as ChangeNoticeChangeType) ?? "Version")
}
/>
);
@@ -190,9 +190,9 @@ export default function AffectedItemForm({
// forces a fresh mount + fresh store that hydrates with these defaults.
<ValidatedForm
key="new-part"
- validator={changeOrderNewPartValidator}
+ validator={changeNoticeNewPartValidator}
method="post"
- action={path.to.changeOrderAffected(changeOrderId)}
+ action={path.to.changeNoticeAffected(changeOrderId)}
defaultValues={{
changeOrderId,
changeType: "New Part",
@@ -247,9 +247,9 @@ export default function AffectedItemForm({
) : (
<ValidatedForm
key="existing-item"
- validator={changeOrderAffectedItemValidator}
+ validator={changeNoticeAffectedItemValidator}
method="post"
- action={path.to.changeOrderAffected(changeOrderId)}
+ action={path.to.changeNoticeAffected(changeOrderId)}
defaultValues={{
changeOrderId,
itemId: "",
@@ -301,7 +301,7 @@ export default function AffectedItemForm({
<AlertDescription>
<Trans>
Your changes go into a new draft version released with
- this change order.
+ this change notice.
</Trans>
</AlertDescription>
</Alert>
diff --git a/apps/erp/app/modules/items/ui/ChangeOrder/ChangeOrderActions.tsx b/apps/erp/app/modules/items/ui/ChangeNotice/ChangeNoticeActions.tsx
similarity index 72%
rename from apps/erp/app/modules/items/ui/ChangeOrder/ChangeOrderActions.tsx
rename to apps/erp/app/modules/items/ui/ChangeNotice/ChangeNoticeActions.tsx
index b60ad8f873..1dbd3c3bd3 100644
--- a/apps/erp/app/modules/items/ui/ChangeOrder/ChangeOrderActions.tsx
+++ b/apps/erp/app/modules/items/ui/ChangeNotice/ChangeNoticeActions.tsx
@@ -17,33 +17,37 @@ import {
} from "~/components/ActionTasks/ActionTaskCard";
import { ActionTaskList } from "~/components/ActionTasks/ActionTaskList";
import { ActionTaskStatusButton } from "~/components/ActionTasks/ActionTaskStatusButton";
+import { JiraIssueDialog } from "~/components/ActionTasks/Jira/IssueDialog";
+import { LinearIssueDialog } from "~/components/ActionTasks/Linear/IssueDialog";
+import { syncActionTaskNotes } from "~/components/ActionTasks/syncNotes";
import { usePermissions, useRouteData, useUser } from "~/hooks";
+import { useIntegrations } from "~/hooks/useIntegrations";
import type { ListItem } from "~/types";
import { getPrivateUrl, path } from "~/utils/path";
-import type { ChangeOrderActionTask } from "../../types";
+import type { ChangeNoticeActionTask } from "../../types";
// Change-order actions — a thin wrapper over the shared ActionTaskList (same
-// component the Quality issue uses). Adding picks from the change order's
+// component the Quality issue uses). Adding picks from the change notice's
// configured required-action templates via the "Add Actions" modal and writes
// back through the reconcile route (`$id.action`), which instantiates the union
// of the current tasks and the newly-picked templates. Each row is an ActionItem
// (notes, status, assignee) with an inline delete. All actions live here on the
// top-level detail route.
-export default function ChangeOrderActions({
+export default function ChangeNoticeActions({
changeOrderId,
actions,
isDisabled
}: {
changeOrderId: string;
- actions: ChangeOrderActionTask[];
+ actions: ChangeNoticeActionTask[];
isDisabled: boolean;
}) {
const routeData = useRouteData<{ requiredActions: ListItem[] }>(
- path.to.changeOrder(changeOrderId)
+ path.to.changeNotice(changeOrderId)
);
const addFetcher = useFetcher<{ success: boolean }>();
- // The reconcile route (`setChangeOrderActionTasks`) sets the exact set of
+ // The reconcile route (`setChangeNoticeActionTasks`) sets the exact set of
// tasks from the posted actionTypeIds, so adding posts the union of the current
// tasks' types and the newly-picked templates (removal is per-card, below).
const onAdd = useCallback(
@@ -56,7 +60,7 @@ export default function ChangeOrderActions({
formData.append("actionIds", merged.join(","));
addFetcher.submit(formData, {
method: "post",
- action: path.to.changeOrderAction(changeOrderId)
+ action: path.to.changeNoticeAction(changeOrderId)
});
},
[actions, changeOrderId, addFetcher]
@@ -65,7 +69,7 @@ export default function ChangeOrderActions({
return (
<ActionTaskList
tasks={actions}
- reorderAction={path.to.changeOrderActionOrder(changeOrderId)}
+ reorderAction={path.to.changeNoticeActionOrder(changeOrderId)}
templates={routeData?.requiredActions ?? []}
onAdd={onAdd}
isAddSubmitting={addFetcher.state !== "idle"}
@@ -92,12 +96,13 @@ function ActionItem({
dragControls
}: {
changeOrderId: string;
- action: ChangeOrderActionTask;
+ action: ChangeNoticeActionTask;
isDisabled: boolean;
dragControls: DragControls;
}) {
const { t } = useLingui();
const permissions = usePermissions();
+ const integrations = useIntegrations();
const {
id: userId,
company: { id: companyId }
@@ -121,12 +126,31 @@ function ActionItem({
return getPrivateUrl(result.data.path);
};
+ const hasLinearLink = !!action.linearIssue;
+ const hasJiraLink = !!action.jiraIssue;
+
const onUpdateContent = useDebounce(
async (value: JSONContent) => {
await carbon
?.from("changeOrderActionTask")
.update({ notes: value, updatedBy: userId })
.eq("id", action.id);
+
+ if (hasLinearLink) {
+ await syncActionTaskNotes("Linear", {
+ actionId: action.id,
+ entityType: "changeOrderActionTask",
+ notes: value
+ });
+ }
+
+ if (hasJiraLink) {
+ await syncActionTaskNotes("Jira", {
+ actionId: action.id,
+ entityType: "changeOrderActionTask",
+ notes: value
+ });
+ }
},
2500,
true
@@ -139,7 +163,7 @@ function ActionItem({
formData.append("status", next);
statusFetcher.submit(formData, {
method: "post",
- action: path.to.changeOrderActionStatus(changeOrderId, action.id)
+ action: path.to.changeNoticeActionStatus(changeOrderId, action.id)
});
};
@@ -149,7 +173,7 @@ function ActionItem({
{},
{
method: "post",
- action: path.to.deleteChangeOrderAction(changeOrderId, action.id)
+ action: path.to.deleteChangeNoticeAction(changeOrderId, action.id)
}
);
};
@@ -180,15 +204,31 @@ function ActionItem({
/>
}
headerExtras={
- canEdit ? (
- <IconButton
- aria-label={t`Delete action`}
- icon={<LuTrash2 />}
- variant="ghost"
- onClick={onDelete}
- isDisabled={deleteFetcher.state !== "idle"}
- />
- ) : undefined
+ <>
+ {integrations.has("linear") && (
+ <LinearIssueDialog
+ entityType="changeOrderActionTask"
+ taskId={action.id}
+ linkedIssue={action.linearIssue}
+ />
+ )}
+ {integrations.has("jira") && (
+ <JiraIssueDialog
+ entityType="changeOrderActionTask"
+ taskId={action.id}
+ linkedIssue={action.jiraIssue}
+ />
+ )}
+ {canEdit && (
+ <IconButton
+ aria-label={t`Delete action`}
+ icon={<LuTrash2 />}
+ variant="ghost"
+ onClick={onDelete}
+ isDisabled={deleteFetcher.state !== "idle"}
+ />
+ )}
+ </>
}
footerExtras={
action.dueDate ? (
diff --git a/apps/erp/app/modules/items/ui/ChangeOrder/ChangeOrderChanges.tsx b/apps/erp/app/modules/items/ui/ChangeNotice/ChangeNoticeChanges.tsx
similarity index 86%
rename from apps/erp/app/modules/items/ui/ChangeOrder/ChangeOrderChanges.tsx
rename to apps/erp/app/modules/items/ui/ChangeNotice/ChangeNoticeChanges.tsx
index 33aa121902..52ed9d15a9 100644
--- a/apps/erp/app/modules/items/ui/ChangeOrder/ChangeOrderChanges.tsx
+++ b/apps/erp/app/modules/items/ui/ChangeNotice/ChangeNoticeChanges.tsx
@@ -7,14 +7,14 @@ import {
VStack
} from "@carbon/react";
import { Trans } from "@lingui/react/macro";
-import ChangeOrderDiffViewer from "./ChangeOrderDiffViewer";
-import type { ReleaseChange } from "./ChangeOrderReleaseMerge";
+import ChangeNoticeDiffViewer from "./ChangeNoticeDiffViewer";
+import type { ReleaseChange } from "./ChangeNoticeReleaseMerge";
import ChangeTypeBadge from "./ChangeTypeBadge";
// The CO-wide changes rollup shown on the top-level overview ($id.details):
// every affected item's read-only authoring diff in one card, mirroring the
-// release confirmation dialog's list (label + ChangeOrderDiffViewer per item).
-export default function ChangeOrderChanges({
+// release confirmation dialog's list (label + ChangeNoticeDiffViewer per item).
+export default function ChangeNoticeChanges({
changes
}: {
changes: ReleaseChange[];
@@ -57,7 +57,7 @@ export default function ChangeOrderChanges({
className="shrink-0"
/>
</HStack>
- <ChangeOrderDiffViewer diff={c.diff} />
+ <ChangeNoticeDiffViewer diff={c.diff} />
</VStack>
))
)}
diff --git a/apps/erp/app/modules/items/ui/ChangeOrder/ChangeOrderContent.tsx b/apps/erp/app/modules/items/ui/ChangeNotice/ChangeNoticeContent.tsx
similarity index 83%
rename from apps/erp/app/modules/items/ui/ChangeOrder/ChangeOrderContent.tsx
rename to apps/erp/app/modules/items/ui/ChangeNotice/ChangeNoticeContent.tsx
index de0fcc8129..6656581e07 100644
--- a/apps/erp/app/modules/items/ui/ChangeOrder/ChangeOrderContent.tsx
+++ b/apps/erp/app/modules/items/ui/ChangeNotice/ChangeNoticeContent.tsx
@@ -13,16 +13,17 @@ import { Editor } from "@carbon/react/Editor";
import { useLingui } from "@lingui/react/macro";
import { nanoid } from "nanoid";
import { useState } from "react";
+import { useFetcher } from "react-router";
import { usePermissions, useUser } from "~/hooks";
-import { getPrivateUrl } from "~/utils/path";
+import { getPrivateUrl, path } from "~/utils/path";
// The two rich-text columns on the changeOrder header (reasonForChange +
// description). Both are stored as JSON and read/written the same way; the
-// debounced writer targets the matching column directly through the
-// request-scoped supabase client (mirrors IssueContent). Rendered as full Cards
+// debounced writer posts to $id.content so the engineering lock is enforced
+// server-side (a direct supabase write had no such gate). Rendered as full Cards
// on the top-level CO detail route; `embedded` drops the Card chrome for callers
// that supply their own frame.
-export function ChangeOrderContentSection({
+export function ChangeNoticeContentSection({
id,
title,
field,
@@ -40,12 +41,12 @@ export function ChangeOrderContentSection({
embedded?: boolean;
}) {
const {
- id: userId,
company: { id: companyId }
} = useUser();
const { carbon } = useCarbon();
const { t } = useLingui();
const permissions = usePermissions();
+ const fetcher = useFetcher<{}>();
const [content, setContent] = useState(initialContent ?? {});
@@ -68,14 +69,11 @@ export function ChangeOrderContentSection({
};
const onUpdateContent = useDebounce(
- async (value: JSONContent) => {
- await carbon
- ?.from("changeOrder")
- .update({
- [field]: value,
- updatedBy: userId
- })
- .eq("id", id);
+ (value: JSONContent) => {
+ fetcher.submit(
+ { field, content: JSON.stringify(value) },
+ { method: "post", action: path.to.changeNoticeContent(id) }
+ );
},
2500,
true
@@ -113,7 +111,7 @@ export function ChangeOrderContentSection({
);
}
-export function ChangeOrderContent({
+export function ChangeNoticeContent({
id,
reasonForChange,
description,
@@ -130,7 +128,7 @@ export function ChangeOrderContent({
return (
<>
- <ChangeOrderContentSection
+ <ChangeNoticeContentSection
key={`${id}-reason`}
id={id}
title={t`Reason for Change`}
@@ -138,7 +136,7 @@ export function ChangeOrderContent({
content={reasonForChange}
isDisabled={isDisabled}
/>
- <ChangeOrderContentSection
+ <ChangeNoticeContentSection
key={`${id}-description`}
id={id}
title={t`Description of Change`}
diff --git a/apps/erp/app/modules/items/ui/ChangeOrder/ChangeOrderDiffViewer.tsx b/apps/erp/app/modules/items/ui/ChangeNotice/ChangeNoticeDiffViewer.tsx
similarity index 98%
rename from apps/erp/app/modules/items/ui/ChangeOrder/ChangeOrderDiffViewer.tsx
rename to apps/erp/app/modules/items/ui/ChangeNotice/ChangeNoticeDiffViewer.tsx
index 5886f1579a..2575a904f3 100644
--- a/apps/erp/app/modules/items/ui/ChangeOrder/ChangeOrderDiffViewer.tsx
+++ b/apps/erp/app/modules/items/ui/ChangeNotice/ChangeNoticeDiffViewer.tsx
@@ -14,7 +14,7 @@ import type { ReactNode } from "react";
import { LuChevronRight } from "react-icons/lu";
import { useItems, useSuppliers } from "~/stores";
import type {
- ChangeOrderItemDiff,
+ ChangeNoticeItemDiff,
MethodDiffEntry,
MethodDiffStatus,
OperationDiffEntry
@@ -22,7 +22,7 @@ import type {
import { DiffBadge } from "./diff-ui";
// -----------------------------------------------------------------------------
-// Read-only Change Order diff viewer (authoring-time). Renders the CO-owned draft
+// Read-only Change Notice diff viewer (authoring-time). Renders the CO-owned draft
// method vs the base Active method it was copied from as a git-style, tree-shaped
// redline: BOM and BOP as SEPARATE sections plus an Attributes section. Each entry
// is a top-level TREE NODE (a BOM component / a BOP operation) whose children are
@@ -31,7 +31,7 @@ import { DiffBadge } from "./diff-ui";
// audit-log red→green style. Unchanged rows are filtered out; an unchanged
// operation is shown (uncolored) only when its children changed.
//
-// This is NOT the release merge UI (ChangeOrderReleaseMerge / ...ConflictResolver,
+// This is NOT the release merge UI (ChangeNoticeReleaseMerge / ...ConflictResolver,
// which have radio-button choices) — it is purely read-only, no forms, no state.
// -----------------------------------------------------------------------------
@@ -626,14 +626,14 @@ function Section({
);
}
-export default function ChangeOrderDiffViewer({
+export default function ChangeNoticeDiffViewer({
diff,
// When `bare`, drop the bordered wrapper + the internal "Changes" label — the
// caller (the affected-item "Changes" card) supplies the frame + title. The
// release dialog keeps the default framed look.
bare = false
}: {
- diff?: ChangeOrderItemDiff;
+ diff?: ChangeNoticeItemDiff;
bare?: boolean;
}) {
const [items] = useItems();
diff --git a/apps/erp/app/modules/items/ui/ChangeOrder/ChangeOrderExplorer.tsx b/apps/erp/app/modules/items/ui/ChangeNotice/ChangeNoticeExplorer.tsx
similarity index 94%
rename from apps/erp/app/modules/items/ui/ChangeOrder/ChangeOrderExplorer.tsx
rename to apps/erp/app/modules/items/ui/ChangeNotice/ChangeNoticeExplorer.tsx
index 6ba1d1779c..8ae740c8c2 100644
--- a/apps/erp/app/modules/items/ui/ChangeOrder/ChangeOrderExplorer.tsx
+++ b/apps/erp/app/modules/items/ui/ChangeNotice/ChangeNoticeExplorer.tsx
@@ -16,12 +16,12 @@ import { LuCirclePlus, LuEllipsisVertical, LuTrash } from "react-icons/lu";
import { Link, useFetcher, useParams } from "react-router";
import { Empty, ItemThumbnail, MethodItemTypeIcon } from "~/components";
import { useRouteData } from "~/hooks";
-import { canEditChangeOrder } from "~/modules/items";
+import { canEditChangeNoticeEngineering } from "~/modules/items";
import { getLinkToItemDetails } from "~/modules/items/ui/Item/ItemForm";
import type { ItemType } from "~/modules/shared";
import { useItems } from "~/stores";
import { path } from "~/utils/path";
-import type { ChangeOrder } from "../../types";
+import type { ChangeNotice } from "../../types";
import AffectedItemForm from "./AffectedItemForm";
import type { AffectedItemDraft } from "./affectedItem.types";
@@ -33,17 +33,19 @@ import type { AffectedItemDraft } from "./affectedItem.types";
// Selection lives in the URL (the affectedId route param). Self-contained: reads
// the affected items and lock state from the $id route loader, so ResizablePanels
// can render it with no props (mirrors SalesOrderExplorer).
-export default function ChangeOrderExplorer() {
+export default function ChangeNoticeExplorer() {
const { id } = useParams();
if (!id) throw new Error("id not found");
const routeData = useRouteData<{
- changeOrder: ChangeOrder;
+ changeNotice: ChangeNotice;
affectedItems: AffectedItemDraft[];
- }>(path.to.changeOrder(id));
+ }>(path.to.changeNotice(id));
const affectedItems = routeData?.affectedItems ?? [];
- const isDisabled = !canEditChangeOrder(routeData?.changeOrder?.status);
+ const isDisabled = !canEditChangeNoticeEngineering(
+ routeData?.changeNotice?.status
+ );
const disclosure = useDisclosure();
@@ -136,7 +138,7 @@ function AffectedItemRow({
return (
<VStack spacing={0} className="border-b">
<Link
- to={path.to.changeOrderAffectedItem(changeOrderId, item.id)}
+ to={path.to.changeNoticeAffectedItem(changeOrderId, item.id)}
prefetch="intent"
className="w-full"
>
@@ -190,7 +192,7 @@ function AffectedItemRow({
{},
{
method: "post",
- action: path.to.deleteChangeOrderAffected(
+ action: path.to.deleteChangeNoticeAffected(
changeOrderId,
item.id
)
diff --git a/apps/erp/app/modules/items/ui/ChangeOrder/ChangeOrderForm.tsx b/apps/erp/app/modules/items/ui/ChangeNotice/ChangeNoticeForm.tsx
similarity index 83%
rename from apps/erp/app/modules/items/ui/ChangeOrder/ChangeOrderForm.tsx
rename to apps/erp/app/modules/items/ui/ChangeNotice/ChangeNoticeForm.tsx
index ef5f4badba..d4a118e198 100644
--- a/apps/erp/app/modules/items/ui/ChangeOrder/ChangeOrderForm.tsx
+++ b/apps/erp/app/modules/items/ui/ChangeNotice/ChangeNoticeForm.tsx
@@ -37,13 +37,16 @@ import {
import { usePermissions } from "~/hooks";
import type { ListItem } from "~/types";
import { path } from "~/utils/path";
-import { changeOrderPriority, changeOrderValidator } from "../../items.models";
-import ChangeOrderPriority from "./ChangeOrderPriority";
+import {
+ changeNoticePriority,
+ changeNoticeValidator
+} from "../../items.models";
+import ChangeNoticePriority from "./ChangeNoticePriority";
-type ChangeOrderFormValues = z.infer<typeof changeOrderValidator>;
+type ChangeNoticeFormValues = z.infer<typeof changeNoticeValidator>;
-type ChangeOrderFormProps = {
- initialValues: ChangeOrderFormValues;
+type ChangeNoticeFormProps = {
+ initialValues: ChangeNoticeFormValues;
types: ListItem[];
// "page" (default) renders in a Card on the create route; "modal" renders in a
// ModalDrawer launched from an item detail page (item pre-selected as affected).
@@ -53,14 +56,14 @@ type ChangeOrderFormProps = {
fetcher?: FetcherWithComponents<unknown>;
};
-const ChangeOrderForm = ({
+const ChangeNoticeForm = ({
initialValues,
types,
type = "page",
open,
onClose,
fetcher
-}: ChangeOrderFormProps) => {
+}: ChangeNoticeFormProps) => {
const { t } = useLingui();
const permissions = usePermissions();
const isEditing = initialValues.id !== undefined;
@@ -70,12 +73,12 @@ const ChangeOrderForm = ({
<>
<Hidden name="id" />
<Hidden name="changeOrderId" />
- {/* Linked NCR is set by the source (e.g. "Create Change Order" from an
+ {/* Linked NCR is set by the source (e.g. "Create Change Notice" from an
Issue) and carried silently — not a user-editable field. */}
<Hidden name="nonConformanceId" />
{/* Affected Parts are added on the CO detail page (top-to-bottom flow), not
chosen here. The create form only carries any pre-selected item (e.g.
- when opened from a part page via CreateChangeOrderModal) as hidden
+ when opened from a part page via CreateChangeNoticeModal) as hidden
inputs so it's still attached on create. */}
{!isEditing &&
(initialValues.affectedItemIds ?? []).map((itemId) => (
@@ -110,8 +113,8 @@ const ChangeOrderForm = ({
<Select
name="priority"
label={t`Priority`}
- options={changeOrderPriority.map((priority) => ({
- label: <ChangeOrderPriority priority={priority} />,
+ options={changeNoticePriority.map((priority) => ({
+ label: <ChangeNoticePriority priority={priority} />,
value: priority
}))}
/>
@@ -150,15 +153,15 @@ const ChangeOrderForm = ({
<ModalDrawerContent>
<ValidatedForm
method="post"
- action={path.to.newChangeOrder}
- validator={changeOrderValidator}
+ action={path.to.newChangeNotice}
+ validator={changeNoticeValidator}
defaultValues={initialValues}
fetcher={fetcher}
className="flex flex-col h-full"
>
<ModalDrawerHeader>
<ModalDrawerTitle>
- <Trans>New Change Order</Trans>
+ <Trans>New Change Notice</Trans>
</ModalDrawerTitle>
</ModalDrawerHeader>
<ModalDrawerBody>{fields}</ModalDrawerBody>
@@ -181,22 +184,22 @@ const ChangeOrderForm = ({
<Card>
<ValidatedForm
method="post"
- validator={changeOrderValidator}
+ validator={changeNoticeValidator}
defaultValues={initialValues}
className="w-full"
>
<CardHeader>
<CardTitle>
{isEditing ? (
- <Trans>Change Order</Trans>
+ <Trans>Change Notice</Trans>
) : (
- <Trans>New Change Order</Trans>
+ <Trans>New Change Notice</Trans>
)}
</CardTitle>
{!isEditing && (
<CardDescription>
<Trans>
- A change order tracks a controlled engineering or manufacturing
+ A change notice tracks a controlled engineering or manufacturing
change through review and implementation.
</Trans>
</CardDescription>
@@ -209,4 +212,4 @@ const ChangeOrderForm = ({
);
};
-export default ChangeOrderForm;
+export default ChangeNoticeForm;
diff --git a/apps/erp/app/modules/items/ui/ChangeOrder/ChangeOrderHeader.tsx b/apps/erp/app/modules/items/ui/ChangeNotice/ChangeNoticeHeader.tsx
similarity index 72%
rename from apps/erp/app/modules/items/ui/ChangeOrder/ChangeOrderHeader.tsx
rename to apps/erp/app/modules/items/ui/ChangeNotice/ChangeNoticeHeader.tsx
index 24f4c554f3..59d7fb02e6 100644
--- a/apps/erp/app/modules/items/ui/ChangeOrder/ChangeOrderHeader.tsx
+++ b/apps/erp/app/modules/items/ui/ChangeNotice/ChangeNoticeHeader.tsx
@@ -29,23 +29,23 @@ import ConfirmDelete from "~/components/Modals/ConfirmDelete";
import { usePermissions, useRouteData, useUser } from "~/hooks";
import { path } from "~/utils/path";
import {
- type changeOrderStatus,
- changeOrderStatusTransitions,
- isChangeOrderLocked
+ type changeNoticeStatus,
+ changeNoticeStatusTransitions,
+ isChangeNoticeLocked
} from "../../items.models";
-import type { ChangeOrder } from "../../types";
-import ChangeOrderStatus from "./ChangeOrderStatus";
+import type { ChangeNotice } from "../../types";
+import ChangeNoticeStatus from "./ChangeNoticeStatus";
import { releaseDialogOpenAtom } from "./releaseDialog.store";
-const ChangeOrderHeader = () => {
+const ChangeNoticeHeader = () => {
const { id } = useParams();
if (!id) throw new Error("id not found");
- const routeData = useRouteData<{ changeOrder: ChangeOrder }>(
- path.to.changeOrder(id)
+ const routeData = useRouteData<{ changeNotice: ChangeNotice }>(
+ path.to.changeNotice(id)
);
- const status = routeData?.changeOrder?.status ?? "Draft";
+ const status = routeData?.changeNotice?.status ?? "Draft";
const { t } = useLingui();
const permissions = usePermissions();
const { company } = useUser();
@@ -60,10 +60,10 @@ const ChangeOrderHeader = () => {
variant: "dropdown"
});
- const isLocked = isChangeOrderLocked(status);
+ const isLocked = isChangeNoticeLocked(status);
const nextStatus =
- changeOrderStatusTransitions[
- status as (typeof changeOrderStatus)[number]
+ changeNoticeStatusTransitions[
+ status as (typeof changeNoticeStatus)[number]
]?.[0] ?? null;
return (
@@ -71,15 +71,15 @@ const ChangeOrderHeader = () => {
<div className="flex flex-shrink-0 items-center justify-between px-4 py-2 bg-card border-b border-border h-[50px] overflow-x-auto scrollbar-hide dark:border-none dark:shadow-[inset_0_0_1px_rgb(255_255_255_/_0.24),_0_0_0_0.5px_rgb(0,0,0,1),0px_0px_4px_rgba(0,_0,_0,_0.08)]">
<VStack spacing={0}>
<HStack>
- <Link to={path.to.changeOrderDetails(id)}>
+ <Link to={path.to.changeNoticeDetails(id)}>
<Heading size="h4" className="flex items-center gap-2">
- <span>{routeData?.changeOrder?.changeOrderId}</span>
+ <span>{routeData?.changeNotice?.changeOrderId}</span>
</Heading>
</Link>
<span className={cn(isLocked && "line-through")}>
- <ChangeOrderStatus status={routeData?.changeOrder?.status} />
+ <ChangeNoticeStatus status={routeData?.changeNotice?.status} />
</span>
- <Copy text={routeData?.changeOrder?.changeOrderId ?? ""} />
+ <Copy text={routeData?.changeNotice?.changeOrderId ?? ""} />
<DropdownMenu>
<DropdownMenuTrigger asChild>
<IconButton
@@ -102,7 +102,33 @@ const ChangeOrderHeader = () => {
{ id, fromStatus: status, status: "Draft" },
{
method: "post",
- action: path.to.changeOrderStatus(id)
+ action: path.to.changeNoticeStatus(id)
+ }
+ );
+ }}
+ >
+ <DropdownMenuIcon icon={<LuLoaderCircle />} />
+ {t`Reopen`}
+ </DropdownMenuItem>
+ )}
+ {/* Reopen from Implementation goes back one stage so the
+ engineering content unlocks without losing progress. */}
+ {status === "Implementation" && (
+ <DropdownMenuItem
+ disabled={
+ statusFetcher.state !== "idle" ||
+ !permissions.can("update", "parts")
+ }
+ onClick={() => {
+ statusFetcher.submit(
+ {
+ id,
+ fromStatus: status,
+ status: "Engineering Complete"
+ },
+ {
+ method: "post",
+ action: path.to.changeNoticeStatus(id)
}
);
}}
@@ -120,7 +146,7 @@ const ChangeOrderHeader = () => {
onClick={deleteModal.onOpen}
>
<DropdownMenuIcon icon={<LuTrash />} />
- {t`Delete Change Order`}
+ {t`Delete Change Notice`}
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
@@ -129,7 +155,7 @@ const ChangeOrderHeader = () => {
<HStack spacing={2}>
{/* The full stage flow (green-dot progress) lives in the middle pane
- (ChangeOrderStatusFlow); the header keeps only the canonical status
+ (ChangeNoticeStatusFlow); the header keeps only the canonical status
badge (above) + the advance/release action. */}
{/* Cancel — a header action (opens the confirm modal) sitting beside the
@@ -152,7 +178,7 @@ const ChangeOrderHeader = () => {
{nextStatus && nextStatus !== "Done" && !isLocked && (
<statusFetcher.Form
method="post"
- action={path.to.changeOrderStatus(id)}
+ action={path.to.changeNoticeStatus(id)}
>
<input type="hidden" name="id" value={id} />
<input type="hidden" name="fromStatus" value={status} />
@@ -186,11 +212,11 @@ const ChangeOrderHeader = () => {
</div>
{deleteModal.isOpen && (
<ConfirmDelete
- action={path.to.deleteChangeOrder(id)}
+ action={path.to.deleteChangeNotice(id)}
isOpen={deleteModal.isOpen}
- name={routeData?.changeOrder?.changeOrderId ?? ""}
+ name={routeData?.changeNotice?.changeOrderId ?? ""}
text={t`Are you sure you want to delete ${
- routeData?.changeOrder?.changeOrderId ?? ""
+ routeData?.changeNotice?.changeOrderId ?? ""
}? This cannot be undone.`}
onCancel={deleteModal.onClose}
onSubmit={deleteModal.onClose}
@@ -198,12 +224,12 @@ const ChangeOrderHeader = () => {
)}
{cancelModal.isOpen && (
<Confirm
- action={path.to.changeOrderStatus(id)}
- title={t`Cancel change order`}
+ action={path.to.changeNoticeStatus(id)}
+ title={t`Cancel change notice`}
text={t`Are you sure you want to cancel ${
- routeData?.changeOrder?.changeOrderId ?? ""
+ routeData?.changeNotice?.changeOrderId ?? ""
}? It will be closed and read-only until you reopen it.`}
- confirmText={t`Cancel Change Order`}
+ confirmText={t`Cancel Change Notice`}
cancelText={t`Keep Open`}
confirmVariant="destructive"
onCancel={cancelModal.onClose}
@@ -219,4 +245,4 @@ const ChangeOrderHeader = () => {
);
};
-export default ChangeOrderHeader;
+export default ChangeNoticeHeader;
diff --git a/apps/erp/app/modules/items/ui/ChangeOrder/ChangeOrderPriority.tsx b/apps/erp/app/modules/items/ui/ChangeNotice/ChangeNoticePriority.tsx
similarity index 82%
rename from apps/erp/app/modules/items/ui/ChangeOrder/ChangeOrderPriority.tsx
rename to apps/erp/app/modules/items/ui/ChangeNotice/ChangeNoticePriority.tsx
index 24874d75cf..938d97077a 100644
--- a/apps/erp/app/modules/items/ui/ChangeOrder/ChangeOrderPriority.tsx
+++ b/apps/erp/app/modules/items/ui/ChangeNotice/ChangeNoticePriority.tsx
@@ -2,17 +2,17 @@ import { BsExclamationSquareFill } from "react-icons/bs";
import { HighPriorityIcon } from "~/assets/icons/HighPriorityIcon";
import { LowPriorityIcon } from "~/assets/icons/LowPriorityIcon";
import { MediumPriorityIcon } from "~/assets/icons/MediumPriorityIcon";
-import type { changeOrderPriority } from "../../items.models";
+import type { changeNoticePriority } from "../../items.models";
-type ChangeOrderPriorityProps = {
- priority?: (typeof changeOrderPriority)[number] | null;
+type ChangeNoticePriorityProps = {
+ priority?: (typeof changeNoticePriority)[number] | null;
className?: string;
};
-function ChangeOrderPriority({
+function ChangeNoticePriority({
priority,
className
-}: ChangeOrderPriorityProps) {
+}: ChangeNoticePriorityProps) {
switch (priority) {
case "Low":
return (
@@ -47,4 +47,4 @@ function ChangeOrderPriority({
}
}
-export default ChangeOrderPriority;
+export default ChangeNoticePriority;
diff --git a/apps/erp/app/modules/items/ui/ChangeOrder/ChangeOrderProperties.tsx b/apps/erp/app/modules/items/ui/ChangeNotice/ChangeNoticeProperties.tsx
similarity index 84%
rename from apps/erp/app/modules/items/ui/ChangeOrder/ChangeOrderProperties.tsx
rename to apps/erp/app/modules/items/ui/ChangeNotice/ChangeNoticeProperties.tsx
index 6c9bf520a1..2337de643c 100644
--- a/apps/erp/app/modules/items/ui/ChangeOrder/ChangeOrderProperties.tsx
+++ b/apps/erp/app/modules/items/ui/ChangeNotice/ChangeNoticeProperties.tsx
@@ -24,15 +24,15 @@ import { Assignee, EmployeeAvatar } from "~/components";
import { Enumerable } from "~/components/Enumerable";
import { Combobox, CreatableCombobox } from "~/components/Form";
import { usePermissions, useRouteData } from "~/hooks";
-import type { action } from "~/routes/x+/items+/change-order+/update";
+import type { action } from "~/routes/x+/items+/change-notice+/update";
import type { ListItem } from "~/types";
import { path } from "~/utils/path";
import { copyToClipboard } from "~/utils/string";
-import { changeOrderPriority, isChangeOrderLocked } from "../../items.models";
-import type { ChangeOrder } from "../../types";
+import { changeNoticePriority, isChangeNoticeLocked } from "../../items.models";
+import type { ChangeNotice } from "../../types";
import type { AffectedItemDraft } from "./affectedItem.types";
-import ChangeOrderReleaseMerge from "./ChangeOrderReleaseMerge";
-import ImpactPanel, { type ChangeOrderImpactItem } from "./ImpactPanel";
+import ChangeNoticeReleaseMerge from "./ChangeNoticeReleaseMerge";
+import ImpactPanel, { type ChangeNoticeImpactItem } from "./ImpactPanel";
// One CO-centric section — the xxs uppercase heading + content used by the
// PurchaseOrder / SalesOrder / Quote property sidebars. Sections are separated by
@@ -66,7 +66,7 @@ function PropertiesSection({
// route.) Self-contained: reads everything from the $id route loader so
// ResizablePanels can render it with only a `key` (mirrors SalesOrderProperties).
// Owns its own width / scroll / border / padding.
-const ChangeOrderProperties = () => {
+const ChangeNoticeProperties = () => {
const { id } = useParams();
if (!id) throw new Error("id not found");
@@ -75,10 +75,10 @@ const ChangeOrderProperties = () => {
const permissions = usePermissions();
const routeData = useRouteData<{
- changeOrder: ChangeOrder;
+ changeNotice: ChangeNotice;
types: ListItem[];
affectedItems: AffectedItemDraft[];
- impactUsedIn: ChangeOrderImpactItem[];
+ impactUsedIn: ChangeNoticeImpactItem[];
nonConformanceOptions: {
id: string;
nonConformanceId: string;
@@ -89,16 +89,16 @@ const ChangeOrderProperties = () => {
nonConformanceId: string;
name: string;
} | null;
- }>(path.to.changeOrder(id));
+ }>(path.to.changeNotice(id));
- const changeOrder = routeData?.changeOrder;
+ const changeNotice = routeData?.changeNotice;
const types = routeData?.types ?? [];
const affectedItems = routeData?.affectedItems ?? [];
const impactUsedIn = routeData?.impactUsedIn ?? [];
const nonConformanceOptions = routeData?.nonConformanceOptions ?? [];
const linkedNonConformance = routeData?.linkedNonConformance ?? null;
- const isLocked = isChangeOrderLocked(changeOrder?.status);
- const isImplementation = changeOrder?.status === "Implementation";
+ const isLocked = isChangeNoticeLocked(changeNotice?.status);
+ const isImplementation = changeNotice?.status === "Implementation";
const canUpdate = permissions.can("update", "parts");
const fetcher = useFetcher<typeof action>();
@@ -117,7 +117,7 @@ const ChangeOrderProperties = () => {
formData.append("value", value?.toString() ?? "");
fetcher.submit(formData, {
method: "post",
- action: path.to.updateChangeOrder
+ action: path.to.updateChangeNotice
});
},
[id]
@@ -140,10 +140,10 @@ const ChangeOrderProperties = () => {
{/* Release is triggered from the header button (opens this confirmation
dialog via releaseDialogOpenAtom). The dialog is mounted here — headless
until opened — so it renders nothing in the panel itself. */}
- {isImplementation && changeOrder && (
- <ChangeOrderReleaseMerge
+ {isImplementation && changeNotice && (
+ <ChangeNoticeReleaseMerge
changeOrderId={id}
- status={changeOrder.status}
+ status={changeNotice.status}
changes={changes}
/>
)}
@@ -162,7 +162,7 @@ const ChangeOrderProperties = () => {
className="p-1"
onClick={() =>
copyToClipboard(
- window.location.origin + path.to.changeOrder(id)
+ window.location.origin + path.to.changeNotice(id)
)
}
>
@@ -170,16 +170,16 @@ const ChangeOrderProperties = () => {
</Button>
</TooltipTrigger>
<TooltipContent>
- <Trans>Copy link to change order</Trans>
+ <Trans>Copy link to change notice</Trans>
</TooltipContent>
</Tooltip>
</HStack>
<VStack spacing={1}>
<span className="text-sm tracking-tight">
- {changeOrder?.changeOrderId}
+ {changeNotice?.changeOrderId}
</span>
<ValidatedForm
- defaultValues={{ name: changeOrder?.name ?? undefined }}
+ defaultValues={{ name: changeNotice?.name ?? undefined }}
validator={z.object({ name: z.string() })}
className="w-full"
>
@@ -189,7 +189,7 @@ const ChangeOrderProperties = () => {
size="sm"
inline
isReadOnly={!canUpdate || isLocked}
- value={changeOrder?.name ?? ""}
+ value={changeNotice?.name ?? ""}
onBlur={(e) => {
onUpdate("name", e.target.value ?? null);
}}
@@ -205,7 +205,7 @@ const ChangeOrderProperties = () => {
</h3>
<ValidatedForm
defaultValues={{
- changeOrderTypeId: changeOrder?.changeOrderTypeId ?? ""
+ changeOrderTypeId: changeNotice?.changeOrderTypeId ?? ""
}}
validator={z.object({ changeOrderTypeId: z.string().optional() })}
className="w-full"
@@ -235,13 +235,13 @@ const ChangeOrderProperties = () => {
id={id}
table="changeOrder"
size="sm"
- value={changeOrder?.assignee ?? ""}
+ value={changeNotice?.assignee ?? ""}
isReadOnly={!canUpdate || isLocked}
/>
</VStack>
<ValidatedForm
- defaultValues={{ openDate: changeOrder?.openDate ?? "" }}
+ defaultValues={{ openDate: changeNotice?.openDate ?? "" }}
validator={z.object({ openDate: z.string().optional() })}
className="w-full"
>
@@ -255,7 +255,7 @@ const ChangeOrderProperties = () => {
</ValidatedForm>
<ValidatedForm
- defaultValues={{ priority: changeOrder?.priority ?? "" }}
+ defaultValues={{ priority: changeNotice?.priority ?? "" }}
validator={z.object({ priority: z.string().optional() })}
className="w-full"
>
@@ -264,7 +264,7 @@ const ChangeOrderProperties = () => {
label={t`Priority`}
inline={(value) => <span>{value}</span>}
isReadOnly={!canUpdate || isLocked}
- options={changeOrderPriority.map((priority) => ({
+ options={changeNoticePriority.map((priority) => ({
value: priority,
label: priority
}))}
@@ -278,7 +278,7 @@ const ChangeOrderProperties = () => {
</h3>
<ValidatedForm
defaultValues={{
- nonConformanceId: changeOrder?.nonConformanceId ?? ""
+ nonConformanceId: changeNotice?.nonConformanceId ?? ""
}}
validator={z.object({ nonConformanceId: z.string().optional() })}
className="w-full"
@@ -290,7 +290,7 @@ const ChangeOrderProperties = () => {
// Typing a new name creates the issue via the full new-issue form
// (with the name prefilled + this CO passed as context) rather than
// guessing the required type/location/priority; on save it links the
- // new issue back to this change order and returns here.
+ // new issue back to this change notice and returns here.
onCreateOption={(name) =>
navigate(
`${path.to.newIssue}?name=${encodeURIComponent(
@@ -322,14 +322,14 @@ const ChangeOrderProperties = () => {
}
/>
</ValidatedForm>
- {changeOrder?.nonConformanceId && (
+ {changeNotice?.nonConformanceId && (
<Link
className="text-xs text-primary hover:underline"
- to={path.to.issue(changeOrder.nonConformanceId)}
+ to={path.to.issue(changeNotice.nonConformanceId)}
>
{linkedNonConformance
? `${linkedNonConformance.nonConformanceId} — ${linkedNonConformance.name}`
- : changeOrder.nonConformanceId}
+ : changeNotice.nonConformanceId}
</Link>
)}
</VStack>
@@ -338,7 +338,7 @@ const ChangeOrderProperties = () => {
<h3 className="text-xs text-muted-foreground">
<Trans>Created By</Trans>
</h3>
- <EmployeeAvatar employeeId={changeOrder?.createdBy ?? ""} size="xxs" />
+ <EmployeeAvatar employeeId={changeNotice?.createdBy ?? ""} size="xxs" />
</VStack>
<Separator />
@@ -352,4 +352,4 @@ const ChangeOrderProperties = () => {
);
};
-export default ChangeOrderProperties;
+export default ChangeNoticeProperties;
diff --git a/apps/erp/app/modules/items/ui/ChangeOrder/ChangeOrderReleaseMerge.tsx b/apps/erp/app/modules/items/ui/ChangeNotice/ChangeNoticeReleaseMerge.tsx
similarity index 90%
rename from apps/erp/app/modules/items/ui/ChangeOrder/ChangeOrderReleaseMerge.tsx
rename to apps/erp/app/modules/items/ui/ChangeNotice/ChangeNoticeReleaseMerge.tsx
index 7438c14979..9ae48bd028 100644
--- a/apps/erp/app/modules/items/ui/ChangeOrder/ChangeOrderReleaseMerge.tsx
+++ b/apps/erp/app/modules/items/ui/ChangeNotice/ChangeNoticeReleaseMerge.tsx
@@ -18,10 +18,10 @@ import { LuCircleCheck } from "react-icons/lu";
import { useFetcher } from "react-router";
import { path } from "~/utils/path";
import type {
- ChangeOrderChangeType,
- ChangeOrderItemDiff
+ ChangeNoticeChangeType,
+ ChangeNoticeItemDiff
} from "../../items.models";
-import ChangeOrderDiffViewer from "./ChangeOrderDiffViewer";
+import ChangeNoticeDiffViewer from "./ChangeNoticeDiffViewer";
import { releaseDialogOpenAtom } from "./releaseDialog.store";
// One affected item's read-only changes, shown in the release confirmation.
@@ -29,13 +29,13 @@ export type ReleaseChange = {
id: string;
label: string;
// The item's description — rendered under the label by the overview Changes
- // rollup (ChangeOrderChanges); the release dialog doesn't populate it.
+ // rollup (ChangeNoticeChanges); the release dialog doesn't populate it.
name?: string | null;
// Change type + draft make-method version, for the ChangeTypeBadge shown in
// the overview Changes rollup.
- changeType: ChangeOrderChangeType;
+ changeType: ChangeNoticeChangeType;
version?: number | null;
- diff?: ChangeOrderItemDiff;
+ diff?: ChangeNoticeItemDiff;
};
// The Implementation → Done release control, rendered as a confirmation dialog
@@ -44,7 +44,7 @@ export type ReleaseChange = {
// Draft make method as a new Active version and archives the prior one — the
// prior version is kept as history, so there is no merge/conflict step. The user
// reviews each item's changes, then confirms. Release is never a one-click action.
-export default function ChangeOrderReleaseMerge({
+export default function ChangeNoticeReleaseMerge({
changeOrderId,
status,
changes
@@ -76,7 +76,7 @@ export default function ChangeOrderReleaseMerge({
<ModalContent className="flex h-[90vh] w-[90vw] flex-col p-0 sm:max-w-3xl">
<ModalHeader className="px-6 pt-6">
<ModalTitle>
- <Trans>Release change order</Trans>
+ <Trans>Release change notice</Trans>
</ModalTitle>
<ModalDescription>
<Trans>
@@ -101,7 +101,7 @@ export default function ChangeOrderReleaseMerge({
>
{c.label}
</h3>
- <ChangeOrderDiffViewer diff={c.diff} />
+ <ChangeNoticeDiffViewer diff={c.diff} />
</VStack>
))
)}
@@ -119,7 +119,7 @@ export default function ChangeOrderReleaseMerge({
</Button>
<fetcher.Form
method="post"
- action={path.to.changeOrderStatus(changeOrderId)}
+ action={path.to.changeNoticeStatus(changeOrderId)}
>
<input type="hidden" name="id" value={changeOrderId} />
<input type="hidden" name="fromStatus" value="Implementation" />
diff --git a/apps/erp/app/modules/items/ui/ChangeOrder/ChangeOrderStatus.tsx b/apps/erp/app/modules/items/ui/ChangeNotice/ChangeNoticeStatus.tsx
similarity index 70%
rename from apps/erp/app/modules/items/ui/ChangeOrder/ChangeOrderStatus.tsx
rename to apps/erp/app/modules/items/ui/ChangeNotice/ChangeNoticeStatus.tsx
index 92af9dd90a..0c3875c87e 100644
--- a/apps/erp/app/modules/items/ui/ChangeOrder/ChangeOrderStatus.tsx
+++ b/apps/erp/app/modules/items/ui/ChangeNotice/ChangeNoticeStatus.tsx
@@ -1,5 +1,5 @@
import { Status } from "@carbon/react";
-import type { ChangeOrderStatus as ChangeOrderStatusType } from "../../types";
+import type { ChangeNoticeStatus as ChangeNoticeStatusType } from "../../types";
// Stage → badge color. Done is success (green); the open stages step through
// gray → blue → yellow → orange as work progresses; Cancelled is red.
@@ -15,11 +15,11 @@ const CHANGE_ORDER_STATUS_COLOR_MAP: Record<
Cancelled: "red"
};
-type ChangeOrderStatusProps = {
- status?: ChangeOrderStatusType | null;
+type ChangeNoticeStatusProps = {
+ status?: ChangeNoticeStatusType | null;
};
-const ChangeOrderStatus = ({ status }: ChangeOrderStatusProps) => {
+const ChangeNoticeStatus = ({ status }: ChangeNoticeStatusProps) => {
if (!status) return null;
const color = CHANGE_ORDER_STATUS_COLOR_MAP[status];
if (!color) return null;
@@ -27,4 +27,4 @@ const ChangeOrderStatus = ({ status }: ChangeOrderStatusProps) => {
return <Status color={color}>{status}</Status>;
};
-export default ChangeOrderStatus;
+export default ChangeNoticeStatus;
diff --git a/apps/erp/app/modules/items/ui/ChangeOrder/ChangeOrderStatusFlow.tsx b/apps/erp/app/modules/items/ui/ChangeNotice/ChangeNoticeStatusFlow.tsx
similarity index 83%
rename from apps/erp/app/modules/items/ui/ChangeOrder/ChangeOrderStatusFlow.tsx
rename to apps/erp/app/modules/items/ui/ChangeNotice/ChangeNoticeStatusFlow.tsx
index ecd01c4460..c44a68c3ed 100644
--- a/apps/erp/app/modules/items/ui/ChangeOrder/ChangeOrderStatusFlow.tsx
+++ b/apps/erp/app/modules/items/ui/ChangeNotice/ChangeNoticeStatusFlow.tsx
@@ -1,25 +1,25 @@
import { cn, Menubar } from "@carbon/react";
import { LuCheck, LuCircle, LuCircleDot } from "react-icons/lu";
-import { changeOrderStageFlow } from "../../items.models";
-import type { ChangeOrderStatus } from "../../types";
+import { changeNoticeStageFlow } from "../../items.models";
+import type { ChangeNoticeStatus } from "../../types";
// The change-order stage flow, mirroring the sales OpportunityState bar: one
// static label per stage with a progress icon that turns emerald on the active
// (and completed) stages — the "green dot" on the current step. Display-only
// (stage changes go through the header's advance/release action), so each stage
// is a plain <p>, not a button — no hover/click affordance, just the progress bar.
-export default function ChangeOrderStatusFlow({
+export default function ChangeNoticeStatusFlow({
status
}: {
- status: ChangeOrderStatus;
+ status: ChangeNoticeStatus;
}) {
// -1 for a Cancelled CO (not part of the forward flow) — every stage renders
// inactive, which is the desired "no progress" look.
- const activeIndex = changeOrderStageFlow.indexOf(status);
+ const activeIndex = changeNoticeStageFlow.indexOf(status);
return (
<Menubar>
- {changeOrderStageFlow.map((stage, index) => {
+ {changeNoticeStageFlow.map((stage, index) => {
const isCurrent = index === activeIndex;
const isCompleted = index < activeIndex;
const Icon = isCompleted ? LuCheck : isCurrent ? LuCircleDot : LuCircle;
diff --git a/apps/erp/app/modules/items/ui/ChangeOrder/ChangeOrdersTable.tsx b/apps/erp/app/modules/items/ui/ChangeNotice/ChangeNoticesTable.tsx
similarity index 81%
rename from apps/erp/app/modules/items/ui/ChangeOrder/ChangeOrdersTable.tsx
rename to apps/erp/app/modules/items/ui/ChangeNotice/ChangeNoticesTable.tsx
index 2ecf3e47e8..c69802aa55 100644
--- a/apps/erp/app/modules/items/ui/ChangeOrder/ChangeOrdersTable.tsx
+++ b/apps/erp/app/modules/items/ui/ChangeNotice/ChangeNoticesTable.tsx
@@ -27,17 +27,17 @@ import { usePeople } from "~/stores/people";
import type { ListItem } from "~/types";
import { path } from "~/utils/path";
import {
- type ChangeOrderChangeType,
- changeOrderPriority,
- changeOrderStatus
+ type ChangeNoticeChangeType,
+ changeNoticePriority,
+ changeNoticeStatus
} from "../../items.models";
-import type { ChangeOrderListItem } from "../../types";
-import ChangeOrderPriority from "./ChangeOrderPriority";
-import ChangeOrderStatus from "./ChangeOrderStatus";
+import type { ChangeNoticeListItem } from "../../types";
+import ChangeNoticePriority from "./ChangeNoticePriority";
+import ChangeNoticeStatus from "./ChangeNoticeStatus";
import ChangeTypeBadge from "./ChangeTypeBadge";
-type ChangeOrdersTableProps = {
- data: ChangeOrderListItem[];
+type ChangeNoticesTableProps = {
+ data: ChangeNoticeListItem[];
types: ListItem[];
count: number;
};
@@ -48,21 +48,21 @@ type ChangeOrdersTableProps = {
type AffectedItemSummary = {
id: string;
itemId: string;
- changeType: ChangeOrderChangeType;
+ changeType: ChangeNoticeChangeType;
newItemId: string | null;
};
-const ChangeOrdersTable = memo(
- ({ data, types, count }: ChangeOrdersTableProps) => {
+const ChangeNoticesTable = memo(
+ ({ data, types, count }: ChangeNoticesTableProps) => {
const navigate = useNavigate();
const { t } = useLingui();
const { formatDate } = useDateFormatter();
const permissions = usePermissions();
const deleteDisclosure = useDisclosure();
- const [selectedChangeOrder, setSelectedChangeOrder] =
- useState<ChangeOrderListItem | null>(null);
+ const [selectedChangeNotice, setSelectedChangeNotice] =
+ useState<ChangeNoticeListItem | null>(null);
- const customColumns = useCustomColumns<ChangeOrderListItem>("changeOrder");
+ const customColumns = useCustomColumns<ChangeNoticeListItem>("changeOrder");
const [people] = usePeople();
const [items] = useItems();
@@ -77,13 +77,13 @@ const ChangeOrdersTable = memo(
useRealtime("changeOrder");
- const columns = useMemo<ColumnDef<ChangeOrderListItem>[]>(() => {
- const defaultColumns: ColumnDef<ChangeOrderListItem>[] = [
+ const columns = useMemo<ColumnDef<ChangeNoticeListItem>[]>(() => {
+ const defaultColumns: ColumnDef<ChangeNoticeListItem>[] = [
{
accessorKey: "changeOrderId",
- header: t`Change Order`,
+ header: t`Change Notice`,
cell: ({ row }) => (
- <Hyperlink to={path.to.changeOrder(row.original.id!)}>
+ <Hyperlink to={path.to.changeNotice(row.original.id!)}>
<div className="flex flex-col gap-0">
<span className="text-sm font-medium">
{row.original.changeOrderId}
@@ -101,12 +101,14 @@ const ChangeOrdersTable = memo(
{
accessorKey: "status",
header: t`Status`,
- cell: ({ row }) => <ChangeOrderStatus status={row.original.status} />,
+ cell: ({ row }) => (
+ <ChangeNoticeStatus status={row.original.status} />
+ ),
meta: {
icon: <LuCircleGauge />,
filter: {
type: "static",
- options: changeOrderStatus.map((status) => ({
+ options: changeNoticeStatus.map((status) => ({
label: status,
value: status
}))
@@ -166,7 +168,7 @@ const ChangeOrdersTable = memo(
})),
isArray: true
},
- exportValue: (row: ChangeOrderListItem) =>
+ exportValue: (row: ChangeNoticeListItem) =>
(row.itemIds ?? []).map((id) => resolveItemId(id)).join(", ")
}
},
@@ -174,13 +176,13 @@ const ChangeOrdersTable = memo(
accessorKey: "priority",
header: t`Priority`,
cell: ({ row }) => (
- <ChangeOrderPriority priority={row.original.priority} />
+ <ChangeNoticePriority priority={row.original.priority} />
),
meta: {
icon: <LuSignal />,
filter: {
type: "static",
- options: changeOrderPriority.map((priority) => ({
+ options: changeNoticePriority.map((priority) => ({
label: priority,
value: priority
}))
@@ -217,12 +219,12 @@ const ChangeOrdersTable = memo(
}, [customColumns, people, items, resolveItemId, types, t, formatDate]);
const canExpandRow = useCallback(
- (row: ChangeOrderListItem) => (row.itemIds?.length ?? 0) > 0,
+ (row: ChangeNoticeListItem) => (row.itemIds?.length ?? 0) > 0,
[]
);
const renderExpandedRow = useCallback(
- (row: ChangeOrderListItem) => {
+ (row: ChangeNoticeListItem) => {
const affectedItems =
(row.affectedItems as AffectedItemSummary[]) ?? [];
if (affectedItems.length === 0) return null;
@@ -265,30 +267,30 @@ const ChangeOrdersTable = memo(
);
const renderContextMenu = useCallback(
- (row: ChangeOrderListItem) => {
+ (row: ChangeNoticeListItem) => {
return (
<>
<MenuItem
disabled={!permissions.can("update", "parts")}
onClick={() => {
- navigate(path.to.changeOrder(row.id!));
+ navigate(path.to.changeNotice(row.id!));
}}
>
<MenuIcon icon={<LuPencil />} />
- {t`Edit Change Order`}
+ {t`Edit Change Notice`}
</MenuItem>
<MenuItem
destructive
disabled={!permissions.can("delete", "parts")}
onClick={() => {
flushSync(() => {
- setSelectedChangeOrder(row);
+ setSelectedChangeNotice(row);
});
deleteDisclosure.onOpen();
}}
>
<MenuIcon icon={<LuTrash />} />
- {t`Delete Change Order`}
+ {t`Delete Change Notice`}
</MenuItem>
</>
);
@@ -298,37 +300,37 @@ const ChangeOrdersTable = memo(
return (
<>
- <Table<ChangeOrderListItem>
+ <Table<ChangeNoticeListItem>
data={data}
columns={columns}
count={count}
primaryAction={
permissions.can("create", "parts") && (
- <New label={t`Change Order`} to={path.to.newChangeOrder} />
+ <New label={t`Change Notice`} to={path.to.newChangeNotice} />
)
}
renderContextMenu={renderContextMenu}
renderExpandedRow={renderExpandedRow}
canExpandRow={canExpandRow}
defaultColumnVisibility={{ itemIds: false }}
- title={t`Change Orders`}
+ title={t`Change Notices`}
table="changeOrder"
withSavedView
/>
- {deleteDisclosure.isOpen && selectedChangeOrder && (
+ {deleteDisclosure.isOpen && selectedChangeNotice && (
<ConfirmDelete
- action={path.to.deleteChangeOrder(selectedChangeOrder.id!)}
+ action={path.to.deleteChangeNotice(selectedChangeNotice.id!)}
isOpen
onCancel={() => {
- setSelectedChangeOrder(null);
+ setSelectedChangeNotice(null);
deleteDisclosure.onClose();
}}
onSubmit={() => {
- setSelectedChangeOrder(null);
+ setSelectedChangeNotice(null);
deleteDisclosure.onClose();
}}
- name={selectedChangeOrder.name ?? "change order"}
- text={t`Are you sure you want to delete this change order?`}
+ name={selectedChangeNotice.name ?? "change notice"}
+ text={t`Are you sure you want to delete this change notice?`}
/>
)}
</>
@@ -336,5 +338,5 @@ const ChangeOrdersTable = memo(
}
);
-ChangeOrdersTable.displayName = "ChangeOrdersTable";
-export default ChangeOrdersTable;
+ChangeNoticesTable.displayName = "ChangeNoticesTable";
+export default ChangeNoticesTable;
diff --git a/apps/erp/app/modules/items/ui/ChangeOrder/ChangeTypeBadge.tsx b/apps/erp/app/modules/items/ui/ChangeNotice/ChangeTypeBadge.tsx
similarity index 89%
rename from apps/erp/app/modules/items/ui/ChangeOrder/ChangeTypeBadge.tsx
rename to apps/erp/app/modules/items/ui/ChangeNotice/ChangeTypeBadge.tsx
index d557af95b2..73fecf7714 100644
--- a/apps/erp/app/modules/items/ui/ChangeOrder/ChangeTypeBadge.tsx
+++ b/apps/erp/app/modules/items/ui/ChangeNotice/ChangeTypeBadge.tsx
@@ -1,6 +1,6 @@
import type { BadgeProps } from "@carbon/react";
import { Badge } from "@carbon/react";
-import type { ChangeOrderChangeType } from "../../items.models";
+import type { ChangeNoticeChangeType } from "../../items.models";
// A single badge summarizing an affected item's change type:
// Version → "Version 2" Revision → "New Revision"
@@ -10,7 +10,7 @@ import type { ChangeOrderChangeType } from "../../items.models";
// method version; a Revision/New Part mints a brand-new item whose method
// restarts at v1, so that number is noise — use the plain label instead.
export function changeTypeBadgeLabel(
- changeType: ChangeOrderChangeType,
+ changeType: ChangeNoticeChangeType,
version?: number | null
): string {
if (changeType === "New Part") return "New";
@@ -22,7 +22,7 @@ export function changeTypeBadgeLabel(
// Color-coded by change type: New Part = green (net-new), Replacement = orange
// (supersedes), Revision = blue, Version = outline.
const changeTypeBadgeVariant: Record<
- ChangeOrderChangeType,
+ ChangeNoticeChangeType,
BadgeProps["variant"]
> = {
"New Part": "green",
@@ -36,7 +36,7 @@ export default function ChangeTypeBadge({
version,
className
}: {
- changeType: ChangeOrderChangeType;
+ changeType: ChangeNoticeChangeType;
version?: number | null;
className?: string;
}) {
diff --git a/apps/erp/app/modules/items/ui/ChangeOrder/CreateChangeOrderModal.tsx b/apps/erp/app/modules/items/ui/ChangeNotice/CreateChangeNoticeModal.tsx
similarity index 85%
rename from apps/erp/app/modules/items/ui/ChangeOrder/CreateChangeOrderModal.tsx
rename to apps/erp/app/modules/items/ui/ChangeNotice/CreateChangeNoticeModal.tsx
index 8d9311f26e..0c63194ba4 100644
--- a/apps/erp/app/modules/items/ui/ChangeOrder/CreateChangeOrderModal.tsx
+++ b/apps/erp/app/modules/items/ui/ChangeNotice/CreateChangeNoticeModal.tsx
@@ -4,9 +4,9 @@ import { useFetcher } from "react-router";
import { useUser } from "~/hooks";
import type { ListItem } from "~/types";
import { path } from "~/utils/path";
-import ChangeOrderForm from "./ChangeOrderForm";
+import ChangeNoticeForm from "./ChangeNoticeForm";
-type CreateChangeOrderModalProps = {
+type CreateChangeNoticeModalProps = {
// The Part to pre-select as the first affected item.
itemId: string;
onClose: () => void;
@@ -17,10 +17,10 @@ type CreateChangeOrderModalProps = {
// loaded on open from the create route's own loader (no extra route or
// layout-loader query), and the form posts to that same route — its action
// creates the CO, attaches the item, then redirects to the CO detail.
-const CreateChangeOrderModal = ({
+const CreateChangeNoticeModal = ({
itemId,
onClose
-}: CreateChangeOrderModalProps) => {
+}: CreateChangeNoticeModalProps) => {
const typesFetcher = useFetcher<{ types: ListItem[] }>();
const user = useUser();
@@ -29,7 +29,7 @@ const CreateChangeOrderModal = ({
useEffect(() => {
if (loadedRef.current) return;
loadedRef.current = true;
- typesFetcher.load(path.to.newChangeOrder);
+ typesFetcher.load(path.to.newChangeNotice);
}, [typesFetcher]);
const initialValues = {
@@ -48,7 +48,7 @@ const CreateChangeOrderModal = ({
};
return (
- <ChangeOrderForm
+ <ChangeNoticeForm
type="modal"
open
onClose={onClose}
@@ -58,4 +58,4 @@ const CreateChangeOrderModal = ({
);
};
-export default CreateChangeOrderModal;
+export default CreateChangeNoticeModal;
diff --git a/apps/erp/app/modules/items/ui/ChangeOrder/ImpactPanel.tsx b/apps/erp/app/modules/items/ui/ChangeNotice/ImpactPanel.tsx
similarity index 96%
rename from apps/erp/app/modules/items/ui/ChangeOrder/ImpactPanel.tsx
rename to apps/erp/app/modules/items/ui/ChangeNotice/ImpactPanel.tsx
index 874b8dc222..1ba054a962 100644
--- a/apps/erp/app/modules/items/ui/ChangeOrder/ImpactPanel.tsx
+++ b/apps/erp/app/modules/items/ui/ChangeNotice/ImpactPanel.tsx
@@ -14,8 +14,8 @@ type UsedInChild = UsedInNode["children"][number];
// Where an affected item is referenced across the system (jobs, POs, sales,
// receipts, methods, NCRs, …) — the same shape the part detail page's "Used In"
-// tree consumes. One entry per affected item on the change order.
-export type ChangeOrderImpactItem = {
+// tree consumes. One entry per affected item on the change notice.
+export type ChangeNoticeImpactItem = {
itemId: string;
readableIdWithRevision: string;
itemName: string | null;
@@ -40,7 +40,7 @@ export type ChangeOrderImpactItem = {
// part detail page's Used In panel (kept in parallel with x+/part+/$itemId), but
// empty categories are dropped — the impact only lists where the item actually
// appears.
-function ImpactItem({ item }: { item: ChangeOrderImpactItem }) {
+function ImpactItem({ item }: { item: ChangeNoticeImpactItem }) {
const { t } = useLingui();
const u = item.usedIn;
@@ -171,7 +171,7 @@ export default function ImpactPanel({
items,
embedded = false
}: {
- items: ChangeOrderImpactItem[];
+ items: ChangeNoticeImpactItem[];
// When true, render without the Card chrome — the rail supplies the section
// frame + title.
embedded?: boolean;
diff --git a/apps/erp/app/modules/items/ui/ChangeNotice/ItemChangeNoticeLock.tsx b/apps/erp/app/modules/items/ui/ChangeNotice/ItemChangeNoticeLock.tsx
new file mode 100644
index 0000000000..554205d356
--- /dev/null
+++ b/apps/erp/app/modules/items/ui/ChangeNotice/ItemChangeNoticeLock.tsx
@@ -0,0 +1,63 @@
+import { Tooltip, TooltipContent, TooltipTrigger } from "@carbon/react";
+import { useLingui } from "@lingui/react/macro";
+import type { ReactNode } from "react";
+import { useRouteData } from "~/hooks";
+import type { ItemType } from "~/modules/shared";
+import { path } from "~/utils/path";
+import { changeNoticeOpenStatuses } from "../../items.models";
+import type { ChangeNoticeForItem } from "../../items.service";
+
+const openStatusSet = new Set<string>(changeNoticeOpenStatuses);
+
+// Reads `openChangeNotices` from the part/tool parent route data; other item types return [].
+export function useItemOpenChangeNotices(
+ type: ItemType | string | undefined,
+ itemId: string | undefined
+): ChangeNoticeForItem[] {
+ const routePath =
+ itemId && type === "Part"
+ ? path.to.part(itemId)
+ : itemId && type === "Tool"
+ ? path.to.tool(itemId)
+ : "";
+ const data = useRouteData<{ openChangeNotices?: ChangeNoticeForItem[] }>(
+ routePath
+ );
+ return (data?.openChangeNotices ?? []).filter((co) =>
+ openStatusSet.has(co.status)
+ );
+}
+
+// Tooltip wrapper for disabled controls (the div anchors hover since disabled elements don't fire it).
+export function ItemChangeNoticeLock({
+ changeNotices,
+ className,
+ children
+}: {
+ changeNotices: ChangeNoticeForItem[];
+ className?: string;
+ children: ReactNode;
+}) {
+ const { t } = useLingui();
+
+ if (changeNotices.length === 0) return <>{children}</>;
+
+ const ids = changeNotices.map((co) => co.changeOrderId).join(", ");
+
+ return (
+ <Tooltip>
+ {/* The child is disabled and can't take focus, so the wrapper carries it —
+ otherwise the tooltip is the only explanation and it's mouse-only. */}
+ <TooltipTrigger asChild>
+ <div className={className} tabIndex={0}>
+ {children}
+ </div>
+ </TooltipTrigger>
+ <TooltipContent>
+ {changeNotices.length === 1
+ ? t`Open in change notice ${ids}. Release it to create new versions or revisions.`
+ : t`Open in change notices ${ids}. Release them to create new versions or revisions.`}
+ </TooltipContent>
+ </Tooltip>
+ );
+}
diff --git a/apps/erp/app/modules/items/ui/ChangeOrder/ItemChangeOrders.tsx b/apps/erp/app/modules/items/ui/ChangeNotice/ItemChangeNotices.tsx
similarity index 72%
rename from apps/erp/app/modules/items/ui/ChangeOrder/ItemChangeOrders.tsx
rename to apps/erp/app/modules/items/ui/ChangeNotice/ItemChangeNotices.tsx
index db77dca92f..108d6afbf3 100644
--- a/apps/erp/app/modules/items/ui/ChangeOrder/ItemChangeOrders.tsx
+++ b/apps/erp/app/modules/items/ui/ChangeNotice/ItemChangeNotices.tsx
@@ -4,38 +4,41 @@ import { Link } from "react-router";
import { Enumerable } from "~/components/Enumerable";
import type { ListItem } from "~/types";
import { path } from "~/utils/path";
-import { isChangeOrderLocked } from "../../items.models";
-import type { ChangeOrderForItem } from "../../items.service";
-import ChangeOrderStatus from "./ChangeOrderStatus";
+import { isChangeNoticeLocked } from "../../items.models";
+import type { ChangeNoticeForItem } from "../../items.service";
+import ChangeNoticeStatus from "./ChangeNoticeStatus";
-type ItemChangeOrdersProps = {
- changeOrders: ChangeOrderForItem[];
+type ItemChangeNoticesProps = {
+ changeNotices: ChangeNoticeForItem[];
types: ListItem[];
};
-// Part → CO traceability (4b): a history card of every change order that
+// Part → CO traceability (4b): a history card of every change notice that
// references this part (across all its revisions). Newest first (the G6 query
// orders it). Done rows are de-emphasized. Renders nothing when empty.
-const ItemChangeOrders = ({ changeOrders, types }: ItemChangeOrdersProps) => {
- if (changeOrders.length === 0) return null;
+const ItemChangeNotices = ({
+ changeNotices,
+ types
+}: ItemChangeNoticesProps) => {
+ if (changeNotices.length === 0) return null;
return (
<Card>
<CardHeader>
<CardTitle>
- <Trans>Change Orders</Trans>
+ <Trans>Change Notices</Trans>
</CardTitle>
</CardHeader>
<CardContent>
<div className="flex flex-col divide-y divide-border">
- {changeOrders.map((co) => {
- const isDone = isChangeOrderLocked(co.status);
+ {changeNotices.map((co) => {
+ const isDone = isChangeNoticeLocked(co.status);
const categoryName =
types.find((ty) => ty.id === co.changeOrderTypeId)?.name ?? null;
return (
<Link
key={co.id}
- to={path.to.changeOrder(co.id)}
+ to={path.to.changeNotice(co.id)}
className={cn(
"flex items-center justify-between gap-4 py-2 hover:bg-accent/50 rounded-md px-2 -mx-2 transition-colors",
isDone && "opacity-60"
@@ -51,7 +54,7 @@ const ItemChangeOrders = ({ changeOrders, types }: ItemChangeOrdersProps) => {
</div>
<div className="flex items-center gap-2 flex-shrink-0">
{categoryName && <Enumerable value={categoryName} />}
- <ChangeOrderStatus status={co.status} />
+ <ChangeNoticeStatus status={co.status} />
</div>
</Link>
);
@@ -62,4 +65,4 @@ const ItemChangeOrders = ({ changeOrders, types }: ItemChangeOrdersProps) => {
);
};
-export default ItemChangeOrders;
+export default ItemChangeNotices;
diff --git a/apps/erp/app/modules/items/ui/ChangeOrder/ItemLink.tsx b/apps/erp/app/modules/items/ui/ChangeNotice/ItemLink.tsx
similarity index 100%
rename from apps/erp/app/modules/items/ui/ChangeOrder/ItemLink.tsx
rename to apps/erp/app/modules/items/ui/ChangeNotice/ItemLink.tsx
diff --git a/apps/erp/app/modules/items/ui/ChangeOrder/ItemOpenChangeOrderAlert.tsx b/apps/erp/app/modules/items/ui/ChangeNotice/ItemOpenChangeNoticeAlert.tsx
similarity index 56%
rename from apps/erp/app/modules/items/ui/ChangeOrder/ItemOpenChangeOrderAlert.tsx
rename to apps/erp/app/modules/items/ui/ChangeNotice/ItemOpenChangeNoticeAlert.tsx
index cb6fa240d3..a3bd3a6997 100644
--- a/apps/erp/app/modules/items/ui/ChangeOrder/ItemOpenChangeOrderAlert.tsx
+++ b/apps/erp/app/modules/items/ui/ChangeNotice/ItemOpenChangeNoticeAlert.tsx
@@ -3,22 +3,22 @@ import { Plural, Trans } from "@lingui/react/macro";
import { LuGitPullRequestArrow } from "react-icons/lu";
import { Link } from "react-router";
import { path } from "~/utils/path";
-import { changeOrderOpenStatuses } from "../../items.models";
-import type { ChangeOrderForItem } from "../../items.service";
+import { changeNoticeOpenStatuses } from "../../items.models";
+import type { ChangeNoticeForItem } from "../../items.service";
-type ItemOpenChangeOrderAlertProps = {
- changeOrders: ChangeOrderForItem[];
+type ItemOpenChangeNoticeAlertProps = {
+ changeNotices: ChangeNoticeForItem[];
};
-const openStatusSet = new Set<string>(changeOrderOpenStatuses);
+const openStatusSet = new Set<string>(changeNoticeOpenStatuses);
// Part → CO traceability (4b): a subtle heads-up when this part is on one or
-// more not-yet-Done change orders. Derived from the same history list. Renders
+// more not-yet-Done change notices. Derived from the same history list. Renders
// nothing when there are no open COs.
-const ItemOpenChangeOrderAlert = ({
- changeOrders
-}: ItemOpenChangeOrderAlertProps) => {
- const open = changeOrders.filter((co) => openStatusSet.has(co.status));
+const ItemOpenChangeNoticeAlert = ({
+ changeNotices
+}: ItemOpenChangeNoticeAlertProps) => {
+ const open = changeNotices.filter((co) => openStatusSet.has(co.status));
if (open.length === 0) return null;
return (
@@ -27,8 +27,8 @@ const ItemOpenChangeOrderAlert = ({
<AlertTitle>
<Plural
value={open.length}
- one="This part is on 1 open change order"
- other="This part is on # open change orders"
+ one="This part is on 1 open change notice"
+ other="This part is on # open change notices"
/>
</AlertTitle>
<AlertDescription>
@@ -36,14 +36,14 @@ const ItemOpenChangeOrderAlert = ({
{open.map((co) => (
<Link
key={co.id}
- to={path.to.changeOrder(co.id)}
+ to={path.to.changeNotice(co.id)}
className="text-sm font-medium hover:underline"
>
{co.changeOrderId}
</Link>
))}
<span className="sr-only">
- <Trans>Open change orders affecting this part</Trans>
+ <Trans>Open change notices affecting this part</Trans>
</span>
</div>
</AlertDescription>
@@ -51,4 +51,4 @@ const ItemOpenChangeOrderAlert = ({
);
};
-export default ItemOpenChangeOrderAlert;
+export default ItemOpenChangeNoticeAlert;
diff --git a/apps/erp/app/modules/items/ui/ChangeOrder/affectedItem.types.ts b/apps/erp/app/modules/items/ui/ChangeNotice/affectedItem.types.ts
similarity index 94%
rename from apps/erp/app/modules/items/ui/ChangeOrder/affectedItem.types.ts
rename to apps/erp/app/modules/items/ui/ChangeNotice/affectedItem.types.ts
index f2664afcf4..97a56c8d1c 100644
--- a/apps/erp/app/modules/items/ui/ChangeOrder/affectedItem.types.ts
+++ b/apps/erp/app/modules/items/ui/ChangeNotice/affectedItem.types.ts
@@ -1,9 +1,9 @@
import type { JSONContent } from "@carbon/react";
import type { MethodItemType, MethodType } from "../../../shared";
-import type { ChangeOrderItemDiff } from "../../items.models";
+import type { ChangeNoticeItemDiff } from "../../items.models";
import type { getRevisionLock } from "../../items.server";
import type {
- ChangeOrderAffectedItemWithLabel,
+ ChangeNoticeAffectedItemWithLabel,
getConfigurationParameters,
getConfigurationRules,
getMethodMaterialsByMakeMethod,
@@ -73,7 +73,7 @@ export type DraftOperationMapped = Omit<
// for the embedded BillOfMaterial / BillOfProcess editors), the change type, and
// the read-only authoring diff. The $id loader assembles this per affected item.
export type AffectedItemDraft = {
- affectedItem: ChangeOrderAffectedItemWithLabel;
+ affectedItem: ChangeNoticeAffectedItemWithLabel;
// The item the draft edits — the same item for a Version, the new item for
// Revision / New Part.
draftItemId: string;
@@ -89,5 +89,5 @@ export type AffectedItemDraft = {
// Attribute/file bundle for the embedded PartProperties editor — set for
// Part-type Revision / New Part affected items, null otherwise.
partData: PartPropertiesData | null;
- diff?: ChangeOrderItemDiff;
+ diff?: ChangeNoticeItemDiff;
};
diff --git a/apps/erp/app/modules/items/ui/ChangeOrder/diff-ui.tsx b/apps/erp/app/modules/items/ui/ChangeNotice/diff-ui.tsx
similarity index 98%
rename from apps/erp/app/modules/items/ui/ChangeOrder/diff-ui.tsx
rename to apps/erp/app/modules/items/ui/ChangeNotice/diff-ui.tsx
index 1e25c5b2ee..1727bdab98 100644
--- a/apps/erp/app/modules/items/ui/ChangeOrder/diff-ui.tsx
+++ b/apps/erp/app/modules/items/ui/ChangeNotice/diff-ui.tsx
@@ -4,7 +4,7 @@ import type { ReactNode } from "react";
import type { MethodDiffEntry } from "../../items.models";
// -----------------------------------------------------------------------------
-// Shared Change Order diff-UI helpers.
+// Shared Change Notice diff-UI helpers.
//
// The BOM / BOP / BOP-children editors all render staged rows keyed against a
// per-entry diff (added / modified / removed). These helpers centralize the
diff --git a/apps/erp/app/modules/items/ui/ChangeNotice/index.ts b/apps/erp/app/modules/items/ui/ChangeNotice/index.ts
new file mode 100644
index 0000000000..95c2249d00
--- /dev/null
+++ b/apps/erp/app/modules/items/ui/ChangeNotice/index.ts
@@ -0,0 +1,20 @@
+export { default as AffectedItemDetail } from "./AffectedItemDetail";
+export type * from "./affectedItem.types";
+export { default as ChangeNoticeActions } from "./ChangeNoticeActions";
+export { default as ChangeNoticeChanges } from "./ChangeNoticeChanges";
+export * from "./ChangeNoticeContent";
+export { default as ChangeNoticeDiffViewer } from "./ChangeNoticeDiffViewer";
+export { default as ChangeNoticeExplorer } from "./ChangeNoticeExplorer";
+export { default as ChangeNoticeForm } from "./ChangeNoticeForm";
+export { default as ChangeNoticeHeader } from "./ChangeNoticeHeader";
+export { default as ChangeNoticeProperties } from "./ChangeNoticeProperties";
+export { default as ChangeNoticeReleaseMerge } from "./ChangeNoticeReleaseMerge";
+export { default as ChangeNoticeStatus } from "./ChangeNoticeStatus";
+export { default as ChangeNoticesTable } from "./ChangeNoticesTable";
+export { default as CreateChangeNoticeModal } from "./CreateChangeNoticeModal";
+export type { ChangeNoticeImpactItem } from "./ImpactPanel";
+export { default as ImpactPanel } from "./ImpactPanel";
+export * from "./ItemChangeNoticeLock";
+export { default as ItemChangeNotices } from "./ItemChangeNotices";
+export { default as ItemOpenChangeNoticeAlert } from "./ItemOpenChangeNoticeAlert";
+export * from "./lock-ui";
diff --git a/apps/erp/app/modules/items/ui/ChangeNotice/lock-ui.tsx b/apps/erp/app/modules/items/ui/ChangeNotice/lock-ui.tsx
new file mode 100644
index 0000000000..c671e7241a
--- /dev/null
+++ b/apps/erp/app/modules/items/ui/ChangeNotice/lock-ui.tsx
@@ -0,0 +1,86 @@
+import { Tooltip, TooltipContent, TooltipTrigger } from "@carbon/react";
+import { Trans, useLingui } from "@lingui/react/macro";
+import type { ReactNode } from "react";
+import { LuLock } from "react-icons/lu";
+import { Link } from "react-router";
+import { path } from "~/utils/path";
+import type { ChangeNoticeForItem } from "../../items.service";
+
+// -----------------------------------------------------------------------------
+// Shared Change Notice lock UI.
+//
+// Two surfaces freeze a card: the notice workspace (content frozen at
+// Implementation) and the item master (a version the notice owns is authored in
+// the notice, not here). Both read the same way because they render the same
+// hint.
+// -----------------------------------------------------------------------------
+
+// Matches the lock affordance BillOfMaterial / BillOfProcess render inline, so
+// every frozen card looks the same. Cards that expose a title slot use this;
+// BOM/BOP take a bare `disabledReason` and wrap it themselves.
+export function LockedHint({ reason }: { reason?: ReactNode }) {
+ const { t } = useLingui();
+
+ return (
+ <Tooltip>
+ {/* Focusable: the tooltip is the only place the lock is explained. */}
+ <TooltipTrigger
+ className="text-muted-foreground"
+ aria-label={t`Why is this locked?`}
+ >
+ <LuLock className="size-3.5" />
+ </TooltipTrigger>
+ <TooltipContent className="max-w-xs">{reason}</TooltipContent>
+ </Tooltip>
+ );
+}
+
+export type ChangeNoticeDraftLock = {
+ id: string;
+ readableId: string;
+};
+
+// A Draft method still stamped with a changeOrderId is owned by that notice —
+// the stamp is cleared at release, so its presence alone means "authored there".
+// The number is resolved separately and may be missing; the id is not.
+export function getChangeNoticeDraftLock(
+ changeOrderId: string | null | undefined,
+ changeNotices: ChangeNoticeForItem[] | null | undefined
+): ChangeNoticeDraftLock | null {
+ if (!changeOrderId) return null;
+ return {
+ id: changeOrderId,
+ readableId:
+ changeNotices?.find((cn) => cn.id === changeOrderId)?.changeOrderId ?? ""
+ };
+}
+
+export function ChangeNoticeDraftLockReason({
+ lock
+}: {
+ lock: ChangeNoticeDraftLock;
+}) {
+ const className = "font-medium underline underline-offset-2";
+
+ if (!lock.readableId) {
+ return (
+ <Trans>
+ This version belongs to an open{" "}
+ <Link to={path.to.changeNotice(lock.id)} className={className}>
+ change notice
+ </Link>
+ . Edit it there.
+ </Trans>
+ );
+ }
+
+ return (
+ <Trans>
+ This version belongs to change notice{" "}
+ <Link to={path.to.changeNotice(lock.id)} className={className}>
+ {lock.readableId}
+ </Link>
+ . Edit it there.
+ </Trans>
+ );
+}
diff --git a/apps/erp/app/modules/items/ui/ChangeOrder/releaseDialog.store.ts b/apps/erp/app/modules/items/ui/ChangeNotice/releaseDialog.store.ts
similarity index 80%
rename from apps/erp/app/modules/items/ui/ChangeOrder/releaseDialog.store.ts
rename to apps/erp/app/modules/items/ui/ChangeNotice/releaseDialog.store.ts
index 8e0f642749..bd9256f199 100644
--- a/apps/erp/app/modules/items/ui/ChangeOrder/releaseDialog.store.ts
+++ b/apps/erp/app/modules/items/ui/ChangeNotice/releaseDialog.store.ts
@@ -1,6 +1,6 @@
import { atom } from "nanostores";
-// Cross-subtree open-state for the Change Order release dialog. The header
+// Cross-subtree open-state for the Change Notice release dialog. The header
// "Release" button and the rail's Release section live in separate React
// subtrees under the $id route, so neither can pass the other a callback; both
// toggle this atom instead. The dialog itself is rendered once (in the rail).
diff --git a/apps/erp/app/modules/items/ui/ChangeOrderActions/ChangeOrderRequiredActionForm.tsx b/apps/erp/app/modules/items/ui/ChangeNoticeActions/ChangeNoticeRequiredActionForm.tsx
similarity index 78%
rename from apps/erp/app/modules/items/ui/ChangeOrderActions/ChangeOrderRequiredActionForm.tsx
rename to apps/erp/app/modules/items/ui/ChangeNoticeActions/ChangeNoticeRequiredActionForm.tsx
index 96db60566f..9f1ea8c66d 100644
--- a/apps/erp/app/modules/items/ui/ChangeOrderActions/ChangeOrderRequiredActionForm.tsx
+++ b/apps/erp/app/modules/items/ui/ChangeNoticeActions/ChangeNoticeRequiredActionForm.tsx
@@ -20,21 +20,21 @@ import type { z } from "zod";
import { Boolean, Hidden, Input, Submit } from "~/components/Form";
import { usePermissions } from "~/hooks";
import { path } from "~/utils/path";
-import { changeOrderRequiredActionValidator } from "../../items.models";
+import { changeNoticeRequiredActionValidator } from "../../items.models";
-type ChangeOrderRequiredActionFormProps = {
- initialValues: z.infer<typeof changeOrderRequiredActionValidator>;
+type ChangeNoticeRequiredActionFormProps = {
+ initialValues: z.infer<typeof changeNoticeRequiredActionValidator>;
type?: "modal" | "drawer";
open?: boolean;
onClose: () => void;
};
-const ChangeOrderRequiredActionForm = ({
+const ChangeNoticeRequiredActionForm = ({
initialValues,
open = true,
type = "drawer",
onClose
-}: ChangeOrderRequiredActionFormProps) => {
+}: ChangeNoticeRequiredActionFormProps) => {
const { t } = useLingui();
const permissions = usePermissions();
const fetcher = useFetcher<PostgrestResponse<{ id: string }>>();
@@ -44,10 +44,10 @@ const ChangeOrderRequiredActionForm = ({
if (fetcher.state === "loading" && fetcher.data?.data) {
onClose?.();
- toast.success(t`Created change order action`);
+ toast.success(t`Created change notice action`);
} else if (fetcher.state === "idle" && fetcher.data?.error) {
toast.error(
- `Failed to create change order action: ${fetcher.data.error.message}`
+ `Failed to create change notice action: ${fetcher.data.error.message}`
);
}
}, [fetcher.data, fetcher.state, onClose, type, t]);
@@ -67,12 +67,12 @@ const ChangeOrderRequiredActionForm = ({
>
<ModalDrawerContent>
<ValidatedForm
- validator={changeOrderRequiredActionValidator}
+ validator={changeNoticeRequiredActionValidator}
method="post"
action={
isEditing
- ? path.to.changeOrderRequiredAction(initialValues.id!)
- : path.to.newChangeOrderRequiredAction
+ ? path.to.changeNoticeRequiredAction(initialValues.id!)
+ : path.to.newChangeNoticeRequiredAction
}
defaultValues={initialValues}
fetcher={fetcher}
@@ -81,8 +81,8 @@ const ChangeOrderRequiredActionForm = ({
<ModalDrawerHeader>
<ModalDrawerTitle>
{isEditing
- ? t`Edit Change Order Action`
- : t`New Change Order Action`}
+ ? t`Edit Change Notice Action`
+ : t`New Change Notice Action`}
</ModalDrawerTitle>
</ModalDrawerHeader>
<ModalDrawerBody>
@@ -110,4 +110,4 @@ const ChangeOrderRequiredActionForm = ({
);
};
-export default ChangeOrderRequiredActionForm;
+export default ChangeNoticeRequiredActionForm;
diff --git a/apps/erp/app/modules/items/ui/ChangeOrderActions/ChangeOrderRequiredActionsTable.tsx b/apps/erp/app/modules/items/ui/ChangeNoticeActions/ChangeNoticeRequiredActionsTable.tsx
similarity index 75%
rename from apps/erp/app/modules/items/ui/ChangeOrderActions/ChangeOrderRequiredActionsTable.tsx
rename to apps/erp/app/modules/items/ui/ChangeNoticeActions/ChangeNoticeRequiredActionsTable.tsx
index 732e6dc179..995e63657e 100644
--- a/apps/erp/app/modules/items/ui/ChangeOrderActions/ChangeOrderRequiredActionsTable.tsx
+++ b/apps/erp/app/modules/items/ui/ChangeNoticeActions/ChangeNoticeRequiredActionsTable.tsx
@@ -8,21 +8,21 @@ import { Hyperlink, New, Table } from "~/components";
import { Enumerable } from "~/components/Enumerable";
import { usePermissions, useUrlParams } from "~/hooks";
import { path } from "~/utils/path";
-import type { ChangeOrderRequiredAction } from "../../types";
+import type { ChangeNoticeRequiredAction } from "../../types";
-type ChangeOrderRequiredActionsTableProps = {
- data: ChangeOrderRequiredAction[];
+type ChangeNoticeRequiredActionsTableProps = {
+ data: ChangeNoticeRequiredAction[];
count: number;
};
-const ChangeOrderRequiredActionsTable = memo(
- ({ data, count }: ChangeOrderRequiredActionsTableProps) => {
+const ChangeNoticeRequiredActionsTable = memo(
+ ({ data, count }: ChangeNoticeRequiredActionsTableProps) => {
const [params] = useUrlParams();
const navigate = useNavigate();
const { t } = useLingui();
const permissions = usePermissions();
- const columns = useMemo<ColumnDef<ChangeOrderRequiredAction>[]>(() => {
+ const columns = useMemo<ColumnDef<ChangeNoticeRequiredAction>[]>(() => {
return [
{
accessorKey: "name",
@@ -45,14 +45,14 @@ const ChangeOrderRequiredActionsTable = memo(
}, [t]);
const renderContextMenu = useCallback(
- (row: ChangeOrderRequiredAction) => {
+ (row: ChangeNoticeRequiredAction) => {
return (
<>
<MenuItem
disabled={!permissions.can("update", "parts")}
onClick={() => {
navigate(
- `${path.to.changeOrderRequiredAction(
+ `${path.to.changeNoticeRequiredAction(
row.id
)}?${params.toString()}`
);
@@ -66,7 +66,7 @@ const ChangeOrderRequiredActionsTable = memo(
disabled={!permissions.can("delete", "parts")}
onClick={() => {
navigate(
- `${path.to.deleteChangeOrderRequiredAction(
+ `${path.to.deleteChangeNoticeRequiredAction(
row.id
)}?${params.toString()}`
);
@@ -82,7 +82,7 @@ const ChangeOrderRequiredActionsTable = memo(
);
return (
- <Table<ChangeOrderRequiredAction>
+ <Table<ChangeNoticeRequiredAction>
data={data}
columns={columns}
count={count}
@@ -90,16 +90,17 @@ const ChangeOrderRequiredActionsTable = memo(
permissions.can("create", "parts") && (
<New
label={t`Action`}
- to={`${path.to.newChangeOrderRequiredAction}?${params.toString()}`}
+ to={`${path.to.newChangeNoticeRequiredAction}?${params.toString()}`}
/>
)
}
renderContextMenu={renderContextMenu}
- title={t`Change Order Actions`}
+ title={t`Change Notice Actions`}
/>
);
}
);
-ChangeOrderRequiredActionsTable.displayName = "ChangeOrderRequiredActionsTable";
-export default ChangeOrderRequiredActionsTable;
+ChangeNoticeRequiredActionsTable.displayName =
+ "ChangeNoticeRequiredActionsTable";
+export default ChangeNoticeRequiredActionsTable;
diff --git a/apps/erp/app/modules/items/ui/ChangeNoticeActions/index.ts b/apps/erp/app/modules/items/ui/ChangeNoticeActions/index.ts
new file mode 100644
index 0000000000..44cc210cac
--- /dev/null
+++ b/apps/erp/app/modules/items/ui/ChangeNoticeActions/index.ts
@@ -0,0 +1,2 @@
+export { default as ChangeNoticeRequiredActionForm } from "./ChangeNoticeRequiredActionForm";
+export { default as ChangeNoticeRequiredActionsTable } from "./ChangeNoticeRequiredActionsTable";
diff --git a/apps/erp/app/modules/items/ui/ChangeOrderTypes/ChangeOrderTypeForm.tsx b/apps/erp/app/modules/items/ui/ChangeNoticeTypes/ChangeNoticeTypeForm.tsx
similarity index 80%
rename from apps/erp/app/modules/items/ui/ChangeOrderTypes/ChangeOrderTypeForm.tsx
rename to apps/erp/app/modules/items/ui/ChangeNoticeTypes/ChangeNoticeTypeForm.tsx
index 1ac99d5d45..6b982fa6aa 100644
--- a/apps/erp/app/modules/items/ui/ChangeOrderTypes/ChangeOrderTypeForm.tsx
+++ b/apps/erp/app/modules/items/ui/ChangeNoticeTypes/ChangeNoticeTypeForm.tsx
@@ -20,21 +20,21 @@ import type { z } from "zod";
import { Hidden, Input, Submit } from "~/components/Form";
import { usePermissions } from "~/hooks";
import { path } from "~/utils/path";
-import { changeOrderTypeValidator } from "../../items.models";
+import { changeNoticeTypeValidator } from "../../items.models";
-type ChangeOrderTypeFormProps = {
- initialValues: z.infer<typeof changeOrderTypeValidator>;
+type ChangeNoticeTypeFormProps = {
+ initialValues: z.infer<typeof changeNoticeTypeValidator>;
type?: "modal" | "drawer";
open?: boolean;
onClose: () => void;
};
-const ChangeOrderTypeForm = ({
+const ChangeNoticeTypeForm = ({
initialValues,
open = true,
type = "drawer",
onClose
-}: ChangeOrderTypeFormProps) => {
+}: ChangeNoticeTypeFormProps) => {
const { t } = useLingui();
const permissions = usePermissions();
const fetcher = useFetcher<PostgrestResponse<{ id: string }>>();
@@ -44,10 +44,10 @@ const ChangeOrderTypeForm = ({
if (fetcher.state === "loading" && fetcher.data?.data) {
onClose?.();
- toast.success(t`Created change order type`);
+ toast.success(t`Created change notice type`);
} else if (fetcher.state === "idle" && fetcher.data?.error) {
toast.error(
- `Failed to create change order type: ${fetcher.data.error.message}`
+ `Failed to create change notice type: ${fetcher.data.error.message}`
);
}
}, [fetcher.data, fetcher.state, onClose, type, t]);
@@ -67,12 +67,12 @@ const ChangeOrderTypeForm = ({
>
<ModalDrawerContent>
<ValidatedForm
- validator={changeOrderTypeValidator}
+ validator={changeNoticeTypeValidator}
method="post"
action={
isEditing
- ? path.to.changeOrderType(initialValues.id!)
- : path.to.newChangeOrderType
+ ? path.to.changeNoticeType(initialValues.id!)
+ : path.to.newChangeNoticeType
}
defaultValues={initialValues}
fetcher={fetcher}
@@ -81,8 +81,8 @@ const ChangeOrderTypeForm = ({
<ModalDrawerHeader>
<ModalDrawerTitle>
{isEditing
- ? t`Edit Change Order Type`
- : t`New Change Order Type`}
+ ? t`Edit Change Notice Type`
+ : t`New Change Notice Type`}
</ModalDrawerTitle>
</ModalDrawerHeader>
<ModalDrawerBody>
@@ -109,4 +109,4 @@ const ChangeOrderTypeForm = ({
);
};
-export default ChangeOrderTypeForm;
+export default ChangeNoticeTypeForm;
diff --git a/apps/erp/app/modules/items/ui/ChangeOrderTypes/ChangeOrderTypesTable.tsx b/apps/erp/app/modules/items/ui/ChangeNoticeTypes/ChangeNoticeTypesTable.tsx
similarity index 76%
rename from apps/erp/app/modules/items/ui/ChangeOrderTypes/ChangeOrderTypesTable.tsx
rename to apps/erp/app/modules/items/ui/ChangeNoticeTypes/ChangeNoticeTypesTable.tsx
index 4074af988f..47c81c8080 100644
--- a/apps/erp/app/modules/items/ui/ChangeOrderTypes/ChangeOrderTypesTable.tsx
+++ b/apps/erp/app/modules/items/ui/ChangeNoticeTypes/ChangeNoticeTypesTable.tsx
@@ -8,21 +8,21 @@ import { Hyperlink, New, Table } from "~/components";
import { Enumerable } from "~/components/Enumerable";
import { usePermissions, useUrlParams } from "~/hooks";
import { path } from "~/utils/path";
-import type { ChangeOrderType } from "../../types";
+import type { ChangeNoticeType } from "../../types";
-type ChangeOrderTypesTableProps = {
- data: ChangeOrderType[];
+type ChangeNoticeTypesTableProps = {
+ data: ChangeNoticeType[];
count: number;
};
-const ChangeOrderTypesTable = memo(
- ({ data, count }: ChangeOrderTypesTableProps) => {
+const ChangeNoticeTypesTable = memo(
+ ({ data, count }: ChangeNoticeTypesTableProps) => {
const [params] = useUrlParams();
const navigate = useNavigate();
const { t } = useLingui();
const permissions = usePermissions();
- const columns = useMemo<ColumnDef<ChangeOrderType>[]>(() => {
+ const columns = useMemo<ColumnDef<ChangeNoticeType>[]>(() => {
return [
{
accessorKey: "name",
@@ -40,14 +40,14 @@ const ChangeOrderTypesTable = memo(
}, [t]);
const renderContextMenu = useCallback(
- (row: ChangeOrderType) => {
+ (row: ChangeNoticeType) => {
return (
<>
<MenuItem
disabled={!permissions.can("update", "parts")}
onClick={() => {
navigate(
- `${path.to.changeOrderType(row.id)}?${params.toString()}`
+ `${path.to.changeNoticeType(row.id)}?${params.toString()}`
);
}}
>
@@ -59,7 +59,7 @@ const ChangeOrderTypesTable = memo(
disabled={!permissions.can("delete", "parts")}
onClick={() => {
navigate(
- `${path.to.deleteChangeOrderType(
+ `${path.to.deleteChangeNoticeType(
row.id
)}?${params.toString()}`
);
@@ -75,7 +75,7 @@ const ChangeOrderTypesTable = memo(
);
return (
- <Table<ChangeOrderType>
+ <Table<ChangeNoticeType>
data={data}
columns={columns}
count={count}
@@ -83,16 +83,16 @@ const ChangeOrderTypesTable = memo(
permissions.can("create", "parts") && (
<New
label={t`Type`}
- to={`${path.to.newChangeOrderType}?${params.toString()}`}
+ to={`${path.to.newChangeNoticeType}?${params.toString()}`}
/>
)
}
renderContextMenu={renderContextMenu}
- title={t`Change Order Types`}
+ title={t`Change Notice Types`}
/>
);
}
);
-ChangeOrderTypesTable.displayName = "ChangeOrderTypesTable";
-export default ChangeOrderTypesTable;
+ChangeNoticeTypesTable.displayName = "ChangeNoticeTypesTable";
+export default ChangeNoticeTypesTable;
diff --git a/apps/erp/app/modules/items/ui/ChangeNoticeTypes/index.ts b/apps/erp/app/modules/items/ui/ChangeNoticeTypes/index.ts
new file mode 100644
index 0000000000..97cbc4af08
--- /dev/null
+++ b/apps/erp/app/modules/items/ui/ChangeNoticeTypes/index.ts
@@ -0,0 +1,2 @@
+export { default as ChangeNoticeTypeForm } from "./ChangeNoticeTypeForm";
+export { default as ChangeNoticeTypesTable } from "./ChangeNoticeTypesTable";
diff --git a/apps/erp/app/modules/items/ui/ChangeOrder/ItemChangeOrderLock.tsx b/apps/erp/app/modules/items/ui/ChangeOrder/ItemChangeOrderLock.tsx
deleted file mode 100644
index 42dba82fba..0000000000
--- a/apps/erp/app/modules/items/ui/ChangeOrder/ItemChangeOrderLock.tsx
+++ /dev/null
@@ -1,59 +0,0 @@
-import { Tooltip, TooltipContent, TooltipTrigger } from "@carbon/react";
-import { useLingui } from "@lingui/react/macro";
-import type { ReactNode } from "react";
-import { useRouteData } from "~/hooks";
-import type { ItemType } from "~/modules/shared";
-import { path } from "~/utils/path";
-import { changeOrderOpenStatuses } from "../../items.models";
-import type { ChangeOrderForItem } from "../../items.service";
-
-const openStatusSet = new Set<string>(changeOrderOpenStatuses);
-
-// Reads `openChangeOrders` from the part/tool parent route data; other item types return [].
-export function useItemOpenChangeOrders(
- type: ItemType | string | undefined,
- itemId: string | undefined
-): ChangeOrderForItem[] {
- const routePath =
- itemId && type === "Part"
- ? path.to.part(itemId)
- : itemId && type === "Tool"
- ? path.to.tool(itemId)
- : "";
- const data = useRouteData<{ openChangeOrders?: ChangeOrderForItem[] }>(
- routePath
- );
- return (data?.openChangeOrders ?? []).filter((co) =>
- openStatusSet.has(co.status)
- );
-}
-
-// Tooltip wrapper for disabled controls (the div anchors hover since disabled elements don't fire it).
-export function ItemChangeOrderLock({
- changeOrders,
- className,
- children
-}: {
- changeOrders: ChangeOrderForItem[];
- className?: string;
- children: ReactNode;
-}) {
- const { t } = useLingui();
-
- if (changeOrders.length === 0) return <>{children}</>;
-
- const ids = changeOrders.map((co) => co.changeOrderId).join(", ");
-
- return (
- <Tooltip>
- <TooltipTrigger asChild>
- <div className={className}>{children}</div>
- </TooltipTrigger>
- <TooltipContent>
- {changeOrders.length === 1
- ? t`Open in change order ${ids}. Release it to create new versions or revisions.`
- : t`Open in change orders ${ids}. Release them to create new versions or revisions.`}
- </TooltipContent>
- </Tooltip>
- );
-}
diff --git a/apps/erp/app/modules/items/ui/ChangeOrder/index.ts b/apps/erp/app/modules/items/ui/ChangeOrder/index.ts
deleted file mode 100644
index 61b9854d41..0000000000
--- a/apps/erp/app/modules/items/ui/ChangeOrder/index.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-export { default as AffectedItemDetail } from "./AffectedItemDetail";
-export type * from "./affectedItem.types";
-export { default as ChangeOrderActions } from "./ChangeOrderActions";
-export { default as ChangeOrderChanges } from "./ChangeOrderChanges";
-export * from "./ChangeOrderContent";
-export { default as ChangeOrderDiffViewer } from "./ChangeOrderDiffViewer";
-export { default as ChangeOrderExplorer } from "./ChangeOrderExplorer";
-export { default as ChangeOrderForm } from "./ChangeOrderForm";
-export { default as ChangeOrderHeader } from "./ChangeOrderHeader";
-export { default as ChangeOrderProperties } from "./ChangeOrderProperties";
-export { default as ChangeOrderReleaseMerge } from "./ChangeOrderReleaseMerge";
-export { default as ChangeOrderStatus } from "./ChangeOrderStatus";
-export { default as ChangeOrdersTable } from "./ChangeOrdersTable";
-export { default as CreateChangeOrderModal } from "./CreateChangeOrderModal";
-export type { ChangeOrderImpactItem } from "./ImpactPanel";
-export { default as ImpactPanel } from "./ImpactPanel";
-export * from "./ItemChangeOrderLock";
-export { default as ItemChangeOrders } from "./ItemChangeOrders";
-export { default as ItemOpenChangeOrderAlert } from "./ItemOpenChangeOrderAlert";
diff --git a/apps/erp/app/modules/items/ui/ChangeOrderActions/index.ts b/apps/erp/app/modules/items/ui/ChangeOrderActions/index.ts
deleted file mode 100644
index 2ee21aeaf5..0000000000
--- a/apps/erp/app/modules/items/ui/ChangeOrderActions/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export { default as ChangeOrderRequiredActionForm } from "./ChangeOrderRequiredActionForm";
-export { default as ChangeOrderRequiredActionsTable } from "./ChangeOrderRequiredActionsTable";
diff --git a/apps/erp/app/modules/items/ui/ChangeOrderTypes/index.ts b/apps/erp/app/modules/items/ui/ChangeOrderTypes/index.ts
deleted file mode 100644
index 95d1ab1b5d..0000000000
--- a/apps/erp/app/modules/items/ui/ChangeOrderTypes/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export { default as ChangeOrderTypeForm } from "./ChangeOrderTypeForm";
-export { default as ChangeOrderTypesTable } from "./ChangeOrderTypesTable";
diff --git a/apps/erp/app/modules/items/ui/Item/BillOfMaterial.tsx b/apps/erp/app/modules/items/ui/Item/BillOfMaterial.tsx
index a423ace3a3..9fd05b85ee 100644
--- a/apps/erp/app/modules/items/ui/Item/BillOfMaterial.tsx
+++ b/apps/erp/app/modules/items/ui/Item/BillOfMaterial.tsx
@@ -31,7 +31,7 @@ import { getItemReadableId } from "@carbon/utils";
import { Trans, useLingui } from "@lingui/react/macro";
import { motion } from "framer-motion";
import { nanoid } from "nanoid";
-import type { Dispatch, SetStateAction } from "react";
+import type { Dispatch, ReactNode, SetStateAction } from "react";
import { useCallback, useEffect, useRef, useState } from "react";
import { flushSync } from "react-dom";
import {
@@ -138,6 +138,11 @@ type BillOfMaterialProps = {
configurationRules?: ConfigurationRule[];
replenishmentSystem?: string;
parentItemId?: string;
+ // Extra read-only reason from the embedding surface (e.g. a change notice whose
+ // engineering content is frozen at Implementation).
+ isDisabled?: boolean;
+ // What to tell the user when isDisabled is what made this read-only.
+ disabledReason?: ReactNode;
} & ReleaseLockProps;
type OrderState = {
@@ -176,7 +181,9 @@ const BillOfMaterial = ({
replenishmentSystem,
parentItemId,
revisionStatus,
- releaseControl
+ releaseControl,
+ isDisabled = false,
+ disabledReason
}: BillOfMaterialProps) => {
const permissions = usePermissions();
const { t } = useLingui();
@@ -187,7 +194,8 @@ const BillOfMaterial = ({
const isReadOnly =
permissions.can("update", "parts") === false ||
makeMethod.status !== "Draft" ||
- isReleaseLocked;
+ isReleaseLocked ||
+ isDisabled;
const addItemButtonRef = useRef<HTMLButtonElement>(null);
@@ -462,7 +470,7 @@ const BillOfMaterial = ({
<Trans>Bill of Material</Trans>
{isReadOnly && (
<Tooltip>
- <TooltipTrigger tabIndex={-1} className="text-muted-foreground">
+ <TooltipTrigger className="text-muted-foreground">
<LuLock />
</TooltipTrigger>
<TooltipContent className="max-w-xs">
@@ -471,6 +479,8 @@ const BillOfMaterial = ({
This method version is read-only. Create a new version
from the method menu to make changes.
</Trans>
+ ) : isDisabled && disabledReason ? (
+ disabledReason
) : (
<Trans>
You don't have permission to edit this bill of material.
diff --git a/apps/erp/app/modules/items/ui/Item/BillOfProcess.tsx b/apps/erp/app/modules/items/ui/Item/BillOfProcess.tsx
index 6e60a77d9a..9bf90bca28 100644
--- a/apps/erp/app/modules/items/ui/Item/BillOfProcess.tsx
+++ b/apps/erp/app/modules/items/ui/Item/BillOfProcess.tsx
@@ -176,6 +176,11 @@ type BillOfProcessProps = {
parameters?: ConfigurationParameter[];
tags: { name: string }[];
selectedMaterialId?: string;
+ // Extra read-only reason from the embedding surface (e.g. a change notice whose
+ // engineering content is frozen at Implementation).
+ isDisabled?: boolean;
+ // What to tell the user when isDisabled is what made this read-only.
+ disabledReason?: ReactNode;
} & ReleaseLockProps;
type PendingWorkInstructions = {
@@ -229,7 +234,9 @@ const BillOfProcess = ({
tags,
selectedMaterialId,
revisionStatus,
- releaseControl
+ releaseControl,
+ isDisabled = false,
+ disabledReason
}: BillOfProcessProps) => {
const permissions = usePermissions();
const { t } = useLingui();
@@ -240,7 +247,8 @@ const BillOfProcess = ({
const isReadOnly =
permissions.can("update", "parts") === false ||
makeMethod.status !== "Draft" ||
- isReleaseLocked;
+ isReleaseLocked ||
+ isDisabled;
const makeMethodId = makeMethod.id;
@@ -807,7 +815,28 @@ const BillOfProcess = ({
<HStack className="justify-between">
<CardHeader>
<CardTitle className="flex flex-row items-center gap-2">
- Bill of Process {isReadOnly && <LuLock />}
+ <Trans>Bill of Process</Trans>
+ {isReadOnly && (
+ <Tooltip>
+ <TooltipTrigger className="text-muted-foreground">
+ <LuLock />
+ </TooltipTrigger>
+ <TooltipContent className="max-w-xs">
+ {makeMethod.status !== "Draft" ? (
+ <Trans>
+ This method version is read-only. Create a new version
+ from the method menu to make changes.
+ </Trans>
+ ) : isDisabled && disabledReason ? (
+ disabledReason
+ ) : (
+ <Trans>
+ You don't have permission to edit this bill of process.
+ </Trans>
+ )}
+ </TooltipContent>
+ </Tooltip>
+ )}
</CardTitle>
</CardHeader>
diff --git a/apps/erp/app/modules/items/ui/Item/ItemDocuments.tsx b/apps/erp/app/modules/items/ui/Item/ItemDocuments.tsx
index 3dad1d661d..f70994e560 100644
--- a/apps/erp/app/modules/items/ui/Item/ItemDocuments.tsx
+++ b/apps/erp/app/modules/items/ui/Item/ItemDocuments.tsx
@@ -51,9 +51,11 @@ type ItemDocumentsProps = {
modelUpload?: ModelUpload;
type: ItemType;
// Read-only: hide the upload affordances and disable delete. Used when the
- // owning record is closed (e.g. a completed/cancelled change order). Defaults
+ // owning record is closed (e.g. a completed/cancelled change notice). Defaults
// to editable so the part detail page is unchanged.
isReadOnly?: boolean;
+ // Rendered beside the title when the embedding surface locked this card.
+ titleExtras?: React.ReactNode;
};
const ItemDocuments = ({
@@ -61,7 +63,8 @@ const ItemDocuments = ({
itemId,
modelUpload,
type,
- isReadOnly = false
+ isReadOnly = false,
+ titleExtras
}: ItemDocumentsProps) => {
const { t } = useLingui();
const { formatDate } = useDateFormatter();
@@ -104,8 +107,9 @@ const ItemDocuments = ({
<Card className="flex-grow">
<HStack className="justify-between items-start">
<CardHeader>
- <CardTitle>
+ <CardTitle className="flex flex-row items-center gap-2">
<Trans>Files</Trans>
+ {titleExtras}
</CardTitle>
</CardHeader>
{!isReadOnly && (
diff --git a/apps/erp/app/modules/items/ui/Item/MakeMethodTools.tsx b/apps/erp/app/modules/items/ui/Item/MakeMethodTools.tsx
index 4767edc85e..94aad7aed3 100644
--- a/apps/erp/app/modules/items/ui/Item/MakeMethodTools.tsx
+++ b/apps/erp/app/modules/items/ui/Item/MakeMethodTools.tsx
@@ -62,10 +62,10 @@ import {
} from "../../items.models";
import type { MakeMethod } from "../../types";
import {
- CreateChangeOrderModal,
- ItemChangeOrderLock,
- useItemOpenChangeOrders
-} from "../ChangeOrder";
+ CreateChangeNoticeModal,
+ ItemChangeNoticeLock,
+ useItemOpenChangeNotices
+} from "../ChangeNotice";
import { getPathToMakeMethod } from "../Methods/utils";
import { getLinkToItemDetails } from "./ItemForm";
import MakeMethodVersionStatus from "./MakeMethodVersionStatus";
@@ -108,15 +108,15 @@ const MakeMethodTools = ({
const saveMethodModal = useDisclosure();
const [hasMethodParts, setHasMethodParts] = useState(true);
const newVersionModal = useDisclosure();
- const changeOrderModal = useDisclosure();
+ const changeNoticeModal = useDisclosure();
const activeMethodModal = useDisclosure();
- const canCreateChangeOrder =
+ const canCreateChangeNotice =
(type === "Part" || type === "Tool") && permissions.can("create", "parts");
const itemLink = type && itemId ? getLinkToItemDetails(type, itemId) : null;
- // Version creation is locked while an open change order owns this item
- const openChangeOrders = useItemOpenChangeOrders(type, itemId);
- const isChangeOrderLocked = openChangeOrders.length > 0;
+ // Version creation is locked while an open change notice owns this item
+ const openChangeNotices = useItemOpenChangeNotices(type, itemId);
+ const isChangeNoticeLocked = openChangeNotices.length > 0;
const activeMethod =
makeMethods.find((m) => m.id === activeMethodId) ?? makeMethods[0];
@@ -304,11 +304,11 @@ const MakeMethodTools = ({
</DropdownMenuSubTrigger>
<DropdownMenuPortal>
<DropdownMenuSubContent>
- <ItemChangeOrderLock
- changeOrders={openChangeOrders}
+ <ItemChangeNoticeLock
+ changeNotices={openChangeNotices}
>
<DropdownMenuItem
- disabled={isChangeOrderLocked}
+ disabled={isChangeNoticeLocked}
onClick={() => {
flushSync(() => {
setSelectedVersion(makeMethod);
@@ -319,7 +319,7 @@ const MakeMethodTools = ({
<DropdownMenuIcon icon={<LuCopy />} />
Duplicate Version
</DropdownMenuItem>
- </ItemChangeOrderLock>
+ </ItemChangeNoticeLock>
{/* <DropdownMenuItem
destructive
@@ -332,13 +332,13 @@ const MakeMethodTools = ({
Delete Version
</DropdownMenuItem> */}
<DropdownMenuSeparator />
- <ItemChangeOrderLock
- changeOrders={openChangeOrders}
+ <ItemChangeNoticeLock
+ changeNotices={openChangeNotices}
>
<DropdownMenuItem
disabled={
makeMethod.status === "Active" ||
- isChangeOrderLocked
+ isChangeNoticeLocked
}
onClick={() => {
flushSync(() => {
@@ -350,7 +350,7 @@ const MakeMethodTools = ({
<DropdownMenuIcon icon={<LuStar />} />
Set as Active Version
</DropdownMenuItem>
- </ItemChangeOrderLock>
+ </ItemChangeNoticeLock>
</DropdownMenuSubContent>
</DropdownMenuPortal>
</DropdownMenuSub>
@@ -358,20 +358,20 @@ const MakeMethodTools = ({
})}
<DropdownMenuSeparator />
{permissions.can("create", "production") && (
- <ItemChangeOrderLock changeOrders={openChangeOrders}>
+ <ItemChangeNoticeLock changeNotices={openChangeNotices}>
<DropdownMenuItem
- disabled={isChangeOrderLocked}
+ disabled={isChangeNoticeLocked}
onClick={newVersionModal.onOpen}
>
<DropdownMenuIcon icon={<LuCirclePlus />} />
New Version
</DropdownMenuItem>
- </ItemChangeOrderLock>
+ </ItemChangeNoticeLock>
)}
- {canCreateChangeOrder && (
- <DropdownMenuItem onClick={changeOrderModal.onOpen}>
+ {canCreateChangeNotice && (
+ <DropdownMenuItem onClick={changeNoticeModal.onOpen}>
<DropdownMenuIcon icon={<LuGitPullRequestArrow />} />
- New Change Order
+ <Trans>New Change Notice</Trans>
</DropdownMenuItem>
)}
</>
@@ -661,10 +661,10 @@ const MakeMethodTools = ({
/>
)}
- {changeOrderModal.isOpen && (
- <CreateChangeOrderModal
+ {changeNoticeModal.isOpen && (
+ <CreateChangeNoticeModal
itemId={itemId}
- onClose={changeOrderModal.onClose}
+ onClose={changeNoticeModal.onClose}
/>
)}
</Fragment>
diff --git a/apps/erp/app/modules/items/ui/Item/ReleaseLockAlert.tsx b/apps/erp/app/modules/items/ui/Item/ReleaseLockAlert.tsx
index 789ed9b26d..f79a69ec00 100644
--- a/apps/erp/app/modules/items/ui/Item/ReleaseLockAlert.tsx
+++ b/apps/erp/app/modules/items/ui/Item/ReleaseLockAlert.tsx
@@ -3,7 +3,7 @@ import { Trans } from "@lingui/react/macro";
import { LuTriangleAlert } from "react-icons/lu";
import type { itemRevisionStatus, plmReleaseControl } from "../../items.models";
-// A released (Production) revision should flow changes through a change order.
+// A released (Production) revision should flow changes through a change notice.
// Only `enforce` hard-locks editing; `warn` keeps editing enabled and shows an
// advisory; `off` does nothing.
export type ReleaseLockProps = {
@@ -42,13 +42,13 @@ const ReleaseLockAlert = ({ isLocked, className }: ReleaseLockAlertProps) => (
<AlertDescription>
{isLocked ? (
<Trans>
- This revision is released (Production). Open a change order to modify
+ This revision is released (Production). Open a change notice to modify
it.
</Trans>
) : (
<Trans>
This revision is released (Production). Changes should normally flow
- through a change order.
+ through a change notice.
</Trans>
)}
</AlertDescription>
diff --git a/apps/erp/app/modules/items/ui/Item/RevisionForm.tsx b/apps/erp/app/modules/items/ui/Item/RevisionForm.tsx
index 559564cc49..27409a8183 100644
--- a/apps/erp/app/modules/items/ui/Item/RevisionForm.tsx
+++ b/apps/erp/app/modules/items/ui/Item/RevisionForm.tsx
@@ -47,18 +47,18 @@ const RevisionForm = ({
? !permissions.can("update", "parts")
: !permissions.can("create", "parts");
- const [openChangeOrder, setOpenChangeOrder] = useState(false);
- // Offer the "open a change order" shortcut only when creating a new revision of
+ const [openChangeNotice, setOpenChangeNotice] = useState(false);
+ // Offer the "open a change notice" shortcut only when creating a new revision of
// a make part/tool (CO affected items are Parts/Tools; the CO route coerces
// Buy items to a Revision change type).
- const canOpenChangeOrder =
+ const canOpenChangeNotice =
!isEditing &&
!hasSizesInsteadOfRevisions &&
(initialValues.type === "Part" || initialValues.type === "Tool");
// biome-ignore lint/correctness/useExhaustiveDependencies: suppressed due to migration
useEffect(() => {
- // The "open a change order" path posts straight to the create+attach route
+ // The "open a change notice" path posts straight to the create+attach route
// (see the form action below), which redirects to the new CO — so it never
// returns here. This only handles the plain new-revision submit.
if (fetcher.data?.success) {
@@ -85,8 +85,8 @@ const RevisionForm = ({
action={
isEditing
? path.to.revision(initialValues.id!)
- : openChangeOrder && initialValues.copyFromId
- ? path.to.newChangeOrderFromItem(initialValues.copyFromId)
+ : openChangeNotice && initialValues.copyFromId
+ ? path.to.newChangeNoticeFromItem(initialValues.copyFromId)
: path.to.newRevision
}
defaultValues={initialValues}
@@ -126,16 +126,16 @@ const RevisionForm = ({
: t`The revision number of the part`
}
/>
- {canOpenChangeOrder && (
+ {canOpenChangeNotice && (
<Boolean
- name="openChangeOrder"
- label={t`Open a change order`}
- description={t`Create a change order for the new revision and open it`}
+ name="openChangeNotice"
+ label={t`Open a change notice`}
+ description={t`Create a change notice for the new revision and open it`}
bordered
- onChange={setOpenChangeOrder}
+ onChange={setOpenChangeNotice}
/>
)}
- {openChangeOrder && (
+ {openChangeNotice && (
<Hidden name="changeType" value="Revision" />
)}
</VStack>
diff --git a/apps/erp/app/modules/items/ui/Item/SupplierParts/SupplierParts.tsx b/apps/erp/app/modules/items/ui/Item/SupplierParts/SupplierParts.tsx
index 851fccd367..213e787fd6 100644
--- a/apps/erp/app/modules/items/ui/Item/SupplierParts/SupplierParts.tsx
+++ b/apps/erp/app/modules/items/ui/Item/SupplierParts/SupplierParts.tsx
@@ -30,15 +30,18 @@ type SupplierPartsProps = {
compact?: boolean;
deleteSupplierPath?: (id: string) => string;
// Suppresses the add row + delete column regardless of permissions — for
- // read-only contexts like a locked (Done/Cancelled) change order.
+ // read-only contexts like a locked (Done/Cancelled) change notice.
isReadOnly?: boolean;
+ // Rendered beside the title when the embedding surface locked this card.
+ titleExtras?: React.ReactNode;
};
const SupplierParts = ({
supplierParts,
compact = false,
deleteSupplierPath,
- isReadOnly = false
+ isReadOnly = false,
+ titleExtras
}: SupplierPartsProps) => {
const navigate = useNavigate();
const { t } = useLingui();
@@ -128,8 +131,9 @@ const SupplierParts = ({
<>
<Card className={cn(compact && "border-none p-0 dark:shadow-none")}>
<CardHeader className={cn(compact && "px-0")}>
- <CardTitle>
+ <CardTitle className="flex flex-row items-center gap-2">
<Trans>Supplier Parts</Trans>
+ {titleExtras}
</CardTitle>
</CardHeader>
<CardContent className={cn(compact && "px-0")}>
diff --git a/apps/erp/app/modules/items/ui/Item/UsedIn.tsx b/apps/erp/app/modules/items/ui/Item/UsedIn.tsx
index 1e76a63128..99c745771a 100644
--- a/apps/erp/app/modules/items/ui/Item/UsedIn.tsx
+++ b/apps/erp/app/modules/items/ui/Item/UsedIn.tsx
@@ -44,9 +44,9 @@ import type { ItemType } from "~/modules/shared";
import { path } from "~/utils/path";
import { getReadableIdWithRevision } from "~/utils/string";
import {
- ItemChangeOrderLock,
- useItemOpenChangeOrders
-} from "../ChangeOrder/ItemChangeOrderLock";
+ ItemChangeNoticeLock,
+ useItemOpenChangeNotices
+} from "../ChangeNotice/ItemChangeNoticeLock";
import { getPathToMakeMethod } from "../Methods/utils";
import RevisionForm from "./RevisionForm";
@@ -206,11 +206,11 @@ export function RevisionsItem({
const revisionDisclosure = useDisclosure();
const defaultDisclosure = useDisclosure();
- // Block manual revision creation while an open change order owns this item —
+ // Block manual revision creation while an open change notice owns this item —
// the CO authors revisions. The button stays visible but disabled, with a
- // tooltip pointing at the change order(s).
- const openChangeOrders = useItemOpenChangeOrders(node.key, itemId);
- const isChangeOrderLocked = openChangeOrders.length > 0;
+ // tooltip pointing at the change notice(s).
+ const openChangeNotices = useItemOpenChangeNotices(node.key, itemId);
+ const isChangeNoticeLocked = openChangeNotices.length > 0;
const [selectedRevision, setSelectedRevision] = useState<{
id?: string;
@@ -250,9 +250,9 @@ export function RevisionsItem({
</div>
</button>
{permissions.can("create", "parts") &&
- (isChangeOrderLocked ? (
- <ItemChangeOrderLock
- changeOrders={openChangeOrders}
+ (isChangeNoticeLocked ? (
+ <ItemChangeNoticeLock
+ changeNotices={openChangeNotices}
className="absolute right-2 top-1.5"
>
<IconButton
@@ -263,7 +263,7 @@ export function RevisionsItem({
className="size-5"
isDisabled
/>
- </ItemChangeOrderLock>
+ </ItemChangeNoticeLock>
) : (
<IconButton
size="sm"
diff --git a/apps/erp/app/modules/items/ui/Parts/PartHeader.tsx b/apps/erp/app/modules/items/ui/Parts/PartHeader.tsx
index 05424190b5..5e0e7b17b8 100644
--- a/apps/erp/app/modules/items/ui/Parts/PartHeader.tsx
+++ b/apps/erp/app/modules/items/ui/Parts/PartHeader.tsx
@@ -26,7 +26,7 @@ import ConfirmDelete from "~/components/Modals/ConfirmDelete";
import { usePermissions, useRouteData, useUser } from "~/hooks";
import { path } from "~/utils/path";
import type { PartSummary } from "../../types";
-import { CreateChangeOrderModal } from "../ChangeOrder";
+import { CreateChangeNoticeModal } from "../ChangeNotice";
import { getItemLifecycleStatus } from "../Item/ItemSupersessionForm";
import { usePartNavigation } from "./usePartNavigation";
@@ -39,7 +39,7 @@ const PartHeader = () => {
const { company } = useUser();
const permissions = usePermissions();
const deleteModal = useDisclosure();
- const changeOrderModal = useDisclosure();
+ const changeNoticeModal = useDisclosure();
const { trigger: auditLogTrigger, drawer: auditLogDrawer } = useAuditLog({
entityType: "item",
entityId: itemId,
@@ -93,10 +93,10 @@ const PartHeader = () => {
<DropdownMenuSeparator />
<DropdownMenuItem
disabled={!permissions.can("create", "parts")}
- onClick={changeOrderModal.onOpen}
+ onClick={changeNoticeModal.onOpen}
>
<DropdownMenuIcon icon={<LuGitPullRequestArrow />} />
- <Trans>Create Change Order</Trans>
+ <Trans>Create Change Notice</Trans>
</DropdownMenuItem>
<DropdownMenuSeparator />
<DropdownMenuItem
@@ -132,10 +132,10 @@ const PartHeader = () => {
/>
)}
</div>
- {changeOrderModal.isOpen && (
- <CreateChangeOrderModal
+ {changeNoticeModal.isOpen && (
+ <CreateChangeNoticeModal
itemId={itemId}
- onClose={changeOrderModal.onClose}
+ onClose={changeNoticeModal.onClose}
/>
)}
{auditLogDrawer}
diff --git a/apps/erp/app/modules/items/ui/Parts/PartProperties.tsx b/apps/erp/app/modules/items/ui/Parts/PartProperties.tsx
index 94dd79e46a..c6aeb032ba 100644
--- a/apps/erp/app/modules/items/ui/Parts/PartProperties.tsx
+++ b/apps/erp/app/modules/items/ui/Parts/PartProperties.tsx
@@ -42,7 +42,7 @@ import type { ListItem } from "~/types";
import { path } from "~/utils/path";
import { copyToClipboard } from "~/utils/string";
import {
- type ChangeOrderChangeType,
+ type ChangeNoticeChangeType,
itemReplenishmentSystems,
itemTrackingTypes
} from "../../items.models";
@@ -79,14 +79,14 @@ type PartPropertiesProps = {
// rows of the part detail sidebar. "form" = standard labeled form fields (used
// by the CO card). Only affects presentation — persistence is unchanged.
layout?: "sidebar" | "form";
- // Read-only: every field/control is non-editable (used when the change order
+ // Read-only: every field/control is non-editable (used when the change notice
// is released/locked). Defaults to editable.
isReadOnly?: boolean;
// The change-order change type this card is embedded for (a CO line). A
// `Revision` keeps the source part number, so the Part Number field is locked
// (Name + the other attributes stay editable); `New Part` gets a fresh number
// and stays editable.
- changeType?: ChangeOrderChangeType;
+ changeType?: ChangeNoticeChangeType;
};
const PartProperties = ({
@@ -723,7 +723,7 @@ const PartProperties = ({
/>
))}
</VStack>
- {/* Active is a lifecycle flag the change order controls at release — not a
+ {/* Active is a lifecycle flag the change notice controls at release — not a
user-editable attribute in the CO card. Keep it on the part page only. */}
{!embedded && (
<ValidatedForm
diff --git a/apps/erp/app/modules/items/ui/Parts/PartsTable.tsx b/apps/erp/app/modules/items/ui/Parts/PartsTable.tsx
index cb576ee030..3478b6eb5a 100644
--- a/apps/erp/app/modules/items/ui/Parts/PartsTable.tsx
+++ b/apps/erp/app/modules/items/ui/Parts/PartsTable.tsx
@@ -594,12 +594,12 @@ const PartsTable = memo(({ data, tags, count }: PartsTableProps) => {
onClick={() =>
fetcher.submit(null, {
method: "post",
- action: path.to.newChangeOrderFromItem(row.id!)
+ action: path.to.newChangeNoticeFromItem(row.id!)
})
}
>
<MenuIcon icon={<LuGitPullRequestArrow />} />
- <Trans>Create Change Order</Trans>
+ <Trans>Create Change Notice</Trans>
</MenuItem>
<MenuItem
destructive
diff --git a/apps/erp/app/modules/items/ui/Tools/ToolHeader.tsx b/apps/erp/app/modules/items/ui/Tools/ToolHeader.tsx
index 5586389a02..20467fe46e 100644
--- a/apps/erp/app/modules/items/ui/Tools/ToolHeader.tsx
+++ b/apps/erp/app/modules/items/ui/Tools/ToolHeader.tsx
@@ -26,7 +26,7 @@ import ConfirmDelete from "~/components/Modals/ConfirmDelete";
import { usePermissions, useRouteData, useUser } from "~/hooks";
import { path } from "~/utils/path";
import type { Tool } from "../../types";
-import { CreateChangeOrderModal } from "../ChangeOrder";
+import { CreateChangeNoticeModal } from "../ChangeNotice";
import { getItemLifecycleStatus } from "../Item/ItemSupersessionForm";
import { useToolNavigation } from "./useToolNavigation";
@@ -39,7 +39,7 @@ const ToolHeader = () => {
const { company } = useUser();
const permissions = usePermissions();
const deleteModal = useDisclosure();
- const changeOrderModal = useDisclosure();
+ const changeNoticeModal = useDisclosure();
const { trigger: auditLogTrigger, drawer: auditLogDrawer } = useAuditLog({
entityType: "item",
entityId: itemId,
@@ -93,10 +93,10 @@ const ToolHeader = () => {
<DropdownMenuSeparator />
<DropdownMenuItem
disabled={!permissions.can("create", "parts")}
- onClick={changeOrderModal.onOpen}
+ onClick={changeNoticeModal.onOpen}
>
<DropdownMenuIcon icon={<LuGitPullRequestArrow />} />
- <Trans>Create Change Order</Trans>
+ <Trans>Create Change Notice</Trans>
</DropdownMenuItem>
<DropdownMenuSeparator />
<DropdownMenuItem
@@ -132,10 +132,10 @@ const ToolHeader = () => {
/>
)}
</div>
- {changeOrderModal.isOpen && (
- <CreateChangeOrderModal
+ {changeNoticeModal.isOpen && (
+ <CreateChangeNoticeModal
itemId={itemId}
- onClose={changeOrderModal.onClose}
+ onClose={changeNoticeModal.onClose}
/>
)}
{auditLogDrawer}
diff --git a/apps/erp/app/modules/items/ui/useItemsSubmodules.tsx b/apps/erp/app/modules/items/ui/useItemsSubmodules.tsx
index fdf20e79f4..f48aa984a6 100644
--- a/apps/erp/app/modules/items/ui/useItemsSubmodules.tsx
+++ b/apps/erp/app/modules/items/ui/useItemsSubmodules.tsx
@@ -63,23 +63,23 @@ export default function useItemsSubmodules() {
]
},
{
- name: t`Change Orders`,
+ name: t`Change Notices`,
routes: [
{
- name: t`Change Orders`,
- to: path.to.changeOrders,
+ name: t`Change Notices`,
+ to: path.to.changeNotices,
icon: <LuGitPullRequestArrow />,
table: "changeOrder"
},
{
- name: t`Change Order Types`,
- to: path.to.changeOrderTypes,
+ name: t`Change Notice Types`,
+ to: path.to.changeNoticeTypes,
icon: <LuTags />,
role: "employee"
},
{
- name: t`Change Order Actions`,
- to: path.to.changeOrderRequiredActions,
+ name: t`Change Notice Actions`,
+ to: path.to.changeNoticeRequiredActions,
icon: <LuListChecks />,
role: "employee"
}
diff --git a/apps/erp/app/modules/quality/quality.service.ts b/apps/erp/app/modules/quality/quality.service.ts
index 3bf9ad316c..db0e3cadb0 100644
--- a/apps/erp/app/modules/quality/quality.service.ts
+++ b/apps/erp/app/modules/quality/quality.service.ts
@@ -392,17 +392,6 @@ export async function getIssueWorkflow(
.single();
}
-export async function getIssueAction(
- client: SupabaseClient<Database>,
- id: string
-) {
- return client
- .from("nonConformanceActionTask")
- .select("id,notes,nonConformanceId,nonConformance(id,nonConformanceId)")
- .eq("id", id)
- .single();
-}
-
export async function getIssueActionTasks(
client: SupabaseClient<Database>,
id: string,
diff --git a/apps/erp/app/modules/quality/ui/Issue/IssueHeader.tsx b/apps/erp/app/modules/quality/ui/Issue/IssueHeader.tsx
index 06f79ac37e..7e1fa91dd0 100644
--- a/apps/erp/app/modules/quality/ui/Issue/IssueHeader.tsx
+++ b/apps/erp/app/modules/quality/ui/Issue/IssueHeader.tsx
@@ -78,13 +78,13 @@ const IssueHeader = () => {
>
<Link
to={`${
- path.to.newChangeOrder
+ path.to.newChangeNotice
}?sourceType=nonConformance&sourceId=${id}&name=${encodeURIComponent(
routeData?.nonConformance?.nonConformanceId ?? ""
)}`}
>
<DropdownMenuIcon icon={<LuGitPullRequestArrow />} />
- <Trans>Create Change Order</Trans>
+ <Trans>Create Change Notice</Trans>
</Link>
</DropdownMenuItem>
<DropdownMenuItem
diff --git a/apps/erp/app/modules/quality/ui/Issue/IssueProperties.tsx b/apps/erp/app/modules/quality/ui/Issue/IssueProperties.tsx
index 9a7ddd0125..e1a21451b6 100644
--- a/apps/erp/app/modules/quality/ui/Issue/IssueProperties.tsx
+++ b/apps/erp/app/modules/quality/ui/Issue/IssueProperties.tsx
@@ -29,8 +29,8 @@ import { Enumerable } from "~/components/Enumerable";
import { Tags } from "~/components/Form";
import CustomFormInlineFields from "~/components/Form/CustomFormInlineFields";
import { usePermissions, useRouteData } from "~/hooks";
-import type { ChangeOrderStatus as ChangeOrderStatusType } from "~/modules/items";
-import { ChangeOrderStatus } from "~/modules/items/ui/ChangeOrder";
+import type { ChangeNoticeStatus as ChangeNoticeStatusType } from "~/modules/items";
+import { ChangeNoticeStatus } from "~/modules/items/ui/ChangeNotice";
import type { action } from "~/routes/x+/items+/update";
import type { ListItem, StorageItem } from "~/types";
import { path } from "~/utils/path";
@@ -58,15 +58,15 @@ const IssueProperties = () => {
requiredActions: ListItem[];
files: Promise<StorageItem[]>;
tags: { name: string }[];
- changeOrders: {
+ changeNotices: {
id: string;
changeOrderId: string;
name: string;
- status: ChangeOrderStatusType;
+ status: ChangeNoticeStatusType;
}[];
}>(path.to.issue(id));
- const changeOrders = routeData?.changeOrders ?? [];
+ const changeNotices = routeData?.changeNotices ?? [];
const optimisticAssignment = useOptimisticAssignment({
id: id,
@@ -554,22 +554,22 @@ const IssueProperties = () => {
onUpdate={onUpdateCustomFields}
/>
- {changeOrders.length > 0 && (
+ {changeNotices.length > 0 && (
<VStack spacing={2}>
<h3 className="text-xs text-muted-foreground">
- <Trans>Change Orders</Trans>
+ <Trans>Change Notices</Trans>
</h3>
<VStack spacing={1}>
- {changeOrders.map((co) => (
+ {changeNotices.map((co) => (
<Link
key={co.id}
- to={path.to.changeOrder(co.id)}
+ to={path.to.changeNotice(co.id)}
className="flex items-center justify-between gap-2 w-full hover:bg-accent/50 rounded-md px-2 -mx-2 py-1 transition-colors"
>
<span className="text-sm text-primary hover:underline truncate">
{co.changeOrderId}
</span>
- <ChangeOrderStatus status={co.status} />
+ <ChangeNoticeStatus status={co.status} />
</Link>
))}
</VStack>
diff --git a/apps/erp/app/modules/quality/ui/Issue/IssueTask.tsx b/apps/erp/app/modules/quality/ui/Issue/IssueTask.tsx
index 0e6b48f0b9..77467f71a6 100644
--- a/apps/erp/app/modules/quality/ui/Issue/IssueTask.tsx
+++ b/apps/erp/app/modules/quality/ui/Issue/IssueTask.tsx
@@ -1,5 +1,4 @@
import { useCarbon } from "@carbon/auth";
-import { getLogger } from "@carbon/logger";
import type { JSONContent } from "@carbon/react";
import {
BarProgress,
@@ -30,6 +29,9 @@ import {
type ActionTaskStatus
} from "~/components/ActionTasks/ActionTaskCard";
import { ActionTaskStatusButton } from "~/components/ActionTasks/ActionTaskStatusButton";
+import { JiraIssueDialog } from "~/components/ActionTasks/Jira/IssueDialog";
+import { LinearIssueDialog } from "~/components/ActionTasks/Linear/IssueDialog";
+import { syncActionTaskNotes } from "~/components/ActionTasks/syncNotes";
import { useProcesses } from "~/components/Form/Process";
import SupplierAvatar from "~/components/SupplierAvatar";
import {
@@ -48,12 +50,8 @@ import type {
} from "~/modules/quality";
import { useSuppliers } from "~/stores";
import { getPrivateUrl, path } from "~/utils/path";
-import { JiraIssueDialog } from "./Jira/IssueDialog";
-import { LinearIssueDialog } from "./Linear/IssueDialog";
-const logger = getLogger("erp", "issuetask");
-
-// TaskProgress moved to the shared ActionTasks folder (SSOT with Change Orders);
+// TaskProgress moved to the shared ActionTasks folder (SSOT with Change Notices);
// re-exported here so existing `~/modules/quality/ui/Issue` importers keep working.
export { ActionTaskProgress as TaskProgress } from "~/components/ActionTasks/ActionTaskProgress";
@@ -303,10 +301,22 @@ export function TaskItem({
}
headerExtras={
<>
- {/* @ts-expect-error TS2322 */}
- {integrations.has("linear") && <LinearIssueDialog task={task} />}
- {/* @ts-expect-error TS2322 */}
- {integrations.has("jira") && <JiraIssueDialog task={task} />}
+ {/* Only action tasks live in `nonConformanceActionTask` — linking any
+ other task type would send an id from a different table. */}
+ {type === "action" && integrations.has("linear") && (
+ <LinearIssueDialog
+ entityType="nonConformanceActionTask"
+ taskId={task.id!}
+ linkedIssue={(task as IssueActionTask).linearIssue}
+ />
+ )}
+ {type === "action" && integrations.has("jira") && (
+ <JiraIssueDialog
+ entityType="nonConformanceActionTask"
+ taskId={task.id!}
+ linkedIssue={(task as IssueActionTask).jiraIssue}
+ />
+ )}
</>
}
footerExtras={
@@ -393,36 +403,20 @@ function useTaskNotes({
// Sync to Linear if this is an action task with a linked Linear issue
if (type === "action" && hasLinearLink) {
- try {
- await fetch(path.to.api.linearSyncNotes, {
- method: "POST",
- headers: { "Content-Type": "application/x-www-form-urlencoded" },
- body: new URLSearchParams({
- actionId: taskId,
- notes: JSON.stringify(content)
- })
- });
- } catch (e) {
- // Silently fail Linear sync - not critical
- logger.error("Failed to sync notes to Linear", { error: e });
- }
+ await syncActionTaskNotes("Linear", {
+ actionId: taskId,
+ entityType: "nonConformanceActionTask",
+ notes: content
+ });
}
// Sync to Jira if this is an action task with a linked Jira issue
if (type === "action" && hasJiraLink) {
- try {
- await fetch(path.to.api.jiraSyncNotes, {
- method: "POST",
- headers: { "Content-Type": "application/x-www-form-urlencoded" },
- body: new URLSearchParams({
- actionId: taskId,
- notes: JSON.stringify(content)
- })
- });
- } catch (e) {
- // Silently fail Jira sync - not critical
- logger.error("Failed to sync notes to Jira", { error: e });
- }
+ await syncActionTaskNotes("Jira", {
+ actionId: taskId,
+ entityType: "nonConformanceActionTask",
+ notes: content
+ });
}
},
2500,
diff --git a/apps/erp/app/modules/settings/ui/AuditLog/AuditLogTable.tsx b/apps/erp/app/modules/settings/ui/AuditLog/AuditLogTable.tsx
index bf0e2fd4d1..9cc6cdd547 100644
--- a/apps/erp/app/modules/settings/ui/AuditLog/AuditLogTable.tsx
+++ b/apps/erp/app/modules/settings/ui/AuditLog/AuditLogTable.tsx
@@ -94,7 +94,7 @@ function getEntityPath(entityId: string): string | null {
quote: path.to.quote,
emp: path.to.employeeAccount,
nc: path.to.issue,
- co: path.to.changeOrder,
+ co: path.to.changeNotice,
sh: path.to.shipment,
rec: path.to.receipt,
ic: path.to.inventoryCount,
diff --git a/apps/erp/app/routes/api+/integrations.jira.issue.create.ts b/apps/erp/app/routes/api+/integrations.jira.issue.create.ts
index 3ea3ca1d65..813e10e188 100644
--- a/apps/erp/app/routes/api+/integrations.jira.issue.create.ts
+++ b/apps/erp/app/routes/api+/integrations.jira.issue.create.ts
@@ -1,5 +1,11 @@
import { getAppUrl } from "@carbon/auth";
import { requirePermissions } from "@carbon/auth/auth.server";
+import {
+ actionTaskEntities,
+ actionTaskParentId,
+ actionTaskPermissions,
+ isActionTaskEntityType
+} from "@carbon/ee/action-task-entity";
import {
getCompanyEmployees,
getJiraClient,
@@ -9,7 +15,8 @@ import {
import { getLogger } from "@carbon/logger";
import type { ActionFunction, LoaderFunction } from "react-router";
import { data } from "react-router";
-import { getIssueAction } from "~/modules/quality/quality.service";
+import { requireChangeNoticeEditable } from "~/modules/items/items.server";
+import { getActionTaskWithParent } from "~/services/action-task.server";
const logger = getLogger("erp", "integrations-jira-issue-create");
@@ -19,9 +26,21 @@ export const action: ActionFunction = async ({ request }) => {
try {
const formData = await request.formData();
- const { companyId, client } = await requirePermissions(request, {});
-
const actionId = formData.get("actionId") as string;
+ const entityType = formData.get("entityType") as string | null;
+
+ if (!isActionTaskEntityType(entityType)) {
+ return data(
+ { success: false, message: "Invalid entityType" },
+ { status: 400 }
+ );
+ }
+
+ const { companyId, client } = await requirePermissions(
+ request,
+ actionTaskPermissions(entityType)
+ );
+
const projectKey = formData.get("projectKey") as string;
const issueTypeId = formData.get("issueTypeId") as string;
const summary = formData.get("title") as string;
@@ -40,13 +59,30 @@ export const action: ActionFunction = async ({ request }) => {
}
const [carbonIssue, siteUrl] = await Promise.all([
- getIssueAction(client, actionId),
+ getActionTaskWithParent(client, entityType, actionId, companyId),
jira.getSiteUrl(companyId)
]);
+ if (entityType === "changeOrderActionTask") {
+ const locked = carbonIssue.parentId
+ ? await requireChangeNoticeEditable(client, {
+ changeNoticeId: carbonIssue.parentId,
+ companyId,
+ scope: "workflow"
+ })
+ : { error: { message: "Could not find change notice" } };
+
+ if (locked) {
+ return data(
+ { success: false, message: locked.error.message },
+ { status: 400 }
+ );
+ }
+ }
+
// Use the task's notes as the Jira issue description, falling back to form description
let adfDescription: any = undefined;
- const notes = carbonIssue.data?.notes;
+ const notes = carbonIssue.notes;
if (notes && typeof notes === "object") {
try {
adfDescription = tiptapToAdf(notes as any);
@@ -89,6 +125,7 @@ export const action: ActionFunction = async ({ request }) => {
}
const linked = await linkActionToJiraIssue(client, companyId, {
+ entityType,
actionId,
issue,
siteUrl
@@ -101,16 +138,18 @@ export const action: ActionFunction = async ({ request }) => {
);
}
- const nonConformanceId = linked.data?.[0].nonConformanceId;
+ const parentId = actionTaskParentId(linked.data, entityType) ?? "";
- const url = getAppUrl() + `/x/issue/${nonConformanceId}/details`;
+ const url =
+ getAppUrl() +
+ `${actionTaskEntities[entityType].detailPath(parentId)}/details`;
// Create a remote link in Jira pointing back to Carbon
await jira.createRemoteLink(
companyId,
issue.id,
url,
- `Linked Carbon Issue: ${carbonIssue.data?.nonConformance?.nonConformanceId ?? ""}`
+ `Linked Carbon Issue: ${carbonIssue.parentReadableId ?? ""}`
);
return { success: true, message: "Jira issue created" };
diff --git a/apps/erp/app/routes/api+/integrations.jira.issue.link.ts b/apps/erp/app/routes/api+/integrations.jira.issue.link.ts
index fe845b9594..b824481da5 100644
--- a/apps/erp/app/routes/api+/integrations.jira.issue.link.ts
+++ b/apps/erp/app/routes/api+/integrations.jira.issue.link.ts
@@ -1,5 +1,11 @@
import { getAppUrl } from "@carbon/auth";
import { requirePermissions } from "@carbon/auth/auth.server";
+import {
+ actionTaskEntities,
+ actionTaskParentId,
+ actionTaskPermissions,
+ isActionTaskEntityType
+} from "@carbon/ee/action-task-entity";
import {
getJiraClient,
getJiraIssueFromExternalId,
@@ -10,22 +16,53 @@ import {
import { getLogger } from "@carbon/logger";
import type { ActionFunction, LoaderFunction } from "react-router";
import { data } from "react-router";
-import { getIssueAction } from "~/modules/quality/quality.service";
+import { requireChangeNoticeEditable } from "~/modules/items/items.server";
+import { getActionTaskWithParent } from "~/services/action-task.server";
const jira = getJiraClient();
const logger = getLogger("erp", "jira", "issue-link");
export const action: ActionFunction = async ({ request }) => {
try {
- const { companyId, client } = await requirePermissions(request, {});
const form = await request.formData();
const actionId = form.get("actionId") as string;
+ const entityType = form.get("entityType") as string | null;
if (!actionId) {
return { success: false, message: "Missing required fields: actionId" };
}
+ if (!isActionTaskEntityType(entityType)) {
+ return { success: false, message: "Invalid entityType" };
+ }
+
+ const { companyId, client } = await requirePermissions(
+ request,
+ actionTaskPermissions(entityType)
+ );
+
+ if (entityType === "changeOrderActionTask") {
+ const task = await getActionTaskWithParent(
+ client,
+ entityType,
+ actionId,
+ companyId
+ );
+
+ const locked = task.parentId
+ ? await requireChangeNoticeEditable(client, {
+ changeNoticeId: task.parentId,
+ companyId,
+ scope: "workflow"
+ })
+ : { error: { message: "Could not find change notice" } };
+
+ if (locked) {
+ return { success: false, message: locked.error.message };
+ }
+ }
+
switch (request.method) {
case "POST": {
const issueId = form.get("issueId") as string;
@@ -38,7 +75,7 @@ export const action: ActionFunction = async ({ request }) => {
}
const [carbonIssue, issue, siteUrl] = await Promise.all([
- getIssueAction(client, actionId),
+ getActionTaskWithParent(client, entityType, actionId, companyId),
jira.getIssue(companyId, issueId),
jira.getSiteUrl(companyId)
]);
@@ -60,6 +97,7 @@ export const action: ActionFunction = async ({ request }) => {
}
const linked = await linkActionToJiraIssue(client, companyId, {
+ entityType,
actionId,
issue,
siteUrl,
@@ -70,12 +108,14 @@ export const action: ActionFunction = async ({ request }) => {
return { success: false, message: "Failed to link issue" };
}
- const nonConformanceId = linked.data?.[0].nonConformanceId;
+ const parentId = actionTaskParentId(linked.data, entityType) ?? "";
- const url = getAppUrl() + `/x/issue/${nonConformanceId}/details`;
+ const url =
+ getAppUrl() +
+ `${actionTaskEntities[entityType].detailPath(parentId)}/details`;
// Update the Jira issue description with the task's notes
- const notes = carbonIssue.data?.notes;
+ const notes = carbonIssue.notes;
if (notes && typeof notes === "object") {
try {
const adfDescription = tiptapToAdf(notes as any);
@@ -94,9 +134,7 @@ export const action: ActionFunction = async ({ request }) => {
companyId,
issue.id,
url,
- `Linked Carbon Issue: ${
- carbonIssue.data?.nonConformance?.nonConformanceId ?? ""
- }`
+ `Linked Carbon Issue: ${carbonIssue.parentReadableId ?? ""}`
);
return { success: true, message: "Linked successfully" };
@@ -106,11 +144,13 @@ export const action: ActionFunction = async ({ request }) => {
const mapping = await getJiraIssueFromExternalId(
client,
companyId,
- actionId
+ actionId,
+ entityType
);
// Unlink from Carbon's DB first
const unlinked = await unlinkActionFromJiraIssue(client, companyId, {
+ entityType,
actionId
});
@@ -155,9 +195,19 @@ export const action: ActionFunction = async ({ request }) => {
};
export const loader: LoaderFunction = async ({ request }) => {
- const { companyId } = await requirePermissions(request, {});
const url = new URL(request.url);
+ const entityType = url.searchParams.get("entityType");
+
+ if (!isActionTaskEntityType(entityType)) {
+ return { issues: [] };
+ }
+
+ const { companyId } = await requirePermissions(
+ request,
+ actionTaskPermissions(entityType)
+ );
+
const query = url.searchParams.get("search") as string;
if (!query || query.trim().length === 0) {
diff --git a/apps/erp/app/routes/api+/integrations.jira.issue.sync-notes.ts b/apps/erp/app/routes/api+/integrations.jira.issue.sync-notes.ts
index baa94a4384..acf86cbe04 100644
--- a/apps/erp/app/routes/api+/integrations.jira.issue.sync-notes.ts
+++ b/apps/erp/app/routes/api+/integrations.jira.issue.sync-notes.ts
@@ -1,4 +1,8 @@
import { requirePermissions } from "@carbon/auth/auth.server";
+import {
+ actionTaskPermissions,
+ isActionTaskEntityType
+} from "@carbon/ee/action-task-entity";
import type { TiptapDocument } from "@carbon/ee/jira.server";
import {
getJiraClient,
@@ -8,26 +12,57 @@ import {
import { getLogger } from "@carbon/logger";
import type { ActionFunction } from "react-router";
import { data } from "react-router";
+import { requireChangeNoticeEditable } from "~/modules/items/items.server";
+import { getActionTaskWithParent } from "~/services/action-task.server";
const logger = getLogger("erp", "integrations-jira-issue-sync-notes");
const jira = getJiraClient();
export const action: ActionFunction = async ({ request }) => {
- const { companyId, client } = await requirePermissions(request, {});
-
if (request.method !== "POST") {
return data({ success: false, message: "Method not allowed" }, 405);
}
const form = await request.formData();
const actionId = form.get("actionId") as string;
+ const entityType = form.get("entityType") as string | null;
const notesStr = form.get("notes") as string;
if (!actionId) {
return data({ success: false, message: "Missing actionId" }, 400);
}
+ if (!isActionTaskEntityType(entityType)) {
+ return data({ success: false, message: "Invalid entityType" }, 400);
+ }
+
+ const { companyId, client } = await requirePermissions(
+ request,
+ actionTaskPermissions(entityType)
+ );
+
+ if (entityType === "changeOrderActionTask") {
+ const task = await getActionTaskWithParent(
+ client,
+ entityType,
+ actionId,
+ companyId
+ );
+
+ const locked = task.parentId
+ ? await requireChangeNoticeEditable(client, {
+ changeNoticeId: task.parentId,
+ companyId,
+ scope: "workflow"
+ })
+ : { error: { message: "Could not find change notice" } };
+
+ if (locked) {
+ return data({ success: false, message: locked.error.message }, 400);
+ }
+ }
+
// Parse the notes JSON
let notes: TiptapDocument | null = null;
try {
@@ -37,7 +72,12 @@ export const action: ActionFunction = async ({ request }) => {
}
// Get the linked Jira issue
- const issue = await getJiraIssueFromExternalId(client, companyId, actionId);
+ const issue = await getJiraIssueFromExternalId(
+ client,
+ companyId,
+ actionId,
+ entityType
+ );
if (!issue) {
return { success: true, message: "No linked Jira issue" };
diff --git a/apps/erp/app/routes/api+/integrations.linear.issue.create.ts b/apps/erp/app/routes/api+/integrations.linear.issue.create.ts
index 924bedede4..a0ff1f4159 100644
--- a/apps/erp/app/routes/api+/integrations.linear.issue.create.ts
+++ b/apps/erp/app/routes/api+/integrations.linear.issue.create.ts
@@ -1,5 +1,11 @@
import { getAppUrl } from "@carbon/auth";
import { requirePermissions } from "@carbon/auth/auth.server";
+import {
+ actionTaskEntities,
+ actionTaskParentId,
+ actionTaskPermissions,
+ isActionTaskEntityType
+} from "@carbon/ee/action-task-entity";
import {
getCompanyEmployees,
getLinearClient,
@@ -8,7 +14,8 @@ import {
import { getLogger } from "@carbon/logger";
import type { ActionFunction, LoaderFunction } from "react-router";
import { data } from "react-router";
-import { getIssueAction } from "~/modules/quality/quality.service";
+import { requireChangeNoticeEditable } from "~/modules/items/items.server";
+import { getActionTaskWithParent } from "~/services/action-task.server";
const logger = getLogger("erp", "integrations-linear-issue-create");
@@ -18,29 +25,57 @@ export const action: ActionFunction = async ({ request }) => {
try {
const data = await request.formData();
- const { companyId, client } = await requirePermissions(request, {});
-
const actionId = data.get("actionId") as string;
+ const entityType = data.get("entityType") as string | null;
+
+ if (!isActionTaskEntityType(entityType)) {
+ return { success: false, message: "Invalid entityType" };
+ }
+
+ const { companyId, client } = await requirePermissions(
+ request,
+ actionTaskPermissions(entityType)
+ );
+
const teamId = data.get("teamId") as string;
const title = data.get("title") as string;
const description = data.get("description") as string;
const assigneeId = data.get("assignee") as string;
- const [carbonIssue, issue] = await Promise.all([
- getIssueAction(client, actionId),
- linear.createIssue(companyId, {
- teamId,
- title,
- description: description || undefined,
- assigneeId: assigneeId || null
- })
- ]);
+ const carbonIssue = await getActionTaskWithParent(
+ client,
+ entityType,
+ actionId,
+ companyId
+ );
+
+ if (entityType === "changeOrderActionTask") {
+ const locked = carbonIssue.parentId
+ ? await requireChangeNoticeEditable(client, {
+ changeNoticeId: carbonIssue.parentId,
+ companyId,
+ scope: "workflow"
+ })
+ : { error: { message: "Could not find change notice" } };
+
+ if (locked) {
+ return { success: false, message: locked.error.message };
+ }
+ }
+
+ const issue = await linear.createIssue(companyId, {
+ teamId,
+ title,
+ description: description || undefined,
+ assigneeId: assigneeId || null
+ });
if (!issue) {
return { success: false, message: "Issue not found" };
}
const linked = await linkActionToLinearIssue(client, companyId, {
+ entityType,
actionId,
issue: issue
});
@@ -49,14 +84,16 @@ export const action: ActionFunction = async ({ request }) => {
return { success: false, message: "Failed to link issue" };
}
- const nonConformanceId = linked.data?.[0].nonConformanceId;
+ const parentId = actionTaskParentId(linked.data, entityType) ?? "";
- const url = getAppUrl() + `/x/issue/${nonConformanceId}/details`;
+ const url =
+ getAppUrl() +
+ `${actionTaskEntities[entityType].detailPath(parentId)}/details`;
await linear.createAttachmentLink(companyId, {
issueId: issue.id,
url,
- title: `Linked Carbon Issue: ${carbonIssue.data?.nonConformanceId ?? ""}`
+ title: `Linked Carbon Issue: ${carbonIssue.parentReadableId ?? ""}`
});
return new Response("Linear issue created");
diff --git a/apps/erp/app/routes/api+/integrations.linear.issue.link.ts b/apps/erp/app/routes/api+/integrations.linear.issue.link.ts
index 98b01d1941..6be452ed97 100644
--- a/apps/erp/app/routes/api+/integrations.linear.issue.link.ts
+++ b/apps/erp/app/routes/api+/integrations.linear.issue.link.ts
@@ -1,5 +1,11 @@
import { getAppUrl } from "@carbon/auth";
import { requirePermissions } from "@carbon/auth/auth.server";
+import {
+ actionTaskEntities,
+ actionTaskParentId,
+ actionTaskPermissions,
+ isActionTaskEntityType
+} from "@carbon/ee/action-task-entity";
import {
getLinearClient,
linkActionToLinearIssue,
@@ -8,7 +14,8 @@ import {
import { getLogger } from "@carbon/logger";
import type { ActionFunction, LoaderFunction } from "react-router";
import { data } from "react-router";
-import { getIssueAction } from "~/modules/quality/quality.service";
+import { requireChangeNoticeEditable } from "~/modules/items/items.server";
+import { getActionTaskWithParent } from "~/services/action-task.server";
const logger = getLogger("erp", "integrations-linear-issue-link");
@@ -16,15 +23,45 @@ const linear = getLinearClient();
export const action: ActionFunction = async ({ request }) => {
try {
- const { companyId, client } = await requirePermissions(request, {});
const form = await request.formData();
const actionId = form.get("actionId") as string;
+ const entityType = form.get("entityType") as string | null;
if (!actionId) {
return { success: false, message: "Missing required fields: actionId" };
}
+ if (!isActionTaskEntityType(entityType)) {
+ return { success: false, message: "Invalid entityType" };
+ }
+
+ const { companyId, client } = await requirePermissions(
+ request,
+ actionTaskPermissions(entityType)
+ );
+
+ if (entityType === "changeOrderActionTask") {
+ const task = await getActionTaskWithParent(
+ client,
+ entityType,
+ actionId,
+ companyId
+ );
+
+ const locked = task.parentId
+ ? await requireChangeNoticeEditable(client, {
+ changeNoticeId: task.parentId,
+ companyId,
+ scope: "workflow"
+ })
+ : { error: { message: "Could not find change notice" } };
+
+ if (locked) {
+ return { success: false, message: locked.error.message };
+ }
+ }
+
switch (request.method) {
case "POST": {
const issueId = form.get("issueId") as string;
@@ -37,7 +74,7 @@ export const action: ActionFunction = async ({ request }) => {
}
const [carbonIssue, issue] = await Promise.all([
- getIssueAction(client, actionId),
+ getActionTaskWithParent(client, entityType, actionId, companyId),
linear.getIssueById(companyId, issueId)
]);
@@ -54,6 +91,7 @@ export const action: ActionFunction = async ({ request }) => {
.single();
const linked = await linkActionToLinearIssue(client, companyId, {
+ entityType,
actionId,
issue,
assignee: assignee.data ? assignee.data.id : null
@@ -63,16 +101,16 @@ export const action: ActionFunction = async ({ request }) => {
return { success: false, message: "Failed to link issue" };
}
- const nonConformanceId = linked.data?.[0].nonConformanceId;
+ const parentId = actionTaskParentId(linked.data, entityType) ?? "";
- const url = getAppUrl() + `/x/issue/${nonConformanceId}/details`;
+ const url =
+ getAppUrl() +
+ `${actionTaskEntities[entityType].detailPath(parentId)}/details`;
await linear.createAttachmentLink(companyId, {
issueId: issue.id as string,
url,
- title: `Linked Carbon Issue: ${
- carbonIssue.data?.nonConformance?.nonConformanceId ?? ""
- }`
+ title: `Linked Carbon Issue: ${carbonIssue.parentReadableId ?? ""}`
});
return { success: true, message: "Linked successfully" };
@@ -81,6 +119,7 @@ export const action: ActionFunction = async ({ request }) => {
case "DELETE": {
// Unlink from Carbon's DB first
const unlinked = await unlinkActionFromLinearIssue(client, companyId, {
+ entityType,
actionId
});
@@ -90,13 +129,10 @@ export const action: ActionFunction = async ({ request }) => {
// Best-effort: clean up attachment in Linear
try {
- const { data: action } = await getIssueAction(client, actionId);
+ const parentId = actionTaskParentId(unlinked.data, entityType);
- if (action?.nonConformanceId) {
- const [found] = await linear.listAttachments(
- companyId,
- action.nonConformanceId
- );
+ if (parentId) {
+ const [found] = await linear.listAttachments(companyId, parentId);
if (found) {
await linear.removeAttachment(companyId, found.id);
@@ -119,9 +155,19 @@ export const action: ActionFunction = async ({ request }) => {
};
export const loader: LoaderFunction = async ({ request }) => {
- const { companyId } = await requirePermissions(request, {});
const url = new URL(request.url);
+ const entityType = url.searchParams.get("entityType");
+
+ if (!isActionTaskEntityType(entityType)) {
+ return { issues: [] };
+ }
+
+ const { companyId } = await requirePermissions(
+ request,
+ actionTaskPermissions(entityType)
+ );
+
const query = url.searchParams.get("search") as string;
const issues = await linear.listIssues(companyId, query);
diff --git a/apps/erp/app/routes/api+/integrations.linear.issue.sync-notes.ts b/apps/erp/app/routes/api+/integrations.linear.issue.sync-notes.ts
index 3085cf751e..fce329b362 100644
--- a/apps/erp/app/routes/api+/integrations.linear.issue.sync-notes.ts
+++ b/apps/erp/app/routes/api+/integrations.linear.issue.sync-notes.ts
@@ -1,4 +1,8 @@
import { requirePermissions } from "@carbon/auth/auth.server";
+import {
+ actionTaskPermissions,
+ isActionTaskEntityType
+} from "@carbon/ee/action-task-entity";
import type { TiptapDocument } from "@carbon/ee/linear.server";
import {
getLinearClient,
@@ -8,26 +12,57 @@ import {
import { getLogger } from "@carbon/logger";
import type { ActionFunction } from "react-router";
import { data } from "react-router";
+import { requireChangeNoticeEditable } from "~/modules/items/items.server";
+import { getActionTaskWithParent } from "~/services/action-task.server";
const logger = getLogger("erp", "integrations-linear-issue-sync-notes");
const linear = getLinearClient();
export const action: ActionFunction = async ({ request }) => {
- const { companyId, client } = await requirePermissions(request, {});
-
if (request.method !== "POST") {
return data({ success: false, message: "Method not allowed" }, 405);
}
const form = await request.formData();
const actionId = form.get("actionId") as string;
+ const entityType = form.get("entityType") as string | null;
const notesStr = form.get("notes") as string;
if (!actionId) {
return data({ success: false, message: "Missing actionId" }, 400);
}
+ if (!isActionTaskEntityType(entityType)) {
+ return data({ success: false, message: "Invalid entityType" }, 400);
+ }
+
+ const { companyId, client } = await requirePermissions(
+ request,
+ actionTaskPermissions(entityType)
+ );
+
+ if (entityType === "changeOrderActionTask") {
+ const task = await getActionTaskWithParent(
+ client,
+ entityType,
+ actionId,
+ companyId
+ );
+
+ const locked = task.parentId
+ ? await requireChangeNoticeEditable(client, {
+ changeNoticeId: task.parentId,
+ companyId,
+ scope: "workflow"
+ })
+ : { error: { message: "Could not find change notice" } };
+
+ if (locked) {
+ return data({ success: false, message: locked.error.message }, 400);
+ }
+ }
+
// Parse the notes JSON
let notes: TiptapDocument | null = null;
try {
@@ -37,7 +72,12 @@ export const action: ActionFunction = async ({ request }) => {
}
// Get the linked Linear issue
- const issue = await getLinearIssueFromExternalId(client, companyId, actionId);
+ const issue = await getLinearIssueFromExternalId(
+ client,
+ companyId,
+ actionId,
+ entityType
+ );
if (!issue) {
return { success: true, message: "No linked Linear issue" };
diff --git a/apps/erp/app/routes/api+/link.ts b/apps/erp/app/routes/api+/link.ts
index 5a6a90426f..be96c48b4f 100644
--- a/apps/erp/app/routes/api+/link.ts
+++ b/apps/erp/app/routes/api+/link.ts
@@ -65,10 +65,10 @@ function resolve(
return path.to.gauge(documentId);
case NotificationEvent.NonConformanceAssignment:
return path.to.issue(documentId);
- case NotificationEvent.ChangeOrderStarted:
- case NotificationEvent.ChangeOrderImplementation:
- case NotificationEvent.ChangeOrderDone:
- return path.to.changeOrderDetails(documentId);
+ case NotificationEvent.ChangeNoticeStarted:
+ case NotificationEvent.ChangeNoticeImplementation:
+ case NotificationEvent.ChangeNoticeDone:
+ return path.to.changeNoticeDetails(documentId);
case NotificationEvent.RiskAssignment:
return path.to.risk(documentId);
case NotificationEvent.ProcedureAssignment:
diff --git a/apps/erp/app/routes/api+/mcp+/lib/tool-metadata.json b/apps/erp/app/routes/api+/mcp+/lib/tool-metadata.json
index 982851b610..07b714bda4 100644
--- a/apps/erp/app/routes/api+/mcp+/lib/tool-metadata.json
+++ b/apps/erp/app/routes/api+/mcp+/lib/tool-metadata.json
@@ -14926,14 +14926,14 @@
}
},
{
- "name": "items_getChangeOrder",
+ "name": "items_getChangeNotice",
"module": "items",
"classification": "READ",
- "description": "get change order",
+ "description": "get change notice",
"paramCount": 1,
"serviceParams": [
"client",
- "changeOrderId",
+ "changeNoticeId",
"companyId"
],
"injectAuth": [
@@ -14942,20 +14942,20 @@
"schema": {
"type": "object",
"properties": {
- "changeOrderId": {
+ "changeNoticeId": {
"type": "string"
}
},
"required": [
- "changeOrderId"
+ "changeNoticeId"
]
}
},
{
- "name": "items_getChangeOrders",
+ "name": "items_getChangeNotices",
"module": "items",
"classification": "READ",
- "description": "get change orders",
+ "description": "get change notices",
"paramCount": 3,
"serviceParams": [
"client",
@@ -14991,10 +14991,10 @@
}
},
{
- "name": "items_insertChangeOrder",
+ "name": "items_insertChangeNotice",
"module": "items",
"classification": "WRITE",
- "description": "insert change order",
+ "description": "insert change notice",
"paramCount": 12,
"serviceParams": [
"client",
@@ -15008,7 +15008,7 @@
"schema": {
"type": "object",
"properties": {
- "changeOrderId": {
+ "changeNoticeId": {
"type": "string"
},
"name": {
@@ -15020,7 +15020,7 @@
"priority": {
"type": "string"
},
- "changeOrderTypeId": {
+ "changeNoticeTypeId": {
"type": "string"
},
"nonConformanceId": {
@@ -15046,10 +15046,10 @@
}
},
{
- "name": "items_updateChangeOrder",
+ "name": "items_updateChangeNotice",
"module": "items",
"classification": "WRITE",
- "description": "update change order",
+ "description": "update change notice",
"paramCount": 13,
"serviceParams": [
"client",
@@ -15117,14 +15117,14 @@
}
},
{
- "name": "items_deleteChangeOrder",
+ "name": "items_deleteChangeNotice",
"module": "items",
"classification": "DESTRUCTIVE",
- "description": "delete change order",
+ "description": "delete change notice",
"paramCount": 1,
"serviceParams": [
"client",
- "changeOrderId",
+ "changeNoticeId",
"companyId"
],
"injectAuth": [
@@ -15133,20 +15133,20 @@
"schema": {
"type": "object",
"properties": {
- "changeOrderId": {
+ "changeNoticeId": {
"type": "string"
}
},
"required": [
- "changeOrderId"
+ "changeNoticeId"
]
}
},
{
- "name": "items_updateChangeOrderStatus",
+ "name": "items_updateChangeNoticeStatus",
"module": "items",
"classification": "WRITE",
- "description": "update change order status",
+ "description": "update change notice status",
"paramCount": 4,
"serviceParams": [
"client",
@@ -15183,10 +15183,10 @@
}
},
{
- "name": "items_getChangeOrderTypes",
+ "name": "items_getChangeNoticeTypes",
"module": "items",
"classification": "READ",
- "description": "get change order types",
+ "description": "get change notice types",
"paramCount": 3,
"serviceParams": [
"client",
@@ -15222,10 +15222,10 @@
}
},
{
- "name": "items_getChangeOrderTypesList",
+ "name": "items_getChangeNoticeTypesList",
"module": "items",
"classification": "READ",
- "description": "get change order types list",
+ "description": "get change notice types list",
"paramCount": 0,
"serviceParams": [
"client",
@@ -15240,14 +15240,15 @@
}
},
{
- "name": "items_getChangeOrderType",
+ "name": "items_getChangeNoticeType",
"module": "items",
"classification": "READ",
- "description": "get change order type",
+ "description": "get change notice type",
"paramCount": 1,
"serviceParams": [
"client",
- "id"
+ "id",
+ "companyId"
],
"injectAuth": [
"companyId"
@@ -15265,14 +15266,14 @@
}
},
{
- "name": "items_upsertChangeOrderType",
+ "name": "items_upsertChangeNoticeType",
"module": "items",
"classification": "WRITE",
- "description": "upsert change order type",
+ "description": "upsert change notice type",
"paramCount": 1,
"serviceParams": [
"client",
- "changeOrderType"
+ "changeNoticeType"
],
"injectAuth": [
"companyId",
@@ -15282,22 +15283,23 @@
"schema": {
"type": "object",
"properties": {
- "changeOrderType": {}
+ "changeNoticeType": {}
},
"required": [
- "changeOrderType"
+ "changeNoticeType"
]
}
},
{
- "name": "items_deleteChangeOrderType",
+ "name": "items_deleteChangeNoticeType",
"module": "items",
"classification": "DESTRUCTIVE",
- "description": "delete change order type",
+ "description": "delete change notice type",
"paramCount": 1,
"serviceParams": [
"client",
- "id"
+ "id",
+ "companyId"
],
"injectAuth": [
"companyId"
@@ -15376,10 +15378,10 @@
}
},
{
- "name": "items_createChangeOrderDraftMethod",
+ "name": "items_createChangeNoticeDraftMethod",
"module": "items",
"classification": "WRITE",
- "description": "create change order draft method",
+ "description": "create change notice draft method",
"paramCount": 4,
"serviceParams": [
"client",
@@ -15393,7 +15395,7 @@
"schema": {
"type": "object",
"properties": {
- "changeOrderId": {
+ "changeNoticeId": {
"type": "string"
},
"itemId": {
@@ -15405,17 +15407,17 @@
}
},
"required": [
- "changeOrderId",
+ "changeNoticeId",
"itemId",
"changeType"
]
}
},
{
- "name": "items_addChangeOrderAffectedItem",
+ "name": "items_addChangeNoticeAffectedItem",
"module": "items",
"classification": "WRITE",
- "description": "add change order affected item",
+ "description": "add change notice affected item",
"paramCount": 5,
"serviceParams": [
"client",
@@ -15429,7 +15431,7 @@
"schema": {
"type": "object",
"properties": {
- "changeOrderId": {
+ "changeNoticeId": {
"type": "string"
},
"itemId": {
@@ -15444,16 +15446,16 @@
}
},
"required": [
- "changeOrderId",
+ "changeNoticeId",
"changeType"
]
}
},
{
- "name": "items_updateChangeOrderAffectedItemChangeType",
+ "name": "items_updateChangeNoticeAffectedItemChangeType",
"module": "items",
"classification": "WRITE",
- "description": "update change order affected item change type",
+ "description": "update change notice affected item change type",
"paramCount": 2,
"serviceParams": [
"client",
@@ -15478,10 +15480,10 @@
}
},
{
- "name": "items_updateChangeOrderAffectedItemCutover",
+ "name": "items_updateChangeNoticeAffectedItemCutover",
"module": "items",
"classification": "WRITE",
- "description": "update change order affected item cutover",
+ "description": "update change notice affected item cutover",
"paramCount": 4,
"serviceParams": [
"client",
@@ -15512,14 +15514,14 @@
}
},
{
- "name": "items_getChangeOrderAffectedItems",
+ "name": "items_getChangeNoticeAffectedItems",
"module": "items",
"classification": "READ",
- "description": "get change order affected items",
+ "description": "get change notice affected items",
"paramCount": 1,
"serviceParams": [
"client",
- "changeOrderId",
+ "changeNoticeId",
"companyId"
],
"injectAuth": [
@@ -15528,20 +15530,20 @@
"schema": {
"type": "object",
"properties": {
- "changeOrderId": {
+ "changeNoticeId": {
"type": "string"
}
},
"required": [
- "changeOrderId"
+ "changeNoticeId"
]
}
},
{
- "name": "items_removeChangeOrderAffectedItem",
+ "name": "items_removeChangeNoticeAffectedItem",
"module": "items",
"classification": "WRITE",
- "description": "remove change order affected item",
+ "description": "remove change notice affected item",
"paramCount": 1,
"serviceParams": [
"client",
@@ -15564,10 +15566,10 @@
}
},
{
- "name": "items_findChangeOrdersForItem",
+ "name": "items_findChangeNoticesForItem",
"module": "items",
"classification": "READ",
- "description": "find change orders for item",
+ "description": "find change notices for item",
"paramCount": 2,
"serviceParams": [
"client",
@@ -15593,10 +15595,10 @@
}
},
{
- "name": "items_getChangeOrdersForNonConformance",
+ "name": "items_getChangeNoticesForNonConformance",
"module": "items",
"classification": "READ",
- "description": "get change orders for non conformance",
+ "description": "get change notices for non conformance",
"paramCount": 1,
"serviceParams": [
"client",
@@ -15619,10 +15621,10 @@
}
},
{
- "name": "items_findOtherOpenChangeOrdersForItem",
+ "name": "items_findOtherOpenChangeNoticesForItem",
"module": "items",
"classification": "READ",
- "description": "find other open change orders for item",
+ "description": "find other open change notices for item",
"paramCount": 2,
"serviceParams": [
"client",
@@ -15637,21 +15639,21 @@
"itemId": {
"type": "string"
},
- "excludeChangeOrderId": {
+ "excludeChangeNoticeId": {
"type": "string"
}
},
"required": [
"itemId",
- "excludeChangeOrderId"
+ "excludeChangeNoticeId"
]
}
},
{
- "name": "items_getItemChangeOrderData",
+ "name": "items_getItemChangeNoticeData",
"module": "items",
"classification": "READ",
- "description": "get item change order data",
+ "description": "get item change notice data",
"paramCount": 1,
"serviceParams": [
"client",
@@ -15674,14 +15676,14 @@
}
},
{
- "name": "items_getChangeOrderActions",
+ "name": "items_getChangeNoticeActions",
"module": "items",
"classification": "READ",
- "description": "get change order actions",
+ "description": "get change notice actions",
"paramCount": 1,
"serviceParams": [
"client",
- "changeOrderId",
+ "changeNoticeId",
"companyId"
],
"injectAuth": [
@@ -15690,20 +15692,20 @@
"schema": {
"type": "object",
"properties": {
- "changeOrderId": {
+ "changeNoticeId": {
"type": "string"
}
},
"required": [
- "changeOrderId"
+ "changeNoticeId"
]
}
},
{
- "name": "items_updateChangeOrderActionStatus",
+ "name": "items_updateChangeNoticeActionStatus",
"module": "items",
"classification": "WRITE",
- "description": "update change order action status",
+ "description": "update change notice action status",
"paramCount": 2,
"serviceParams": [
"client",
@@ -15730,10 +15732,10 @@
}
},
{
- "name": "items_deleteChangeOrderAction",
+ "name": "items_deleteChangeNoticeAction",
"module": "items",
"classification": "DESTRUCTIVE",
- "description": "delete change order action",
+ "description": "delete change notice action",
"paramCount": 1,
"serviceParams": [
"client",
@@ -15755,14 +15757,14 @@
}
},
{
- "name": "items_updateChangeOrderActionOrder",
+ "name": "items_updateChangeNoticeActionOrder",
"module": "items",
"classification": "WRITE",
- "description": "update change order action order",
+ "description": "update change notice action order",
"paramCount": 2,
"serviceParams": [
"db",
- "updates"
+ "args"
],
"injectAuth": [
"companyId",
@@ -15771,24 +15773,39 @@
"schema": {
"type": "object",
"properties": {
- "id": {
+ "changeNoticeId": {
"type": "string"
},
- "sortOrder": {
- "type": "number"
+ "updates": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "sortOrder": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "id",
+ "sortOrder"
+ ]
+ }
}
},
"required": [
- "id",
- "sortOrder"
+ "changeNoticeId",
+ "updates"
]
}
},
{
- "name": "items_getChangeOrderRequiredActions",
+ "name": "items_getChangeNoticeRequiredActions",
"module": "items",
"classification": "READ",
- "description": "get change order required actions",
+ "description": "get change notice required actions",
"paramCount": 3,
"serviceParams": [
"client",
@@ -15824,10 +15841,10 @@
}
},
{
- "name": "items_getChangeOrderRequiredActionsList",
+ "name": "items_getChangeNoticeRequiredActionsList",
"module": "items",
"classification": "READ",
- "description": "get change order required actions list",
+ "description": "get change notice required actions list",
"paramCount": 0,
"serviceParams": [
"client",
@@ -15842,14 +15859,15 @@
}
},
{
- "name": "items_getChangeOrderRequiredAction",
+ "name": "items_getChangeNoticeRequiredAction",
"module": "items",
"classification": "READ",
- "description": "get change order required action",
+ "description": "get change notice required action",
"paramCount": 1,
"serviceParams": [
"client",
- "id"
+ "id",
+ "companyId"
],
"injectAuth": [
"companyId"
@@ -15867,10 +15885,10 @@
}
},
{
- "name": "items_upsertChangeOrderRequiredAction",
+ "name": "items_upsertChangeNoticeRequiredAction",
"module": "items",
"classification": "WRITE",
- "description": "upsert change order required action",
+ "description": "upsert change notice required action",
"paramCount": 3,
"serviceParams": [
"client",
@@ -15901,14 +15919,15 @@
}
},
{
- "name": "items_deleteChangeOrderRequiredAction",
+ "name": "items_deleteChangeNoticeRequiredAction",
"module": "items",
"classification": "DESTRUCTIVE",
- "description": "delete change order required action",
+ "description": "delete change notice required action",
"paramCount": 1,
"serviceParams": [
"client",
- "id"
+ "id",
+ "companyId"
],
"injectAuth": [
"companyId"
@@ -15926,10 +15945,10 @@
}
},
{
- "name": "items_setChangeOrderActionTasks",
+ "name": "items_setChangeNoticeActionTasks",
"module": "items",
"classification": "WRITE",
- "description": "set change order action tasks",
+ "description": "set change notice action tasks",
"paramCount": 2,
"serviceParams": [
"client",
@@ -15942,7 +15961,7 @@
"schema": {
"type": "object",
"properties": {
- "changeOrderId": {
+ "changeNoticeId": {
"type": "string"
},
"requiredActionIds": {
@@ -15953,16 +15972,16 @@
}
},
"required": [
- "changeOrderId",
+ "changeNoticeId",
"requiredActionIds"
]
}
},
{
- "name": "items_seedDefaultChangeOrderActions",
+ "name": "items_seedDefaultChangeNoticeActions",
"module": "items",
"classification": "WRITE",
- "description": "seed default change order actions",
+ "description": "seed default change notice actions",
"paramCount": 1,
"serviceParams": [
"client",
@@ -15974,12 +15993,12 @@
"schema": {
"type": "object",
"properties": {
- "changeOrderId": {
+ "changeNoticeId": {
"type": "string"
}
},
"required": [
- "changeOrderId"
+ "changeNoticeId"
]
}
},
@@ -16006,14 +16025,14 @@
}
},
{
- "name": "items_getChangeOrderDiff",
+ "name": "items_getChangeNoticeDiff",
"module": "items",
"classification": "READ",
- "description": "get change order diff",
+ "description": "get change notice diff",
"paramCount": 1,
"serviceParams": [
"client",
- "changeOrderId",
+ "changeNoticeId",
"companyId"
],
"injectAuth": [
@@ -16022,12 +16041,12 @@
"schema": {
"type": "object",
"properties": {
- "changeOrderId": {
+ "changeNoticeId": {
"type": "string"
}
},
"required": [
- "changeOrderId"
+ "changeNoticeId"
]
}
},
@@ -27785,31 +27804,6 @@
]
}
},
- {
- "name": "quality_getIssueAction",
- "module": "quality",
- "classification": "READ",
- "description": "get issue action",
- "paramCount": 1,
- "serviceParams": [
- "client",
- "id"
- ],
- "injectAuth": [
- "companyId"
- ],
- "schema": {
- "type": "object",
- "properties": {
- "id": {
- "type": "string"
- }
- },
- "required": [
- "id"
- ]
- }
- },
{
"name": "quality_getIssueActionTasks",
"module": "quality",
diff --git a/apps/erp/app/routes/x+/change-order+/_layout.tsx b/apps/erp/app/routes/x+/change-notice+/_layout.tsx
similarity index 80%
rename from apps/erp/app/routes/x+/change-order+/_layout.tsx
rename to apps/erp/app/routes/x+/change-notice+/_layout.tsx
index 9b7be5b8c1..a162ef7d78 100644
--- a/apps/erp/app/routes/x+/change-order+/_layout.tsx
+++ b/apps/erp/app/routes/x+/change-notice+/_layout.tsx
@@ -5,7 +5,7 @@ import type { Handle } from "~/utils/handle";
import { path } from "~/utils/path";
export const meta: MetaFunction = () => {
- return [{ title: "Carbon | Change Order" }];
+ return [{ title: "Carbon | Change Notice" }];
};
export const handle: Handle = {
@@ -14,6 +14,6 @@ export const handle: Handle = {
module: "items"
};
-export default function ChangeOrderRoute() {
+export default function ChangeNoticeRoute() {
return <Outlet />;
}
diff --git a/apps/erp/app/routes/x+/change-notice+/new.tsx b/apps/erp/app/routes/x+/change-notice+/new.tsx
new file mode 100644
index 0000000000..0e50c49fe6
--- /dev/null
+++ b/apps/erp/app/routes/x+/change-notice+/new.tsx
@@ -0,0 +1,181 @@
+import { assertIsPost, error } from "@carbon/auth";
+import { requirePermissions } from "@carbon/auth/auth.server";
+import { flash } from "@carbon/auth/session.server";
+import type { Json } from "@carbon/database";
+import { validationError, validator } from "@carbon/form";
+import { getLocalTimeZone, today } from "@internationalized/date";
+import { msg } from "@lingui/core/macro";
+import type { ActionFunctionArgs, LoaderFunctionArgs } from "react-router";
+import { redirect, useLoaderData } from "react-router";
+import { useUser } from "~/hooks";
+import {
+ addChangeNoticeAffectedItem,
+ changeNoticeValidator,
+ getChangeNoticeTypesList,
+ insertChangeNotice
+} from "~/modules/items";
+import { ChangeNoticeForm } from "~/modules/items/ui/ChangeNotice";
+import { setCustomFields } from "~/utils/form";
+import type { Handle } from "~/utils/handle";
+import { path } from "~/utils/path";
+
+export const handle: Handle = {
+ breadcrumb: msg`Change Notices`,
+ to: path.to.changeNotices,
+ module: "items"
+};
+
+// The reason/description form fields arrive as plain text; the columns are
+// tiptap JSON, so wrap non-empty text into a minimal doc (the inline Editor on
+// the detail page then edits it as rich text). Empty stays undefined.
+function toRichText(value: string | undefined): Json | undefined {
+ if (!value) return undefined;
+ return {
+ type: "doc",
+ content: [{ type: "paragraph", content: [{ type: "text", text: value }] }]
+ } as unknown as Json;
+}
+
+export async function loader({ request }: LoaderFunctionArgs) {
+ const { client, companyId } = await requirePermissions(request, {
+ view: "parts"
+ });
+
+ const types = await getChangeNoticeTypesList(client, companyId);
+
+ // "Create Change Notice" from an Issue (NCR) links here with the source in the
+ // query string. Pre-link the non-conformance so the created CO references it
+ // (changeOrder.nonConformanceId) — the create action reads this off the form.
+ const url = new URL(request.url);
+ const sourceType = url.searchParams.get("sourceType");
+ const sourceId = url.searchParams.get("sourceId") ?? undefined;
+ const name = url.searchParams.get("name") ?? undefined;
+
+ const nonConformanceId =
+ sourceType === "nonConformance" ? sourceId : undefined;
+
+ return {
+ types: types.data ?? [],
+ nonConformanceId: nonConformanceId ?? "",
+ name: name ?? ""
+ };
+}
+
+export async function action({ request }: ActionFunctionArgs) {
+ assertIsPost(request);
+ const { client, companyId, userId } = await requirePermissions(request, {
+ create: "parts"
+ });
+
+ const formData = await request.formData();
+ const validation = await validator(changeNoticeValidator).validate(formData);
+
+ if (validation.error) {
+ return validationError(validation.error);
+ }
+
+ const d = validation.data;
+
+ const createResult = await insertChangeNotice(client, {
+ changeNoticeId: d.changeOrderId || undefined,
+ name: d.name,
+ reasonForChange: toRichText(d.reasonForChange),
+ description: toRichText(d.description),
+ priority: d.priority,
+ changeNoticeTypeId: d.changeOrderTypeId || undefined,
+ nonConformanceId: d.nonConformanceId || undefined,
+ openDate: d.openDate || today(getLocalTimeZone()).toString(),
+ dueDate: d.dueDate || undefined,
+ assignee: d.assignee || undefined,
+ companyId,
+ createdBy: userId,
+ customFields: setCustomFields(formData)
+ });
+
+ if (createResult.error || !createResult.data) {
+ throw redirect(
+ path.to.changeNotices,
+ await flash(
+ request,
+ error(createResult.error, "Failed to create change notice")
+ )
+ );
+ }
+
+ // Attach any affected Parts picked at create time. Each is added as a Version
+ // change (the service coerces Buy items to Revision). Best-effort: the CO
+ // already exists, so a per-item failure lands the user on the detail page with
+ // a warning rather than losing the CO.
+ const submittedItemIds = [...new Set(d.affectedItemIds ?? [])];
+
+ // Change notices operate on Parts only — the create modal is reachable from
+ // Tool pages, so filter out anything that isn't a Part.
+ const submittedItems = submittedItemIds.length
+ ? await client
+ .from("item")
+ .select("id, type")
+ .in("id", submittedItemIds)
+ .eq("companyId", companyId)
+ : null;
+
+ const affectedItemIds = (submittedItems?.data ?? [])
+ .filter((item) => item.type === "Part")
+ .map((item) => item.id);
+ const skippedNonParts = submittedItemIds.length - affectedItemIds.length;
+
+ let affectedError: Parameters<typeof error>[0] =
+ submittedItems?.error ?? null;
+ for (const itemId of affectedItemIds) {
+ const add = await addChangeNoticeAffectedItem(client, {
+ changeNoticeId: createResult.data.id,
+ itemId,
+ changeType: "Version",
+ companyId,
+ userId
+ });
+ if (add.error) affectedError = add.error;
+ }
+
+ if (affectedError || skippedNonParts > 0) {
+ throw redirect(
+ path.to.changeNoticeDetails(createResult.data.id),
+ await flash(
+ request,
+ error(
+ affectedError,
+ affectedError
+ ? "Change notice created, but some items could not be added"
+ : "Change notice created. Change notices support Parts only, so non-Part items were skipped"
+ )
+ )
+ );
+ }
+
+ throw redirect(path.to.changeNoticeDetails(createResult.data.id));
+}
+
+export default function ChangeNoticeNewRoute() {
+ const { types, nonConformanceId, name } = useLoaderData<typeof loader>();
+ const user = useUser();
+
+ const initialValues = {
+ id: undefined,
+ changeOrderId: undefined,
+ name,
+ reasonForChange: "",
+ description: "",
+ changeOrderTypeId: "",
+ assignee: user.id,
+ priority: "Medium" as const,
+ openDate: today(getLocalTimeZone()).toString(),
+ dueDate: "",
+ nonConformanceId,
+ affectedItemIds: []
+ };
+
+ return (
+ <div className="max-w-4xl w-full p-2 sm:p-0 mx-auto mt-0 md:mt-8">
+ <ChangeNoticeForm initialValues={initialValues} types={types} />
+ </div>
+ );
+}
diff --git a/apps/erp/app/routes/x+/change-order+/new.tsx b/apps/erp/app/routes/x+/change-order+/new.tsx
index 62f691ea89..3dd2713253 100644
--- a/apps/erp/app/routes/x+/change-order+/new.tsx
+++ b/apps/erp/app/routes/x+/change-order+/new.tsx
@@ -1,162 +1,7 @@
-import { assertIsPost, error } from "@carbon/auth";
-import { requirePermissions } from "@carbon/auth/auth.server";
-import { flash } from "@carbon/auth/session.server";
-import type { Json } from "@carbon/database";
-import { validationError, validator } from "@carbon/form";
-import { getLocalTimeZone, today } from "@internationalized/date";
-import { msg } from "@lingui/core/macro";
-import type { ActionFunctionArgs, LoaderFunctionArgs } from "react-router";
-import { redirect, useLoaderData } from "react-router";
-import { useUser } from "~/hooks";
-import {
- addChangeOrderAffectedItem,
- changeOrderValidator,
- getChangeOrderTypesList,
- insertChangeOrder
-} from "~/modules/items";
-import { ChangeOrderForm } from "~/modules/items/ui/ChangeOrder";
-import { setCustomFields } from "~/utils/form";
-import type { Handle } from "~/utils/handle";
+import { redirect } from "react-router";
import { path } from "~/utils/path";
-export const handle: Handle = {
- breadcrumb: msg`Change Orders`,
- to: path.to.changeOrders,
- module: "items"
-};
-
-// The reason/description form fields arrive as plain text; the columns are
-// tiptap JSON, so wrap non-empty text into a minimal doc (the inline Editor on
-// the detail page then edits it as rich text). Empty stays undefined.
-function toRichText(value: string | undefined): Json | undefined {
- if (!value) return undefined;
- return {
- type: "doc",
- content: [{ type: "paragraph", content: [{ type: "text", text: value }] }]
- } as unknown as Json;
-}
-
-export async function loader({ request }: LoaderFunctionArgs) {
- const { client, companyId } = await requirePermissions(request, {
- view: "parts"
- });
-
- const types = await getChangeOrderTypesList(client, companyId);
-
- // "Create Change Order" from an Issue (NCR) links here with the source in the
- // query string. Pre-link the non-conformance so the created CO references it
- // (changeOrder.nonConformanceId) — the create action reads this off the form.
- const url = new URL(request.url);
- const sourceType = url.searchParams.get("sourceType");
- const sourceId = url.searchParams.get("sourceId") ?? undefined;
- const name = url.searchParams.get("name") ?? undefined;
-
- const nonConformanceId =
- sourceType === "nonConformance" ? sourceId : undefined;
-
- return {
- types: types.data ?? [],
- nonConformanceId: nonConformanceId ?? "",
- name: name ?? ""
- };
-}
-
-export async function action({ request }: ActionFunctionArgs) {
- assertIsPost(request);
- const { client, companyId, userId } = await requirePermissions(request, {
- create: "parts"
- });
-
- const formData = await request.formData();
- const validation = await validator(changeOrderValidator).validate(formData);
-
- if (validation.error) {
- return validationError(validation.error);
- }
-
- const d = validation.data;
-
- const createResult = await insertChangeOrder(client, {
- changeOrderId: d.changeOrderId || undefined,
- name: d.name,
- reasonForChange: toRichText(d.reasonForChange),
- description: toRichText(d.description),
- priority: d.priority,
- changeOrderTypeId: d.changeOrderTypeId || undefined,
- nonConformanceId: d.nonConformanceId || undefined,
- openDate: d.openDate || today(getLocalTimeZone()).toString(),
- dueDate: d.dueDate || undefined,
- assignee: d.assignee || undefined,
- companyId,
- createdBy: userId,
- customFields: setCustomFields(formData)
- });
-
- if (createResult.error || !createResult.data) {
- throw redirect(
- path.to.changeOrders,
- await flash(
- request,
- error(createResult.error, "Failed to create change order")
- )
- );
- }
-
- // Attach any affected Parts/Tools picked at create time. Each is added as a
- // Version change (the service coerces Buy items to Revision). Best-effort: the
- // CO already exists, so a per-item failure lands the user on the detail page
- // with a warning rather than losing the CO.
- const affectedItemIds = [...new Set(d.affectedItemIds ?? [])];
- let affectedError: Parameters<typeof error>[0] = null;
- for (const itemId of affectedItemIds) {
- const add = await addChangeOrderAffectedItem(client, {
- changeOrderId: createResult.data.id,
- itemId,
- changeType: "Version",
- companyId,
- userId
- });
- if (add.error) affectedError = add.error;
- }
-
- if (affectedError) {
- throw redirect(
- path.to.changeOrderDetails(createResult.data.id),
- await flash(
- request,
- error(
- affectedError,
- "Change order created, but some items could not be added"
- )
- )
- );
- }
-
- throw redirect(path.to.changeOrderDetails(createResult.data.id));
-}
-
-export default function ChangeOrderNewRoute() {
- const { types, nonConformanceId, name } = useLoaderData<typeof loader>();
- const user = useUser();
-
- const initialValues = {
- id: undefined,
- changeOrderId: undefined,
- name,
- reasonForChange: "",
- description: "",
- changeOrderTypeId: "",
- assignee: user.id,
- priority: "Medium" as const,
- openDate: today(getLocalTimeZone()).toString(),
- dueDate: "",
- nonConformanceId,
- affectedItemIds: []
- };
-
- return (
- <div className="max-w-4xl w-full p-2 sm:p-0 mx-auto mt-0 md:mt-8">
- <ChangeOrderForm initialValues={initialValues} types={types} />
- </div>
- );
+// Legacy URL shim: /x/change-order/new → /x/change-notice/new
+export async function loader() {
+ throw redirect(path.to.newChangeNotice, 301);
}
diff --git a/apps/erp/app/routes/x+/issue+/$id.tsx b/apps/erp/app/routes/x+/issue+/$id.tsx
index 9225115cbb..63c4e8ee05 100644
--- a/apps/erp/app/routes/x+/issue+/$id.tsx
+++ b/apps/erp/app/routes/x+/issue+/$id.tsx
@@ -15,7 +15,7 @@ import {
} from "react-router";
import { PanelProvider, ResizablePanels } from "~/components/Layout/Panels";
import {
- getChangeOrdersForNonConformance,
+ getChangeNoticesForNonConformance,
getItemFiles
} from "~/modules/items";
import {
@@ -59,7 +59,7 @@ export async function loader({ request, params }: LoaderFunctionArgs) {
requiredActions,
suppliers,
tags,
- changeOrders
+ changeNotices
] = await Promise.all([
getIssue(client, id),
getIssueTypesList(client, companyId),
@@ -67,7 +67,7 @@ export async function loader({ request, params }: LoaderFunctionArgs) {
getIssueSuppliers(client, id, companyId),
getTagsList(client, companyId, "nonConformance"),
// Reverse Linked-NCR cross-link (4a): COs referencing this issue.
- getChangeOrdersForNonConformance(client, id, companyId)
+ getChangeNoticesForNonConformance(client, id, companyId)
]);
if (nonConformance.error) {
@@ -85,7 +85,7 @@ export async function loader({ request, params }: LoaderFunctionArgs) {
requiredActions: requiredActions.data ?? [],
suppliers: suppliers.data ?? [],
tags: tags.data ?? [],
- changeOrders: changeOrders.data ?? []
+ changeNotices: changeNotices.data ?? []
};
}
diff --git a/apps/erp/app/routes/x+/issue+/new.tsx b/apps/erp/app/routes/x+/issue+/new.tsx
index 604cdb0b0d..01935427df 100644
--- a/apps/erp/app/routes/x+/issue+/new.tsx
+++ b/apps/erp/app/routes/x+/issue+/new.tsx
@@ -10,7 +10,7 @@ import { msg } from "@lingui/core/macro";
import type { ActionFunctionArgs, LoaderFunctionArgs } from "react-router";
import { redirect, useLoaderData } from "react-router";
import { useUrlParams, useUser } from "~/hooks";
-import { updateChangeOrder } from "~/modules/items";
+import { updateChangeNotice } from "~/modules/items";
import {
deleteIssue,
getIssueTypesList,
@@ -166,29 +166,29 @@ export async function action({ request }: ActionFunctionArgs) {
logger.error("Failed to send notifications", { error });
}
- // Created from a change order's "Linked Issue" combobox: link the new issue
+ // Created from a change notice's "Linked Issue" combobox: link the new issue
// back onto the CO and return there instead of the issue detail. The user
// `client` update is RLS-scoped, so it only lands if they can edit the CO.
const changeOrderId = url.searchParams.get("changeOrderId");
if (changeOrderId) {
- const linkResult = await updateChangeOrder(client, {
+ const linkResult = await updateChangeNotice(client, {
id: changeOrderId,
nonConformanceId: ncrId,
updatedBy: userId
});
if (linkResult.error) {
throw redirect(
- path.to.changeOrder(changeOrderId),
+ path.to.changeNotice(changeOrderId),
await flash(
request,
error(
linkResult.error,
- "Issue created but failed to link to change order"
+ "Issue created but failed to link to change notice"
)
)
);
}
- throw redirect(path.to.changeOrder(changeOrderId));
+ throw redirect(path.to.changeNotice(changeOrderId));
}
throw redirect(path.to.issue(ncrId!));
@@ -211,7 +211,7 @@ export default function IssueNewRoute() {
const salesOrderLineId = params.get("salesOrderLineId");
const shipmentLineId = params.get("shipmentLineId");
const operationSupplierProcessId = params.get("operationSupplierProcessId");
- // Prefilled when a change order's "Linked Issue" combobox creates a new issue.
+ // Prefilled when a change notice's "Linked Issue" combobox creates a new issue.
const name = params.get("name");
const initialValues = {
diff --git a/apps/erp/app/routes/x+/items+/change-order+/$id.$affectedId.details.$supplierPartId.delete.tsx b/apps/erp/app/routes/x+/items+/change-notice+/$id.$affectedId.details.$supplierPartId.delete.tsx
similarity index 93%
rename from apps/erp/app/routes/x+/items+/change-order+/$id.$affectedId.details.$supplierPartId.delete.tsx
rename to apps/erp/app/routes/x+/items+/change-notice+/$id.$affectedId.details.$supplierPartId.delete.tsx
index b6cb017fb5..db6d6a27d4 100644
--- a/apps/erp/app/routes/x+/items+/change-order+/$id.$affectedId.details.$supplierPartId.delete.tsx
+++ b/apps/erp/app/routes/x+/items+/change-notice+/$id.$affectedId.details.$supplierPartId.delete.tsx
@@ -29,13 +29,13 @@ export async function action({ request, params }: ActionFunctionArgs) {
if (deleteError) {
throw redirect(
- path.to.changeOrderAffectedItem(id, affectedId),
+ path.to.changeNoticeAffectedItem(id, affectedId),
await flash(request, error(deleteError, "Failed to delete supplier part"))
);
}
throw redirect(
- path.to.changeOrderAffectedItem(id, affectedId),
+ path.to.changeNoticeAffectedItem(id, affectedId),
await flash(request, success("Supplier part deleted"))
);
}
diff --git a/apps/erp/app/routes/x+/items+/change-order+/$id.$affectedId.details.$supplierPartId.tsx b/apps/erp/app/routes/x+/items+/change-notice+/$id.$affectedId.details.$supplierPartId.tsx
similarity index 95%
rename from apps/erp/app/routes/x+/items+/change-order+/$id.$affectedId.details.$supplierPartId.tsx
rename to apps/erp/app/routes/x+/items+/change-notice+/$id.$affectedId.details.$supplierPartId.tsx
index 53e8c4a35c..ffa1ba3486 100644
--- a/apps/erp/app/routes/x+/items+/change-order+/$id.$affectedId.details.$supplierPartId.tsx
+++ b/apps/erp/app/routes/x+/items+/change-notice+/$id.$affectedId.details.$supplierPartId.tsx
@@ -2,7 +2,7 @@ import { requirePermissions } from "@carbon/auth/auth.server";
import type { LoaderFunctionArgs } from "react-router";
import { useLoaderData, useNavigate, useParams } from "react-router";
import { useRouteData } from "~/hooks";
-import type { AffectedItemDraft } from "~/modules/items/ui/ChangeOrder";
+import type { AffectedItemDraft } from "~/modules/items/ui/ChangeNotice";
import { SupplierPartForm } from "~/modules/items/ui/Item";
import { path } from "~/utils/path";
@@ -57,7 +57,7 @@ export async function loader({ request, params }: LoaderFunctionArgs) {
};
}
-export default function ChangeOrderEditSupplierPartRoute() {
+export default function ChangeNoticeEditSupplierPartRoute() {
const { id, affectedId } = useParams();
if (!id) throw new Error("Could not find id");
if (!affectedId) throw new Error("Could not find affectedId");
@@ -66,7 +66,7 @@ export default function ChangeOrderEditSupplierPartRoute() {
useLoaderData<typeof loader>();
const routeData = useRouteData<{ affectedItems: AffectedItemDraft[] }>(
- path.to.changeOrder(id)
+ path.to.changeNotice(id)
);
const affected =
routeData?.affectedItems.find((a) => a.affectedItem.id === affectedId) ??
@@ -74,7 +74,7 @@ export default function ChangeOrderEditSupplierPartRoute() {
const navigate = useNavigate();
const onClose = () =>
- navigate(path.to.changeOrderAffectedItem(id, affectedId));
+ navigate(path.to.changeNoticeAffectedItem(id, affectedId));
const initialValues = {
id: supplierPart.id,
diff --git a/apps/erp/app/routes/x+/items+/change-order+/$id.$affectedId.details.new.tsx b/apps/erp/app/routes/x+/items+/change-notice+/$id.$affectedId.details.new.tsx
similarity index 90%
rename from apps/erp/app/routes/x+/items+/change-order+/$id.$affectedId.details.new.tsx
rename to apps/erp/app/routes/x+/items+/change-notice+/$id.$affectedId.details.new.tsx
index c05f582fe0..b569efc5a4 100644
--- a/apps/erp/app/routes/x+/items+/change-order+/$id.$affectedId.details.new.tsx
+++ b/apps/erp/app/routes/x+/items+/change-notice+/$id.$affectedId.details.new.tsx
@@ -1,6 +1,6 @@
import { useNavigate, useParams } from "react-router";
import { useRouteData } from "~/hooks";
-import type { AffectedItemDraft } from "~/modules/items/ui/ChangeOrder";
+import type { AffectedItemDraft } from "~/modules/items/ui/ChangeNotice";
import { SupplierPartForm } from "~/modules/items/ui/Item";
import { path } from "~/utils/path";
@@ -10,13 +10,13 @@ import { path } from "~/utils/path";
// create action (path.to.newPartSupplier(draftItemId)), which returns
// { success } without redirecting, so the CO stays put and loader revalidation
// refreshes the grid in place.
-export default function ChangeOrderNewSupplierPartRoute() {
+export default function ChangeNoticeNewSupplierPartRoute() {
const { id, affectedId } = useParams();
if (!id) throw new Error("Could not find id");
if (!affectedId) throw new Error("Could not find affectedId");
const routeData = useRouteData<{ affectedItems: AffectedItemDraft[] }>(
- path.to.changeOrder(id)
+ path.to.changeNotice(id)
);
const affected =
routeData?.affectedItems.find((a) => a.affectedItem.id === affectedId) ??
@@ -24,7 +24,7 @@ export default function ChangeOrderNewSupplierPartRoute() {
const navigate = useNavigate();
const onClose = () =>
- navigate(path.to.changeOrderAffectedItem(id, affectedId));
+ navigate(path.to.changeNoticeAffectedItem(id, affectedId));
// The grid only renders (and links here) for Part-type lines with partData.
if (!affected?.partData) return null;
diff --git a/apps/erp/app/routes/x+/items+/change-order+/$id.$affectedId.details.tsx b/apps/erp/app/routes/x+/items+/change-notice+/$id.$affectedId.details.tsx
similarity index 53%
rename from apps/erp/app/routes/x+/items+/change-order+/$id.$affectedId.details.tsx
rename to apps/erp/app/routes/x+/items+/change-notice+/$id.$affectedId.details.tsx
index b1bbdb2c1d..3acac7d56e 100644
--- a/apps/erp/app/routes/x+/items+/change-order+/$id.$affectedId.details.tsx
+++ b/apps/erp/app/routes/x+/items+/change-notice+/$id.$affectedId.details.tsx
@@ -1,28 +1,29 @@
import { VStack } from "@carbon/react";
-import { Trans } from "@lingui/react/macro";
+import { Trans, useLingui } from "@lingui/react/macro";
import { useParams } from "react-router";
import { useRouteData } from "~/hooks";
-import type { ChangeOrder } from "~/modules/items";
-import { canEditChangeOrder } from "~/modules/items";
-import type { AffectedItemDraft } from "~/modules/items/ui/ChangeOrder";
-import AffectedItemDetail from "~/modules/items/ui/ChangeOrder/AffectedItemDetail";
+import type { ChangeNotice } from "~/modules/items";
+import { canEditChangeNoticeEngineering } from "~/modules/items";
+import type { AffectedItemDraft } from "~/modules/items/ui/ChangeNotice";
+import AffectedItemDetail from "~/modules/items/ui/ChangeNotice/AffectedItemDetail";
import { path } from "~/utils/path";
// The selected affected item's line detail, addressed by the URL (not client
// state) — mirrors the sales order line route `$orderId.$lineId.details`. Its
// data comes from the parent $id loader (useRouteData); the URL only decides
// which affected item to show, so refresh + back/forward reselect it.
-export default function ChangeOrderAffectedItemRoute() {
+export default function ChangeNoticeAffectedItemRoute() {
const { id, affectedId } = useParams();
+ const { t } = useLingui();
if (!id) throw new Error("Could not find id");
const routeData = useRouteData<{
- changeOrder: ChangeOrder;
+ changeNotice: ChangeNotice;
affectedItems: AffectedItemDraft[];
- }>(path.to.changeOrder(id));
+ }>(path.to.changeNotice(id));
- const changeOrder = routeData?.changeOrder;
- if (!changeOrder) throw new Error("Could not find change order data");
+ const changeNotice = routeData?.changeNotice;
+ if (!changeNotice) throw new Error("Could not find change notice data");
const affected =
routeData?.affectedItems.find((a) => a.affectedItem.id === affectedId) ??
@@ -36,7 +37,14 @@ export default function ChangeOrderAffectedItemRoute() {
);
}
- const isDisabled = !canEditChangeOrder(changeOrder.status);
+ const isDisabled = !canEditChangeNoticeEngineering(changeNotice.status);
+ // UI copy is kept separate from the server guard's flash text (same split as
+ // ReleaseLockAlert) — React macros can't run server-side, so this is the
+ // translated half of the same condition.
+ const disabledReason =
+ changeNotice.status === "Implementation"
+ ? t`This change notice is being implemented, so its changes are locked. Reopen it to edit.`
+ : t`This change notice is closed, so its changes are read-only.`;
return (
<VStack spacing={2} className="p-2">
@@ -45,6 +53,7 @@ export default function ChangeOrderAffectedItemRoute() {
changeOrderId={id}
affected={affected}
isDisabled={isDisabled}
+ disabledReason={disabledReason}
/>
</VStack>
);
diff --git a/apps/erp/app/routes/x+/items+/change-order+/$id._index.tsx b/apps/erp/app/routes/x+/items+/change-notice+/$id._index.tsx
similarity index 84%
rename from apps/erp/app/routes/x+/items+/change-order+/$id._index.tsx
rename to apps/erp/app/routes/x+/items+/change-notice+/$id._index.tsx
index 9b7c32d28e..57bd792417 100644
--- a/apps/erp/app/routes/x+/items+/change-order+/$id._index.tsx
+++ b/apps/erp/app/routes/x+/items+/change-notice+/$id._index.tsx
@@ -5,5 +5,5 @@ import { path } from "~/utils/path";
export async function loader({ params }: LoaderFunctionArgs) {
const { id } = params;
if (!id) throw new Error("Could not find id");
- throw redirect(path.to.changeOrderDetails(id));
+ throw redirect(path.to.changeNoticeDetails(id));
}
diff --git a/apps/erp/app/routes/x+/items+/change-order+/$id.action.$actionId.status.tsx b/apps/erp/app/routes/x+/items+/change-notice+/$id.action.$actionId.status.tsx
similarity index 53%
rename from apps/erp/app/routes/x+/items+/change-order+/$id.action.$actionId.status.tsx
rename to apps/erp/app/routes/x+/items+/change-notice+/$id.action.$actionId.status.tsx
index a10b1d7daa..b78dae5cc6 100644
--- a/apps/erp/app/routes/x+/items+/change-order+/$id.action.$actionId.status.tsx
+++ b/apps/erp/app/routes/x+/items+/change-notice+/$id.action.$actionId.status.tsx
@@ -5,20 +5,35 @@ import { validationError, validator } from "@carbon/form";
import type { ActionFunctionArgs } from "react-router";
import { data } from "react-router";
import {
- changeOrderActionStatusValidator,
- updateChangeOrderActionStatus
+ changeNoticeActionStatusValidator,
+ updateChangeNoticeActionStatus
} from "~/modules/items";
+import {
+ requireChangeNoticeChildRoute,
+ requireEditableChangeNoticeRoute
+} from "~/modules/items/items.server";
export async function action({ request, params }: ActionFunctionArgs) {
assertIsPost(request);
- const { client, userId } = await requirePermissions(request, {
+ const { client, companyId, userId } = await requirePermissions(request, {
update: "parts"
});
+ const changeNoticeId = params.id;
+ if (!changeNoticeId) throw new Error("Could not find id");
+
+ const locked = await requireEditableChangeNoticeRoute(request, {
+ client,
+ changeNoticeId,
+ companyId,
+ scope: "workflow"
+ });
+ if (locked) return locked;
+
const formData = await request.formData();
- const validation = await validator(changeOrderActionStatusValidator).validate(
- formData
- );
+ const validation = await validator(
+ changeNoticeActionStatusValidator
+ ).validate(formData);
if (validation.error) {
return validationError(validation.error);
@@ -32,7 +47,16 @@ export async function action({ request, params }: ActionFunctionArgs) {
);
}
- const update = await updateChangeOrderActionStatus(client, {
+ const owned = await requireChangeNoticeChildRoute(request, {
+ client,
+ table: "changeOrderActionTask",
+ id,
+ changeNoticeId,
+ companyId
+ });
+ if (owned) return owned;
+
+ const update = await updateChangeNoticeActionStatus(client, {
id,
status,
userId
diff --git a/apps/erp/app/routes/x+/items+/change-notice+/$id.action.delete.$actionId.tsx b/apps/erp/app/routes/x+/items+/change-notice+/$id.action.delete.$actionId.tsx
new file mode 100644
index 0000000000..b985685fde
--- /dev/null
+++ b/apps/erp/app/routes/x+/items+/change-notice+/$id.action.delete.$actionId.tsx
@@ -0,0 +1,48 @@
+import { assertIsPost, error } from "@carbon/auth";
+import { requirePermissions } from "@carbon/auth/auth.server";
+import { flash } from "@carbon/auth/session.server";
+import type { ActionFunctionArgs } from "react-router";
+import { data } from "react-router";
+import { deleteChangeNoticeAction } from "~/modules/items";
+import {
+ requireChangeNoticeChildRoute,
+ requireEditableChangeNoticeRoute
+} from "~/modules/items/items.server";
+
+export async function action({ request, params }: ActionFunctionArgs) {
+ assertIsPost(request);
+ const { client, companyId } = await requirePermissions(request, {
+ delete: "parts"
+ });
+
+ const { id: changeNoticeId, actionId } = params;
+ if (!changeNoticeId) throw new Error("Could not find id");
+ if (!actionId) throw new Error("Could not find actionId");
+ const locked = await requireEditableChangeNoticeRoute(request, {
+ client,
+ changeNoticeId,
+ companyId,
+ scope: "workflow"
+ });
+ if (locked) return locked;
+
+ const owned = await requireChangeNoticeChildRoute(request, {
+ client,
+ table: "changeOrderActionTask",
+ id: actionId,
+ changeNoticeId,
+ companyId
+ });
+ if (owned) return owned;
+
+ const remove = await deleteChangeNoticeAction(client, actionId);
+
+ if (remove.error) {
+ return data(
+ { success: false },
+ await flash(request, error(remove.error, "Failed to remove action"))
+ );
+ }
+
+ return { success: true };
+}
diff --git a/apps/erp/app/routes/x+/items+/change-order+/$id.action.order.tsx b/apps/erp/app/routes/x+/items+/change-notice+/$id.action.order.tsx
similarity index 58%
rename from apps/erp/app/routes/x+/items+/change-order+/$id.action.order.tsx
rename to apps/erp/app/routes/x+/items+/change-notice+/$id.action.order.tsx
index 53906b1262..ca3c495887 100644
--- a/apps/erp/app/routes/x+/items+/change-order+/$id.action.order.tsx
+++ b/apps/erp/app/routes/x+/items+/change-notice+/$id.action.order.tsx
@@ -3,15 +3,27 @@ import { requirePermissions } from "@carbon/auth/auth.server";
import { flash } from "@carbon/auth/session.server";
import type { ActionFunctionArgs } from "react-router";
import { data } from "react-router";
-import { updateChangeOrderActionOrder } from "~/modules/items";
+import { updateChangeNoticeActionOrder } from "~/modules/items";
+import { requireEditableChangeNoticeRoute } from "~/modules/items/items.server";
import { getDatabaseClient } from "~/services/database.server";
-export async function action({ request }: ActionFunctionArgs) {
+export async function action({ request, params }: ActionFunctionArgs) {
assertIsPost(request);
- const { userId } = await requirePermissions(request, {
+ const { client, companyId, userId } = await requirePermissions(request, {
update: "parts"
});
+ const changeNoticeId = params.id;
+ if (!changeNoticeId) throw new Error("Could not find id");
+
+ const locked = await requireEditableChangeNoticeRoute(request, {
+ client,
+ changeNoticeId,
+ companyId,
+ scope: "workflow"
+ });
+ if (locked) return locked;
+
const updateMap = (await request.formData()).get("updates") as string;
if (!updateMap) {
return data(
@@ -29,7 +41,11 @@ export async function action({ request }: ActionFunctionArgs) {
}));
try {
- await updateChangeOrderActionOrder(getDatabaseClient(), updates);
+ await updateChangeNoticeActionOrder(getDatabaseClient(), {
+ changeNoticeId,
+ companyId,
+ updates
+ });
} catch (err) {
return data(
{ success: false },
diff --git a/apps/erp/app/routes/x+/items+/change-order+/$id.action.tsx b/apps/erp/app/routes/x+/items+/change-notice+/$id.action.tsx
similarity index 68%
rename from apps/erp/app/routes/x+/items+/change-order+/$id.action.tsx
rename to apps/erp/app/routes/x+/items+/change-notice+/$id.action.tsx
index 0edd81af67..bcde763092 100644
--- a/apps/erp/app/routes/x+/items+/change-order+/$id.action.tsx
+++ b/apps/erp/app/routes/x+/items+/change-notice+/$id.action.tsx
@@ -3,9 +3,10 @@ import { requirePermissions } from "@carbon/auth/auth.server";
import { flash } from "@carbon/auth/session.server";
import type { ActionFunctionArgs } from "react-router";
import { data } from "react-router";
-import { setChangeOrderActionTasks } from "~/modules/items";
+import { setChangeNoticeActionTasks } from "~/modules/items";
+import { requireEditableChangeNoticeRoute } from "~/modules/items/items.server";
-// Reconcile a change order's action tasks to the set chosen in the sidebar's
+// Reconcile a change notice's action tasks to the set chosen in the sidebar's
// "Required Actions" multiselect (mirrors Quality's requiredActionIds field):
// selected templates are instantiated, deselected ones removed.
export async function action({ request, params }: ActionFunctionArgs) {
@@ -16,14 +17,21 @@ export async function action({ request, params }: ActionFunctionArgs) {
const { id } = params;
if (!id) throw new Error("id not found");
+ const locked = await requireEditableChangeNoticeRoute(request, {
+ client,
+ changeNoticeId: params.id,
+ companyId,
+ scope: "workflow"
+ });
+ if (locked) return locked;
const formData = await request.formData();
const requiredActionIds = String(formData.get("actionIds") ?? "")
.split(",")
.filter(Boolean);
- const result = await setChangeOrderActionTasks(client, {
- changeOrderId: id,
+ const result = await setChangeNoticeActionTasks(client, {
+ changeNoticeId: id,
requiredActionIds,
companyId,
userId
diff --git a/apps/erp/app/routes/x+/items+/change-order+/$id.affected.$affectedId.change-type.tsx b/apps/erp/app/routes/x+/items+/change-notice+/$id.affected.$affectedId.change-type.tsx
similarity index 60%
rename from apps/erp/app/routes/x+/items+/change-order+/$id.affected.$affectedId.change-type.tsx
rename to apps/erp/app/routes/x+/items+/change-notice+/$id.affected.$affectedId.change-type.tsx
index 9540919502..6365104612 100644
--- a/apps/erp/app/routes/x+/items+/change-order+/$id.affected.$affectedId.change-type.tsx
+++ b/apps/erp/app/routes/x+/items+/change-notice+/$id.affected.$affectedId.change-type.tsx
@@ -5,19 +5,34 @@ import { validationError, validator } from "@carbon/form";
import type { ActionFunctionArgs } from "react-router";
import { data } from "react-router";
import {
- changeOrderAffectedItemChangeTypeValidator,
- updateChangeOrderAffectedItemChangeType
+ changeNoticeAffectedItemChangeTypeValidator,
+ updateChangeNoticeAffectedItemChangeType
} from "~/modules/items";
+import {
+ requireChangeNoticeChildRoute,
+ requireEditableChangeNoticeRoute
+} from "~/modules/items/items.server";
-export async function action({ request }: ActionFunctionArgs) {
+export async function action({ request, params }: ActionFunctionArgs) {
assertIsPost(request);
const { client, companyId, userId } = await requirePermissions(request, {
update: "parts"
});
+ const changeNoticeId = params.id;
+ if (!changeNoticeId) throw new Error("Could not find id");
+
+ const locked = await requireEditableChangeNoticeRoute(request, {
+ client,
+ changeNoticeId,
+ companyId,
+ scope: "engineering"
+ });
+ if (locked) return locked;
+
const formData = await request.formData();
const validation = await validator(
- changeOrderAffectedItemChangeTypeValidator
+ changeNoticeAffectedItemChangeTypeValidator
).validate(formData);
if (validation.error) {
@@ -38,7 +53,16 @@ export async function action({ request }: ActionFunctionArgs) {
);
}
- const update = await updateChangeOrderAffectedItemChangeType(client, {
+ const owned = await requireChangeNoticeChildRoute(request, {
+ client,
+ table: "changeOrderAffectedItem",
+ id,
+ changeNoticeId,
+ companyId
+ });
+ if (owned) return owned;
+
+ const update = await updateChangeNoticeAffectedItemChangeType(client, {
id,
changeType,
companyId,
diff --git a/apps/erp/app/routes/x+/items+/change-order+/$id.affected.$affectedId.cutover.tsx b/apps/erp/app/routes/x+/items+/change-notice+/$id.affected.$affectedId.cutover.tsx
similarity index 52%
rename from apps/erp/app/routes/x+/items+/change-order+/$id.affected.$affectedId.cutover.tsx
rename to apps/erp/app/routes/x+/items+/change-notice+/$id.affected.$affectedId.cutover.tsx
index 7b229d0048..76bb7130bb 100644
--- a/apps/erp/app/routes/x+/items+/change-order+/$id.affected.$affectedId.cutover.tsx
+++ b/apps/erp/app/routes/x+/items+/change-notice+/$id.affected.$affectedId.cutover.tsx
@@ -5,19 +5,34 @@ import { validationError, validator } from "@carbon/form";
import type { ActionFunctionArgs } from "react-router";
import { data } from "react-router";
import {
- changeOrderAffectedItemCutoverValidator,
- updateChangeOrderAffectedItemCutover
+ changeNoticeAffectedItemCutoverValidator,
+ updateChangeNoticeAffectedItemCutover
} from "~/modules/items";
+import {
+ requireChangeNoticeChildRoute,
+ requireEditableChangeNoticeRoute
+} from "~/modules/items/items.server";
-export async function action({ request }: ActionFunctionArgs) {
+export async function action({ request, params }: ActionFunctionArgs) {
assertIsPost(request);
- const { client, userId } = await requirePermissions(request, {
+ const { client, companyId, userId } = await requirePermissions(request, {
update: "parts"
});
+ const changeNoticeId = params.id;
+ if (!changeNoticeId) throw new Error("Could not find id");
+
+ const locked = await requireEditableChangeNoticeRoute(request, {
+ client,
+ changeNoticeId,
+ companyId,
+ scope: "engineering"
+ });
+ if (locked) return locked;
+
const formData = await request.formData();
const validation = await validator(
- changeOrderAffectedItemCutoverValidator
+ changeNoticeAffectedItemCutoverValidator
).validate(formData);
if (validation.error) {
@@ -31,7 +46,16 @@ export async function action({ request }: ActionFunctionArgs) {
successorEffectivityDate
} = validation.data;
- const update = await updateChangeOrderAffectedItemCutover(client, {
+ const owned = await requireChangeNoticeChildRoute(request, {
+ client,
+ table: "changeOrderAffectedItem",
+ id,
+ changeNoticeId,
+ companyId
+ });
+ if (owned) return owned;
+
+ const update = await updateChangeNoticeAffectedItemCutover(client, {
id,
supersessionMode,
discontinuationDate,
diff --git a/apps/erp/app/routes/x+/items+/change-order+/$id.affected.delete.$affectedId.tsx b/apps/erp/app/routes/x+/items+/change-notice+/$id.affected.delete.$affectedId.tsx
similarity index 51%
rename from apps/erp/app/routes/x+/items+/change-order+/$id.affected.delete.$affectedId.tsx
rename to apps/erp/app/routes/x+/items+/change-notice+/$id.affected.delete.$affectedId.tsx
index d705a29ab0..8b910c0362 100644
--- a/apps/erp/app/routes/x+/items+/change-order+/$id.affected.delete.$affectedId.tsx
+++ b/apps/erp/app/routes/x+/items+/change-notice+/$id.affected.delete.$affectedId.tsx
@@ -3,7 +3,11 @@ import { requirePermissions } from "@carbon/auth/auth.server";
import { flash } from "@carbon/auth/session.server";
import type { ActionFunctionArgs } from "react-router";
import { data } from "react-router";
-import { removeChangeOrderAffectedItem } from "~/modules/items";
+import { removeChangeNoticeAffectedItem } from "~/modules/items";
+import {
+ requireChangeNoticeChildRoute,
+ requireEditableChangeNoticeRoute
+} from "~/modules/items/items.server";
export async function action({ request, params }: ActionFunctionArgs) {
assertIsPost(request);
@@ -11,10 +15,27 @@ export async function action({ request, params }: ActionFunctionArgs) {
delete: "parts"
});
- const { affectedId } = params;
+ const { id: changeNoticeId, affectedId } = params;
+ if (!changeNoticeId) throw new Error("Could not find id");
if (!affectedId) throw new Error("Could not find affectedId");
+ const locked = await requireEditableChangeNoticeRoute(request, {
+ client,
+ changeNoticeId,
+ companyId,
+ scope: "engineering"
+ });
+ if (locked) return locked;
+
+ const owned = await requireChangeNoticeChildRoute(request, {
+ client,
+ table: "changeOrderAffectedItem",
+ id: affectedId,
+ changeNoticeId,
+ companyId
+ });
+ if (owned) return owned;
- const remove = await removeChangeOrderAffectedItem(
+ const remove = await removeChangeNoticeAffectedItem(
client,
affectedId,
companyId
diff --git a/apps/erp/app/routes/x+/items+/change-order+/$id.affected.tsx b/apps/erp/app/routes/x+/items+/change-notice+/$id.affected.tsx
similarity index 61%
rename from apps/erp/app/routes/x+/items+/change-order+/$id.affected.tsx
rename to apps/erp/app/routes/x+/items+/change-notice+/$id.affected.tsx
index 8cf3ea52aa..07f094460b 100644
--- a/apps/erp/app/routes/x+/items+/change-order+/$id.affected.tsx
+++ b/apps/erp/app/routes/x+/items+/change-notice+/$id.affected.tsx
@@ -5,23 +5,34 @@ import { validationError, validator } from "@carbon/form";
import type { ActionFunctionArgs } from "react-router";
import { data } from "react-router";
import {
- addChangeOrderAffectedItem,
- changeOrderAffectedItemValidator,
- changeOrderNewPartValidator
+ addChangeNoticeAffectedItem,
+ changeNoticeAffectedItemValidator,
+ changeNoticeNewPartValidator
} from "~/modules/items";
+import { requireEditableChangeNoticeRoute } from "~/modules/items/items.server";
-export async function action({ request }: ActionFunctionArgs) {
+export async function action({ request, params }: ActionFunctionArgs) {
assertIsPost(request);
const { client, companyId, userId } = await requirePermissions(request, {
update: "parts"
});
+ const { id } = params;
+ if (!id) throw new Error("Could not find id");
+ const locked = await requireEditableChangeNoticeRoute(request, {
+ client,
+ changeNoticeId: params.id,
+ companyId,
+ scope: "engineering"
+ });
+ if (locked) return locked;
+
const formData = await request.formData();
// Net-new "New Part": no existing itemId — mint a brand-new Part/Tool and add
// it as a New Part affected item. The other change types add an existing item.
if (formData.get("changeType") === "New Part") {
- const validation = await validator(changeOrderNewPartValidator).validate(
+ const validation = await validator(changeNoticeNewPartValidator).validate(
formData
);
if (validation.error) {
@@ -34,8 +45,16 @@ export async function action({ request }: ActionFunctionArgs) {
replenishmentSystem,
itemTrackingType
} = validation.data;
- const add = await addChangeOrderAffectedItem(client, {
- changeOrderId,
+ // The lock guard above authorized the notice in the URL, so the write must
+ // target that same notice.
+ if (changeOrderId !== id) {
+ return data(
+ { success: false },
+ await flash(request, error(null, "Invalid change notice"))
+ );
+ }
+ const add = await addChangeNoticeAffectedItem(client, {
+ changeNoticeId: changeOrderId,
changeType: "New Part",
// A net-new affected item is always a Part.
newPart: {
@@ -60,9 +79,9 @@ export async function action({ request }: ActionFunctionArgs) {
return { success: true, id: add.data.id };
}
- const validation = await validator(changeOrderAffectedItemValidator).validate(
- formData
- );
+ const validation = await validator(
+ changeNoticeAffectedItemValidator
+ ).validate(formData);
if (validation.error) {
return validationError(validation.error);
@@ -70,8 +89,15 @@ export async function action({ request }: ActionFunctionArgs) {
const { changeOrderId, itemId, changeType, revision } = validation.data;
- const add = await addChangeOrderAffectedItem(client, {
- changeOrderId,
+ if (changeOrderId !== id) {
+ return data(
+ { success: false },
+ await flash(request, error(null, "Invalid change notice"))
+ );
+ }
+
+ const add = await addChangeNoticeAffectedItem(client, {
+ changeNoticeId: changeOrderId,
itemId,
changeType,
// Only a Revision change consumes an explicit revision label.
diff --git a/apps/erp/app/routes/x+/items+/change-notice+/$id.content.tsx b/apps/erp/app/routes/x+/items+/change-notice+/$id.content.tsx
new file mode 100644
index 0000000000..edefe89886
--- /dev/null
+++ b/apps/erp/app/routes/x+/items+/change-notice+/$id.content.tsx
@@ -0,0 +1,60 @@
+import { assertIsPost } from "@carbon/auth";
+import { requirePermissions } from "@carbon/auth/auth.server";
+import type { ActionFunctionArgs } from "react-router";
+import { updateChangeNotice } from "~/modules/items";
+import { requireEditableChangeNoticeRoute } from "~/modules/items/items.server";
+
+// The two rich-text header columns. They used to be written straight from the
+// browser via the supabase client, which left no server-side place to enforce
+// the engineering lock — hence this action.
+const CONTENT_FIELDS = ["reasonForChange", "description"] as const;
+
+type ContentField = (typeof CONTENT_FIELDS)[number];
+
+export async function action({ request, params }: ActionFunctionArgs) {
+ assertIsPost(request);
+ const { client, companyId, userId } = await requirePermissions(request, {
+ update: "parts"
+ });
+
+ const { id } = params;
+ if (!id) throw new Error("Could not find id");
+ const locked = await requireEditableChangeNoticeRoute(request, {
+ client,
+ changeNoticeId: params.id,
+ companyId,
+ scope: "engineering"
+ });
+ if (locked) return locked;
+
+ const formData = await request.formData();
+ const field = formData.get("field");
+ const content = formData.get("content");
+
+ if (
+ typeof field !== "string" ||
+ !CONTENT_FIELDS.includes(field as ContentField) ||
+ typeof content !== "string"
+ ) {
+ return { error: { message: "Invalid form data" }, data: null };
+ }
+
+ let parsed: unknown;
+ try {
+ parsed = JSON.parse(content);
+ } catch {
+ return { error: { message: "Invalid content" }, data: null };
+ }
+
+ const result = await updateChangeNotice(client, {
+ id,
+ [field]: parsed,
+ updatedBy: userId
+ });
+
+ if (result.error) {
+ return { error: { message: "Failed to update change notice" }, data: null };
+ }
+
+ return { error: null, data: result.data };
+}
diff --git a/apps/erp/app/routes/x+/items+/change-order+/$id.details.tsx b/apps/erp/app/routes/x+/items+/change-notice+/$id.details.tsx
similarity index 56%
rename from apps/erp/app/routes/x+/items+/change-order+/$id.details.tsx
rename to apps/erp/app/routes/x+/items+/change-notice+/$id.details.tsx
index 80228743e9..6eef4c8a91 100644
--- a/apps/erp/app/routes/x+/items+/change-order+/$id.details.tsx
+++ b/apps/erp/app/routes/x+/items+/change-notice+/$id.details.tsx
@@ -2,15 +2,18 @@ import type { JSONContent } from "@carbon/react";
import { VStack } from "@carbon/react";
import { useParams } from "react-router";
import { useRouteData } from "~/hooks";
-import type { ChangeOrder, ChangeOrderActionTask } from "~/modules/items";
-import { canEditChangeOrder } from "~/modules/items";
-import type { AffectedItemDraft } from "~/modules/items/ui/ChangeOrder";
+import type { ChangeNotice, ChangeNoticeActionTask } from "~/modules/items";
import {
- ChangeOrderActions,
- ChangeOrderChanges,
- ChangeOrderContent
-} from "~/modules/items/ui/ChangeOrder";
-import ChangeOrderStatusFlow from "~/modules/items/ui/ChangeOrder/ChangeOrderStatusFlow";
+ canEditChangeNoticeEngineering,
+ canEditChangeNoticeWorkflow
+} from "~/modules/items";
+import type { AffectedItemDraft } from "~/modules/items/ui/ChangeNotice";
+import {
+ ChangeNoticeActions,
+ ChangeNoticeChanges,
+ ChangeNoticeContent
+} from "~/modules/items/ui/ChangeNotice";
+import ChangeNoticeStatusFlow from "~/modules/items/ui/ChangeNotice/ChangeNoticeStatusFlow";
import { path } from "~/utils/path";
// Top-level change-order detail (the CO overview) — mirrors the sales order
@@ -20,20 +23,22 @@ import { path } from "~/utils/path";
// item's authoring diff), and the action tasks (with the shared "Add Actions"
// picker). Affected items live in their own line routes (`$id.$affectedId.details`),
// linked from the explorer.
-export default function ChangeOrderDetailsRoute() {
+export default function ChangeNoticeDetailsRoute() {
const { id } = useParams();
if (!id) throw new Error("Could not find id");
const routeData = useRouteData<{
- changeOrder: ChangeOrder;
- actions: ChangeOrderActionTask[];
+ changeNotice: ChangeNotice;
+ actions: ChangeNoticeActionTask[];
affectedItems: AffectedItemDraft[];
- }>(path.to.changeOrder(id));
- const changeOrder = routeData?.changeOrder;
+ }>(path.to.changeNotice(id));
+ const changeNotice = routeData?.changeNotice;
- if (!changeOrder) throw new Error("Could not find change order data");
+ if (!changeNotice) throw new Error("Could not find change notice data");
- const isDisabled = !canEditChangeOrder(changeOrder.status);
+ const isDisabled = !canEditChangeNoticeEngineering(changeNotice.status);
+ // Action tasks are workflow content — executing them is what Implementation is for.
+ const isWorkflowDisabled = !canEditChangeNoticeWorkflow(changeNotice.status);
// Same shape the release dialog reviews (label + per-item diff), plus the
// change type + draft version for the badge in the Changes rollup.
@@ -48,18 +53,18 @@ export default function ChangeOrderDetailsRoute() {
return (
<VStack spacing={2} className="p-2">
- <ChangeOrderStatusFlow status={changeOrder.status} />
- <ChangeOrderChanges changes={changes} />
- <ChangeOrderContent
+ <ChangeNoticeStatusFlow status={changeNotice.status} />
+ <ChangeNoticeChanges changes={changes} />
+ <ChangeNoticeContent
id={id}
- reasonForChange={changeOrder.reasonForChange as JSONContent}
- description={changeOrder.description as JSONContent}
+ reasonForChange={changeNotice.reasonForChange as JSONContent}
+ description={changeNotice.description as JSONContent}
isDisabled={isDisabled}
/>
- <ChangeOrderActions
+ <ChangeNoticeActions
changeOrderId={id}
actions={routeData?.actions ?? []}
- isDisabled={isDisabled}
+ isDisabled={isWorkflowDisabled}
/>
</VStack>
);
diff --git a/apps/erp/app/routes/x+/items+/change-order+/$id.status.tsx b/apps/erp/app/routes/x+/items+/change-notice+/$id.status.tsx
similarity index 63%
rename from apps/erp/app/routes/x+/items+/change-order+/$id.status.tsx
rename to apps/erp/app/routes/x+/items+/change-notice+/$id.status.tsx
index 24fed3fac2..5c04903fab 100644
--- a/apps/erp/app/routes/x+/items+/change-order+/$id.status.tsx
+++ b/apps/erp/app/routes/x+/items+/change-notice+/$id.status.tsx
@@ -5,14 +5,14 @@ import { validationError, validator } from "@carbon/form";
import type { ActionFunctionArgs } from "react-router";
import { redirect } from "react-router";
import {
- changeOrderBroadcastStages,
- changeOrderStatusValidator,
- updateChangeOrderStatus
+ changeNoticeBroadcastStages,
+ changeNoticeStatusValidator,
+ updateChangeNoticeStatus
} from "~/modules/items";
import {
- applyChangeOrder,
- changeOrderStageEvent,
- notifyChangeOrderTransition
+ applyChangeNotice,
+ changeNoticeStageEvent,
+ notifyChangeNoticeTransition
} from "~/modules/items/items.server";
import { getDatabaseClient } from "~/services/database.server";
import { path, requestReferrer } from "~/utils/path";
@@ -27,7 +27,7 @@ export async function action({ request, params }: ActionFunctionArgs) {
if (!id) throw new Error("Could not find id");
const formData = await request.formData();
- const validation = await validator(changeOrderStatusValidator).validate(
+ const validation = await validator(changeNoticeStatusValidator).validate(
formData
);
@@ -37,26 +37,26 @@ export async function action({ request, params }: ActionFunctionArgs) {
const { fromStatus, status: toStatus, assignee } = validation.data;
- // Implementation → Done IS the apply: applyChangeOrder activates each affected
+ // Implementation → Done IS the apply: applyChangeNotice activates each affected
// item's CO-owned Draft make method and performs the final CAS flip to Done
// (G1/G2). All other transitions go through the plain guarded status writer.
if (toStatus === "Done") {
- const applied = await applyChangeOrder(client, getDatabaseClient(), {
- changeOrderId: id,
+ const applied = await applyChangeNotice(client, getDatabaseClient(), {
+ changeNoticeId: id,
userId,
companyId
});
if (applied.error || !applied.data) {
throw redirect(
- requestReferrer(request) ?? path.to.changeOrderDetails(id),
+ requestReferrer(request) ?? path.to.changeNoticeDetails(id),
await flash(
request,
- error(applied.error, "Failed to apply change order")
+ error(applied.error, "Failed to apply change notice")
)
);
}
} else {
- const update = await updateChangeOrderStatus(client, {
+ const update = await updateChangeNoticeStatus(client, {
id,
companyId,
fromStatus,
@@ -67,10 +67,10 @@ export async function action({ request, params }: ActionFunctionArgs) {
if (update.error || !update.data) {
throw redirect(
- requestReferrer(request) ?? path.to.changeOrderDetails(id),
+ requestReferrer(request) ?? path.to.changeNoticeDetails(id),
await flash(
request,
- error(update.error, "Failed to update change order status")
+ error(update.error, "Failed to update change notice status")
)
);
}
@@ -78,18 +78,18 @@ export async function action({ request, params }: ActionFunctionArgs) {
// Broadcast to the company team only on the stages that broadcast on entry
// (Start / Implementation / Done). Best-effort; never blocks the redirect.
- if (changeOrderBroadcastStages.includes(toStatus)) {
- await notifyChangeOrderTransition({
+ if (changeNoticeBroadcastStages.includes(toStatus)) {
+ await notifyChangeNoticeTransition({
client,
- event: changeOrderStageEvent[toStatus],
- changeOrderId: id,
+ event: changeNoticeStageEvent[toStatus],
+ changeNoticeId: id,
companyId,
userId
});
}
throw redirect(
- requestReferrer(request) ?? path.to.changeOrderDetails(id),
- await flash(request, success("Updated change order status"))
+ requestReferrer(request) ?? path.to.changeNoticeDetails(id),
+ await flash(request, success("Updated change notice status"))
);
}
diff --git a/apps/erp/app/routes/x+/items+/change-order+/$id.tsx b/apps/erp/app/routes/x+/items+/change-notice+/$id.tsx
similarity index 88%
rename from apps/erp/app/routes/x+/items+/change-order+/$id.tsx
rename to apps/erp/app/routes/x+/items+/change-notice+/$id.tsx
index f8a319b3e8..2e1ef9138c 100644
--- a/apps/erp/app/routes/x+/items+/change-order+/$id.tsx
+++ b/apps/erp/app/routes/x+/items+/change-notice+/$id.tsx
@@ -7,12 +7,12 @@ import type { LoaderFunctionArgs } from "react-router";
import { Outlet, redirect, useLoaderData, useParams } from "react-router";
import { PanelProvider, ResizablePanels } from "~/components/Layout/Panels";
import {
- getChangeOrder,
- getChangeOrderActions,
- getChangeOrderAffectedItems,
- getChangeOrderDiff,
- getChangeOrderRequiredActionsList,
- getChangeOrderTypesList,
+ getChangeNotice,
+ getChangeNoticeActions,
+ getChangeNoticeAffectedItems,
+ getChangeNoticeDiff,
+ getChangeNoticeRequiredActionsList,
+ getChangeNoticeTypesList,
getConfigurationParameters,
getConfigurationRules,
getItemFiles,
@@ -27,12 +27,12 @@ import {
getSupplierParts
} from "~/modules/items";
import { getRevisionLock } from "~/modules/items/items.server";
-import type { AffectedItemDraft } from "~/modules/items/ui/ChangeOrder";
+import type { AffectedItemDraft } from "~/modules/items/ui/ChangeNotice";
import {
- ChangeOrderExplorer,
- ChangeOrderHeader,
- ChangeOrderProperties
-} from "~/modules/items/ui/ChangeOrder";
+ ChangeNoticeExplorer,
+ ChangeNoticeHeader,
+ ChangeNoticeProperties
+} from "~/modules/items/ui/ChangeNotice";
import { getIssue, getIssues } from "~/modules/quality";
import { getLocationsList } from "~/modules/resources";
import type { MethodItemType, MethodType } from "~/modules/shared";
@@ -42,11 +42,11 @@ import { path } from "~/utils/path";
export const handle: Handle = {
// Leaf crumb: show the CO's readable number (from loader data), not a second
- // static "Change Orders" (the parent _layout already renders the list crumb).
+ // static "Change Notices" (the parent _layout already renders the list crumb).
breadcrumb: (
_params: unknown,
- data?: { changeOrder?: { changeOrderId?: string } }
- ) => data?.changeOrder?.changeOrderId ?? msg`Change Order`,
+ data?: { changeNotice?: { changeOrderId?: string } }
+ ) => data?.changeNotice?.changeOrderId ?? msg`Change Notice`,
module: "parts",
// The CO detail workspace has its own left affected-items sidebar — hide the
// Items module sidebar here so two left sidebars don't stack.
@@ -61,13 +61,13 @@ export async function loader({ request, params }: LoaderFunctionArgs) {
const { id } = params;
if (!id) throw new Error("Could not find id");
- const [changeOrder, types, affected, diff, actions, nonConformances] =
+ const [changeNotice, types, affected, diff, actions, nonConformances] =
await Promise.all([
- getChangeOrder(client, id, companyId),
- getChangeOrderTypesList(client, companyId),
- getChangeOrderAffectedItems(client, id, companyId),
- getChangeOrderDiff(client, id, companyId),
- getChangeOrderActions(client, id, companyId),
+ getChangeNotice(client, id, companyId),
+ getChangeNoticeTypesList(client, companyId),
+ getChangeNoticeAffectedItems(client, id, companyId),
+ getChangeNoticeDiff(client, id, companyId),
+ getChangeNoticeActions(client, id, companyId),
// NCR cross-link picker options (4a).
getIssues(client, companyId)
]);
@@ -77,21 +77,21 @@ export async function loader({ request, params }: LoaderFunctionArgs) {
// Active default-action templates for the "Add Actions" picker.
const requiredActions =
- (await getChangeOrderRequiredActionsList(client, companyId)).data ?? [];
+ (await getChangeNoticeRequiredActionsList(client, companyId)).data ?? [];
- if (changeOrder.error) {
+ if (changeNotice.error) {
throw redirect(
- path.to.changeOrders,
+ path.to.changeNotices,
await flash(
request,
- error(changeOrder.error, "Failed to load change order")
+ error(changeNotice.error, "Failed to load change notice")
)
);
}
// Human label for the currently-linked NCR (so the sidebar link shows the
// readable id/name, not the raw id).
- const linkedNonConformanceId = changeOrder.data?.nonConformanceId ?? null;
+ const linkedNonConformanceId = changeNotice.data?.nonConformanceId ?? null;
const linkedNonConformance = linkedNonConformanceId
? (await getIssue(client, linkedNonConformanceId)).data
: null;
@@ -268,7 +268,7 @@ export async function loader({ request, params }: LoaderFunctionArgs) {
);
return {
- changeOrder: changeOrder.data,
+ changeNotice: changeNotice.data,
types: types.data ?? [],
affectedItems,
diff: diff.data ?? { items: [] },
@@ -286,7 +286,7 @@ export async function loader({ request, params }: LoaderFunctionArgs) {
};
}
-export default function ChangeOrderIdRoute() {
+export default function ChangeNoticeIdRoute() {
const { id } = useParams();
if (!id) throw new Error("Could not find id");
// Surfaced to child routes + header/explorer/properties via useRouteData.
@@ -300,17 +300,17 @@ export default function ChangeOrderIdRoute() {
// actions, impact, and the release dialog.
<PanelProvider>
<div className="flex flex-col h-[calc(100dvh-49px)] overflow-hidden w-full">
- <ChangeOrderHeader />
+ <ChangeNoticeHeader />
<div className="flex h-[calc(100dvh-99px)] overflow-hidden w-full">
<div className="flex flex-grow overflow-hidden">
<ResizablePanels
- explorer={<ChangeOrderExplorer />}
+ explorer={<ChangeNoticeExplorer />}
content={
<div className="h-[calc(100dvh-99px)] overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent w-full">
<Outlet />
</div>
}
- properties={<ChangeOrderProperties key={id} />}
+ properties={<ChangeNoticeProperties key={id} />}
/>
</div>
</div>
diff --git a/apps/erp/app/routes/x+/items+/change-orders+/_layout.tsx b/apps/erp/app/routes/x+/items+/change-notice+/_layout.tsx
similarity index 68%
rename from apps/erp/app/routes/x+/items+/change-orders+/_layout.tsx
rename to apps/erp/app/routes/x+/items+/change-notice+/_layout.tsx
index 4a7ceff7a8..bd63eb8bd7 100644
--- a/apps/erp/app/routes/x+/items+/change-orders+/_layout.tsx
+++ b/apps/erp/app/routes/x+/items+/change-notice+/_layout.tsx
@@ -5,15 +5,15 @@ import type { Handle } from "~/utils/handle";
import { path } from "~/utils/path";
export const meta: MetaFunction = () => {
- return [{ title: "Carbon | Change Orders" }];
+ return [{ title: "Carbon | Change Notice" }];
};
export const handle: Handle = {
- breadcrumb: msg`Change Orders`,
- to: path.to.changeOrders,
+ breadcrumb: msg`Change Notices`,
+ to: path.to.changeNotices,
module: "items"
};
-export default function ChangeOrdersRoute() {
+export default function ChangeNoticeRoute() {
return <Outlet />;
}
diff --git a/apps/erp/app/routes/x+/items+/change-order+/delete.$id.tsx b/apps/erp/app/routes/x+/items+/change-notice+/delete.$id.tsx
similarity index 70%
rename from apps/erp/app/routes/x+/items+/change-order+/delete.$id.tsx
rename to apps/erp/app/routes/x+/items+/change-notice+/delete.$id.tsx
index 4c1333215c..3346a528fc 100644
--- a/apps/erp/app/routes/x+/items+/change-order+/delete.$id.tsx
+++ b/apps/erp/app/routes/x+/items+/change-notice+/delete.$id.tsx
@@ -3,7 +3,7 @@ import { requirePermissions } from "@carbon/auth/auth.server";
import { flash } from "@carbon/auth/session.server";
import type { ActionFunctionArgs } from "react-router";
import { data, redirect } from "react-router";
-import { deleteChangeOrder } from "~/modules/items";
+import { deleteChangeNotice } from "~/modules/items";
import { path } from "~/utils/path";
export async function action({ request, params }: ActionFunctionArgs) {
@@ -14,19 +14,19 @@ export async function action({ request, params }: ActionFunctionArgs) {
const { id } = params;
if (!id) throw new Error("id is not found");
- const mutation = await deleteChangeOrder(client, id, companyId);
+ const mutation = await deleteChangeNotice(client, id, companyId);
if (mutation.error) {
return data(
{ success: false },
await flash(
request,
- error(mutation.error, "Failed to delete change order")
+ error(mutation.error, "Failed to delete change notice")
)
);
}
throw redirect(
- path.to.changeOrders,
- await flash(request, success("Successfully deleted change order"))
+ path.to.changeNotices,
+ await flash(request, success("Successfully deleted change notice"))
);
}
diff --git a/apps/erp/app/routes/x+/items+/change-order+/new-from-item.$itemId.tsx b/apps/erp/app/routes/x+/items+/change-notice+/new-from-item.$itemId.tsx
similarity index 71%
rename from apps/erp/app/routes/x+/items+/change-order+/new-from-item.$itemId.tsx
rename to apps/erp/app/routes/x+/items+/change-notice+/new-from-item.$itemId.tsx
index 4b1ff14660..d0e6fc7674 100644
--- a/apps/erp/app/routes/x+/items+/change-order+/new-from-item.$itemId.tsx
+++ b/apps/erp/app/routes/x+/items+/change-notice+/new-from-item.$itemId.tsx
@@ -5,15 +5,15 @@ import { getLocalTimeZone, today } from "@internationalized/date";
import type { ActionFunctionArgs } from "react-router";
import { redirect } from "react-router";
import {
- addChangeOrderAffectedItem,
- type ChangeOrderChangeType,
- changeOrderChangeTypes,
+ addChangeNoticeAffectedItem,
+ type ChangeNoticeChangeType,
+ changeNoticeChangeTypes,
getItem,
- insertChangeOrder
+ insertChangeNotice
} from "~/modules/items";
import { path, requestReferrer } from "~/utils/path";
-// One-click "Create Change Order" for a part/tool: mint a CO and attach the item
+// One-click "Create Change Notice" for a part/tool: mint a CO and attach the item
// as its first affected item, then open the CO. Change-order creation lives only
// here (and new.tsx) — this route is the single home for the create+attach flow,
// so no CO logic leaks into the revision/part routes that link to it.
@@ -21,7 +21,7 @@ import { path, requestReferrer } from "~/utils/path";
// The optional `changeType` + `revision` POST fields let callers request a
// specific kind of change (the new-revision modal posts `Revision` plus the
// typed revision label); with no body it defaults to a `Version` change (the
-// parts-table "Create Change Order" action).
+// parts-table "Create Change Notice" action).
export async function action({ request, params }: ActionFunctionArgs) {
assertIsPost(request);
const { client, companyId, userId } = await requirePermissions(request, {
@@ -33,10 +33,10 @@ export async function action({ request, params }: ActionFunctionArgs) {
const formData = await request.formData();
const changeTypeRaw = formData.get("changeType");
- const changeType: ChangeOrderChangeType = changeOrderChangeTypes.includes(
- changeTypeRaw as ChangeOrderChangeType
+ const changeType: ChangeNoticeChangeType = changeNoticeChangeTypes.includes(
+ changeTypeRaw as ChangeNoticeChangeType
)
- ? (changeTypeRaw as ChangeOrderChangeType)
+ ? (changeTypeRaw as ChangeNoticeChangeType)
: "Version";
const revisionRaw = formData.get("revision");
const revision =
@@ -44,13 +44,13 @@ export async function action({ request, params }: ActionFunctionArgs) {
? revisionRaw.trim()
: undefined;
- const backTo = requestReferrer(request) ?? path.to.changeOrders;
+ const backTo = requestReferrer(request) ?? path.to.changeNotices;
const item = await getItem(client, itemId);
const label =
item.data?.readableIdWithRevision ?? item.data?.readableId ?? itemId;
- const co = await insertChangeOrder(client, {
+ const co = await insertChangeNotice(client, {
companyId,
createdBy: userId,
name: `Change for ${label}`,
@@ -59,12 +59,12 @@ export async function action({ request, params }: ActionFunctionArgs) {
if (co.error || !co.data) {
throw redirect(
backTo,
- await flash(request, error(co.error, "Failed to create change order"))
+ await flash(request, error(co.error, "Failed to create change notice"))
);
}
- const add = await addChangeOrderAffectedItem(client, {
- changeOrderId: co.data.id,
+ const add = await addChangeNoticeAffectedItem(client, {
+ changeNoticeId: co.data.id,
itemId,
changeType,
revision,
@@ -73,19 +73,19 @@ export async function action({ request, params }: ActionFunctionArgs) {
});
if (add.error) {
throw redirect(
- path.to.changeOrder(co.data.id),
+ path.to.changeNotice(co.data.id),
await flash(
request,
error(
add.error,
- "Change order created, but the item could not be added"
+ "Change notice created, but the item could not be added"
)
)
);
}
throw redirect(
- path.to.changeOrder(co.data.id),
- await flash(request, success("Change order created"))
+ path.to.changeNotice(co.data.id),
+ await flash(request, success("Change notice created"))
);
}
diff --git a/apps/erp/app/routes/x+/items+/change-order+/update.tsx b/apps/erp/app/routes/x+/items+/change-notice+/update.tsx
similarity index 69%
rename from apps/erp/app/routes/x+/items+/change-order+/update.tsx
rename to apps/erp/app/routes/x+/items+/change-notice+/update.tsx
index 5d47369ba0..2ae541362b 100644
--- a/apps/erp/app/routes/x+/items+/change-order+/update.tsx
+++ b/apps/erp/app/routes/x+/items+/change-notice+/update.tsx
@@ -1,11 +1,11 @@
import { requirePermissions } from "@carbon/auth/auth.server";
import type { ActionFunctionArgs } from "react-router";
-import { isChangeOrderLocked, updateChangeOrder } from "~/modules/items";
+import { isChangeNoticeLocked, updateChangeNotice } from "~/modules/items";
-// Inline field editor used by ChangeOrderProperties (and future inline editors).
+// Inline field editor used by ChangeNoticeProperties (and future inline editors).
// The fetcher posts { id, field, value }; only a curated set of header fields is
// writable here. Rich-text (reasonForChange/description) is written directly by
-// ChangeOrderContent via the supabase client, so it is not handled here.
+// ChangeNoticeContent via the supabase client, so it is not handled here.
const EDITABLE_FIELDS = [
"name",
"changeOrderTypeId",
@@ -29,7 +29,7 @@ export async function action({ request }: ActionFunctionArgs) {
const value = formData.get("value");
if (typeof id !== "string" || !id) {
- return { error: { message: "Invalid change order id" }, data: null };
+ return { error: { message: "Invalid change notice id" }, data: null };
}
if (
typeof field !== "string" ||
@@ -38,7 +38,7 @@ export async function action({ request }: ActionFunctionArgs) {
return { error: { message: `Invalid field: ${field}` }, data: null };
}
- // Locked guard — Done change orders are read-only.
+ // Locked guard — Done change notices are read-only.
const existing = await client
.from("changeOrder")
.select("status")
@@ -46,23 +46,23 @@ export async function action({ request }: ActionFunctionArgs) {
.eq("companyId", companyId)
.single();
- if (isChangeOrderLocked(existing.data?.status)) {
+ if (isChangeNoticeLocked(existing.data?.status)) {
return {
- error: { message: "Cannot modify a completed change order." },
+ error: { message: "Cannot modify a completed change notice." },
data: null
};
}
const normalized = typeof value === "string" && value !== "" ? value : null;
- const result = await updateChangeOrder(client, {
+ const result = await updateChangeNotice(client, {
id,
[field]: normalized,
updatedBy: userId
});
if (result.error) {
- return { error: { message: "Failed to update change order" }, data: null };
+ return { error: { message: "Failed to update change notice" }, data: null };
}
return { error: null, data: result.data };
diff --git a/apps/erp/app/routes/x+/items+/change-order-actions.$id.tsx b/apps/erp/app/routes/x+/items+/change-notice-actions.$id.tsx
similarity index 68%
rename from apps/erp/app/routes/x+/items+/change-order-actions.$id.tsx
rename to apps/erp/app/routes/x+/items+/change-notice-actions.$id.tsx
index 55b3a8804d..cdf8d7af4c 100644
--- a/apps/erp/app/routes/x+/items+/change-order-actions.$id.tsx
+++ b/apps/erp/app/routes/x+/items+/change-notice-actions.$id.tsx
@@ -5,15 +5,15 @@ import { validationError, validator } from "@carbon/form";
import type { ActionFunctionArgs, LoaderFunctionArgs } from "react-router";
import { data, redirect, useLoaderData, useNavigate } from "react-router";
import {
- changeOrderRequiredActionValidator,
- getChangeOrderRequiredAction,
- upsertChangeOrderRequiredAction
+ changeNoticeRequiredActionValidator,
+ getChangeNoticeRequiredAction,
+ upsertChangeNoticeRequiredAction
} from "~/modules/items";
-import { ChangeOrderRequiredActionForm } from "~/modules/items/ui/ChangeOrderActions";
+import { ChangeNoticeRequiredActionForm } from "~/modules/items/ui/ChangeNoticeActions";
import { path } from "~/utils/path";
export async function loader({ request, params }: LoaderFunctionArgs) {
- const { client } = await requirePermissions(request, {
+ const { client, companyId } = await requirePermissions(request, {
view: "parts",
role: "employee"
});
@@ -21,14 +21,18 @@ export async function loader({ request, params }: LoaderFunctionArgs) {
const { id } = params;
if (!id) throw notFound("id not found");
- const requiredAction = await getChangeOrderRequiredAction(client, id);
+ const requiredAction = await getChangeNoticeRequiredAction(
+ client,
+ id,
+ companyId
+ );
if (requiredAction.error) {
throw redirect(
- path.to.changeOrderRequiredActions,
+ path.to.changeNoticeRequiredActions,
await flash(
request,
- error(requiredAction.error, "Failed to get change order action")
+ error(requiredAction.error, "Failed to get change notice action")
)
);
}
@@ -46,7 +50,7 @@ export async function action({ request }: ActionFunctionArgs) {
const formData = await request.formData();
const validation = await validator(
- changeOrderRequiredActionValidator
+ changeNoticeRequiredActionValidator
).validate(formData);
if (validation.error) {
@@ -56,7 +60,7 @@ export async function action({ request }: ActionFunctionArgs) {
const { id, ...d } = validation.data;
if (!id) throw new Error("id not found");
- const update = await upsertChangeOrderRequiredAction(client, {
+ const update = await upsertChangeNoticeRequiredAction(client, {
id,
name: d.name,
active: d.active,
@@ -69,18 +73,18 @@ export async function action({ request }: ActionFunctionArgs) {
{},
await flash(
request,
- error(update.error, "Failed to update change order action")
+ error(update.error, "Failed to update change notice action")
)
);
}
throw redirect(
- path.to.changeOrderRequiredActions,
- await flash(request, success("Updated change order action"))
+ path.to.changeNoticeRequiredActions,
+ await flash(request, success("Updated change notice action"))
);
}
-export default function EditChangeOrderRequiredActionRoute() {
+export default function EditChangeNoticeRequiredActionRoute() {
const { requiredAction } = useLoaderData<typeof loader>();
const navigate = useNavigate();
@@ -91,7 +95,7 @@ export default function EditChangeOrderRequiredActionRoute() {
};
return (
- <ChangeOrderRequiredActionForm
+ <ChangeNoticeRequiredActionForm
key={initialValues.id}
initialValues={initialValues}
onClose={() => navigate(-1)}
diff --git a/apps/erp/app/routes/x+/items+/change-order-actions.delete.$id.tsx b/apps/erp/app/routes/x+/items+/change-notice-actions.delete.$id.tsx
similarity index 54%
rename from apps/erp/app/routes/x+/items+/change-order-actions.delete.$id.tsx
rename to apps/erp/app/routes/x+/items+/change-notice-actions.delete.$id.tsx
index 63004ac8be..b21a2a16d5 100644
--- a/apps/erp/app/routes/x+/items+/change-order-actions.delete.$id.tsx
+++ b/apps/erp/app/routes/x+/items+/change-notice-actions.delete.$id.tsx
@@ -6,26 +6,30 @@ import type { ActionFunctionArgs, LoaderFunctionArgs } from "react-router";
import { redirect, useLoaderData, useNavigate, useParams } from "react-router";
import { ConfirmDelete } from "~/components/Modals";
import {
- deleteChangeOrderRequiredAction,
- getChangeOrderRequiredAction
+ deleteChangeNoticeRequiredAction,
+ getChangeNoticeRequiredAction
} from "~/modules/items";
import { getParams, path } from "~/utils/path";
export async function loader({ request, params }: LoaderFunctionArgs) {
- const { client } = await requirePermissions(request, {
+ const { client, companyId } = await requirePermissions(request, {
view: "parts",
role: "employee"
});
const { id } = params;
if (!id) throw notFound("id not found");
- const requiredAction = await getChangeOrderRequiredAction(client, id);
+ const requiredAction = await getChangeNoticeRequiredAction(
+ client,
+ id,
+ companyId
+ );
if (requiredAction.error) {
throw redirect(
- `${path.to.changeOrderRequiredActions}?${getParams(request)}`,
+ `${path.to.changeNoticeRequiredActions}?${getParams(request)}`,
await flash(
request,
- error(requiredAction.error, "Failed to get change order action")
+ error(requiredAction.error, "Failed to get change notice action")
)
);
}
@@ -34,42 +38,43 @@ export async function loader({ request, params }: LoaderFunctionArgs) {
}
export async function action({ request, params }: ActionFunctionArgs) {
- const { client } = await requirePermissions(request, {
+ const { client, companyId } = await requirePermissions(request, {
delete: "parts"
});
const { id } = params;
if (!id) {
throw redirect(
- `${path.to.changeOrderRequiredActions}?${getParams(request)}`,
+ `${path.to.changeNoticeRequiredActions}?${getParams(request)}`,
await flash(
request,
- error(params, "Failed to get a change order action id")
+ error(params, "Failed to get a change notice action id")
)
);
}
- const { error: deleteError } = await deleteChangeOrderRequiredAction(
+ const { error: deleteError } = await deleteChangeNoticeRequiredAction(
client,
- id
+ id,
+ companyId
);
if (deleteError) {
throw redirect(
- `${path.to.changeOrderRequiredActions}?${getParams(request)}`,
+ `${path.to.changeNoticeRequiredActions}?${getParams(request)}`,
await flash(
request,
- error(deleteError, "Failed to delete change order action")
+ error(deleteError, "Failed to delete change notice action")
)
);
}
throw redirect(
- `${path.to.changeOrderRequiredActions}?${getParams(request)}`,
- await flash(request, success("Successfully deleted change order action"))
+ `${path.to.changeNoticeRequiredActions}?${getParams(request)}`,
+ await flash(request, success("Successfully deleted change notice action"))
);
}
-export default function DeleteChangeOrderRequiredActionRoute() {
+export default function DeleteChangeNoticeRequiredActionRoute() {
const { id } = useParams();
const { requiredAction } = useLoaderData<typeof loader>();
const navigate = useNavigate();
@@ -78,12 +83,12 @@ export default function DeleteChangeOrderRequiredActionRoute() {
if (!requiredAction) return null;
if (!id) throw notFound("id not found");
- const onCancel = () => navigate(path.to.changeOrderRequiredActions);
+ const onCancel = () => navigate(path.to.changeNoticeRequiredActions);
return (
<ConfirmDelete
- action={path.to.deleteChangeOrderRequiredAction(id)}
+ action={path.to.deleteChangeNoticeRequiredAction(id)}
name={requiredAction.name}
- text={t`Are you sure you want to delete the change order action: ${requiredAction.name}? This cannot be undone.`}
+ text={t`Are you sure you want to delete the change notice action: ${requiredAction.name}? This cannot be undone.`}
onCancel={onCancel}
/>
);
diff --git a/apps/erp/app/routes/x+/items+/change-order-actions.new.tsx b/apps/erp/app/routes/x+/items+/change-notice-actions.new.tsx
similarity index 70%
rename from apps/erp/app/routes/x+/items+/change-order-actions.new.tsx
rename to apps/erp/app/routes/x+/items+/change-notice-actions.new.tsx
index 23dfbed321..cfad88888c 100644
--- a/apps/erp/app/routes/x+/items+/change-order-actions.new.tsx
+++ b/apps/erp/app/routes/x+/items+/change-notice-actions.new.tsx
@@ -5,10 +5,10 @@ import { validationError, validator } from "@carbon/form";
import type { ActionFunctionArgs, LoaderFunctionArgs } from "react-router";
import { redirect, useNavigate } from "react-router";
import {
- changeOrderRequiredActionValidator,
- upsertChangeOrderRequiredAction
+ changeNoticeRequiredActionValidator,
+ upsertChangeNoticeRequiredAction
} from "~/modules/items";
-import { ChangeOrderRequiredActionForm } from "~/modules/items/ui/ChangeOrderActions";
+import { ChangeNoticeRequiredActionForm } from "~/modules/items/ui/ChangeNoticeActions";
import { getParams, path, requestReferrer } from "~/utils/path";
export async function loader({ request }: LoaderFunctionArgs) {
@@ -29,14 +29,14 @@ export async function action({ request }: ActionFunctionArgs) {
const modal = formData.get("type") === "modal";
const validation = await validator(
- changeOrderRequiredActionValidator
+ changeNoticeRequiredActionValidator
).validate(formData);
if (validation.error) {
return validationError(validation.error);
}
- const insert = await upsertChangeOrderRequiredAction(client, {
+ const insert = await upsertChangeNoticeRequiredAction(client, {
name: validation.data.name,
active: validation.data.active,
companyId,
@@ -47,10 +47,10 @@ export async function action({ request }: ActionFunctionArgs) {
? insert
: redirect(
requestReferrer(request) ??
- `${path.to.changeOrderRequiredActions}?${getParams(request)}`,
+ `${path.to.changeNoticeRequiredActions}?${getParams(request)}`,
await flash(
request,
- error(insert.error, "Failed to insert change order action")
+ error(insert.error, "Failed to insert change notice action")
)
);
}
@@ -58,12 +58,12 @@ export async function action({ request }: ActionFunctionArgs) {
return modal
? insert
: redirect(
- `${path.to.changeOrderRequiredActions}?${getParams(request)}`,
- await flash(request, success("Change order action created"))
+ `${path.to.changeNoticeRequiredActions}?${getParams(request)}`,
+ await flash(request, success("Change notice action created"))
);
}
-export default function NewChangeOrderRequiredActionRoute() {
+export default function NewChangeNoticeRequiredActionRoute() {
const navigate = useNavigate();
const initialValues = {
name: "",
@@ -71,7 +71,7 @@ export default function NewChangeOrderRequiredActionRoute() {
};
return (
- <ChangeOrderRequiredActionForm
+ <ChangeNoticeRequiredActionForm
initialValues={initialValues}
onClose={() => navigate(-1)}
/>
diff --git a/apps/erp/app/routes/x+/items+/change-order-actions.tsx b/apps/erp/app/routes/x+/items+/change-notice-actions.tsx
similarity index 70%
rename from apps/erp/app/routes/x+/items+/change-order-actions.tsx
rename to apps/erp/app/routes/x+/items+/change-notice-actions.tsx
index 1215cdb10d..27395c7a55 100644
--- a/apps/erp/app/routes/x+/items+/change-order-actions.tsx
+++ b/apps/erp/app/routes/x+/items+/change-notice-actions.tsx
@@ -3,15 +3,15 @@ import { VStack } from "@carbon/react";
import { msg } from "@lingui/core/macro";
import type { LoaderFunctionArgs } from "react-router";
import { Outlet, useLoaderData } from "react-router";
-import { getChangeOrderRequiredActions } from "~/modules/items";
-import { ChangeOrderRequiredActionsTable } from "~/modules/items/ui/ChangeOrderActions";
+import { getChangeNoticeRequiredActions } from "~/modules/items";
+import { ChangeNoticeRequiredActionsTable } from "~/modules/items/ui/ChangeNoticeActions";
import type { Handle } from "~/utils/handle";
import { path } from "~/utils/path";
import { getGenericQueryFilters } from "~/utils/query";
export const handle: Handle = {
- breadcrumb: msg`Change Order Actions`,
- to: path.to.changeOrderRequiredActions
+ breadcrumb: msg`Change Notice Actions`,
+ to: path.to.changeNoticeRequiredActions
};
export async function loader({ request }: LoaderFunctionArgs) {
@@ -26,7 +26,7 @@ export async function loader({ request }: LoaderFunctionArgs) {
const { limit, offset, sorts, filters } =
getGenericQueryFilters(searchParams);
- return await getChangeOrderRequiredActions(client, companyId, {
+ return await getChangeNoticeRequiredActions(client, companyId, {
search,
limit,
offset,
@@ -35,12 +35,12 @@ export async function loader({ request }: LoaderFunctionArgs) {
});
}
-export default function ChangeOrderActionsRoute() {
+export default function ChangeNoticeActionsRoute() {
const { data, count } = useLoaderData<typeof loader>();
return (
<VStack spacing={0} className="h-full">
- <ChangeOrderRequiredActionsTable data={data ?? []} count={count ?? 0} />
+ <ChangeNoticeRequiredActionsTable data={data ?? []} count={count ?? 0} />
<Outlet />
</VStack>
);
diff --git a/apps/erp/app/routes/x+/items+/change-order-types.$id.tsx b/apps/erp/app/routes/x+/items+/change-notice-types.$id.tsx
similarity index 57%
rename from apps/erp/app/routes/x+/items+/change-order-types.$id.tsx
rename to apps/erp/app/routes/x+/items+/change-notice-types.$id.tsx
index ee9a257e28..45e61b8101 100644
--- a/apps/erp/app/routes/x+/items+/change-order-types.$id.tsx
+++ b/apps/erp/app/routes/x+/items+/change-notice-types.$id.tsx
@@ -5,15 +5,15 @@ import { validationError, validator } from "@carbon/form";
import type { ActionFunctionArgs, LoaderFunctionArgs } from "react-router";
import { data, redirect, useLoaderData, useNavigate } from "react-router";
import {
- changeOrderTypeValidator,
- getChangeOrderType,
- upsertChangeOrderType
+ changeNoticeTypeValidator,
+ getChangeNoticeType,
+ upsertChangeNoticeType
} from "~/modules/items";
-import { ChangeOrderTypeForm } from "~/modules/items/ui/ChangeOrderTypes";
+import { ChangeNoticeTypeForm } from "~/modules/items/ui/ChangeNoticeTypes";
import { path } from "~/utils/path";
export async function loader({ request, params }: LoaderFunctionArgs) {
- const { client } = await requirePermissions(request, {
+ const { client, companyId } = await requirePermissions(request, {
view: "parts",
role: "employee"
});
@@ -21,31 +21,31 @@ export async function loader({ request, params }: LoaderFunctionArgs) {
const { id } = params;
if (!id) throw notFound("id not found");
- const changeOrderType = await getChangeOrderType(client, id);
+ const changeNoticeType = await getChangeNoticeType(client, id, companyId);
- if (changeOrderType.error) {
+ if (changeNoticeType.error) {
throw redirect(
- path.to.changeOrderTypes,
+ path.to.changeNoticeTypes,
await flash(
request,
- error(changeOrderType.error, "Failed to get change order category")
+ error(changeNoticeType.error, "Failed to get change notice category")
)
);
}
return {
- changeOrderType: changeOrderType.data
+ changeNoticeType: changeNoticeType.data
};
}
export async function action({ request }: ActionFunctionArgs) {
assertIsPost(request);
- const { client, userId } = await requirePermissions(request, {
+ const { client, companyId, userId } = await requirePermissions(request, {
update: "parts"
});
const formData = await request.formData();
- const validation = await validator(changeOrderTypeValidator).validate(
+ const validation = await validator(changeNoticeTypeValidator).validate(
formData
);
@@ -56,9 +56,10 @@ export async function action({ request }: ActionFunctionArgs) {
const { id, ...d } = validation.data;
if (!id) throw new Error("id not found");
- const update = await upsertChangeOrderType(client, {
+ const update = await upsertChangeNoticeType(client, {
id,
...d,
+ companyId,
updatedBy: userId
});
@@ -67,28 +68,28 @@ export async function action({ request }: ActionFunctionArgs) {
{},
await flash(
request,
- error(update.error, "Failed to update change order category")
+ error(update.error, "Failed to update change notice category")
)
);
}
throw redirect(
- path.to.changeOrderTypes,
- await flash(request, success("Updated change order category"))
+ path.to.changeNoticeTypes,
+ await flash(request, success("Updated change notice category"))
);
}
-export default function EditChangeOrderTypeRoute() {
- const { changeOrderType } = useLoaderData<typeof loader>();
+export default function EditChangeNoticeTypeRoute() {
+ const { changeNoticeType } = useLoaderData<typeof loader>();
const navigate = useNavigate();
const initialValues = {
- id: changeOrderType.id ?? undefined,
- name: changeOrderType.name ?? ""
+ id: changeNoticeType.id ?? undefined,
+ name: changeNoticeType.name ?? ""
};
return (
- <ChangeOrderTypeForm
+ <ChangeNoticeTypeForm
key={initialValues.id}
initialValues={initialValues}
onClose={() => navigate(-1)}
diff --git a/apps/erp/app/routes/x+/items+/change-notice-types.delete.$id.tsx b/apps/erp/app/routes/x+/items+/change-notice-types.delete.$id.tsx
new file mode 100644
index 0000000000..73b16273cf
--- /dev/null
+++ b/apps/erp/app/routes/x+/items+/change-notice-types.delete.$id.tsx
@@ -0,0 +1,90 @@
+import { error, notFound, success } from "@carbon/auth";
+import { requirePermissions } from "@carbon/auth/auth.server";
+import { flash } from "@carbon/auth/session.server";
+import { useLingui } from "@lingui/react/macro";
+import type { ActionFunctionArgs, LoaderFunctionArgs } from "react-router";
+import { redirect, useLoaderData, useNavigate, useParams } from "react-router";
+import { ConfirmDelete } from "~/components/Modals";
+import { deleteChangeNoticeType, getChangeNoticeType } from "~/modules/items";
+import { getParams, path } from "~/utils/path";
+
+export async function loader({ request, params }: LoaderFunctionArgs) {
+ const { client, companyId } = await requirePermissions(request, {
+ view: "parts",
+ role: "employee"
+ });
+ const { id } = params;
+ if (!id) throw notFound("id not found");
+
+ const changeNoticeType = await getChangeNoticeType(client, id, companyId);
+ if (changeNoticeType.error) {
+ throw redirect(
+ `${path.to.changeNoticeTypes}?${getParams(request)}`,
+ await flash(
+ request,
+ error(changeNoticeType.error, "Failed to get change notice category")
+ )
+ );
+ }
+
+ return { changeNoticeType: changeNoticeType.data };
+}
+
+export async function action({ request, params }: ActionFunctionArgs) {
+ const { client, companyId } = await requirePermissions(request, {
+ delete: "parts"
+ });
+
+ const { id } = params;
+ if (!id) {
+ throw redirect(
+ `${path.to.changeNoticeTypes}?${getParams(request)}`,
+ await flash(
+ request,
+ error(params, "Failed to get a change notice category id")
+ )
+ );
+ }
+
+ const { error: deleteError } = await deleteChangeNoticeType(
+ client,
+ id,
+ companyId
+ );
+ if (deleteError) {
+ const errorMessage =
+ deleteError.code === "23503"
+ ? "Change notice category is used elsewhere, cannot delete"
+ : "Failed to delete change notice category";
+
+ throw redirect(
+ `${path.to.changeNoticeTypes}?${getParams(request)}`,
+ await flash(request, error(deleteError, errorMessage))
+ );
+ }
+
+ throw redirect(
+ `${path.to.changeNoticeTypes}?${getParams(request)}`,
+ await flash(request, success("Successfully deleted change notice category"))
+ );
+}
+
+export default function DeleteChangeNoticeTypeRoute() {
+ const { id } = useParams();
+ const { changeNoticeType } = useLoaderData<typeof loader>();
+ const navigate = useNavigate();
+ const { t } = useLingui();
+
+ if (!changeNoticeType) return null;
+ if (!id) throw notFound("id not found");
+
+ const onCancel = () => navigate(path.to.changeNoticeTypes);
+ return (
+ <ConfirmDelete
+ action={path.to.deleteChangeNoticeType(id)}
+ name={changeNoticeType.name}
+ text={t`Are you sure you want to delete the change notice category: ${changeNoticeType.name}? This cannot be undone.`}
+ onCancel={onCancel}
+ />
+ );
+}
diff --git a/apps/erp/app/routes/x+/items+/change-order-types.new.tsx b/apps/erp/app/routes/x+/items+/change-notice-types.new.tsx
similarity index 70%
rename from apps/erp/app/routes/x+/items+/change-order-types.new.tsx
rename to apps/erp/app/routes/x+/items+/change-notice-types.new.tsx
index 507acffa4e..be91a4e346 100644
--- a/apps/erp/app/routes/x+/items+/change-order-types.new.tsx
+++ b/apps/erp/app/routes/x+/items+/change-notice-types.new.tsx
@@ -5,10 +5,10 @@ import { validationError, validator } from "@carbon/form";
import type { ActionFunctionArgs, LoaderFunctionArgs } from "react-router";
import { redirect, useNavigate } from "react-router";
import {
- changeOrderTypeValidator,
- upsertChangeOrderType
+ changeNoticeTypeValidator,
+ upsertChangeNoticeType
} from "~/modules/items";
-import { ChangeOrderTypeForm } from "~/modules/items/ui/ChangeOrderTypes";
+import { ChangeNoticeTypeForm } from "~/modules/items/ui/ChangeNoticeTypes";
import { getParams, path, requestReferrer } from "~/utils/path";
export async function loader({ request }: LoaderFunctionArgs) {
@@ -28,7 +28,7 @@ export async function action({ request }: ActionFunctionArgs) {
const formData = await request.formData();
const modal = formData.get("type") === "modal";
- const validation = await validator(changeOrderTypeValidator).validate(
+ const validation = await validator(changeNoticeTypeValidator).validate(
formData
);
@@ -36,7 +36,7 @@ export async function action({ request }: ActionFunctionArgs) {
return validationError(validation.error);
}
- const insert = await upsertChangeOrderType(client, {
+ const insert = await upsertChangeNoticeType(client, {
name: validation.data.name,
companyId,
createdBy: userId
@@ -46,10 +46,10 @@ export async function action({ request }: ActionFunctionArgs) {
? insert
: redirect(
requestReferrer(request) ??
- `${path.to.changeOrderTypes}?${getParams(request)}`,
+ `${path.to.changeNoticeTypes}?${getParams(request)}`,
await flash(
request,
- error(insert.error, "Failed to insert change order category")
+ error(insert.error, "Failed to insert change notice category")
)
);
}
@@ -57,19 +57,19 @@ export async function action({ request }: ActionFunctionArgs) {
return modal
? insert
: redirect(
- `${path.to.changeOrderTypes}?${getParams(request)}`,
- await flash(request, success("Change order category created"))
+ `${path.to.changeNoticeTypes}?${getParams(request)}`,
+ await flash(request, success("Change notice category created"))
);
}
-export default function NewChangeOrderTypeRoute() {
+export default function NewChangeNoticeTypeRoute() {
const navigate = useNavigate();
const initialValues = {
name: ""
};
return (
- <ChangeOrderTypeForm
+ <ChangeNoticeTypeForm
initialValues={initialValues}
onClose={() => navigate(-1)}
/>
diff --git a/apps/erp/app/routes/x+/items+/change-order-types.tsx b/apps/erp/app/routes/x+/items+/change-notice-types.tsx
similarity index 73%
rename from apps/erp/app/routes/x+/items+/change-order-types.tsx
rename to apps/erp/app/routes/x+/items+/change-notice-types.tsx
index 4bf121fa70..97de2f7a16 100644
--- a/apps/erp/app/routes/x+/items+/change-order-types.tsx
+++ b/apps/erp/app/routes/x+/items+/change-notice-types.tsx
@@ -3,15 +3,15 @@ import { VStack } from "@carbon/react";
import { msg } from "@lingui/core/macro";
import type { LoaderFunctionArgs } from "react-router";
import { Outlet, useLoaderData } from "react-router";
-import { getChangeOrderTypes } from "~/modules/items";
-import { ChangeOrderTypesTable } from "~/modules/items/ui/ChangeOrderTypes";
+import { getChangeNoticeTypes } from "~/modules/items";
+import { ChangeNoticeTypesTable } from "~/modules/items/ui/ChangeNoticeTypes";
import type { Handle } from "~/utils/handle";
import { path } from "~/utils/path";
import { getGenericQueryFilters } from "~/utils/query";
export const handle: Handle = {
- breadcrumb: msg`Change Order Types`,
- to: path.to.changeOrderTypes
+ breadcrumb: msg`Change Notice Types`,
+ to: path.to.changeNoticeTypes
};
export async function loader({ request }: LoaderFunctionArgs) {
@@ -26,7 +26,7 @@ export async function loader({ request }: LoaderFunctionArgs) {
const { limit, offset, sorts, filters } =
getGenericQueryFilters(searchParams);
- return await getChangeOrderTypes(client, companyId, {
+ return await getChangeNoticeTypes(client, companyId, {
search,
limit,
offset,
@@ -35,12 +35,12 @@ export async function loader({ request }: LoaderFunctionArgs) {
});
}
-export default function ChangeOrderTypesRoute() {
+export default function ChangeNoticeTypesRoute() {
const { data, count } = useLoaderData<typeof loader>();
return (
<VStack spacing={0} className="h-full">
- <ChangeOrderTypesTable data={data ?? []} count={count ?? 0} />
+ <ChangeNoticeTypesTable data={data ?? []} count={count ?? 0} />
<Outlet />
</VStack>
);
diff --git a/apps/erp/app/routes/x+/items+/change-notices+/_index.tsx b/apps/erp/app/routes/x+/items+/change-notices+/_index.tsx
new file mode 100644
index 0000000000..de8c01896e
--- /dev/null
+++ b/apps/erp/app/routes/x+/items+/change-notices+/_index.tsx
@@ -0,0 +1,61 @@
+import { error } from "@carbon/auth";
+import { requirePermissions } from "@carbon/auth/auth.server";
+import { flash } from "@carbon/auth/session.server";
+import { VStack } from "@carbon/react";
+import type { LoaderFunctionArgs } from "react-router";
+import { Outlet, redirect, useLoaderData } from "react-router";
+import { getChangeNotices, getChangeNoticeTypesList } from "~/modules/items";
+import { ChangeNoticesTable } from "~/modules/items/ui/ChangeNotice";
+import { path } from "~/utils/path";
+import { getGenericQueryFilters } from "~/utils/query";
+
+export async function loader({ request }: LoaderFunctionArgs) {
+ const { client, companyId } = await requirePermissions(request, {
+ view: "parts",
+ role: "employee"
+ });
+
+ const url = new URL(request.url);
+ const searchParams = new URLSearchParams(url.search);
+ const search = searchParams.get("search");
+ const { limit, offset, sorts, filters } =
+ getGenericQueryFilters(searchParams);
+
+ const [changeNotices, types] = await Promise.all([
+ getChangeNotices(client, companyId, {
+ search,
+ limit,
+ offset,
+ sorts,
+ filters
+ }),
+ getChangeNoticeTypesList(client, companyId)
+ ]);
+
+ if (changeNotices.error) {
+ throw redirect(
+ path.to.authenticatedRoot,
+ await flash(
+ request,
+ error(changeNotices.error, "Error loading change notices")
+ )
+ );
+ }
+
+ return {
+ changeNotices: changeNotices.data ?? [],
+ count: changeNotices.count ?? 0,
+ types: types.data ?? []
+ };
+}
+
+export default function ChangeNoticesIndexRoute() {
+ const { changeNotices, count, types } = useLoaderData<typeof loader>();
+
+ return (
+ <VStack spacing={0} className="h-full">
+ <ChangeNoticesTable data={changeNotices} count={count} types={types} />
+ <Outlet />
+ </VStack>
+ );
+}
diff --git a/apps/erp/app/routes/x+/items+/change-order+/_layout.tsx b/apps/erp/app/routes/x+/items+/change-notices+/_layout.tsx
similarity index 67%
rename from apps/erp/app/routes/x+/items+/change-order+/_layout.tsx
rename to apps/erp/app/routes/x+/items+/change-notices+/_layout.tsx
index 26deeae586..41fd888583 100644
--- a/apps/erp/app/routes/x+/items+/change-order+/_layout.tsx
+++ b/apps/erp/app/routes/x+/items+/change-notices+/_layout.tsx
@@ -5,15 +5,15 @@ import type { Handle } from "~/utils/handle";
import { path } from "~/utils/path";
export const meta: MetaFunction = () => {
- return [{ title: "Carbon | Change Order" }];
+ return [{ title: "Carbon | Change Notices" }];
};
export const handle: Handle = {
- breadcrumb: msg`Change Orders`,
- to: path.to.changeOrders,
+ breadcrumb: msg`Change Notices`,
+ to: path.to.changeNotices,
module: "items"
};
-export default function ChangeOrderRoute() {
+export default function ChangeNoticesRoute() {
return <Outlet />;
}
diff --git a/apps/erp/app/routes/x+/items+/change-order+/$.tsx b/apps/erp/app/routes/x+/items+/change-order+/$.tsx
new file mode 100644
index 0000000000..e69adbaf56
--- /dev/null
+++ b/apps/erp/app/routes/x+/items+/change-order+/$.tsx
@@ -0,0 +1,14 @@
+import type { LoaderFunctionArgs } from "react-router";
+import { redirect } from "react-router";
+
+// Legacy URL shim: /x/items/change-order/* → /x/items/change-notice/*
+export async function loader({ request }: LoaderFunctionArgs) {
+ const url = new URL(request.url);
+ throw redirect(
+ `${url.pathname.replace(
+ "/items/change-order",
+ "/items/change-notice"
+ )}${url.search}`,
+ 301
+ );
+}
diff --git a/apps/erp/app/routes/x+/items+/change-order+/$id.action.delete.$actionId.tsx b/apps/erp/app/routes/x+/items+/change-order+/$id.action.delete.$actionId.tsx
deleted file mode 100644
index f462e56e03..0000000000
--- a/apps/erp/app/routes/x+/items+/change-order+/$id.action.delete.$actionId.tsx
+++ /dev/null
@@ -1,27 +0,0 @@
-import { assertIsPost, error } from "@carbon/auth";
-import { requirePermissions } from "@carbon/auth/auth.server";
-import { flash } from "@carbon/auth/session.server";
-import type { ActionFunctionArgs } from "react-router";
-import { data } from "react-router";
-import { deleteChangeOrderAction } from "~/modules/items";
-
-export async function action({ request, params }: ActionFunctionArgs) {
- assertIsPost(request);
- const { client } = await requirePermissions(request, {
- delete: "parts"
- });
-
- const { actionId } = params;
- if (!actionId) throw new Error("Could not find actionId");
-
- const remove = await deleteChangeOrderAction(client, actionId);
-
- if (remove.error) {
- return data(
- { success: false },
- await flash(request, error(remove.error, "Failed to remove action"))
- );
- }
-
- return { success: true };
-}
diff --git a/apps/erp/app/routes/x+/items+/change-order-actions.$.tsx b/apps/erp/app/routes/x+/items+/change-order-actions.$.tsx
new file mode 100644
index 0000000000..4c8d0989fb
--- /dev/null
+++ b/apps/erp/app/routes/x+/items+/change-order-actions.$.tsx
@@ -0,0 +1,14 @@
+import type { LoaderFunctionArgs } from "react-router";
+import { redirect } from "react-router";
+
+// Legacy URL shim: /x/items/change-order-actions/* → /x/items/change-notice-actions/*
+export async function loader({ request }: LoaderFunctionArgs) {
+ const url = new URL(request.url);
+ throw redirect(
+ `${url.pathname.replace(
+ "/items/change-order-actions",
+ "/items/change-notice-actions"
+ )}${url.search}`,
+ 301
+ );
+}
diff --git a/apps/erp/app/routes/x+/items+/change-order-types.$.tsx b/apps/erp/app/routes/x+/items+/change-order-types.$.tsx
new file mode 100644
index 0000000000..c000fea4da
--- /dev/null
+++ b/apps/erp/app/routes/x+/items+/change-order-types.$.tsx
@@ -0,0 +1,14 @@
+import type { LoaderFunctionArgs } from "react-router";
+import { redirect } from "react-router";
+
+// Legacy URL shim: /x/items/change-order-types/* → /x/items/change-notice-types/*
+export async function loader({ request }: LoaderFunctionArgs) {
+ const url = new URL(request.url);
+ throw redirect(
+ `${url.pathname.replace(
+ "/items/change-order-types",
+ "/items/change-notice-types"
+ )}${url.search}`,
+ 301
+ );
+}
diff --git a/apps/erp/app/routes/x+/items+/change-order-types.delete.$id.tsx b/apps/erp/app/routes/x+/items+/change-order-types.delete.$id.tsx
deleted file mode 100644
index d99a417a1c..0000000000
--- a/apps/erp/app/routes/x+/items+/change-order-types.delete.$id.tsx
+++ /dev/null
@@ -1,86 +0,0 @@
-import { error, notFound, success } from "@carbon/auth";
-import { requirePermissions } from "@carbon/auth/auth.server";
-import { flash } from "@carbon/auth/session.server";
-import { useLingui } from "@lingui/react/macro";
-import type { ActionFunctionArgs, LoaderFunctionArgs } from "react-router";
-import { redirect, useLoaderData, useNavigate, useParams } from "react-router";
-import { ConfirmDelete } from "~/components/Modals";
-import { deleteChangeOrderType, getChangeOrderType } from "~/modules/items";
-import { getParams, path } from "~/utils/path";
-
-export async function loader({ request, params }: LoaderFunctionArgs) {
- const { client } = await requirePermissions(request, {
- view: "parts",
- role: "employee"
- });
- const { id } = params;
- if (!id) throw notFound("id not found");
-
- const changeOrderType = await getChangeOrderType(client, id);
- if (changeOrderType.error) {
- throw redirect(
- `${path.to.changeOrderTypes}?${getParams(request)}`,
- await flash(
- request,
- error(changeOrderType.error, "Failed to get change order category")
- )
- );
- }
-
- return { changeOrderType: changeOrderType.data };
-}
-
-export async function action({ request, params }: ActionFunctionArgs) {
- const { client } = await requirePermissions(request, {
- delete: "parts"
- });
-
- const { id } = params;
- if (!id) {
- throw redirect(
- `${path.to.changeOrderTypes}?${getParams(request)}`,
- await flash(
- request,
- error(params, "Failed to get a change order category id")
- )
- );
- }
-
- const { error: deleteError } = await deleteChangeOrderType(client, id);
- if (deleteError) {
- const errorMessage =
- deleteError.code === "23503"
- ? "Change order category is used elsewhere, cannot delete"
- : "Failed to delete change order category";
-
- throw redirect(
- `${path.to.changeOrderTypes}?${getParams(request)}`,
- await flash(request, error(deleteError, errorMessage))
- );
- }
-
- throw redirect(
- `${path.to.changeOrderTypes}?${getParams(request)}`,
- await flash(request, success("Successfully deleted change order category"))
- );
-}
-
-export default function DeleteChangeOrderTypeRoute() {
- const { id } = useParams();
- const { changeOrderType } = useLoaderData<typeof loader>();
- const navigate = useNavigate();
- const { t } = useLingui();
-
- if (!changeOrderType) return null;
- if (!id) throw notFound("id not found");
-
- const onCancel = () => navigate(path.to.changeOrderTypes);
- return (
- <ConfirmDelete
- action={path.to.deleteChangeOrderType(id)}
- name={changeOrderType.name}
- text={t`Are you sure you want to delete the change order category: ${changeOrderType.name}? This cannot be undone.`}
- onCancel={onCancel}
- />
- );
-}
diff --git a/apps/erp/app/routes/x+/items+/change-orders+/_index.tsx b/apps/erp/app/routes/x+/items+/change-orders+/_index.tsx
index f5c720c7b1..0109bd3ef7 100644
--- a/apps/erp/app/routes/x+/items+/change-orders+/_index.tsx
+++ b/apps/erp/app/routes/x+/items+/change-orders+/_index.tsx
@@ -1,61 +1,7 @@
-import { error } from "@carbon/auth";
-import { requirePermissions } from "@carbon/auth/auth.server";
-import { flash } from "@carbon/auth/session.server";
-import { VStack } from "@carbon/react";
-import type { LoaderFunctionArgs } from "react-router";
-import { Outlet, redirect, useLoaderData } from "react-router";
-import { getChangeOrders, getChangeOrderTypesList } from "~/modules/items";
-import { ChangeOrdersTable } from "~/modules/items/ui/ChangeOrder";
+import { redirect } from "react-router";
import { path } from "~/utils/path";
-import { getGenericQueryFilters } from "~/utils/query";
-export async function loader({ request }: LoaderFunctionArgs) {
- const { client, companyId } = await requirePermissions(request, {
- view: "parts",
- role: "employee"
- });
-
- const url = new URL(request.url);
- const searchParams = new URLSearchParams(url.search);
- const search = searchParams.get("search");
- const { limit, offset, sorts, filters } =
- getGenericQueryFilters(searchParams);
-
- const [changeOrders, types] = await Promise.all([
- getChangeOrders(client, companyId, {
- search,
- limit,
- offset,
- sorts,
- filters
- }),
- getChangeOrderTypesList(client, companyId)
- ]);
-
- if (changeOrders.error) {
- throw redirect(
- path.to.authenticatedRoot,
- await flash(
- request,
- error(changeOrders.error, "Error loading change orders")
- )
- );
- }
-
- return {
- changeOrders: changeOrders.data ?? [],
- count: changeOrders.count ?? 0,
- types: types.data ?? []
- };
-}
-
-export default function ChangeOrdersIndexRoute() {
- const { changeOrders, count, types } = useLoaderData<typeof loader>();
-
- return (
- <VStack spacing={0} className="h-full">
- <ChangeOrdersTable data={changeOrders} count={count} types={types} />
- <Outlet />
- </VStack>
- );
+// Legacy URL shim: /x/items/change-orders → /x/items/change-notices
+export async function loader() {
+ throw redirect(path.to.changeNotices, 301);
}
diff --git a/apps/erp/app/routes/x+/items+/methods+/material.$id.tsx b/apps/erp/app/routes/x+/items+/methods+/material.$id.tsx
index 0088400f07..e337b62cc8 100644
--- a/apps/erp/app/routes/x+/items+/methods+/material.$id.tsx
+++ b/apps/erp/app/routes/x+/items+/methods+/material.$id.tsx
@@ -29,7 +29,7 @@ export async function action({ request, params }: ActionFunctionArgs) {
}
// Release-lock gate: block edits to a released (Production) revision unless a
- // change order is used. enforce -> block; warn -> proceed + flash; off -> no-op.
+ // change notice is used. enforce -> block; warn -> proceed + flash; off -> no-op.
const lock = await checkRevisionLock(client, {
kind: "makeMethod",
id: validation.data.makeMethodId,
diff --git a/apps/erp/app/routes/x+/items+/methods+/material.delete.$id.tsx b/apps/erp/app/routes/x+/items+/methods+/material.delete.$id.tsx
index 6fcec72f82..08fa2b0da4 100644
--- a/apps/erp/app/routes/x+/items+/methods+/material.delete.$id.tsx
+++ b/apps/erp/app/routes/x+/items+/methods+/material.delete.$id.tsx
@@ -18,7 +18,7 @@ export async function action({ request, params }: ActionFunctionArgs) {
}
// Release-lock gate: block edits to a released (Production) revision unless a
- // change order is used. enforce -> block; warn -> proceed + flash; off -> no-op.
+ // change notice is used. enforce -> block; warn -> proceed + flash; off -> no-op.
const lock = await checkRevisionLock(client, {
kind: "material",
id,
diff --git a/apps/erp/app/routes/x+/items+/methods+/material.new.tsx b/apps/erp/app/routes/x+/items+/methods+/material.new.tsx
index 3bf7baac36..4e56968951 100644
--- a/apps/erp/app/routes/x+/items+/methods+/material.new.tsx
+++ b/apps/erp/app/routes/x+/items+/methods+/material.new.tsx
@@ -24,7 +24,7 @@ export async function action({ request, params }: ActionFunctionArgs) {
}
// Release-lock gate: block edits to a released (Production) revision unless a
- // change order is used. enforce -> block; warn -> proceed + flash; off -> no-op.
+ // change notice is used. enforce -> block; warn -> proceed + flash; off -> no-op.
const lock = await checkRevisionLock(client, {
kind: "makeMethod",
id: validation.data.makeMethodId,
diff --git a/apps/erp/app/routes/x+/items+/methods+/material.order.tsx b/apps/erp/app/routes/x+/items+/methods+/material.order.tsx
index 02bf89b659..eb275ccdc5 100644
--- a/apps/erp/app/routes/x+/items+/methods+/material.order.tsx
+++ b/apps/erp/app/routes/x+/items+/methods+/material.order.tsx
@@ -29,7 +29,7 @@ export async function action({ request }: ActionFunctionArgs) {
);
// Release-lock gate: block edits to a released (Production) revision unless a
- // change order is used. All materials in a reorder share one make method.
+ // change notice is used. All materials in a reorder share one make method.
const lock = await checkRevisionLock(client, {
kind: "material",
id: updates[0]?.id,
diff --git a/apps/erp/app/routes/x+/items+/revisions.new.tsx b/apps/erp/app/routes/x+/items+/revisions.new.tsx
index 2fbd2ac33e..1713e5cb30 100644
--- a/apps/erp/app/routes/x+/items+/revisions.new.tsx
+++ b/apps/erp/app/routes/x+/items+/revisions.new.tsx
@@ -60,7 +60,7 @@ export async function action({ request }: ActionFunctionArgs) {
}
})();
- // newItemId lets the caller (e.g. the new-revision modal's "open change order"
+ // newItemId lets the caller (e.g. the new-revision modal's "open change notice"
// option) act on the created revision without parsing it out of `link`.
return { success: true, link, newItemId: result.data.id };
}
diff --git a/apps/erp/app/routes/x+/part+/$itemId.details.tsx b/apps/erp/app/routes/x+/part+/$itemId.details.tsx
index 5d1a822d8b..cadf9b3b49 100644
--- a/apps/erp/app/routes/x+/part+/$itemId.details.tsx
+++ b/apps/erp/app/routes/x+/part+/$itemId.details.tsx
@@ -20,7 +20,7 @@ import type { ItemFile, MakeMethod, PartSummary } from "~/modules/items";
import {
getConfigurationParameters,
getConfigurationRules,
- getItemChangeOrderData,
+ getItemChangeNoticeData,
getItemManufacturing,
getMakeMethodById,
getMakeMethods,
@@ -33,9 +33,12 @@ import {
} from "~/modules/items";
import { getRevisionLock } from "~/modules/items/items.server";
import {
- ItemChangeOrders,
- ItemOpenChangeOrderAlert
-} from "~/modules/items/ui/ChangeOrder";
+ ChangeNoticeDraftLockReason,
+ getChangeNoticeDraftLock,
+ ItemChangeNotices,
+ ItemOpenChangeNoticeAlert,
+ LockedHint
+} from "~/modules/items/ui/ChangeNotice";
import {
BillOfMaterial,
BillOfProcess,
@@ -66,17 +69,17 @@ export async function loader({ request, params }: LoaderFunctionArgs) {
const url = new URL(request.url);
const requestedMethodId = url.searchParams.get("methodId");
- const [makeMethods, revisionLock, changeOrderData] = await Promise.all([
+ const [makeMethods, revisionLock, changeNoticeData] = await Promise.all([
getMakeMethods(client, itemId, companyId),
getRevisionLock(client, { itemId, companyId }),
// Part → CO traceability (4b): CO history for this part + type labels.
- getItemChangeOrderData(client, itemId, companyId)
+ getItemChangeNoticeData(client, itemId, companyId)
]);
const revisionStatus = revisionLock.revisionStatus;
const releaseControl = revisionLock.releaseControl;
// Include CO-owned draft methods so a revision/new-part item created by an open
- // Change Order still shows its BOM/BOP on the item master. The draft is the same
+ // Change Notice still shows its BOM/BOP on the item master. The draft is the same
// makeMethod the CO edits, so the two surfaces stay in sync. Active is still
// preferred below, so a Version CO's item keeps its live method as the default.
const selectable = makeMethods.data ?? [];
@@ -92,7 +95,7 @@ export async function loader({ request, params }: LoaderFunctionArgs) {
tags: [],
revisionStatus,
releaseControl,
- ...changeOrderData
+ ...changeNoticeData
};
}
@@ -103,7 +106,7 @@ export async function loader({ request, params }: LoaderFunctionArgs) {
tags: [],
revisionStatus,
releaseControl,
- ...changeOrderData
+ ...changeNoticeData
};
}
@@ -157,7 +160,7 @@ export async function loader({ request, params }: LoaderFunctionArgs) {
tags: tags.data ?? [],
revisionStatus,
releaseControl,
- ...changeOrderData
+ ...changeNoticeData
};
}
@@ -253,10 +256,19 @@ export default function PartDetailsRoute() {
tags,
revisionStatus,
releaseControl,
- changeOrders,
- changeOrderTypes
+ changeNotices,
+ changeNoticeTypes
} = useLoaderData<typeof loader>();
+ const draftLock = getChangeNoticeDraftLock(
+ methodData?.makeMethod.changeOrderId,
+ changeNotices
+ );
+ const lockReason = draftLock ? (
+ <ChangeNoticeDraftLockReason lock={draftLock} />
+ ) : undefined;
+ const lockHint = lockReason ? <LockedHint reason={lockReason} /> : undefined;
+
const partData = useRouteData<{
partSummary: PartSummary;
files: Promise<ItemFile[]>;
@@ -276,7 +288,7 @@ export default function PartDetailsRoute() {
return (
<VStack spacing={2} className="p-2">
{permissions.is("employee") && (
- <ItemOpenChangeOrderAlert changeOrders={changeOrders ?? []} />
+ <ItemOpenChangeNoticeAlert changeNotices={changeNotices ?? []} />
)}
{permissions.is("employee") && methodData && (
<>
@@ -341,6 +353,8 @@ export default function PartDetailsRoute() {
replenishmentSystem={partData.partSummary?.replenishmentSystem}
revisionStatus={revisionStatus}
releaseControl={releaseControl}
+ isDisabled={!!draftLock}
+ disabledReason={lockReason}
/>
<BillOfProcess
key={`bop:${itemId}`}
@@ -359,6 +373,8 @@ export default function PartDetailsRoute() {
tags={tags}
revisionStatus={revisionStatus}
releaseControl={releaseControl}
+ isDisabled={!!draftLock}
+ disabledReason={lockReason}
/>
</>
)}
@@ -373,6 +389,8 @@ export default function PartDetailsRoute() {
itemId={itemId}
modelUpload={partData.partSummary ?? undefined}
type="Part"
+ isReadOnly={!!draftLock}
+ titleExtras={lockHint}
/>
)}
</DeferredFiles>
@@ -385,15 +403,16 @@ export default function PartDetailsRoute() {
/> */}
<CadModel
- isReadOnly={!permissions.can("update", "parts")}
+ isReadOnly={!permissions.can("update", "parts") || !!draftLock}
metadata={{ itemId }}
modelPath={partData?.partSummary?.modelPath ?? null}
title={t`CAD Model`}
+ titleExtras={lockHint}
/>
<ItemRiskRegister itemId={itemId} />
- <ItemChangeOrders
- changeOrders={changeOrders ?? []}
- types={changeOrderTypes ?? []}
+ <ItemChangeNotices
+ changeNotices={changeNotices ?? []}
+ types={changeNoticeTypes ?? []}
/>
</>
)}
diff --git a/apps/erp/app/routes/x+/part+/$itemId.tsx b/apps/erp/app/routes/x+/part+/$itemId.tsx
index b4095de655..18e25b8aac 100644
--- a/apps/erp/app/routes/x+/part+/$itemId.tsx
+++ b/apps/erp/app/routes/x+/part+/$itemId.tsx
@@ -29,8 +29,8 @@ import { ResizablePanels } from "~/components/Layout";
import { flattenTree } from "~/components/TreeView";
import type { ItemFile, PartSummary } from "~/modules/items";
import {
- changeOrderOpenStatuses,
- findChangeOrdersForItem,
+ changeNoticeOpenStatuses,
+ findChangeNoticesForItem,
getItemFiles,
getItemSupersededBy,
getItemSupersession,
@@ -79,7 +79,7 @@ export async function loader({ request, params }: LoaderFunctionArgs) {
tags,
supersession,
supersededBy,
- openChangeOrders
+ openChangeNotices
] = await Promise.all([
getPart(client, itemId, companyId),
getSupplierParts(client, itemId, companyId),
@@ -88,10 +88,10 @@ export async function loader({ request, params }: LoaderFunctionArgs) {
getItemSupersession(client, itemId, companyId),
getItemSupersededBy(client, itemId, companyId),
// Locks manual version/revision creation while a CO owns this part
- findChangeOrdersForItem(client, {
+ findChangeNoticesForItem(client, {
itemId,
companyId,
- statuses: changeOrderOpenStatuses
+ statuses: changeNoticeOpenStatuses
})
]);
@@ -115,7 +115,7 @@ export async function loader({ request, params }: LoaderFunctionArgs) {
const methodTree = getMakeMethods(client, itemId, companyId).then(
async (makeMethods) => {
// Include CO-owned drafts so a revision/new-part item created by an open
- // Change Order shows its method tree on the item master, in sync with the
+ // Change Notice shows its method tree on the item master, in sync with the
// CO (same makeMethod). Active is still preferred as the default below.
const selectable = makeMethods.data ?? [];
const makeMethod = requestedMethodId
@@ -156,7 +156,7 @@ export async function loader({ request, params }: LoaderFunctionArgs) {
tags: tags.data ?? [],
usedIn: getPartUsedIn(client, itemId, companyId),
methodTree,
- openChangeOrders: openChangeOrders.data ?? []
+ openChangeNotices: openChangeNotices.data ?? []
};
}
diff --git a/apps/erp/app/routes/x+/tool+/$itemId.details.tsx b/apps/erp/app/routes/x+/tool+/$itemId.details.tsx
index d25a68514b..b01ec08f6e 100644
--- a/apps/erp/app/routes/x+/tool+/$itemId.details.tsx
+++ b/apps/erp/app/routes/x+/tool+/$itemId.details.tsx
@@ -14,7 +14,7 @@ import { CadModel, DeferredFiles } from "~/components";
import { usePermissions, useRouteData } from "~/hooks";
import type { ItemFile, MakeMethod, ToolSummary } from "~/modules/items";
import {
- getItemChangeOrderData,
+ getItemChangeNoticeData,
getItemManufacturing,
getMakeMethodById,
getMakeMethods,
@@ -27,9 +27,12 @@ import {
} from "~/modules/items";
import { getRevisionLock } from "~/modules/items/items.server";
import {
- ItemChangeOrders,
- ItemOpenChangeOrderAlert
-} from "~/modules/items/ui/ChangeOrder";
+ ChangeNoticeDraftLockReason,
+ getChangeNoticeDraftLock,
+ ItemChangeNotices,
+ ItemOpenChangeNoticeAlert,
+ LockedHint
+} from "~/modules/items/ui/ChangeNotice";
import {
BillOfMaterial,
BillOfProcess,
@@ -58,16 +61,16 @@ export async function loader({ request, params }: LoaderFunctionArgs) {
const url = new URL(request.url);
const requestedMethodId = url.searchParams.get("methodId");
- const [makeMethods, revisionLock, changeOrderData] = await Promise.all([
+ const [makeMethods, revisionLock, changeNoticeData] = await Promise.all([
getMakeMethods(client, itemId, companyId),
getRevisionLock(client, { itemId, companyId }),
// Tool → CO traceability (4b): CO history for this tool + type labels.
- getItemChangeOrderData(client, itemId, companyId)
+ getItemChangeNoticeData(client, itemId, companyId)
]);
const revisionStatus = revisionLock.revisionStatus;
const releaseControl = revisionLock.releaseControl;
// Include CO-owned draft methods so a revision/new-part item created by an open
- // Change Order still shows its BOM/BOP on the item master. The draft is the same
+ // Change Notice still shows its BOM/BOP on the item master. The draft is the same
// makeMethod the CO edits, so the two surfaces stay in sync. Active is still
// preferred below, so a Version CO's item keeps its live method as the default.
const selectable = makeMethods.data ?? [];
@@ -83,7 +86,7 @@ export async function loader({ request, params }: LoaderFunctionArgs) {
tags: [],
revisionStatus,
releaseControl,
- ...changeOrderData
+ ...changeNoticeData
};
}
@@ -94,7 +97,7 @@ export async function loader({ request, params }: LoaderFunctionArgs) {
tags: [],
revisionStatus,
releaseControl,
- ...changeOrderData
+ ...changeNoticeData
};
}
@@ -129,7 +132,7 @@ export async function loader({ request, params }: LoaderFunctionArgs) {
tags: tags.data ?? [],
revisionStatus,
releaseControl,
- ...changeOrderData
+ ...changeNoticeData
};
}
@@ -216,10 +219,19 @@ export default function ToolDetailsRoute() {
tags,
revisionStatus,
releaseControl,
- changeOrders,
- changeOrderTypes
+ changeNotices,
+ changeNoticeTypes
} = useLoaderData<typeof loader>();
+ const draftLock = getChangeNoticeDraftLock(
+ methodData?.makeMethod.changeOrderId,
+ changeNotices
+ );
+ const lockReason = draftLock ? (
+ <ChangeNoticeDraftLockReason lock={draftLock} />
+ ) : undefined;
+ const lockHint = lockReason ? <LockedHint reason={lockReason} /> : undefined;
+
const toolData = useRouteData<{
toolSummary: ToolSummary;
files: Promise<ItemFile[]>;
@@ -239,7 +251,7 @@ export default function ToolDetailsRoute() {
return (
<VStack spacing={2} className="p-2">
{permissions.is("employee") && (
- <ItemOpenChangeOrderAlert changeOrders={changeOrders ?? []} />
+ <ItemOpenChangeNoticeAlert changeNotices={changeNotices ?? []} />
)}
{permissions.is("employee") && methodData && (
<>
@@ -289,6 +301,8 @@ export default function ToolDetailsRoute() {
replenishmentSystem={toolData.toolSummary?.replenishmentSystem}
revisionStatus={revisionStatus}
releaseControl={releaseControl}
+ isDisabled={!!draftLock}
+ disabledReason={lockReason}
/>
<BillOfProcess
key={`bop:${itemId}`}
@@ -298,6 +312,8 @@ export default function ToolDetailsRoute() {
tags={tags}
revisionStatus={revisionStatus}
releaseControl={releaseControl}
+ isDisabled={!!draftLock}
+ disabledReason={lockReason}
/>
</>
)}
@@ -312,21 +328,24 @@ export default function ToolDetailsRoute() {
itemId={itemId}
modelUpload={toolData.toolSummary ?? undefined}
type="Tool"
+ isReadOnly={!!draftLock}
+ titleExtras={lockHint}
/>
)}
</DeferredFiles>
<CadModel
- isReadOnly={!permissions.can("update", "parts")}
+ isReadOnly={!permissions.can("update", "parts") || !!draftLock}
metadata={{ itemId }}
modelPath={toolData?.toolSummary?.modelPath ?? null}
title={t`CAD Model`}
+ titleExtras={lockHint}
/>
<ItemRiskRegister itemId={itemId} />
- <ItemChangeOrders
- changeOrders={changeOrders ?? []}
- types={changeOrderTypes ?? []}
+ <ItemChangeNotices
+ changeNotices={changeNotices ?? []}
+ types={changeNoticeTypes ?? []}
/>
</>
)}
diff --git a/apps/erp/app/routes/x+/tool+/$itemId.tsx b/apps/erp/app/routes/x+/tool+/$itemId.tsx
index c670031837..44e81cdbe8 100644
--- a/apps/erp/app/routes/x+/tool+/$itemId.tsx
+++ b/apps/erp/app/routes/x+/tool+/$itemId.tsx
@@ -29,8 +29,8 @@ import { ResizablePanels } from "~/components/Layout";
import { flattenTree } from "~/components/TreeView";
import type { ItemFile, ToolSummary } from "~/modules/items";
import {
- changeOrderOpenStatuses,
- findChangeOrdersForItem,
+ changeNoticeOpenStatuses,
+ findChangeNoticesForItem,
getItemFiles,
getItemSupersededBy,
getItemSupersession,
@@ -74,7 +74,7 @@ export async function loader({ request, params }: LoaderFunctionArgs) {
tags,
supersession,
supersededBy,
- openChangeOrders
+ openChangeNotices
] = await Promise.all([
getTool(client, itemId, companyId),
getSupplierParts(client, itemId, companyId),
@@ -83,10 +83,10 @@ export async function loader({ request, params }: LoaderFunctionArgs) {
getItemSupersession(client, itemId, companyId),
getItemSupersededBy(client, itemId, companyId),
// Locks manual version/revision creation while a CO owns this tool
- findChangeOrdersForItem(client, {
+ findChangeNoticesForItem(client, {
itemId,
companyId,
- statuses: changeOrderOpenStatuses
+ statuses: changeNoticeOpenStatuses
})
]);
@@ -143,7 +143,7 @@ export async function loader({ request, params }: LoaderFunctionArgs) {
tags: tags.data ?? [],
usedIn: getPartUsedIn(client, itemId, companyId),
methodTree,
- openChangeOrders: openChangeOrders.data ?? []
+ openChangeNotices: openChangeNotices.data ?? []
};
}
diff --git a/apps/erp/app/services/action-task.server.ts b/apps/erp/app/services/action-task.server.ts
new file mode 100644
index 0000000000..a604a49806
--- /dev/null
+++ b/apps/erp/app/services/action-task.server.ts
@@ -0,0 +1,56 @@
+import type { Database } from "@carbon/database";
+import type { ActionTaskEntityType } from "@carbon/ee/action-task-entity";
+import { actionTaskEntities } from "@carbon/ee/action-task-entity";
+import type { SupabaseClient } from "@supabase/supabase-js";
+
+// The readable identifier on each action task's parent, used for the Linear
+// attachment / Jira remote-link title.
+const actionTaskParents: Record<
+ ActionTaskEntityType,
+ { parentTable: string; readableColumn: string }
+> = {
+ nonConformanceActionTask: {
+ parentTable: "nonConformance",
+ readableColumn: "nonConformanceId"
+ },
+ changeOrderActionTask: {
+ parentTable: "changeOrder",
+ readableColumn: "changeOrderId"
+ }
+};
+
+export type ActionTaskWithParent = {
+ id: string | null;
+ notes: unknown;
+ parentId: string | null;
+ parentReadableId: string | null;
+};
+
+// Entity-aware action-task read: resolves the task plus its parent (NCR or change notice) — reads an action
+// task and its parent's readable id from whichever table the entity type names.
+export async function getActionTaskWithParent(
+ client: SupabaseClient<Database>,
+ entityType: ActionTaskEntityType,
+ taskId: string,
+ companyId: string
+): Promise<ActionTaskWithParent> {
+ const { table, parentColumn } = actionTaskEntities[entityType];
+ const { parentTable, readableColumn } = actionTaskParents[entityType];
+
+ const result = await client
+ .from(table)
+ .select(`id, notes, ${parentColumn}, ${parentTable}(${readableColumn})`)
+ .eq("id", taskId)
+ .eq("companyId", companyId)
+ .maybeSingle();
+
+ // The select string is built from the entity map, which erases Supabase's row typing
+ const row = result.data as Record<string, any> | null;
+
+ return {
+ id: row?.id ?? null,
+ notes: row?.notes ?? null,
+ parentId: row?.[parentColumn] ?? null,
+ parentReadableId: row?.[parentTable]?.[readableColumn] ?? null
+ };
+}
diff --git a/apps/erp/app/utils/path.ts b/apps/erp/app/utils/path.ts
index 115809e2ab..f6f394382e 100644
--- a/apps/erp/app/utils/path.ts
+++ b/apps/erp/app/utils/path.ts
@@ -366,58 +366,61 @@ export const path = {
calibrations: `${x}/quality/calibrations`,
cancelPurchasingRfq: (id: string) =>
generatePath(`${x}/purchasing-rfq/${id}/cancel`),
- changeOrder: (id: string) => generatePath(`${x}/items/change-order/${id}`),
- changeOrderAction: (id: string) =>
- generatePath(`${x}/items/change-order/${id}/action`),
- changeOrderActionOrder: (id: string) =>
- generatePath(`${x}/items/change-order/${id}/action/order`),
- changeOrderActionStatus: (id: string, actionId: string) =>
- generatePath(`${x}/items/change-order/${id}/action/${actionId}/status`),
- // Change Order content (Phase 2): BOM change rows + per-assembly targets, and
+ changeNotice: (id: string) =>
+ generatePath(`${x}/items/change-notice/${id}`),
+ changeNoticeAction: (id: string) =>
+ generatePath(`${x}/items/change-notice/${id}/action`),
+ changeNoticeActionOrder: (id: string) =>
+ generatePath(`${x}/items/change-notice/${id}/action/order`),
+ changeNoticeActionStatus: (id: string, actionId: string) =>
+ generatePath(`${x}/items/change-notice/${id}/action/${actionId}/status`),
+ // Change Notice content (Phase 2): BOM change rows + per-assembly targets, and
// freeform actions. Top-to-bottom: affected items selected first, then
// per-item staged BOM/BOP/attributes edited in place.
- changeOrderAffected: (id: string) =>
- generatePath(`${x}/items/change-order/${id}/affected`),
- changeOrderAffectedChangeType: (id: string, affectedId: string) =>
+ changeNoticeAffected: (id: string) =>
+ generatePath(`${x}/items/change-notice/${id}/affected`),
+ changeNoticeAffectedChangeType: (id: string, affectedId: string) =>
generatePath(
- `${x}/items/change-order/${id}/affected/${affectedId}/change-type`
+ `${x}/items/change-notice/${id}/affected/${affectedId}/change-type`
),
- changeOrderAffectedCutover: (id: string, affectedId: string) =>
+ changeNoticeAffectedCutover: (id: string, affectedId: string) =>
generatePath(
- `${x}/items/change-order/${id}/affected/${affectedId}/cutover`
+ `${x}/items/change-notice/${id}/affected/${affectedId}/cutover`
),
// Each affected item is its own line-item detail route (mirrors the sales
// order line detail `${x}/sales-order/${orderId}/${lineId}/details`). The URL
// drives selection — refresh + back/forward reselect it.
- changeOrderAffectedItem: (id: string, affectedId: string) =>
- generatePath(`${x}/items/change-order/${id}/${affectedId}/details`),
+ changeNoticeAffectedItem: (id: string, affectedId: string) =>
+ generatePath(`${x}/items/change-notice/${id}/${affectedId}/details`),
+ changeNoticeContent: (id: string) =>
+ generatePath(`${x}/items/change-notice/${id}/content`),
// Delete action for a supplier part managed on a CO line (Buy Revision/New
// Part). Create/edit are reached relatively from the SupplierParts grid.
- changeOrderDeleteSupplierPart: (
+ changeNoticeDeleteSupplierPart: (
id: string,
affectedId: string,
supplierPartId: string
) =>
generatePath(
- `${x}/items/change-order/${id}/${affectedId}/details/${supplierPartId}/delete`
+ `${x}/items/change-notice/${id}/${affectedId}/details/${supplierPartId}/delete`
),
- changeOrderDetails: (id: string) =>
- generatePath(`${x}/items/change-order/${id}/details`),
- changeOrderRequiredAction: (id: string) =>
- generatePath(`${x}/items/change-order-actions/${id}`),
- // Change Order Actions config (the changeOrderRequiredAction default-action
- // templates) — a sibling of the CO list, like change-order-types above.
- changeOrderRequiredActions: `${x}/items/change-order-actions`,
- changeOrderStatus: (id: string) =>
- generatePath(`${x}/items/change-order/${id}/status`),
- // Change Orders — a sub-area of the Items module. List + config live under
- // /x/items/change-orders; the detail record lives under /x/items/change-order/:id.
- changeOrders: `${x}/items/change-orders`,
- changeOrderType: (id: string) =>
- generatePath(`${x}/items/change-order-types/${id}`),
- // Change Order Types — a sibling of the CO list (not nested under it), so the
+ changeNoticeDetails: (id: string) =>
+ generatePath(`${x}/items/change-notice/${id}/details`),
+ changeNoticeRequiredAction: (id: string) =>
+ generatePath(`${x}/items/change-notice-actions/${id}`),
+ // Change Notice Actions config (the changeNoticeRequiredAction default-action
+ // templates) — a sibling of the CO list, like change-notice-types above.
+ changeNoticeRequiredActions: `${x}/items/change-notice-actions`,
+ changeNoticeStatus: (id: string) =>
+ generatePath(`${x}/items/change-notice/${id}/status`),
+ // Change Notices — a sub-area of the Items module. List + config live under
+ // /x/items/change-notices; the detail record lives under /x/items/change-notice/:id.
+ changeNotices: `${x}/items/change-notices`,
+ changeNoticeType: (id: string) =>
+ generatePath(`${x}/items/change-notice-types/${id}`),
+ // Change Notice Types — a sibling of the CO list (not nested under it), so the
// Items sidebar doesn't highlight both entries via prefix matching.
- changeOrderTypes: `${x}/items/change-order-types`,
+ changeNoticeTypes: `${x}/items/change-notice-types`,
chartOfAccount: (id: string) =>
generatePath(`${x}/accounting/charts/${id}`),
chartOfAccounts: `${x}/accounting/charts`,
@@ -556,18 +559,18 @@ export const path = {
generatePath(
`${x}/inventory/batch-property/${itemId}/property/delete/${id}`
),
- deleteChangeOrder: (id: string) =>
- generatePath(`${x}/items/change-order/delete/${id}`),
- deleteChangeOrderAction: (id: string, actionId: string) =>
- generatePath(`${x}/items/change-order/${id}/action/delete/${actionId}`),
- deleteChangeOrderAffected: (id: string, affectedId: string) =>
+ deleteChangeNotice: (id: string) =>
+ generatePath(`${x}/items/change-notice/delete/${id}`),
+ deleteChangeNoticeAction: (id: string, actionId: string) =>
+ generatePath(`${x}/items/change-notice/${id}/action/delete/${actionId}`),
+ deleteChangeNoticeAffected: (id: string, affectedId: string) =>
generatePath(
- `${x}/items/change-order/${id}/affected/delete/${affectedId}`
+ `${x}/items/change-notice/${id}/affected/delete/${affectedId}`
),
- deleteChangeOrderRequiredAction: (id: string) =>
- generatePath(`${x}/items/change-order-actions/delete/${id}`),
- deleteChangeOrderType: (id: string) =>
- generatePath(`${x}/items/change-order-types/delete/${id}`),
+ deleteChangeNoticeRequiredAction: (id: string) =>
+ generatePath(`${x}/items/change-notice-actions/delete/${id}`),
+ deleteChangeNoticeType: (id: string) =>
+ generatePath(`${x}/items/change-notice-types/delete/${id}`),
deleteCompany: (id: string) =>
generatePath(`${x}/settings/companies/delete/${id}`),
deleteConfigurationParameter: (itemId: string, id: string) =>
@@ -1388,13 +1391,13 @@ export const path = {
// Create form lives at its own top-level route (like /x/part/new and
// /x/sales-order/new) so it renders with the app sidebar rather than nested
// under the Items module layout.
- newChangeOrder: `${x}/change-order/new`,
+ newChangeNotice: `${x}/change-notice/new`,
// One-click create-a-CO-for-this-item (POST) — used by the part version
// dropdown and the new-revision modal.
- newChangeOrderFromItem: (itemId: string) =>
- generatePath(`${x}/items/change-order/new-from-item/${itemId}`),
- newChangeOrderRequiredAction: `${x}/items/change-order-actions/new`,
- newChangeOrderType: `${x}/items/change-order-types/new`,
+ newChangeNoticeFromItem: (itemId: string) =>
+ generatePath(`${x}/items/change-notice/new-from-item/${itemId}`),
+ newChangeNoticeRequiredAction: `${x}/items/change-notice-actions/new`,
+ newChangeNoticeType: `${x}/items/change-notice-types/new`,
newChartOfAccount: `${x}/accounting/charts/new`,
newChartOfAccountGroup: `${x}/accounting/charts/new-group`,
newCompany: `${x}/settings/company/new`,
@@ -2101,7 +2104,7 @@ export const path = {
uoms: `${x}/items/uom`,
updateAssemblyUnit: (id: string, unitId: string) =>
generatePath(`${x}/assembly/${id}/units/${unitId}`),
- updateChangeOrder: `${x}/items/change-order/update`,
+ updateChangeNotice: `${x}/items/change-notice/update`,
updateInspectionDocumentName: (id: string) =>
generatePath(`${x}/inspection-document/${id}/update-name`),
updateIssueItem: `${x}/issue/item/update`,
diff --git a/docs/content/docs/reference/audit-log.mdx b/docs/content/docs/reference/audit-log.mdx
index 7fa0c7bd93..9061b4621f 100644
--- a/docs/content/docs/reference/audit-log.mdx
+++ b/docs/content/docs/reference/audit-log.mdx
@@ -33,7 +33,7 @@ Carbon tracks a fixed set of entities. Anything not on this list is not audited.
| Sales Invoice | Purchase Invoice |
| Quote | Supplier Quote |
| Job | Employee |
-| Non-Conformance | Change Order |
+| Non-Conformance | Change Notice |
| Gauge | Shipment |
| Receipt | Warehouse Transfer |
| Stock Transfer | Inventory Count |
diff --git a/docs/content/docs/reference/change-orders/change-types.mdx b/docs/content/docs/reference/change-orders/change-types.mdx
index 11bbd8477b..d829ff84ef 100644
--- a/docs/content/docs/reference/change-orders/change-types.mdx
+++ b/docs/content/docs/reference/change-orders/change-types.mdx
@@ -4,7 +4,7 @@ description: Version, Revision, Replacement Part, and New Part — the per-affec
---
Change type is set per affected item (default **Version**) and is the most load-bearing field on the whole
-change order. It decides two things at once: what you're allowed to edit on the draft, and what release
+change notice. It decides two things at once: what you're allowed to edit on the draft, and what release
creates from it. Two axes tell the four types apart: is there a **predecessor** item, and does the result keep
the **same part number**.
@@ -15,7 +15,7 @@ the **same part number**.
| Version | BoM and BoP on the **same item** | A new **method version**; the prior Active version is archived | None |
| Revision | Attributes, documents, BoM and BoP | A new **item revision** (same Part ID, next revision) | Old revision → new revision |
| Replacement Part | Attributes, documents, BoM and BoP | A **new part number** derived from the affected part | Affected part → new part |
-| New Part | Attributes, documents, BoM and BoP | A **net-new part** minted under the change order | None — it has no predecessor |
+| New Part | Attributes, documents, BoM and BoP | A **net-new part** minted under the change notice | None — it has no predecessor |
<Callout type="info" title="A Version bumps the method; the two replacement types mint a new item; New Part is net-new.">
Don't conflate them. A **Version** produces a new method version on the *same* item row, so existing stock and
@@ -53,9 +53,9 @@ Change type also controls the editable surface on the affected item:
- **Revision**, **Replacement Part**, and **New Part** add **Part Properties** (attributes) and documents on
top of BoM and BoP, because each is producing a genuinely new item, not just a new recipe.
-<Callout type="warning" title="Change orders operate on Parts only.">
+<Callout type="warning" title="Change notices operate on Parts only.">
The **Add Affected Item** picker accepts **Parts only** — the existing-item selector is filtered to Parts, and
-the New Part mini-form always mints a Part. There's no Tool path in the change-order UI.
+the New Part mini-form always mints a Part. There's no Tool path in the change-notice UI.
</Callout>
<Callout type="warning" title="A purchased item can't take a Version.">
@@ -75,7 +75,7 @@ Choosing **New Part** in the change-type selector swaps the affected-item modal
<Field name="Tracking Type" required>Inventory, Non-Inventory, Serial, or Batch. Defaults to **Inventory**.</Field>
</FieldTable>
-Submitting mints an inactive Part under the change order and adds it as a **New Part** affected item. It stays
+Submitting mints an inactive Part under the change notice and adds it as a **New Part** affected item. It stays
hidden until release reveals it.
## Supplier parts on a purchased line
@@ -90,7 +90,7 @@ here the same way you would on a live part.
A draft item starts with **no** supplier parts — the source item's suppliers aren't copied onto the draft. If a
purchased Revision, Replacement Part, or New Part releases with an empty grid, the new part is stocked but has
no way to buy it, so a purchase order can't reference it. Fill the grid on the line first. The suppliers you add
-show up in the change order's [changes](/docs/reference/change-orders/lifecycle#review-the-changes-then-release)
+show up in the change notice's [changes](/docs/reference/change-orders/lifecycle#review-the-changes-then-release)
as additions.
</Callout>
@@ -101,6 +101,6 @@ as additions.
What release does with each change type.
</Card>
<Card title="Methods & sourcing" href="/docs/reference/methods">
- Method versions and the Draft/Active/Archived states a change order drives.
+ Method versions and the Draft/Active/Archived states a change notice drives.
</Card>
</Cards>
diff --git a/docs/content/docs/reference/change-orders/creating.mdx b/docs/content/docs/reference/change-orders/creating.mdx
index 1cd7e7325c..4b212a60fb 100644
--- a/docs/content/docs/reference/change-orders/creating.mdx
+++ b/docs/content/docs/reference/change-orders/creating.mdx
@@ -1,25 +1,25 @@
---
-title: Create a change order
-description: The entry points that open a change order, the fields on the create form, and how change orders surface back on a part or tool page.
+title: Create a change notice
+description: The entry points that open a change notice, the fields on the create form, and how change notices surface back on a part or tool page.
---
-There's no single "new change order" button tucked in one menu. Carbon lets you start a change order from
+There's no single "new change notice" button tucked in one menu. Carbon lets you start a change notice from
wherever you notice the change is needed — a standalone form, the part you're looking at, its method version
-menu, or a quality issue. Every path lands on the same change-order detail page.
+menu, or a quality issue. Every path lands on the same change-notice detail page.
## Entry points
<FieldTable>
- <Field name="Items → Change Orders → New">The standalone form. Start here when the change spans several parts or you haven't opened a specific one yet.</Field>
- <Field name="Part or Tool header → Create Change Order">Opens the create form as a modal with the current part or tool pre-attached as the first affected item.</Field>
- <Field name="Parts table → row menu → Create Change Order">A one-click start: mints the change order, attaches that part, and drops you on its detail page.</Field>
- <Field name="Method version menu → New Change Order">On a part's method, the same version menu that holds **New Version** offers **New Change Order** — the natural place to reach for a change while you're looking at the recipe.</Field>
- <Field name="Quality issue → Create Change Order">From a non-conformance, this opens a change order with the issue linked, so the engineering fix is traceable back to the problem that prompted it.</Field>
+ <Field name="Items → Change Notices → New">The standalone form. Start here when the change spans several parts or you haven't opened a specific one yet.</Field>
+ <Field name="Part or Tool header → Create Change Notice">Opens the create form as a modal with the current part or tool pre-attached as the first affected item.</Field>
+ <Field name="Parts table → row menu → Create Change Notice">A one-click start: mints the change notice, attaches that part, and drops you on its detail page.</Field>
+ <Field name="Method version menu → New Change Notice">On a part's method, the same version menu that holds **New Version** offers **New Change Notice** — the natural place to reach for a change while you're looking at the recipe.</Field>
+ <Field name="Quality issue → Create Change Notice">From a non-conformance, this opens a change notice with the issue linked, so the engineering fix is traceable back to the problem that prompted it.</Field>
</FieldTable>
<Callout type="info" title="Starting from a part pre-attaches it.">
The part-header, tool-header, parts-table, and method-version entry points all pre-select that part or tool as
-the change order's first affected item, so you land ready to pick a change type and edit. The standalone form
+the change notice's first affected item, so you land ready to pick a change type and edit. The standalone form
starts with no affected items — you add them on the detail page.
</Callout>
@@ -29,7 +29,7 @@ The header form is short — the substance is in the affected items you edit lat
<FieldTable>
<Field name="Name" required>What this change is, in a line.</Field>
- <Field name="Category">The change-order type, drawn from your configured categories. See [Categories & actions](/docs/reference/change-orders/setup).</Field>
+ <Field name="Category">The change-notice type, drawn from your configured categories. See [Categories & actions](/docs/reference/change-orders/setup).</Field>
<Field name="Reason for Change">Why the change is needed. Rich text.</Field>
<Field name="Description of Change">What's changing, in narrative. Rich text.</Field>
<Field name="Owner">The employee responsible.</Field>
@@ -39,35 +39,42 @@ The header form is short — the substance is in the affected items you edit lat
</FieldTable>
The form has no affected-items field — you add those on the detail page after creating. When you start from a
-part, tool, or quality issue, that source is carried silently onto the new change order (the part or tool as a
-pre-attached affected item, the non-conformance as the linked issue). Submitting creates the change order,
+part, tool, or quality issue, that source is carried silently onto the new change notice (the part or tool as a
+pre-attached affected item, the non-conformance as the linked issue). Submitting creates the change notice,
attaches any pre-selected item, and redirects to its detail page at **"Draft"**.
-<Callout type="note" title="There's no separate change-order permission.">
-Change orders are gated by the **Parts** permission: creating one needs create access on Parts, and
-advancing or releasing needs update access. If someone can manage parts, they can manage change orders.
+<Callout type="note" title="There's no separate change-notice permission.">
+Change notices are gated by the **Parts** permission: creating one needs create access on Parts, and
+advancing or releasing needs update access. If someone can manage parts, they can manage change notices.
</Callout>
-## Where change orders surface on a part
+## Where change notices surface on a part
-Change orders don't just live in their own list — they show up on the parts and tools they touch, so nobody
+Change notices don't just live in their own list — they show up on the parts and tools they touch, so nobody
edits a design that's mid-change without seeing it.
-- **Open change order alert.** When a part is on one or more change orders that haven't reached **"Done"**,
- its detail page shows a warning: *"This part is on 1 open change order"* (or *"…# open change orders"*),
- with each change order id linked. This is the guardrail against two people revising the same part blind.
- It's informational, not a lock — [parallel change orders on the same
- part](/docs/reference/change-orders/lifecycle#parallel-change-orders-on-the-same-part) are allowed.
-- **Change Orders history.** A card lists every change order that has touched the part, newest first, with
+- **Open change notice alert.** When a part is on one or more change notices that haven't reached **"Done"**,
+ its detail page shows a warning: *"This part is on 1 open change notice"* (or *"…# open change notices"*),
+ with each change notice id linked. This is the guardrail against two people revising the same part blind.
+ It's informational, not a lock — [parallel change notices on the same
+ part](/docs/reference/change-orders/lifecycle#parallel-change-notices-on-the-same-part) are allowed.
+- **Change Notices history.** A card lists every change notice that has touched the part, newest first, with
released ones de-emphasized — the full "why did this part change?" trail.
-- **Provenance back-link.** A revision or part created by a released change order carries a *"Created by
- ECO-…"* reference to the change order that made it.
+- **Provenance back-link.** A revision or part created by a released change notice carries a *"Created by
+ CN-…"* reference to the change notice that made it.
-<Callout type="note" title="Change orders are numbered ECO-.">
-Each change order gets a per-company readable id like **ECO-000001**. That's the id you'll see in the alert,
+<Callout type="note" title="Change notices are numbered CN-.">
+Each change notice gets a per-company readable id like **CN-000001**. That's the id you'll see in the alert,
the history card, and the provenance link.
</Callout>
+<Callout type="info" title="Records created before the rename keep their ECO- ids.">
+The feature used to be called a change order and numbered **ECO-000001**. Only *new* records pick up the
+**CN-** prefix — existing ids are left exactly as they were, because they're audit trail and are quoted in
+drawings, emails, and customer correspondence. So a mature company will see both **ECO-000042** and
+**CN-000043** in the same list. They're the same kind of record.
+</Callout>
+
## Related
<Cards>
diff --git a/docs/content/docs/reference/change-orders/index.mdx b/docs/content/docs/reference/change-orders/index.mdx
index 6c76439566..e70c7d29c9 100644
--- a/docs/content/docs/reference/change-orders/index.mdx
+++ b/docs/content/docs/reference/change-orders/index.mdx
@@ -1,66 +1,67 @@
---
-title: Change orders
+title: Change notices
description: How Carbon drafts an engineering change against real methods, reviews it as a diff, and releases it so downstream planning supersedes the versions it replaces.
---
-A **change order** groups the parts whose designs are changing, revises each one on a hidden draft, and
+A **change notice** groups the parts whose designs are changing, revises each one on a hidden draft, and
releases them together. It answers "what changed, who owns it, and what does the new version supersede?"
without touching a live method until you release.
The model is deliberately top-down. You pick the affected items first, then edit each item's real
-<Term id="bom">method</Term> (its bill of materials and bill of process) inside the change order. Nothing
-about the part moves for planning, jobs, or costing until release. Change orders live under **Items → Change
-Orders**, and every action is gated by the `parts` permission.
+<Term id="bom">method</Term> (its bill of materials and bill of process) inside the change notice. Nothing
+about the part moves for planning, jobs, or costing until release. Change notices live under **Items → Change
+Notices**, and every action is gated by the `parts` permission.
## The affected item is the unit of work
-A change order is a header plus a list of **affected items**. The picker accepts **Parts only** — materials,
-consumables, services, and tools have no path in the change-order UI, so they're excluded. Each affected item
+A change notice is a header plus a list of **affected items**. The picker accepts **Parts only** — materials,
+consumables, services, and tools have no path in the change-notice UI, so they're excluded. Each affected item
carries its own <Term id="change-order-change-type">change type</Term>, its own edits, and its own cutover
configuration.
Adding an affected item snapshots the item's live **Active** method into a new **Draft** method stamped with
-the change order's id. That draft is hidden from every version switcher, copy-target picker, and MRP, job, or
+the change notice's id. That draft is hidden from every version switcher, copy-target picker, and MRP, job, or
cost read until release. You edit it with the same **Bill of Material**, **Bill of Process**, and **Part
Properties** editors you use anywhere else.
<Callout type="note" title="The draft is a real method, not a staged copy.">
Carbon does not mirror your edits into shadow tables. An affected item's edits live on an actual make method
-whose change-order id is set, which is why the diff is exact and release is just an activation. The draft is
+whose change-notice id is set, which is why the diff is exact and release is just an activation. The draft is
invisible everywhere else precisely because that id is set — clearing it at release is what makes the draft
live.
</Callout>
## Find one in the list
-**Items → Change Orders** lists every change order. Because the affected item is the unit of work, each row
+**Items → Change Notices** lists every change notice. Because the affected item is the unit of work, each row
**expands** to reveal the parts it changes — one line per affected item, with its change type badge and, for a
Revision or Replacement Part, the old item number arrowed to the new one (**P000123 → P000124**). A New Part
-shows a single id — it's net-new, with no predecessor to arrow from. You see what a change order touches
+shows a single id — it's net-new, with no predecessor to arrow from. You see what a change notice touches
without opening it.
-To find the change orders that touch a specific part, use the **Item** filter. Pick one or more items and the
-list narrows to change orders that affect them. The **Items** column that backs the filter is hidden by
+To find the change notices that touch a specific part, use the **Item** filter. Pick one or more items and the
+list narrows to change notices that affect them. The **Items** column that backs the filter is hidden by
default; turn it on from the column toggle if you want it in view or in a CSV export.
## How the pieces fit
<Cards>
- <Card title="Create a change order" href="/docs/reference/change-orders/creating">
- Every entry point — the standalone form, a part header, the parts table, the method version menu, and a
- quality issue — plus how change orders surface back on a part.
+ <Card title="Create a change notice" href="/docs/reference/change-orders/creating">
+ Every entry point — the standalone form, a part or tool header, the parts table, the method version
+ menu, and a quality issue — plus how change notices surface back on a part.
</Card>
<Card title="Change types" href="/docs/reference/change-orders/change-types">
Version, Revision, Replacement Part, and New Part: what each lets you edit and what release creates.
</Card>
<Card title="Lifecycle & release" href="/docs/reference/change-orders/lifecycle">
- The five stages, the diff review, the impact panel, and what release actually does.
+ The five stages, the Implementation lock and Reopen, the diff review, the impact panel, and what release
+ actually does.
</Card>
<Card title="Supersession & cutover" href="/docs/reference/change-orders/supersession">
How a released revision phases over, and how MRP and Get Method honor it downstream.
</Card>
<Card title="Categories & actions" href="/docs/reference/change-orders/setup">
- The change-order category lookup and the reusable action-task templates.
+ The change-notice category lookup, the reusable action-task templates, and linking a task to Linear.
</Card>
</Cards>
@@ -71,6 +72,6 @@ default; turn it on from the column toggle if you want it in view or in a CSV ex
The narrative tour: draft a change, review the diff, release, and let supersession carry it downstream.
</Card>
<Card title="Methods & sourcing" href="/docs/reference/methods">
- Method versions, Draft/Active/Archived, and Get Method — the machinery a change order drives.
+ Method versions, Draft/Active/Archived, and Get Method — the machinery a change notice drives.
</Card>
</Cards>
diff --git a/docs/content/docs/reference/change-orders/lifecycle.mdx b/docs/content/docs/reference/change-orders/lifecycle.mdx
index bacb9d6904..23202eb61c 100644
--- a/docs/content/docs/reference/change-orders/lifecycle.mdx
+++ b/docs/content/docs/reference/change-orders/lifecycle.mdx
@@ -1,33 +1,75 @@
---
title: Lifecycle & release
-description: The five change-order stages, the impact panel, the diff review, and exactly what release does when a change order reaches Done.
+description: The five change-notice stages, the Implementation lock and Reopen, the impact panel, the diff review, and exactly what release does when a change notice reaches Done.
---
-A change order advances forward one stage at a time. There's no approval toggle and no going back — the
-stages *are* the workflow, and the change order is its own release gate. The one exit is **"Cancel"**,
-available from every open stage; a cancelled change order can later be reopened to **"Draft"**.
+A change notice advances forward one stage at a time. There's no approval toggle — the stages *are* the
+workflow, and the change notice is its own release gate. There are two ways back: **Reopen** at
+**"Implementation"** sends it one stage back to **"Engineering Complete"**, and **"Cancel"** — available from
+every open stage — closes it, after which **Reopen** returns it to **"Draft"**.
## The stages
<StatusFlow>
- <Status name="Draft">The change order is being written. Pick affected items, set change types, and edit each draft method. Nothing is broadcast.</Status>
+ <Status name="Draft">The change notice is being written. Pick affected items, set change types, and edit each draft method. Nothing is broadcast.</Status>
<Status name="Start">Work is underway. Advancing to Start broadcasts a notification to the team.</Status>
<Status name="Engineering Complete">The design edits are finished and ready for implementation review. Silent, no broadcast.</Status>
- <Status name="Implementation" accent>The release stage. The **"Release"** action is available here; it reviews every affected item's diff and applies the change. Advancing here broadcasts.</Status>
- <Status name="Done" terminal>Released and locked. The change order becomes a read-only historical record; broadcasts on entry.</Status>
- <Status name="Cancelled" terminal>The off-ramp. The header's **"Cancel"** action closes the change order from any open stage without releasing anything. Locked like **"Done"**, but reversible: **"Reopen"** returns it to **"Draft"**.</Status>
+ <Status name="Implementation" accent>The release stage. The engineering content freezes here, and the **"Release"** action becomes available; it reviews every affected item's diff and applies the change. Advancing here broadcasts.</Status>
+ <Status name="Done" terminal>Released and locked. The change notice becomes a read-only historical record; broadcasts on entry.</Status>
+ <Status name="Cancelled" terminal>The off-ramp. The header's **"Cancel"** action closes the change notice from any open stage without releasing anything. Locked like **"Done"**, but reversible: **"Reopen"** returns it to **"Draft"**.</Status>
</StatusFlow>
The **"Start"**, **"Implementation"**, and **"Done"** transitions each notify the team; **"Engineering
-Complete"** is silent. Once a change order reaches **"Done"** it is locked — every editor is read-only.
+Complete"** is silent. Once a change notice reaches **"Done"** it is locked — every editor is read-only.
**"Cancelled"** is locked too, but not lost: cancelling keeps every affected item's draft, and **"Reopen"**
-takes the change order back to **"Draft"** to pick up where it left off. Only **"Done"** is permanent.
-Deleting a change order is the destructive path — that discards each affected item's draft and any new
-items the change order minted, so nothing is orphaned.
+takes the change notice back to **"Draft"** to pick up where it left off. Only **"Done"** is permanent.
+Deleting a change notice is the destructive path — that discards each affected item's draft and any new
+items the change notice minted, so nothing is orphaned.
+
+## Implementation freezes the engineering content
+
+Advancing to **"Implementation"** means "we are now rolling this out." From that moment the *engineering*
+content is read-only, so what's being implemented can't shift underneath the people implementing it. The
+*workflow* content stays editable, because coordinating the rollout is exactly the work that happens at this
+stage.
+
+| Locked at Implementation (engineering) | Still editable at Implementation (workflow) |
+| --- | --- |
+| Adding or removing affected items | Action tasks — add, complete, skip, reorder, delete |
+| Changing an affected item's change type | Assignee |
+| The staged **Bill of Material** and **Bill of Process** drafts | Due date |
+| The cutover config (supersession mode, discontinuation date, successor effectivity date) | Priority |
+| **Reason for Change** and **Description of Change** | Category |
+
+The lock is enforced on the server, not just greyed out in the UI. If a stale tab tries to write a frozen
+field you get *"This change notice is being implemented, so its changes are locked. Reopen it to make
+changes."*
+
+<Callout type="info" title="Reviewing still works while frozen.">
+Freezing only blocks writes. The **Changes** rollup, each affected item's diff, and the impact panel all stay
+visible at Implementation — you can read the whole change, you just can't edit it.
+</Callout>
+
+## Reopen
+
+If review at Implementation turns up something that has to change, use **Reopen** in the **⋮** menu next to
+the change notice id. It sends the notice back one stage to **"Engineering Complete"**, which unfreezes the
+affected items, the drafts, the cutover config, and the narrative fields. Nothing you've already done is
+discarded — the drafts, diffs, and action tasks are exactly as you left them. Edit, then advance to
+Implementation again. (The same **Reopen** action appears on a **"Cancelled"** notice, where it returns it to
+**"Draft"** instead.)
+
+<Callout type="warning" title="Done is terminal — there is no reopen from Done.">
+Reopen exists only at **"Implementation"** (before release) and at **"Cancelled"** (nothing was released).
+Releasing to **"Done"** has already activated the new method versions, revealed the new items, and written the
+supersessions that downstream MRP and Get Method are now acting on. Un-doing that would mean retracting live
+planning decisions, so Carbon doesn't offer it. To change the same parts again, raise a new change notice —
+the released methods and items are its starting point.
+</Callout>
## The impact panel
-Alongside the affected items, a change order shows an **Impact** panel: a where-used tree for each affected
+Alongside the affected items, a change notice shows an **Impact** panel: a where-used tree for each affected
item across jobs, job materials, method materials, purchase orders, receipts, quotes, issues, maintenance,
and assembly instructions.
@@ -39,13 +81,13 @@ nothing here blocks releasing."*
## Review the changes, then release
-You don't have to wait for release to see what a change order does. The overview page carries a **Changes**
+You don't have to wait for release to see what a change notice does. The overview page carries a **Changes**
card, between the description and the action tasks, that rolls up **every** affected item's diff as you author
it — each item labeled with its change type, its diff rendered read-only. It's the same view the release dialog
shows, available the whole time so you can check your work before you commit. An item with nothing edited yet
reads *"No changes yet."*
-Release itself lives on the change order at **"Implementation"**. The **"Release change order"** dialog lays out
+Release itself lives on the change notice at **"Implementation"**. The **"Release change notice"** dialog lays out
that same per-item diff one more time before you commit — *"Review each item's changes, then confirm —
releasing can't be undone."*
@@ -73,23 +115,23 @@ type](/docs/reference/change-orders/change-types):
1. **Activates the draft method** — it becomes the new **Active** version and the prior Active version is
**Archived** (kept as history, never deleted).
2. **Reveals the new item** — for a Revision, Replacement Part, or New Part, the newly created item is switched
- live and stamped with the change order id. A Version has no new item.
+ live and stamped with the change notice id. A Version has no new item.
3. **Writes the supersession** — for a Revision or Replacement Part only, from the old item to the new one,
using that affected item's cutover settings. A New Part has no predecessor, so it supersedes nothing. See
[Supersession & cutover](/docs/reference/change-orders/supersession).
New Part items are released first, so a parent assembly whose draft BoM references a consolidated new part
-finds it already active. When every affected item is processed, the change order flips to **"Done"**.
+finds it already active. When every affected item is processed, the change notice flips to **"Done"**.
<Callout type="note" title="Release is idempotent, not one big transaction.">
-Each affected item is marked done the moment its draft's change-order id is cleared, so a re-run skips items
+Each affected item is marked done the moment its draft's change-notice id is cleared, so a re-run skips items
already released and resumes at the first unreleased one. The final flip to **"Done"** is a compare-and-swap
on the **"Implementation"** status, so two people releasing at once can't double-apply.
</Callout>
-## Parallel change orders on the same part
+## Parallel change notices on the same part
-Two change orders can revise the same part at once. Each drafts its own method version, and Carbon steps
+Two change notices can revise the same part at once. Each drafts its own method version, and Carbon steps
around version collisions so they don't clobber each other. Whichever releases second activates on top of the
first, and the earlier version is archived as history rather than overwritten — so no work is lost. There's no
merge-conflict step to resolve.
@@ -108,9 +150,15 @@ merge-conflict step to resolve.
<AgentContext>
## Troubleshooting
-### "Cannot modify a completed change order."
-At **"Done"** the change order is a locked, read-only historical record — nothing reopens it. To make further changes to the same parts, raise a new change order; the released methods and items are its starting point. At **"Cancelled"** it is also locked, but the **"Reopen"** action returns it to **"Draft"** for further editing.
+### "This change notice is being implemented, so its changes are locked. Reopen it to make changes."
+The change notice is at **"Implementation"**, where the engineering content is frozen — affected items, the BoM/BoP drafts, the cutover config, and the Reason for Change / Description fields. Use **Reopen** in the **⋮** menu next to the change notice id to send it back to **"Engineering Complete"**, make the edit, then advance to Implementation again. Nothing is lost in the round trip. Action tasks, assignee, due date, and priority are *not* frozen — if one of those is refusing to save, the cause is something else (permissions, or the notice is closed).
+
+### "This change notice is closed, so its changes are read-only."
+The change notice is at **"Done"** or **"Cancelled"**. At **"Done"** it is a locked historical record and **Reopen is not available** — releasing already activated the new methods and wrote the supersessions that planning is acting on. To make further changes to the same parts, raise a new change notice; the released methods and items are its starting point. At **"Cancelled"** it is also locked, but the **"Reopen"** action returns it to **"Draft"** for further editing.
### Release button not available
-The **"Release"** action only appears at the **"Implementation"** stage. If the user can't find it, check the change order's current stage — it must be advanced (one stage at a time, no skipping) to Implementation first.
+The **"Release"** action only appears at the **"Implementation"** stage. If the user can't find it, check the change notice's current stage — it must be advanced (one stage at a time, no skipping) to Implementation first.
+
+### Can't find Reopen
+**Reopen** sits in the **⋮** menu beside the change notice id. It appears at **"Implementation"** (back to **"Engineering Complete"**) and at **"Cancelled"** (back to **"Draft"**). It is not offered at Draft, Start, or Engineering Complete — nothing is frozen at those stages, so there's nothing to unlock — nor at **"Done"**, which is terminal. Editing also requires the `parts` update permission.
</AgentContext>
diff --git a/docs/content/docs/reference/change-orders/meta.json b/docs/content/docs/reference/change-orders/meta.json
index ece0019e34..efe2958ac3 100644
--- a/docs/content/docs/reference/change-orders/meta.json
+++ b/docs/content/docs/reference/change-orders/meta.json
@@ -1,5 +1,5 @@
{
- "title": "Change orders",
+ "title": "Change notices",
"defaultOpen": false,
"pages": ["creating", "change-types", "lifecycle", "supersession", "setup"]
}
diff --git a/docs/content/docs/reference/change-orders/setup.mdx b/docs/content/docs/reference/change-orders/setup.mdx
index decb42e8bb..71908e0af6 100644
--- a/docs/content/docs/reference/change-orders/setup.mdx
+++ b/docs/content/docs/reference/change-orders/setup.mdx
@@ -1,24 +1,24 @@
---
title: Categories & actions
-description: The two company-scoped lookups that sit alongside change orders — the category list and the reusable action-task templates.
+description: The two company-scoped lookups that sit alongside change notices — the category list and the reusable action-task templates — plus linking an action task to Linear.
---
-Two configuration lists live next to change orders in the Items nav. Both are company-scoped and edited by
+Two configuration lists live next to change notices in the Items nav. Both are company-scoped and edited by
employees with the `parts` permission.
-## Change order categories
+## Change notice categories
-**Items → Change Order Types** holds the values for a change order's **"Category"** field — the same idea as
+**Items → Change Notice Types** holds the values for a change notice's **"Category"** field — the same idea as
issue types in Quality. Carbon seeds eleven to start: *Design Improvement*, *Cost Reduction*, *Quality / Reliability Improvement*, *Supplier / Sourcing Change*, *Material or Component Change*, *Obsolescence / End-of-Life*, *Regulatory / Compliance*, *Safety*, *Manufacturing / Producibility*, *Customer Request*, and *Documentation Error / Correction*. Add,
rename, or remove them to match how your shop classifies changes.
-Category is descriptive: it groups and filters change orders, but it doesn't change how release behaves. That
+Category is descriptive: it groups and filters change notices, but it doesn't change how release behaves. That
job belongs to the [change type](/docs/reference/change-orders/change-types) on each affected item.
-## Change order actions
+## Change notice actions
-**Items → Change Order Actions** holds reusable **action-task templates** — the checklist items a change
-order commonly needs. Carbon seeds seven:
+**Items → Change Notice Actions** holds reusable **action-task templates** — the checklist items a change
+notice commonly needs. Carbon seeds seven:
- Engineering Review
- Update Drawings / CAD
@@ -28,22 +28,64 @@ order commonly needs. Carbon seeds seven:
- Inventory Disposition (rework / scrap / use-as-is)
- Notify Affected Parties
-A new change order can seed its task list from the active templates. On the change order, each task tracks a
+A new change notice can seed its task list from the active templates. On the change notice, each task tracks a
status — **Pending**, **In Progress**, **Completed**, or **Skipped** — plus an assignee, due date, and notes.
<Callout type="note" title="Action tasks are freeform, not gates.">
Tasks are a coordination checklist, not an approval workflow. A task's status never blocks a stage from
-advancing or a change order from releasing — the [stages](/docs/reference/change-orders/lifecycle) are the
+advancing or a change notice from releasing — the [stages](/docs/reference/change-orders/lifecycle) are the
only gate.
</Callout>
+Because tasks are the *workflow* side of a change notice rather than its engineering content, they stay
+editable at the **"Implementation"** stage, when the drafts and affected items are already frozen. See
+[Implementation freezes the engineering
+content](/docs/reference/change-orders/lifecycle#implementation-freezes-the-engineering-content).
+
+## Link a task to Linear
+
+If engineering tracks its work in Linear, an action task can point at the ticket instead of duplicating it.
+This works exactly the way it does on a [quality issue's](/docs/reference/quality) action tasks — same dialog,
+same behavior.
+
+The affordance is a Linear icon on the task row, and it only appears when your company has the [Linear
+integration](/docs/integrations/project-management) connected. Once a task is linked, the icon is replaced by
+the ticket's identifier, so you can see at a glance which tasks are being worked outside Carbon.
+
+Opening the dialog gives you two tabs:
+
+<FieldTable>
+ <Field name="Link Existing">Search your Linear issues and attach one to this task.</Field>
+ <Field name="Create New">Create a fresh ticket from the task and attach it in one step.</Field>
+</FieldTable>
+
+A linked task shows the ticket's title, identifier, state, and assignee, with a link out to the ticket itself
+and an **Unlink** button to break the connection. A task holds at most one ticket per provider — the tabs are
+disabled while a link exists, so unlink first if you need to point somewhere else.
+
+<Callout type="info" title="The link is two-way.">
+Edits to the task's **notes** in Carbon are pushed to the linked ticket's description. In the other direction,
+when the ticket changes in Linear, a webhook syncs its **status**, **assignee**, **due date**, and
+**description** back onto the Carbon task — so completing the ticket in Linear marks the action task
+completed here. Whoever is doing the work never has to update two systems.
+</Callout>
+
+<Callout type="note" title="Jira works the same way, when it's available.">
+The same task row also offers a Jira icon, with the identical Link Existing / Create New dialog and two-way
+sync. Jira only shows up when the integration is connected *and* the server has Jira OAuth credentials
+configured, so on most installs Linear is the one you'll see.
+</Callout>
+
## Related
<Cards>
- <Card title="Create a change order" href="/docs/reference/change-orders/creating">
+ <Card title="Create a change notice" href="/docs/reference/change-orders/creating">
Where the category is set and tasks are seeded.
</Card>
<Card title="Lifecycle & release" href="/docs/reference/change-orders/lifecycle">
- The stages that actually gate a change order.
+ The stages that actually gate a change notice.
+ </Card>
+ <Card title="Project management integrations" href="/docs/integrations/project-management">
+ Connecting Linear and Jira in the first place.
</Card>
</Cards>
diff --git a/docs/content/docs/reference/issues.mdx b/docs/content/docs/reference/issues.mdx
index c941ea8e0f..de8aa97a23 100644
--- a/docs/content/docs/reference/issues.mdx
+++ b/docs/content/docs/reference/issues.mdx
@@ -91,7 +91,7 @@ Closing an issue is where the affected material gets resolved. Each `nonConforma
An issue links to the documents and records it concerns through typed association tables. There are ten association types: **items**, **customers**, **suppliers**, **job operations**, **purchase-order lines**, **sales-order lines**, **shipment lines**, **receipt lines**, **tracked entities**, and **inbound inspections**. These are what let quality trace a defect back to exactly where it came from — a specific received lot, a specific job operation, a specific supplier — and what makes supplier quality a *derived* number rather than a scorecard you maintain by hand.
-From the issue header you can also spin up a [change order](/docs/reference/change-orders) directly, carrying the issue across as its source, when the fix is an engineering change rather than a one-off disposition.
+From the issue header you can also spin up a [change notice](/docs/reference/change-orders) directly, carrying the issue across as its source, when the fix is an engineering change rather than a one-off disposition.
## Related
@@ -105,7 +105,7 @@ From the issue header you can also spin up a [change order](/docs/reference/chan
<Card title="Risk register" href="/docs/reference/risks">
Risks and opportunities tracked by source, alongside non-conformances.
</Card>
- <Card title="Change orders" href="/docs/reference/change-orders">
+ <Card title="Change notices" href="/docs/reference/change-orders">
Turn an issue into an engineering change.
</Card>
</Cards>
diff --git a/docs/content/docs/reference/notifications.mdx b/docs/content/docs/reference/notifications.mdx
index 084e6fe1de..cf3fb18444 100644
--- a/docs/content/docs/reference/notifications.mdx
+++ b/docs/content/docs/reference/notifications.mdx
@@ -20,7 +20,7 @@ falls into one of three shapes:
<FieldTable>
<Field name="Assignments">Someone is put on a record: a job, job operation, sales order, purchase order, RFQ, purchase invoice, supplier quote, issue, risk, procedure, picking list, stock transfer, maintenance dispatch, or training. The assignee is the recipient.</Field>
- <Field name="State changes & responses">A record's state moved in a way someone should know about: an approval was **requested**, **approved**, or **rejected**; a job **completed**; a change order entered a new stage; a quote **expired**; a customer or supplier responded to a digital quote or supplier quote.</Field>
+ <Field name="State changes & responses">A record's state moved in a way someone should know about: an approval was **requested**, **approved**, or **rejected**; a job **completed**; a change notice entered a new stage; a quote **expired**; a customer or supplier responded to a digital quote or supplier quote.</Field>
<Field name="Expirations & reminders">Time-driven, raised by scheduled jobs rather than a user action: a **gauge calibration expired**, a **maintenance dispatch** was auto-created for a work center, or a weekly **training reminder** rolls up a person's outstanding trainings.</Field>
</FieldTable>
@@ -52,7 +52,7 @@ channel opt-outs. There are twelve, and the mapping is fixed in code
| Maintenance | Maintenance dispatch (assigned or created), gauge calibration expired |
| Training | Training and procedure assignments, resource training, training reminder |
| Suggestion | Suggestion response |
-| Items | Change order started / in implementation / complete |
+| Items | Change notice started / in implementation / complete |
| General | Anything without a specific bucket |
<Callout type="warn">
diff --git a/docs/content/docs/reference/sequences.mdx b/docs/content/docs/reference/sequences.mdx
index ab212943fc..5b7b9b1813 100644
--- a/docs/content/docs/reference/sequences.mdx
+++ b/docs/content/docs/reference/sequences.mdx
@@ -1,15 +1,15 @@
---
title: Numbering sequences
-description: The per-company generator behind every readable document number — jobs, change orders, payments, and more.
+description: The per-company generator behind every readable document number — jobs, change notices, payments, and more.
---
-Every document Carbon creates gets a <Term id="readable-id">human-readable number</Term>: a job is `J000001`, an engineering change order is `ECO-000001`, a payment is `PAY-2026-07-000001`. Those numbers come from <Term id="numbering-sequence">sequences</Term> — one small counter per document type, per company. Each sequence knows its prefix, its suffix, how wide the number is, how much to step by, and what value comes next. When a document is created, Carbon reads the sequence, formats the next value, and advances the counter.
+Every document Carbon creates gets a <Term id="readable-id">human-readable number</Term>: a job is `J000001`, an engineering change notice is `CN-000001`, a payment is `PAY-2026-07-000001`. Those numbers come from <Term id="numbering-sequence">sequences</Term> — one small counter per document type, per company. Each sequence knows its prefix, its suffix, how wide the number is, how much to step by, and what value comes next. When a document is created, Carbon reads the sequence, formats the next value, and advances the counter.
Sequences live under **Settings → Sequences**. Every company gets a full set seeded when it's created, and you can retune any of them — change the prefix, restart the counter, widen the padding — without touching code.
## What a sequence is
-A sequence is a row in the `sequence` table, keyed by `("table", "companyId")` — one counter per document type per company (`packages/database/supabase/migrations/20230525025310_sequences.sql:1`, primary key moved to `("table", "companyId")` in `20240704105128_rfq.sql:120`). The `table` column names the document type it counts (`"job"`, `"changeOrder"`, `"payment"`), and `name` is the label you see in the UI ("Job", "Change Order", "Payment").
+A sequence is a row in the `sequence` table, keyed by `("table", "companyId")` — one counter per document type per company (`packages/database/supabase/migrations/20230525025310_sequences.sql:1`, primary key moved to `("table", "companyId")` in `20240704105128_rfq.sql:120`). The `table` column names the document type it counts (`"job"`, `"changeOrder"`, `"payment"`), and `name` is the label you see in the UI ("Job", "Change Notice", "Payment").
When something needs a new number, Carbon assembles it from three parts:
@@ -85,7 +85,7 @@ A new company is seeded with a sequence for every numbered document type (`packa
| Stock transfer | `stockTransfer` | `ST` | `ST000001` |
| Picking list | `pickingList` | `PL` | `PL000001` |
| Inventory count | `inventoryCount` | `IC` | `IC000001` |
-| Change order | `changeOrder` | `ECO-` | `ECO-000001` |
+| Change notice | `changeOrder` | `CN-` | `CN-000001` |
| Issue (NCR) | `nonConformance` | `NCR` | `NCR000001` |
| Inbound inspection | `inboundInspection` | `II` | `II000001` |
| Gauge | `gauge` | `G` | `G00001` |
@@ -103,6 +103,8 @@ Payments are a good example of the pattern in action. A `payment`, a `creditMemo
<Callout type="note" title="A few sequences were re-seeded for existing companies with different prefixes">
The seed table above is what a brand-new company gets. When some sequences were added after launch, the migration that backfilled them for existing companies used a different prefix — jobs, for instance, were backfilled as `WO` for older companies (`packages/database/supabase/migrations/20240909194622_jobs.sql:363`) even though new companies seed as `J`. If a prefix on your company doesn't match the table above, it's likely one of these backfilled defaults. Either way, you can change it under **Settings → Sequences**.
+
+Change notices are the reverse case: their sequence was re-prefixed from `ECO-` to `CN-` for every company during the rename, so only *new* records get `CN-000001`. Ids already minted as `ECO-000001` are left exactly as they were.
</Callout>
## How a number gets assigned
@@ -111,7 +113,7 @@ The flow is the same everywhere a number is minted:
<Steps>
<Step>
- A document is created — you convert a sales order line to a [job](/docs/reference/jobs), open a [change order](/docs/reference/change-orders), or record a payment.
+ A document is created — you convert a sales order line to a [job](/docs/reference/jobs), open a [change notice](/docs/reference/change-orders), or record a payment.
</Step>
<Step>
Carbon looks up the sequence for that document type and company, computes `next + step`, zero-pads it to `size`, and wraps it in the (date-interpolated) prefix and suffix.
diff --git a/docs/content/guides/change-order.mdx b/docs/content/guides/change-order.mdx
index 93e674f4b9..b1d7219707 100644
--- a/docs/content/guides/change-order.mdx
+++ b/docs/content/guides/change-order.mdx
@@ -10,50 +10,50 @@ flowIndex: 4
The robot's arm bracket needs a thicker wall and one fewer fastener. In a lot of systems that means editing
the live part and hoping nothing in flight notices. Carbon makes you do it deliberately: you open a
-<Term>change order</Term>, edit a hidden draft of the part's method, review exactly what changed, and release
+<Term id="change-order">change notice</Term>, edit a hidden draft of the part's method, review exactly what changed, and release
when it's ready. Until that moment, every job, plan, and cost calculation still sees the old bracket.
-> A change order is the paper trail and the workbench at once. You revise on a draft that no one else can
+> A change notice is the paper trail and the workbench at once. You revise on a draft that no one else can
> see, and release turns that draft into the new truth.
## Start with the parts, not the change
-You can start from **Items → Change Orders → New**, but you'll usually start from the bracket itself. Its part
-header has a **"Create Change Order"** action, its row in the parts table has the same, and the method's
-version menu — the one with **New Version** — offers **New Change Order** right where you're looking at the
+You can start from **Items → Change Notices → New**, but you'll usually start from the bracket itself. Its part
+header has a **"Create Change Notice"** action, its row in the parts table has the same, and the method's
+version menu — the one with **New Version** — offers **New Change Notice** right where you're looking at the
recipe. Each of those pre-attaches the bracket as the first affected item. A change can even start from a
-quality issue, which links the non-conformance to the change order so the fix traces back to the problem.
+quality issue, which links the non-conformance to the change notice so the fix traces back to the problem.
-However you start, the header form is short: a **"Name"**, a **"Category"** (your change-order types, seeded
+However you start, the header form is short: a **"Name"**, a **"Category"** (your change-notice types, seeded
with a starter set like *Design Improvement*, *Cost Reduction*, and *Obsolescence / End-of-Life*), a **"Reason for Change"** and **"Description
of Change"**, an **"Owner"**, **"Priority"**, and dates. If you started from a quality issue, that
non-conformance rides along as the linked issue. The affected item is the unit of work, and once you're on the
-change order the **Add Affected Item** picker is deliberately narrow: **Parts only**. A material, consumable,
+change notice the **Add Affected Item** picker is deliberately narrow: **Parts only**. A material, consumable,
or service doesn't carry an engineering revision, so it never appears.
Before you touch the bracket, though, its own page already warned you this was coming. A part that's on an
-open change order shows a heading right on its detail page — *"This part is on 1 open change order"* — with the
-change order linked, so nobody revises a design that's already mid-change. The alert informs rather than
-blocks: a second change order on the same part is allowed, and Carbon keeps their draft versions from
+open change notice shows a heading right on its detail page — *"This part is on 1 open change notice"* — with the
+change notice linked, so nobody revises a design that's already mid-change. The alert informs rather than
+blocks: a second change notice on the same part is allowed, and Carbon keeps their draft versions from
colliding, so a deliberate parallel change is fine.
-<Screenshot label="New change order form" caption="Name, category, reason, owner, and priority. The header before any affected item is added." ratio="wide" />
+<Screenshot label="New change notice form" caption="Name, category, reason, owner, and priority. The header before any affected item is added." ratio="wide" />
<Callout tone="blue" badge="TOP-DOWN, NOT BOTTOM-UP" title="You pick the parts first, then edit them in place.">
Carbon doesn't ask you to describe a change as a list of add-this, delete-that rows. You select the affected
-part and then edit its actual bill of materials and bill of process inside the change order. The change is
+part and then edit its actual bill of materials and bill of process inside the change notice. The change is
whatever the finished draft says it is.
</Callout>
## Draft the change in place
Add the bracket and Carbon quietly snapshots its live <Term id="bom">method</Term> into a new **Draft**
-version stamped to this change order. That draft is invisible everywhere else — it won't show in a version
+version stamped to this change notice. That draft is invisible everywhere else — it won't show in a version
switcher, a copy-target list, or anything MRP, jobs, or costing read. You edit it with the same **Bill of
Material** and **Bill of Process** editors you'd use on the part directly.
Before you edit, pick a **change type** on the affected item. It's the most consequential choice on the whole
-change order, because it decides both what you can touch and what release will create. You can switch it
+change notice, because it decides both what you can touch and what release will create. You can switch it
later, but not for free: switching discards the draft and mints a fresh one from the live method, so any
edits you'd made are reset. Decide the type first, then edit.
@@ -89,12 +89,12 @@ supplier, part number, price, and order quantities on the line before you releas
## Review the diff
-Advance the change order through its stages: **Draft**, then **"Start"**, then **"Engineering Complete"**,
+Advance the change notice through its stages: **Draft**, then **"Start"**, then **"Engineering Complete"**,
then **"Implementation"**. It only moves forward, one step at a time, and **"Start"**, **"Implementation"**,
and **"Done"** each notify the team. There's no separate approval step to configure — the stages are the
-workflow, and the change order is its own gate. If the change doesn't pan out, you're not trapped in the
+workflow, and the change notice is its own gate. If the change doesn't pan out, you're not trapped in the
forward march either: a **"Cancel"** action sits in the header at every open stage. Cancelling locks the
-change order but keeps every draft, and **"Reopen"** takes it back to **Draft** later with your edits
+change notice but keeps every draft, and **"Reopen"** takes it back to **Draft** later with your edits
intact, so shelving a change costs nothing.
You don't have to reach Implementation to see what you've done. The overview page carries a **Changes** card
@@ -105,7 +105,7 @@ At **"Implementation"** the **"Release"** action opens. It doesn't just apply th
affected item's change as a read-only diff first. Materials added and removed, operations and their steps
changed, attributes that moved — laid out line by line against the method you snapshotted from.
-<Screenshot label="Release change order — diff review" caption="The dropped fastener line and the thicker-wall attribute, shown as a diff before you confirm." ratio="tall" />
+<Screenshot label="Release change notice — diff review" caption="The dropped fastener line and the thicker-wall attribute, shown as a diff before you confirm." ratio="tall" />
<Callout tone="neutral" badge="EXACT BY CONSTRUCTION" title="The diff is real because the draft is real.">
There's no shadow copy of your edits to drift out of sync. You edited an actual draft method, so the diff is
@@ -116,7 +116,7 @@ simply that draft compared against the live one it came from. What you review is
Confirm the release and Carbon walks the affected items. For the bracket revision it activates the draft
method, archives the prior version, reveals the new revision as a live item, and writes a
-<Term>supersession</Term> from the old revision to the new one. When every item is done, the change order
+<Term>supersession</Term> from the old revision to the new one. When every item is done, the change notice
flips to **"Done"** and locks as a read-only record.
You never wrote that supersession by hand. You only chose *how* it phases over, through the affected item's
@@ -139,6 +139,6 @@ That's what makes releasing safe on a busy floor.
<Divider />
-Afterward the new revision carries a *"Created by ECO-…"* back-link to the change order that made it, and the
+Afterward the new revision carries a *"Created by CN-…"* back-link to the change notice that made it, and the
bracket's page shows its full change history. The trail from "the wall was too thin" to the released revision
is one click, and the floor never built a single bracket against a design that wasn't done.
diff --git a/packages/database/src/audit.config.ts b/packages/database/src/audit.config.ts
index b5bb7ede0d..b04267d6cd 100644
--- a/packages/database/src/audit.config.ts
+++ b/packages/database/src/audit.config.ts
@@ -357,7 +357,7 @@ export const auditConfig = {
},
changeOrder: {
- label: "Change Order",
+ label: "Change Notice",
tables: {
changeOrder: { role: "root" },
changeOrderAffectedItem: { entityIdColumn: "changeOrderId" },
diff --git a/packages/database/src/seed-change-orders.ts b/packages/database/src/seed-change-orders.ts
index 79f9970857..e039b7b6cb 100644
--- a/packages/database/src/seed-change-orders.ts
+++ b/packages/database/src/seed-change-orders.ts
@@ -464,7 +464,7 @@ async function addBopOperation(
// ---------------------------------------------------------------------------
// Change-order builders
// ---------------------------------------------------------------------------
-type ChangeOrderInput = {
+type ChangeNoticeInput = {
changeOrderId: string;
name: string;
status: string;
@@ -475,9 +475,9 @@ type ChangeOrderInput = {
nonConformanceId?: string | null;
};
-async function createChangeOrder(
+async function createChangeNotice(
ctx: Ctx,
- input: ChangeOrderInput
+ input: ChangeNoticeInput
): Promise<string> {
const { client, companyId, userId } = ctx;
const res = await client.query(
@@ -507,7 +507,7 @@ async function createChangeOrder(
// ---------------------------------------------------------------------------
// v2 change-content builders — CO-owned Draft make methods (no staging tables).
//
-// Mirrors createChangeOrderDraftMethod (changeOrder.service.ts):
+// Mirrors createChangeNoticeDraftMethod (items.service.ts):
// Version → new Draft method version on the SAME item, copying the Active
// method's BOM + BOP rows; changeOrderId stamped.
// Revision → new inactive revision item (same readableId, bumped revision);
@@ -1074,7 +1074,7 @@ async function seed() {
console.log("8. Creating change orders...");
// ECO-000001 — Implementation
- const co1 = await createChangeOrder(ctx, {
+ const co1 = await createChangeNotice(ctx, {
changeOrderId: "ECO-000001",
name: "Sync 3 Derailleur Mount",
status: "Implementation",
@@ -1138,7 +1138,7 @@ async function seed() {
);
// ECO-000002 — Engineering Complete
- const co2 = await createChangeOrder(ctx, {
+ const co2 = await createChangeNotice(ctx, {
changeOrderId: "ECO-000002",
name: "VEH3 Battery Lock Update",
status: "Engineering Complete",
@@ -1155,7 +1155,7 @@ async function seed() {
await addBomLine(ctx, co2Affected.draftMakeMethodId, brg200, 1, 1);
// ECO-000003 — Start
- const co3 = await createChangeOrder(ctx, {
+ const co3 = await createChangeNotice(ctx, {
changeOrderId: "ECO-000003",
name: "Cargo Box Bracket Redesign",
status: "Start",
@@ -1170,7 +1170,7 @@ async function seed() {
await deleteDraftMaterial(ctx, co3Affected.draftMakeMethodId, fst101);
// ECO-000004 — Start. Demonstrates the Revision + New Part change types.
- const co4 = await createChangeOrder(ctx, {
+ const co4 = await createChangeNotice(ctx, {
changeOrderId: "ECO-000004",
name: "Cable Routing Doc Update + FFF Replacement",
status: "Start",
@@ -1202,7 +1202,7 @@ async function seed() {
);
// ECO-000005 — Done (already-applied CO)
- const co5 = await createChangeOrder(ctx, {
+ const co5 = await createChangeNotice(ctx, {
changeOrderId: "ECO-000005",
name: "Saddle Supersession Royal MW",
status: "Done",
@@ -1224,7 +1224,7 @@ async function seed() {
);
// ECO-000006 — Draft (Unassigned, blank)
- await createChangeOrder(ctx, {
+ await createChangeNotice(ctx, {
changeOrderId: "ECO-000006",
name: "Luxembourg Handlebar Stem",
status: "Draft",
@@ -1234,7 +1234,7 @@ async function seed() {
// ECO-000007 — Start. One affected item (VEH0000001, a top-level product not
// touched by another open CO): add a Locking Washer to its staged BOM.
- const co7 = await createChangeOrder(ctx, {
+ const co7 = await createChangeNotice(ctx, {
changeOrderId: "ECO-000007",
name: "Fork Crown Reinforcement",
status: "Start",
diff --git a/packages/database/supabase/functions/lib/seed.data.ts b/packages/database/supabase/functions/lib/seed.data.ts
index fe5e510bef..f88453a699 100644
--- a/packages/database/supabase/functions/lib/seed.data.ts
+++ b/packages/database/supabase/functions/lib/seed.data.ts
@@ -287,8 +287,8 @@ export const sequences = [
},
{
table: "changeOrder",
- name: "Change Order",
- prefix: "ECO-",
+ name: "Change Notice",
+ prefix: "CN-",
suffix: null,
next: 0,
size: 6,
diff --git a/packages/database/supabase/migrations/20260727112136_change-notice-sequence-prefix.sql b/packages/database/supabase/migrations/20260727112136_change-notice-sequence-prefix.sql
new file mode 100644
index 0000000000..107201dc92
--- /dev/null
+++ b/packages/database/supabase/migrations/20260727112136_change-notice-sequence-prefix.sql
@@ -0,0 +1,5 @@
+-- Change Order → Change Notice: new records get CN-, existing readableIds are
+-- left alone (they are audit trail and referenced externally).
+UPDATE "sequence"
+SET "prefix" = 'CN-', "name" = 'Change Notice'
+WHERE "table" = 'changeOrder' AND "prefix" = 'ECO-';
diff --git a/packages/documents/src/email/previews/ChangeOrderDone.tsx b/packages/documents/src/email/previews/ChangeNoticeDone.tsx
similarity index 66%
rename from packages/documents/src/email/previews/ChangeOrderDone.tsx
rename to packages/documents/src/email/previews/ChangeNoticeDone.tsx
index 0e0265c1d3..68d2169a27 100644
--- a/packages/documents/src/email/previews/ChangeOrderDone.tsx
+++ b/packages/documents/src/email/previews/ChangeNoticeDone.tsx
@@ -1,17 +1,17 @@
import { NotificationEmail } from "../NotificationEmail";
// Preview fixture — mirrors what getNotificationContent builds for the
-// ChangeOrderDone event. Not shipped (not exported from index.ts).
-export default function ChangeOrderDonePreview() {
+// ChangeNoticeDone event. Not shipped (not exported from index.ts).
+export default function ChangeNoticeDonePreview() {
return (
<NotificationEmail
- heading={"Change order complete"}
- preview={"Change order complete"}
- message={"Change order ECO-000012 is complete"}
+ heading={"Change notice complete"}
+ preview={"Change notice complete"}
+ message={"Change notice ECO-000012 is complete"}
reference={"ECO-000012"}
recipientName={"John Doe"}
- ctaLabel={"View change order"}
- ctaUrl={"https://app.carbon.ms/x/items/change-order/1/details"}
+ ctaLabel={"View change notice"}
+ ctaUrl={"https://app.carbon.ms/x/items/change-notice/1/details"}
details={[
{
label: "Name",
diff --git a/packages/documents/src/email/previews/ChangeOrderImplementation.tsx b/packages/documents/src/email/previews/ChangeNoticeImplementation.tsx
similarity index 63%
rename from packages/documents/src/email/previews/ChangeOrderImplementation.tsx
rename to packages/documents/src/email/previews/ChangeNoticeImplementation.tsx
index 55b6d95fe6..38898dfc4d 100644
--- a/packages/documents/src/email/previews/ChangeOrderImplementation.tsx
+++ b/packages/documents/src/email/previews/ChangeNoticeImplementation.tsx
@@ -1,17 +1,17 @@
import { NotificationEmail } from "../NotificationEmail";
// Preview fixture — mirrors what getNotificationContent builds for the
-// ChangeOrderImplementation event. Not shipped (not exported from index.ts).
-export default function ChangeOrderImplementationPreview() {
+// ChangeNoticeImplementation event. Not shipped (not exported from index.ts).
+export default function ChangeNoticeImplementationPreview() {
return (
<NotificationEmail
- heading={"Change order in implementation"}
- preview={"Change order in implementation"}
- message={"Change order ECO-000012 has moved to implementation"}
+ heading={"Change notice in implementation"}
+ preview={"Change notice in implementation"}
+ message={"Change notice ECO-000012 has moved to implementation"}
reference={"ECO-000012"}
recipientName={"John Doe"}
- ctaLabel={"View change order"}
- ctaUrl={"https://app.carbon.ms/x/items/change-order/1/details"}
+ ctaLabel={"View change notice"}
+ ctaUrl={"https://app.carbon.ms/x/items/change-notice/1/details"}
details={[
{
label: "Name",
diff --git a/packages/documents/src/email/previews/ChangeOrderStarted.tsx b/packages/documents/src/email/previews/ChangeNoticeStarted.tsx
similarity index 66%
rename from packages/documents/src/email/previews/ChangeOrderStarted.tsx
rename to packages/documents/src/email/previews/ChangeNoticeStarted.tsx
index ea6d23dd0d..ead0655b99 100644
--- a/packages/documents/src/email/previews/ChangeOrderStarted.tsx
+++ b/packages/documents/src/email/previews/ChangeNoticeStarted.tsx
@@ -1,17 +1,17 @@
import { NotificationEmail } from "../NotificationEmail";
// Preview fixture — mirrors what getNotificationContent builds for the
-// ChangeOrderStarted event. Not shipped (not exported from index.ts).
-export default function ChangeOrderStartedPreview() {
+// ChangeNoticeStarted event. Not shipped (not exported from index.ts).
+export default function ChangeNoticeStartedPreview() {
return (
<NotificationEmail
- heading={"Change order started"}
- preview={"Change order started"}
- message={"Change order ECO-000012 has started"}
+ heading={"Change notice started"}
+ preview={"Change notice started"}
+ message={"Change notice ECO-000012 has started"}
reference={"ECO-000012"}
recipientName={"John Doe"}
- ctaLabel={"View change order"}
- ctaUrl={"https://app.carbon.ms/x/items/change-order/1/details"}
+ ctaLabel={"View change notice"}
+ ctaUrl={"https://app.carbon.ms/x/items/change-notice/1/details"}
details={[
{
label: "Name",
diff --git a/packages/ee/package.json b/packages/ee/package.json
index fc1d589b14..fd109684d7 100644
--- a/packages/ee/package.json
+++ b/packages/ee/package.json
@@ -5,6 +5,7 @@
"exports": {
".": "./src/index.ts",
"./accounting": "./src/accounting/index.ts",
+ "./action-task-entity": "./src/lib/actionTaskEntity.ts",
"./storage-rules": "./src/storage-rules/index.ts",
"./storage-rules.server": "./src/storage-rules/server.ts",
"./exchange-rates.server": "./src/exchange-rates/exchange-rates.server.ts",
diff --git a/packages/ee/src/jira/lib/service.ts b/packages/ee/src/jira/lib/service.ts
index 1467635b7e..0fbcfe6e39 100644
--- a/packages/ee/src/jira/lib/service.ts
+++ b/packages/ee/src/jira/lib/service.ts
@@ -2,6 +2,8 @@ import { getCarbonServiceRole } from "@carbon/auth/client.server";
import type { Database } from "@carbon/database";
import { getLogger } from "@carbon/logger";
import type { SupabaseClient } from "@supabase/supabase-js";
+import type { ActionTaskEntityType } from "../../lib/actionTaskEntity";
+import { actionTaskEntities } from "../../lib/actionTaskEntity";
import { adfToTiptap } from "./richtext";
import type { JiraCredentials, JiraIssue, JiraIssueMapping } from "./types";
import { JiraIssueMappingSchema } from "./types";
@@ -85,6 +87,7 @@ export async function linkActionToJiraIssue(
client: SupabaseClient<Database>,
companyId: string,
input: {
+ entityType: ActionTaskEntityType;
actionId: string;
issue: JiraIssue;
siteUrl: string;
@@ -92,6 +95,7 @@ export async function linkActionToJiraIssue(
syncNotes?: boolean;
}
) {
+ const entity = actionTaskEntities[input.entityType];
const mapping = issueToMapping(input.issue, input.siteUrl);
// Convert Jira description (ADF) to Tiptap format for notes
@@ -121,11 +125,11 @@ export async function linkActionToJiraIssue(
// Update the task fields
const result = await client
- .from("nonConformanceActionTask")
+ .from(entity.table)
.update(updateData)
.eq("companyId", companyId)
.eq("id", input.actionId)
- .select("nonConformanceId");
+ .select(entity.parentColumn);
// Delete any existing Jira mapping for this action
// Use service role to bypass RLS (no DELETE policy for authenticated users)
@@ -133,13 +137,14 @@ export async function linkActionToJiraIssue(
await serviceRoleForLink
.from("externalIntegrationMapping")
.delete()
- .eq("entityType", "nonConformanceActionTask")
+ .eq("companyId", companyId)
+ .eq("entityType", input.entityType)
.eq("entityId", input.actionId)
.eq("integration", "jira");
// Create the new mapping
await client.from("externalIntegrationMapping").insert({
- entityType: "nonConformanceActionTask",
+ entityType: input.entityType,
entityId: input.actionId,
integration: "jira",
externalId: input.issue.id,
@@ -157,23 +162,27 @@ export async function unlinkActionFromJiraIssue(
client: SupabaseClient<Database>,
companyId: string,
input: {
+ entityType: ActionTaskEntityType;
actionId: string;
assignee?: string | null;
}
) {
+ const entity = actionTaskEntities[input.entityType];
+
// Delete the Jira mapping using service role to bypass RLS
const serviceRole = getCarbonServiceRole();
await serviceRole
.from("externalIntegrationMapping")
.delete()
- .eq("entityType", "nonConformanceActionTask")
+ .eq("companyId", companyId)
+ .eq("entityType", input.entityType)
.eq("entityId", input.actionId)
.eq("integration", "jira");
- // Return the nonConformanceId for the action task
+ // Return the parent id for the action task
return client
- .from("nonConformanceActionTask")
- .select("nonConformanceId")
+ .from(entity.table)
+ .select(entity.parentColumn)
.eq("companyId", companyId)
.eq("id", input.actionId);
}
@@ -184,12 +193,13 @@ export async function unlinkActionFromJiraIssue(
export const getJiraIssueFromExternalId = async (
client: SupabaseClient<Database>,
companyId: string,
- actionId: string
+ actionId: string,
+ entityType: ActionTaskEntityType
): Promise<JiraIssueMapping | null> => {
const { data: mapping } = await client
.from("externalIntegrationMapping")
.select("metadata")
- .eq("entityType", "nonConformanceActionTask")
+ .eq("entityType", entityType)
.eq("entityId", actionId)
.eq("integration", "jira")
.eq("companyId", companyId)
@@ -229,12 +239,13 @@ export async function updateJiraIssueMapping(
client: SupabaseClient<Database>,
companyId: string,
actionId: string,
- mapping: JiraIssueMapping
+ mapping: JiraIssueMapping,
+ entityType: ActionTaskEntityType
) {
return await client
.from("externalIntegrationMapping")
.update({ metadata: mapping as any })
- .eq("entityType", "nonConformanceActionTask")
+ .eq("entityType", entityType)
.eq("entityId", actionId)
.eq("integration", "jira")
.eq("companyId", companyId);
diff --git a/packages/ee/src/lib/actionTaskEntity.ts b/packages/ee/src/lib/actionTaskEntity.ts
new file mode 100644
index 0000000000..5bc4855987
--- /dev/null
+++ b/packages/ee/src/lib/actionTaskEntity.ts
@@ -0,0 +1,49 @@
+export type ActionTaskEntityType =
+ | "nonConformanceActionTask"
+ | "changeOrderActionTask";
+
+export const actionTaskEntities: Record<
+ ActionTaskEntityType,
+ {
+ table: ActionTaskEntityType;
+ parentColumn: string;
+ detailPath: (parentId: string) => string;
+ }
+> = {
+ nonConformanceActionTask: {
+ table: "nonConformanceActionTask",
+ parentColumn: "nonConformanceId",
+ detailPath: (parentId) => `/x/issue/${parentId}`
+ },
+ changeOrderActionTask: {
+ table: "changeOrderActionTask",
+ parentColumn: "changeOrderId",
+ detailPath: (parentId) => `/x/items/change-notice/${parentId}`
+ }
+};
+
+export function isActionTaskEntityType(
+ value: string | null | undefined
+): value is ActionTaskEntityType {
+ return !!value && value in actionTaskEntities;
+}
+
+export function actionTaskPermissions(entityType: ActionTaskEntityType): {
+ update?: string;
+} {
+ return entityType === "changeOrderActionTask"
+ ? { update: "parts" }
+ : { update: "quality" };
+}
+
+export function actionTaskParentId(
+ rows: unknown,
+ entityType: ActionTaskEntityType
+): string | null {
+ // The ee services select the parent column dynamically, which erases Supabase's row typing
+ return (
+ (rows as Record<string, string | null>[] | null)?.[0]?.[
+ actionTaskEntities[entityType].parentColumn
+ ] ?? null
+ );
+}
diff --git a/packages/ee/src/linear/lib/service.ts b/packages/ee/src/linear/lib/service.ts
index 4c200236a4..545b2dd250 100644
--- a/packages/ee/src/linear/lib/service.ts
+++ b/packages/ee/src/linear/lib/service.ts
@@ -3,6 +3,8 @@ import type { Database } from "@carbon/database";
import { getLogger } from "@carbon/logger";
import type { SupabaseClient } from "@supabase/supabase-js";
import type z from "zod";
+import type { ActionTaskEntityType } from "../../lib/actionTaskEntity";
+import { actionTaskEntities } from "../../lib/actionTaskEntity";
import { markdownToTiptap } from "./richtext";
import { LinearIssueSchema } from "./types";
import { mapLinearStatusToCarbonStatus } from "./utils";
@@ -25,12 +27,14 @@ export async function linkActionToLinearIssue(
client: SupabaseClient<Database>,
companyId: string,
input: {
+ entityType: ActionTaskEntityType;
actionId: string;
issue: z.infer<typeof LinearIssueSchema>;
assignee?: string | null;
syncNotes?: boolean;
}
) {
+ const entity = actionTaskEntities[input.entityType];
const { data, success } = LinearIssueSchema.safeParse(input.issue);
if (!success) return null;
@@ -60,11 +64,11 @@ export async function linkActionToLinearIssue(
// Update the task fields
const result = await client
- .from("nonConformanceActionTask")
+ .from(entity.table)
.update(updateData)
.eq("companyId", companyId)
.eq("id", input.actionId)
- .select("nonConformanceId");
+ .select(entity.parentColumn);
// Upsert the Linear mapping in externalIntegrationMapping
// Use service role to bypass RLS (no DELETE policy for authenticated users)
@@ -72,12 +76,13 @@ export async function linkActionToLinearIssue(
await serviceRoleForLink
.from("externalIntegrationMapping")
.delete()
- .eq("entityType", "nonConformanceActionTask")
+ .eq("companyId", companyId)
+ .eq("entityType", input.entityType)
.eq("entityId", input.actionId)
.eq("integration", "linear");
await client.from("externalIntegrationMapping").insert({
- entityType: "nonConformanceActionTask",
+ entityType: input.entityType,
entityId: input.actionId,
integration: "linear",
externalId: data.id,
@@ -107,23 +112,27 @@ export async function unlinkActionFromLinearIssue(
client: SupabaseClient<Database>,
companyId: string,
input: {
+ entityType: ActionTaskEntityType;
actionId: string;
assignee?: string | null;
}
) {
+ const entity = actionTaskEntities[input.entityType];
+
// Delete the Linear mapping using service role to bypass RLS
const serviceRole = getCarbonServiceRole();
await serviceRole
.from("externalIntegrationMapping")
.delete()
- .eq("entityType", "nonConformanceActionTask")
+ .eq("companyId", companyId)
+ .eq("entityType", input.entityType)
.eq("entityId", input.actionId)
.eq("integration", "linear");
- // Return the nonConformanceId for the action task
+ // Return the parent id for the action task
return client
- .from("nonConformanceActionTask")
- .select("nonConformanceId")
+ .from(entity.table)
+ .select(entity.parentColumn)
.eq("companyId", companyId)
.eq("id", input.actionId);
}
@@ -131,12 +140,13 @@ export async function unlinkActionFromLinearIssue(
export const getLinearIssueFromExternalId = async (
client: SupabaseClient<Database>,
companyId: string,
- actionId: string
+ actionId: string,
+ entityType: ActionTaskEntityType
) => {
const { data: mapping } = await client
.from("externalIntegrationMapping")
.select("metadata")
- .eq("entityType", "nonConformanceActionTask")
+ .eq("entityType", entityType)
.eq("entityId", actionId)
.eq("integration", "linear")
.eq("companyId", companyId)
diff --git a/packages/ee/src/notifications/services/jira.ts b/packages/ee/src/notifications/services/jira.ts
index 70ccfc98de..ff7cd1fd5c 100644
--- a/packages/ee/src/notifications/services/jira.ts
+++ b/packages/ee/src/notifications/services/jira.ts
@@ -37,7 +37,8 @@ export class JiraNotificationService implements NotificationService {
const issue = await getJiraIssueFromExternalId(
context.serviceRole,
event.companyId,
- event.data.id
+ event.data.id,
+ "nonConformanceActionTask"
);
if (!issue) return;
@@ -57,7 +58,8 @@ export class JiraNotificationService implements NotificationService {
const issue = await getJiraIssueFromExternalId(
context.serviceRole,
event.companyId,
- event.data.id
+ event.data.id,
+ "nonConformanceActionTask"
);
if (!issue) return; // No linked Jira issue
@@ -89,7 +91,8 @@ export class JiraNotificationService implements NotificationService {
const issue = await getJiraIssueFromExternalId(
context.serviceRole,
event.companyId,
- event.data.id
+ event.data.id,
+ "nonConformanceActionTask"
);
if (!issue) return; // No linked Jira issue
diff --git a/packages/ee/src/notifications/services/linear.ts b/packages/ee/src/notifications/services/linear.ts
index 79182d6857..1b22184656 100644
--- a/packages/ee/src/notifications/services/linear.ts
+++ b/packages/ee/src/notifications/services/linear.ts
@@ -37,7 +37,8 @@ export class LinearNotificationService implements NotificationService {
const issue = await getLinearIssueFromExternalId(
context.serviceRole,
event.companyId,
- event.data.id
+ event.data.id,
+ "nonConformanceActionTask"
);
if (!issue) return;
@@ -63,7 +64,8 @@ export class LinearNotificationService implements NotificationService {
const issue = await getLinearIssueFromExternalId(
context.serviceRole,
event.companyId,
- event.data.id
+ event.data.id,
+ "nonConformanceActionTask"
);
if (!issue) return; // No linked Linear issue
@@ -94,7 +96,8 @@ export class LinearNotificationService implements NotificationService {
const issue = await getLinearIssueFromExternalId(
context.serviceRole,
event.companyId,
- event.data.id
+ event.data.id,
+ "nonConformanceActionTask"
);
if (!issue) return; // No linked Linear issue
diff --git a/packages/glossary/src/terms.ts b/packages/glossary/src/terms.ts
index 1657ad4cc8..db01422712 100644
--- a/packages/glossary/src/terms.ts
+++ b/packages/glossary/src/terms.ts
@@ -74,7 +74,7 @@ export const terms = {
definition: msg`Classifies a routing operation: Process, Assembly, and Inspection operations run on your own shop floor in the MES — Assembly gets the guided assembly view and Inspection a quality check — while an Outside Processing operation is subcontracted to a supplier and creates a purchase order; the process carries the same type and defaults it on new operations.`
},
"change-order": {
- term: msg`Change order`,
+ term: msg`Change notice`,
definition: msg`An engineering change: the affected items whose methods are revised on a draft and released together, superseding the versions they replace.`
},
wip: {
diff --git a/packages/jobs/src/inngest/functions/integrations/jira.ts b/packages/jobs/src/inngest/functions/integrations/jira.ts
index 0851aa19b0..1fb652e0e5 100644
--- a/packages/jobs/src/inngest/functions/integrations/jira.ts
+++ b/packages/jobs/src/inngest/functions/integrations/jira.ts
@@ -1,4 +1,5 @@
import { getCarbonServiceRole } from "@carbon/auth/client.server";
+import { isActionTaskEntityType } from "@carbon/ee/action-task-entity";
import {
getCompanyEmployees,
getJiraClient,
@@ -63,8 +64,7 @@ export const jiraSyncFunction = inngest.createFunction(
// Look up the action task via the mapping table
const mapping = await carbon
.from("externalIntegrationMapping")
- .select("entityId")
- .eq("entityType", "nonConformanceActionTask")
+ .select("entityId, entityType")
.eq("integration", "jira")
.eq("externalId", issueId)
.eq("companyId", payload.companyId)
@@ -78,6 +78,18 @@ export const jiraSyncFunction = inngest.createFunction(
}
const actionId = mapping.data.entityId;
+ const entityType = mapping.data.entityType;
+
+ if (!isActionTaskEntityType(entityType)) {
+ logger.info("Ignoring Jira mapping for non-action-task entity", {
+ entityType,
+ externalId: issueId
+ });
+ return {
+ success: false,
+ message: `Mapping for Jira issue ID ${issueId} is not an action task (entityType: ${entityType})`
+ };
+ }
// Fetch the full issue from Jira
const fullIssue = await jira.getIssue(payload.companyId, issueId);
@@ -105,6 +117,7 @@ export const jiraSyncFunction = inngest.createFunction(
// Update the linked action task
const updated = await linkActionToJiraIssue(carbon, payload.companyId, {
actionId,
+ entityType,
issue: fullIssue,
siteUrl,
assignee,
diff --git a/packages/jobs/src/inngest/functions/integrations/linear.ts b/packages/jobs/src/inngest/functions/integrations/linear.ts
index d468820768..a8a01876b2 100644
--- a/packages/jobs/src/inngest/functions/integrations/linear.ts
+++ b/packages/jobs/src/inngest/functions/integrations/linear.ts
@@ -1,4 +1,5 @@
import { getCarbonServiceRole } from "@carbon/auth/client.server";
+import { isActionTaskEntityType } from "@carbon/ee/action-task-entity";
import {
getCompanyEmployees,
getLinearClient,
@@ -41,8 +42,7 @@ export const linearSyncFunction = inngest.createFunction(
// Look up the action task via the mapping table
const mapping = await carbon
.from("externalIntegrationMapping")
- .select("entityId")
- .eq("entityType", "nonConformanceActionTask")
+ .select("entityId, entityType")
.eq("integration", "linear")
.eq("externalId", payload.event.data.id)
.eq("companyId", payload.companyId)
@@ -59,6 +59,19 @@ export const linearSyncFunction = inngest.createFunction(
};
}
+ const mappedEntityType = mapping.data!.entityType;
+
+ if (!isActionTaskEntityType(mappedEntityType)) {
+ logger.info("Ignoring Linear mapping for non-action-task entity", {
+ entityType: mappedEntityType,
+ externalId: payload.event.data.id
+ });
+ return {
+ success: false,
+ message: `Mapping for Linear issue ID ${payload.event.data.id} is not an action task (entityType: ${mappedEntityType})`
+ };
+ }
+
const fullIssue = await linear.getIssueById(
payload.companyId,
payload.event.data.id
@@ -88,6 +101,7 @@ export const linearSyncFunction = inngest.createFunction(
const updated = await linkActionToLinearIssue(carbon, payload.companyId, {
actionId: action.data.id,
+ entityType: mappedEntityType,
issue: fullIssue,
assignee,
syncNotes: true
diff --git a/packages/jobs/src/inngest/functions/notifications/content.ts b/packages/jobs/src/inngest/functions/notifications/content.ts
index 166b2d8329..5782506871 100644
--- a/packages/jobs/src/inngest/functions/notifications/content.ts
+++ b/packages/jobs/src/inngest/functions/notifications/content.ts
@@ -120,17 +120,17 @@ type EventContentOptions = {
userId?: string;
};
-function changeOrderStageDescription(
+function changeNoticeStageDescription(
type: NotificationEvent,
readableId: string
): string {
switch (type) {
- case NotificationEvent.ChangeOrderStarted:
- return `Change order ${readableId} has started`;
- case NotificationEvent.ChangeOrderImplementation:
- return `Change order ${readableId} has moved to implementation`;
+ case NotificationEvent.ChangeNoticeStarted:
+ return `Change notice ${readableId} has started`;
+ case NotificationEvent.ChangeNoticeImplementation:
+ return `Change notice ${readableId} has moved to implementation`;
default:
- return `Change order ${readableId} is complete`;
+ return `Change notice ${readableId} is complete`;
}
}
@@ -1107,23 +1107,23 @@ async function buildEventContent(
};
}
- case NotificationEvent.ChangeOrderStarted:
- case NotificationEvent.ChangeOrderImplementation:
- case NotificationEvent.ChangeOrderDone: {
+ case NotificationEvent.ChangeNoticeStarted:
+ case NotificationEvent.ChangeNoticeImplementation:
+ case NotificationEvent.ChangeNoticeDone: {
// Company-scope both lookups: readable ids (ECO-…) repeat across tenants.
const companyId = opts?.companyId;
if (!companyId) {
throw new Error(
- `companyId is required to resolve change order ${documentId}`
+ `companyId is required to resolve change notice ${documentId}`
);
}
// documentId may be the row id (co_…) or the readable id (ECO-…) — try both.
- const changeOrderColumns =
+ const changeNoticeColumns =
"changeOrderId, name, type, priority, status, dueDate, assignee";
const rowLookup = await client
.from("changeOrder")
- .select(changeOrderColumns)
+ .select(changeNoticeColumns)
.eq("id", documentId)
.eq("companyId", companyId)
.maybeSingle();
@@ -1132,11 +1132,11 @@ async function buildEventContent(
throw rowLookup.error;
}
- let changeOrderData = rowLookup.data;
- if (!changeOrderData) {
+ let changeNoticeData = rowLookup.data;
+ if (!changeNoticeData) {
const readableIdLookup = await client
.from("changeOrder")
- .select(changeOrderColumns)
+ .select(changeNoticeColumns)
.eq("changeOrderId", documentId)
.eq("companyId", companyId)
.maybeSingle();
@@ -1144,25 +1144,25 @@ async function buildEventContent(
console.error("Failed to get changeOrder", readableIdLookup.error);
throw readableIdLookup.error;
}
- changeOrderData = readableIdLookup.data;
+ changeNoticeData = readableIdLookup.data;
}
- if (!changeOrderData) {
- throw new Error(`Change order not found for documentId ${documentId}`);
+ if (!changeNoticeData) {
+ throw new Error(`Change notice not found for documentId ${documentId}`);
}
- const readableId = changeOrderData.changeOrderId;
- const description = changeOrderStageDescription(type, readableId);
+ const readableId = changeNoticeData.changeOrderId;
+ const description = changeNoticeStageDescription(type, readableId);
let assigneeName: string | null = null;
- if (changeOrderData.assignee) {
+ if (changeNoticeData.assignee) {
const assignee = await client
.from("user")
.select("fullName")
- .eq("id", changeOrderData.assignee)
+ .eq("id", changeNoticeData.assignee)
.maybeSingle();
if (assignee.error) {
- console.error("Failed to get change order assignee", assignee.error);
+ console.error("Failed to get change notice assignee", assignee.error);
}
assigneeName = assignee.data?.fullName ?? null;
}
@@ -1171,11 +1171,11 @@ async function buildEventContent(
description,
reference: readableId ?? undefined,
details: buildDetails([
- { label: "Name", value: changeOrderData.name },
- { label: "Type", value: changeOrderData.type },
- { label: "Priority", value: changeOrderData.priority },
- { label: "Due", value: formatDetailDate(changeOrderData.dueDate) },
- { label: "Status", value: changeOrderData.status },
+ { label: "Name", value: changeNoticeData.name },
+ { label: "Type", value: changeNoticeData.type },
+ { label: "Priority", value: changeNoticeData.priority },
+ { label: "Due", value: formatDetailDate(changeNoticeData.dueDate) },
+ { label: "Status", value: changeNoticeData.status },
{ label: "Assignee", value: assigneeName }
])
};
diff --git a/packages/jobs/src/inngest/functions/notifications/notify.ts b/packages/jobs/src/inngest/functions/notifications/notify.ts
index 1e770322dc..401c4b55bd 100644
--- a/packages/jobs/src/inngest/functions/notifications/notify.ts
+++ b/packages/jobs/src/inngest/functions/notifications/notify.ts
@@ -62,15 +62,15 @@ const defaultDestinations: Partial<
NotificationDestination.Email,
NotificationDestination.Slack
],
- [NotificationEvent.ChangeOrderStarted]: [
+ [NotificationEvent.ChangeNoticeStarted]: [
NotificationDestination.Email,
NotificationDestination.Slack
],
- [NotificationEvent.ChangeOrderImplementation]: [
+ [NotificationEvent.ChangeNoticeImplementation]: [
NotificationDestination.Email,
NotificationDestination.Slack
],
- [NotificationEvent.ChangeOrderDone]: [
+ [NotificationEvent.ChangeNoticeDone]: [
NotificationDestination.Email,
NotificationDestination.Slack
],
diff --git a/packages/locale/locales/de/erp.po b/packages/locale/locales/de/erp.po
index 2da478ddbe..781b237a82 100644
--- a/packages/locale/locales/de/erp.po
+++ b/packages/locale/locales/de/erp.po
@@ -45,8 +45,8 @@ msgid "(excluded for this customer)"
msgstr "(für diesen Kunden ausgeschlossen)"
#. placeholder {0}: open.length
-msgid "{0, plural, one {This part is on 1 open change order} other {This part is on # open change orders}}"
-msgstr "{0, plural, one {Dieses Teil befindet sich in 1 offener Änderungsanweisung} other {Dieses Teil befindet sich in # offenen Änderungsanweisungen}}"
+msgid "{0, plural, one {This part is on 1 open change notice} other {This part is on # open change notices}}"
+msgstr "{0, plural, one {Dieses Teil ist auf 1 offener Änderungsmitteilung} other {Dieses Teil ist auf # offenen Änderungsmitteilungen}}"
#. placeholder {0}: ar.count
msgid "{0} customers with a balance"
@@ -224,8 +224,8 @@ msgstr "90 Tage"
msgid "A Carbon-run data migration — you load your own data"
msgstr "Eine von Carbon durchgeführte Datenmigration – Sie laden Ihre eigenen Daten"
-msgid "A change order tracks a controlled engineering or manufacturing change through review and implementation."
-msgstr "Eine Änderungsanweisung verfolgt eine kontrollierte technische oder Fertigungsänderung durch Überprüfung und Umsetzung."
+msgid "A change notice tracks a controlled engineering or manufacturing change through review and implementation."
+msgstr "Eine Änderungsmitteilung verfolgt eine kontrollierte Ingenieur- oder Fertigungsänderung durch Überprüfung und Umsetzung."
msgid "A clearing account holding the value of goods received but not yet billed; the supplier invoice clears it."
msgstr "Ein Clearingkonto, das den Wert der erhaltenen, aber noch nicht in Rechnung gestellten Waren hält; die Lieferantenrechnung gleicht es aus."
@@ -1145,7 +1145,7 @@ msgstr "Sind Sie sicher, dass Sie den Prozess aktivieren möchten: {name}? Er wi
msgid "Are you sure you want to activate this gauge?."
msgstr "Sind Sie sicher, dass Sie dieses Messinstrument aktivieren möchten?."
-#. placeholder {0}: routeData?.changeOrder?.changeOrderId ?? ""
+#. placeholder {0}: routeData?.changeNotice?.changeOrderId ?? ""
msgid "Are you sure you want to cancel {0}? It will be closed and read-only until you reopen it."
msgstr "Sind Sie sicher, dass Sie {0} stornieren möchten? Es wird geschlossen und schreibgeschützt, bis Sie es erneut öffnen."
@@ -1245,12 +1245,12 @@ msgid "Are you sure you want to delete the asset class: {0}? This cannot be undo
msgstr "Möchten Sie die Anlageklasse wirklich löschen: {0}? Dies kann nicht rückgängig gemacht werden."
#. placeholder {0}: requiredAction.name
-msgid "Are you sure you want to delete the change order action: {0}? This cannot be undone."
-msgstr "Sind Sie sicher, dass Sie die Änderungsauftragsmaßnahme löschen möchten: {0}? Dies kann nicht rückgängig gemacht werden."
+msgid "Are you sure you want to delete the change notice action: {0}? This cannot be undone."
+msgstr "Sind Sie sicher, dass Sie die Änderungsmitteilung-Aktion löschen möchten: {0}? Dies kann nicht rückgängig gemacht werden."
-#. placeholder {0}: changeOrderType.name
-msgid "Are you sure you want to delete the change order category: {0}? This cannot be undone."
-msgstr "Möchten Sie die Änderungsanweisungskategorie wirklich löschen: {0}? Dies kann nicht rückgängig gemacht werden."
+#. placeholder {0}: changeNoticeType.name
+msgid "Are you sure you want to delete the change notice category: {0}? This cannot be undone."
+msgstr "Sind Sie sicher, dass Sie die Änderungsmitteilung-Kategorie löschen möchten: {0}? Dies kann nicht rückgängig gemacht werden."
msgid "Are you sure you want to delete the contractor: {name}? This cannot be undone."
msgstr "Sind Sie sicher, dass Sie den Auftragnehmer: {name} löschen möchten? Dies kann nicht rückgängig gemacht werden."
@@ -1410,8 +1410,8 @@ msgstr "Sind Sie sicher, dass Sie den Webhook löschen möchten: {0}? Dies kann
msgid "Are you sure you want to delete this approval rule? This cannot be undone."
msgstr "Sind Sie sicher, dass Sie diese Genehmigungsregel löschen möchten? Dies kann nicht rückgängig gemacht werden."
-msgid "Are you sure you want to delete this change order?"
-msgstr "Möchten Sie diese Änderungsanweisung wirklich löschen?"
+msgid "Are you sure you want to delete this change notice?"
+msgstr "Sind Sie sicher, dass Sie diese Änderungsmitteilung löschen möchten?"
msgid "Are you sure you want to delete this gauge?"
msgstr "Sind Sie sicher, dass Sie dieses Messinstrument löschen möchten?"
@@ -2052,11 +2052,11 @@ msgstr "Diese Datei kann nicht heruntergeladen werden"
msgid "Cancel"
msgstr "Abbrechen"
-msgid "Cancel change order"
-msgstr "Änderungsauftrag stornieren"
+msgid "Cancel change notice"
+msgstr "Änderungsmitteilung abbrechen"
-msgid "Cancel Change Order"
-msgstr "Änderungsauftrag stornieren"
+msgid "Cancel Change Notice"
+msgstr "Änderungsmitteilung abbrechen"
msgid "Cancel Job"
msgstr "Auftrag abbrechen"
@@ -2232,20 +2232,20 @@ msgstr "Dokument ändern"
msgid "Change Inspection Plan"
msgstr "Inspektionsplan ändern"
-msgid "Change order"
-msgstr "Änderungsauftrag"
+msgid "Change notice"
+msgstr "Änderungsmitteilung"
-msgid "Change Order"
-msgstr "Änderungsanweisung"
+msgid "Change Notice"
+msgstr "Änderungsmitteilung"
-msgid "Change Order Actions"
-msgstr "Änderungsauftragsmaßnahmen"
+msgid "Change Notice Actions"
+msgstr "Änderungsmitteilung-Aktionen"
-msgid "Change Order Types"
-msgstr "Änderungsanweisungstypen"
+msgid "Change Notice Types"
+msgstr "Änderungsmitteilung-Typen"
-msgid "Change Orders"
-msgstr "Änderungsanweisungen"
+msgid "Change Notices"
+msgstr "Änderungsmitteilungen"
msgid "Change status"
msgstr "Status ändern"
@@ -2840,8 +2840,8 @@ msgstr "Job-Nummer kopieren"
msgid "Copy link"
msgstr "Link kopieren"
-msgid "Copy link to change order"
-msgstr "Link zur Änderungsanweisung kopieren"
+msgid "Copy link to change notice"
+msgstr "Link zur Änderungsmitteilung kopieren"
msgid "Copy link to consumable"
msgstr "Link zum Verbrauchsmaterial kopieren"
@@ -3064,8 +3064,8 @@ msgstr "Erstelle {0} Werte"
msgid "Create & Snapshot"
msgstr "Erstellen & Snapshot"
-msgid "Create a change order for the new revision and open it"
-msgstr "Erstellen Sie einen Änderungsauftrag für die neue Überarbeitung und öffnen Sie ihn"
+msgid "Create a change notice for the new revision and open it"
+msgstr "Erstellen Sie eine Änderungsmitteilung für die neue Überarbeitung und öffnen Sie sie"
msgid "Create a new kanban card for scan-based replenishment."
msgstr "Erstellen Sie eine neue Kanban-Karte für scan-basierte Nachschubversorgung."
@@ -3094,8 +3094,8 @@ msgstr "Bestellungen erstellen und genehmigen"
msgid "Create audit trail entries"
msgstr "Audit-Trail-Einträge erstellen"
-msgid "Create Change Order"
-msgstr "Änderungsanweisung erstellen"
+msgid "Create Change Notice"
+msgstr "Änderungsmitteilung erstellen"
msgid "Create Issue"
msgstr "Problem erstellen"
@@ -3151,11 +3151,11 @@ msgstr "Erstellt am"
msgid "Created By"
msgstr "Erstellt von"
-msgid "Created change order action"
-msgstr "Änderungsauftragsmaßnahme erstellt"
+msgid "Created change notice action"
+msgstr "Änderungsmitteilung-Aktion erstellt"
-msgid "Created change order type"
-msgstr "Änderungsauftragstyp erstellt"
+msgid "Created change notice type"
+msgstr "Änderungsmitteilung-Typ erstellt"
msgid "Created consumable"
msgstr "Verbrauchsmaterial erstellt"
@@ -3825,8 +3825,8 @@ msgstr "Attribut löschen"
msgid "Delete Category"
msgstr "Kategorie löschen"
-msgid "Delete Change Order"
-msgstr "Änderungsanweisung löschen"
+msgid "Delete Change Notice"
+msgstr "Änderungsmitteilung löschen"
msgid "Delete Consumable"
msgstr "Verbrauchsmaterial löschen"
@@ -4555,14 +4555,14 @@ msgstr "Attributkategorie bearbeiten"
msgid "Edit Category"
msgstr "Kategorie bearbeiten"
-msgid "Edit Change Order"
-msgstr "Änderungsanweisung bearbeiten"
+msgid "Edit Change Notice"
+msgstr "Änderungsmitteilung bearbeiten"
-msgid "Edit Change Order Action"
-msgstr "Änderungsauftragsmaßnahme bearbeiten"
+msgid "Edit Change Notice Action"
+msgstr "Änderungsmitteilung-Aktion bearbeiten"
-msgid "Edit Change Order Type"
-msgstr "Änderungsauftragstyp bearbeiten"
+msgid "Edit Change Notice Type"
+msgstr "Änderungsmitteilung-Typ bearbeiten"
msgid "Edit column visibility"
msgstr "Spaltensichtbarkeit bearbeiten"
@@ -7990,14 +7990,14 @@ msgstr "Neues Attribut"
msgid "New Attribute Category"
msgstr "Neue Attributkategorie"
-msgid "New Change Order"
-msgstr "Neue Änderungsanweisung"
+msgid "New Change Notice"
+msgstr "Neue Änderungsmitteilung"
-msgid "New Change Order Action"
-msgstr "Neue Änderungsauftragsmaßnahme"
+msgid "New Change Notice Action"
+msgstr "Neue Änderungsmitteilung-Aktion"
-msgid "New Change Order Type"
-msgstr "Neuer Änderungsauftragstyp"
+msgid "New Change Notice Type"
+msgstr "Neuer Änderungsmitteilung-Typ"
msgid "New Consumable"
msgstr "Neuer Verbrauchsstoff"
@@ -8341,6 +8341,9 @@ msgstr "Keine verfügbaren verfolgten Entitäten gefunden"
msgid "No BOM input has a shelf-life policy"
msgstr "Keine BOM-Eingabe hat eine Shelf-Life-Richtlinie"
+msgid "No CAD model to preview."
+msgstr "Kein CAD-Modell zum Vorschau verfügbar."
+
msgid "No calibration records found"
msgstr "Keine Kalibrierungsdatensätze gefunden"
@@ -8782,8 +8785,8 @@ msgstr "Oops! Der Link, auf den Sie zugreifen möchten, ist ungültig."
msgid "Open"
msgstr "Öffnen"
-msgid "Open a change order"
-msgstr "Öffnen Sie einen Änderungsauftrag"
+msgid "Open a change notice"
+msgstr "Öffnen Sie eine Änderungsmitteilung"
msgid "Open Actions"
msgstr "Offene Maßnahmen"
@@ -8800,8 +8803,8 @@ msgstr "Offene Forderungen"
msgid "Open Audit Log"
msgstr "Audit-Protokoll öffnen"
-msgid "Open change orders affecting this part"
-msgstr "Offene Änderungsanweisungen, die diesen Teil betreffen"
+msgid "Open change notices affecting this part"
+msgstr "Offene Änderungsmitteilungen, die dieses Teil beeinflussen"
msgid "Open Date"
msgstr "Öffnungsdatum"
@@ -8812,11 +8815,11 @@ msgstr "Offene Einsätze"
msgid "Open in Carbon"
msgstr "In Carbon öffnen"
-msgid "Open in change order {ids}. Release it to create new versions or revisions."
-msgstr "Offen in Änderungsauftrag {ids}. Geben Sie ihn frei, um neue Versionen oder Überarbeitungen zu erstellen."
+msgid "Open in change notice {ids}. Release it to create new versions or revisions."
+msgstr "Öffnen Sie in der Änderungsmitteilung {ids}. Geben Sie sie frei, um neue Versionen oder Überarbeitungen zu erstellen."
-msgid "Open in change orders {ids}. Release them to create new versions or revisions."
-msgstr "Änderungsaufträge {ids} öffnen. Geben Sie sie frei, um neue Versionen oder Überarbeitungen zu erstellen."
+msgid "Open in change notices {ids}. Release them to create new versions or revisions."
+msgstr "Öffnen Sie in den Änderungsmitteilungen {ids}. Geben Sie sie frei, um neue Versionen oder Überarbeitungen zu erstellen."
msgid "Open in MES"
msgstr "Im MES öffnen"
@@ -10295,7 +10298,7 @@ msgid "Refresh exchange rate"
msgstr "Wechselkurs aktualisieren"
msgid "Regenerate"
-msgstr "Neu generieren"
+msgstr "Regenerieren"
msgid "Regenerating thumbnail…"
msgstr "Miniaturansicht wird neu generiert…"
@@ -10342,8 +10345,8 @@ msgstr "Relative Zeitleiste · Daten müssen noch bestätigt werden"
msgid "Release"
msgstr "Freigabe"
-msgid "Release change order"
-msgstr "Änderungsauftrag freigeben"
+msgid "Release change notice"
+msgstr "Änderungsmitteilung freigeben"
msgid "Release control"
msgstr "Freigabekontrolle"
@@ -13133,6 +13136,12 @@ msgstr "Diese Aufträge haben Operationen, die diesem Arbeitszentrum zugewiesen
msgid "These journal entries are still Draft, so their debits and credits aren't in the ledger for this period. Post each one, or re-date it into a later open period."
msgstr "Diese Journaleinträge sind noch im Entwurf, daher befinden sich ihre Belastungen und Gutschriften nicht im Ledger für diese Periode. Buchen Sie jeden Eintrag, oder buchen Sie ihn in eine spätere offene Periode um."
+msgid "This change notice is being implemented, so its changes are locked. Reopen it to edit."
+msgstr "Diese Änderungsmitteilung wird gerade implementiert, daher sind ihre Änderungen gesperrt. Öffnen Sie sie erneut zum Bearbeiten."
+
+msgid "This change notice is closed, so its changes are read-only."
+msgstr "Diese Änderungsmitteilung ist geschlossen, daher sind ihre Änderungen schreibgeschützt."
+
msgid "This completes the Discovery step."
msgstr "Dies schließt den Discovery-Schritt ab."
@@ -13217,11 +13226,11 @@ msgstr "Diese Periode hat keine Journaleinträge und kann dauerhaft gelöscht we
msgid "This Quarter"
msgstr "Dieses Quartal"
-msgid "This revision is released (Production). Changes should normally flow through a change order."
-msgstr "Diese Überarbeitung ist freigegeben (Produktion). Änderungen sollten normalerweise durch eine Änderungsanforderung fließen."
+msgid "This revision is released (Production). Changes should normally flow through a change notice."
+msgstr "Diese Überarbeitung wird freigegeben (Produktion). Änderungen sollten normalerweise durch eine Änderungsmitteilung fließen."
-msgid "This revision is released (Production). Open a change order to modify it."
-msgstr "Diese Überarbeitung ist freigegeben (Produktion). Öffnen Sie eine Änderungsanforderung, um sie zu ändern."
+msgid "This revision is released (Production). Open a change notice to modify it."
+msgstr "Diese Überarbeitung wird freigegeben (Produktion). Öffnen Sie eine Änderungsmitteilung, um sie zu ändern."
msgid "This sales order has associated jobs. Choose what to do with them."
msgstr "Diese Bestellung hat zugeordnete Aufträge. Wählen Sie, was damit geschehen soll."
@@ -13239,6 +13248,13 @@ msgstr "dieser Lieferant"
msgid "This updates the theme for all users of the application"
msgstr "Dies aktualisiert das Design für alle Benutzer der Anwendung"
+msgid "This version belongs to an open <0>change notice</0>. Edit it there."
+msgstr "Diese Version gehört zu einer offenen <0>Änderungsmitteilung</0>. Bearbeiten Sie sie dort."
+
+#. placeholder {0}: lock.readableId
+msgid "This version belongs to change notice <0>{0}</0>. Edit it there."
+msgstr "Diese Version gehört zur Änderungsmitteilung <0>{0}</0>. Bearbeiten Sie sie dort."
+
msgid "This will make this version read-only and replace any material make methods with this version."
msgstr "Dies macht diese Version schreibgeschützt und ersetzt alle Material-Make-Methoden durch diese Version."
@@ -14658,6 +14674,9 @@ msgstr "Warum wird das Ablaufdatum geändert?"
msgid "Why is this included?"
msgstr "Warum ist dies enthalten?"
+msgid "Why is this locked?"
+msgstr "Warum ist dies gesperrt?"
+
msgid "Why stock is changing — Positive (found), Negative (lost/scrap), or Set (replace count with a measured value)."
msgstr "Warum sich der Bestand ändert — Positiv (gefunden), Negativ (verloren/ausschuss) oder Satz (Zählwert mit gemessenem Wert ersetzen)."
@@ -14809,6 +14828,9 @@ msgstr "Sie haben {leftoverQuantity} weitere {0} als die bestellte Menge von {1}
msgid "You don't have permission to edit this bill of material."
msgstr "Sie haben keine Berechtigung, diese Stückliste zu bearbeiten."
+msgid "You don't have permission to edit this bill of process."
+msgstr "Sie haben keine Berechtigung, diesen Betriebsplan zu bearbeiten."
+
msgid "You drive it; we make sure it's done right. Expert eyes on your setup, data, and go-live."
msgstr "Du bestimmst das Tempo; wir sorgen dafür, dass es richtig gemacht wird. Fachkundige Augen auf dein Setup, deine Daten und deinen Go-Live."
@@ -14843,8 +14865,8 @@ msgstr "Du bist seit {hoursElapsed} Stunden angemeldet. Hast du vergessen, dich
msgid "Your books and how money flows."
msgstr "Ihre Bücher und wie Geld fließt."
-msgid "Your changes go into a new draft version released with this change order."
-msgstr "Ihre Änderungen werden in eine neue Entwurfsversion aufgenommen, die mit dieser Änderungsorder freigegeben wird."
+msgid "Your changes go into a new draft version released with this change notice."
+msgstr "Ihre Änderungen werden in eine neue Entwurfsversion übernommen, die mit dieser Änderungsmitteilung freigegeben wird."
msgid "Your Console PIN"
msgstr "Ihre Konsolen-PIN"
diff --git a/packages/locale/locales/en/erp.po b/packages/locale/locales/en/erp.po
index f76c006f54..1fbb3adc4f 100644
--- a/packages/locale/locales/en/erp.po
+++ b/packages/locale/locales/en/erp.po
@@ -45,8 +45,8 @@ msgid "(excluded for this customer)"
msgstr "(excluded for this customer)"
#. placeholder {0}: open.length
-msgid "{0, plural, one {This part is on 1 open change order} other {This part is on # open change orders}}"
-msgstr "{0, plural, one {This part is on 1 open change order} other {This part is on # open change orders}}"
+msgid "{0, plural, one {This part is on 1 open change notice} other {This part is on # open change notices}}"
+msgstr "{0, plural, one {This part is on 1 open change notice} other {This part is on # open change notices}}"
#. placeholder {0}: ar.count
msgid "{0} customers with a balance"
@@ -224,8 +224,8 @@ msgstr "90D"
msgid "A Carbon-run data migration — you load your own data"
msgstr "A Carbon-run data migration — you load your own data"
-msgid "A change order tracks a controlled engineering or manufacturing change through review and implementation."
-msgstr "A change order tracks a controlled engineering or manufacturing change through review and implementation."
+msgid "A change notice tracks a controlled engineering or manufacturing change through review and implementation."
+msgstr "A change notice tracks a controlled engineering or manufacturing change through review and implementation."
msgid "A clearing account holding the value of goods received but not yet billed; the supplier invoice clears it."
msgstr "A clearing account holding the value of goods received but not yet billed; the supplier invoice clears it."
@@ -1145,7 +1145,7 @@ msgstr "Are you sure you want to activate the process: {name}? It will appear in
msgid "Are you sure you want to activate this gauge?."
msgstr "Are you sure you want to activate this gauge?."
-#. placeholder {0}: routeData?.changeOrder?.changeOrderId ?? ""
+#. placeholder {0}: routeData?.changeNotice?.changeOrderId ?? ""
msgid "Are you sure you want to cancel {0}? It will be closed and read-only until you reopen it."
msgstr "Are you sure you want to cancel {0}? It will be closed and read-only until you reopen it."
@@ -1245,12 +1245,12 @@ msgid "Are you sure you want to delete the asset class: {0}? This cannot be undo
msgstr "Are you sure you want to delete the asset class: {0}? This cannot be undone."
#. placeholder {0}: requiredAction.name
-msgid "Are you sure you want to delete the change order action: {0}? This cannot be undone."
-msgstr "Are you sure you want to delete the change order action: {0}? This cannot be undone."
+msgid "Are you sure you want to delete the change notice action: {0}? This cannot be undone."
+msgstr "Are you sure you want to delete the change notice action: {0}? This cannot be undone."
-#. placeholder {0}: changeOrderType.name
-msgid "Are you sure you want to delete the change order category: {0}? This cannot be undone."
-msgstr "Are you sure you want to delete the change order category: {0}? This cannot be undone."
+#. placeholder {0}: changeNoticeType.name
+msgid "Are you sure you want to delete the change notice category: {0}? This cannot be undone."
+msgstr "Are you sure you want to delete the change notice category: {0}? This cannot be undone."
msgid "Are you sure you want to delete the contractor: {name}? This cannot be undone."
msgstr "Are you sure you want to delete the contractor: {name}? This cannot be undone."
@@ -1410,8 +1410,8 @@ msgstr "Are you sure you want to delete the webhook: {0}? This cannot be undone.
msgid "Are you sure you want to delete this approval rule? This cannot be undone."
msgstr "Are you sure you want to delete this approval rule? This cannot be undone."
-msgid "Are you sure you want to delete this change order?"
-msgstr "Are you sure you want to delete this change order?"
+msgid "Are you sure you want to delete this change notice?"
+msgstr "Are you sure you want to delete this change notice?"
msgid "Are you sure you want to delete this gauge?"
msgstr "Are you sure you want to delete this gauge?"
@@ -2052,11 +2052,11 @@ msgstr "Can't download this file"
msgid "Cancel"
msgstr "Cancel"
-msgid "Cancel change order"
-msgstr "Cancel change order"
+msgid "Cancel change notice"
+msgstr "Cancel change notice"
-msgid "Cancel Change Order"
-msgstr "Cancel Change Order"
+msgid "Cancel Change Notice"
+msgstr "Cancel Change Notice"
msgid "Cancel Job"
msgstr "Cancel Job"
@@ -2232,20 +2232,20 @@ msgstr "Change Document"
msgid "Change Inspection Plan"
msgstr "Change Inspection Plan"
-msgid "Change order"
-msgstr "Change order"
+msgid "Change notice"
+msgstr "Change notice"
-msgid "Change Order"
-msgstr "Change Order"
+msgid "Change Notice"
+msgstr "Change Notice"
-msgid "Change Order Actions"
-msgstr "Change Order Actions"
+msgid "Change Notice Actions"
+msgstr "Change Notice Actions"
-msgid "Change Order Types"
-msgstr "Change Order Types"
+msgid "Change Notice Types"
+msgstr "Change Notice Types"
-msgid "Change Orders"
-msgstr "Change Orders"
+msgid "Change Notices"
+msgstr "Change Notices"
msgid "Change status"
msgstr "Change status"
@@ -2840,8 +2840,8 @@ msgstr "Copy Job number"
msgid "Copy link"
msgstr "Copy link"
-msgid "Copy link to change order"
-msgstr "Copy link to change order"
+msgid "Copy link to change notice"
+msgstr "Copy link to change notice"
msgid "Copy link to consumable"
msgstr "Copy link to consumable"
@@ -3064,8 +3064,8 @@ msgstr "Create {0} values"
msgid "Create & Snapshot"
msgstr "Create & Snapshot"
-msgid "Create a change order for the new revision and open it"
-msgstr "Create a change order for the new revision and open it"
+msgid "Create a change notice for the new revision and open it"
+msgstr "Create a change notice for the new revision and open it"
msgid "Create a new kanban card for scan-based replenishment."
msgstr "Create a new kanban card for scan-based replenishment."
@@ -3094,8 +3094,8 @@ msgstr "Create and approve purchase orders"
msgid "Create audit trail entries"
msgstr "Create audit trail entries"
-msgid "Create Change Order"
-msgstr "Create Change Order"
+msgid "Create Change Notice"
+msgstr "Create Change Notice"
msgid "Create Issue"
msgstr "Create Issue"
@@ -3151,11 +3151,11 @@ msgstr "Created At"
msgid "Created By"
msgstr "Created By"
-msgid "Created change order action"
-msgstr "Created change order action"
+msgid "Created change notice action"
+msgstr "Created change notice action"
-msgid "Created change order type"
-msgstr "Created change order type"
+msgid "Created change notice type"
+msgstr "Created change notice type"
msgid "Created consumable"
msgstr "Created consumable"
@@ -3825,8 +3825,8 @@ msgstr "Delete Attribute"
msgid "Delete Category"
msgstr "Delete Category"
-msgid "Delete Change Order"
-msgstr "Delete Change Order"
+msgid "Delete Change Notice"
+msgstr "Delete Change Notice"
msgid "Delete Consumable"
msgstr "Delete Consumable"
@@ -4555,14 +4555,14 @@ msgstr "Edit Attribute Category"
msgid "Edit Category"
msgstr "Edit Category"
-msgid "Edit Change Order"
-msgstr "Edit Change Order"
+msgid "Edit Change Notice"
+msgstr "Edit Change Notice"
-msgid "Edit Change Order Action"
-msgstr "Edit Change Order Action"
+msgid "Edit Change Notice Action"
+msgstr "Edit Change Notice Action"
-msgid "Edit Change Order Type"
-msgstr "Edit Change Order Type"
+msgid "Edit Change Notice Type"
+msgstr "Edit Change Notice Type"
msgid "Edit column visibility"
msgstr "Edit column visibility"
@@ -7990,14 +7990,14 @@ msgstr "New Attribute"
msgid "New Attribute Category"
msgstr "New Attribute Category"
-msgid "New Change Order"
-msgstr "New Change Order"
+msgid "New Change Notice"
+msgstr "New Change Notice"
-msgid "New Change Order Action"
-msgstr "New Change Order Action"
+msgid "New Change Notice Action"
+msgstr "New Change Notice Action"
-msgid "New Change Order Type"
-msgstr "New Change Order Type"
+msgid "New Change Notice Type"
+msgstr "New Change Notice Type"
msgid "New Consumable"
msgstr "New Consumable"
@@ -8341,6 +8341,9 @@ msgstr "No available tracked entities found"
msgid "No BOM input has a shelf-life policy"
msgstr "No BOM input has a shelf-life policy"
+msgid "No CAD model to preview."
+msgstr "No CAD model to preview."
+
msgid "No calibration records found"
msgstr "No calibration records found"
@@ -8782,8 +8785,8 @@ msgstr "Oops! The link you're trying to access is not valid."
msgid "Open"
msgstr "Open"
-msgid "Open a change order"
-msgstr "Open a change order"
+msgid "Open a change notice"
+msgstr "Open a change notice"
msgid "Open Actions"
msgstr "Open Actions"
@@ -8800,8 +8803,8 @@ msgstr "Open AR"
msgid "Open Audit Log"
msgstr "Open Audit Log"
-msgid "Open change orders affecting this part"
-msgstr "Open change orders affecting this part"
+msgid "Open change notices affecting this part"
+msgstr "Open change notices affecting this part"
msgid "Open Date"
msgstr "Open Date"
@@ -8812,11 +8815,11 @@ msgstr "Open Dispatches"
msgid "Open in Carbon"
msgstr "Open in Carbon"
-msgid "Open in change order {ids}. Release it to create new versions or revisions."
-msgstr "Open in change order {ids}. Release it to create new versions or revisions."
+msgid "Open in change notice {ids}. Release it to create new versions or revisions."
+msgstr "Open in change notice {ids}. Release it to create new versions or revisions."
-msgid "Open in change orders {ids}. Release them to create new versions or revisions."
-msgstr "Open in change orders {ids}. Release them to create new versions or revisions."
+msgid "Open in change notices {ids}. Release them to create new versions or revisions."
+msgstr "Open in change notices {ids}. Release them to create new versions or revisions."
msgid "Open in MES"
msgstr "Open in MES"
@@ -10342,8 +10345,8 @@ msgstr "Relative timeline · dates to be confirmed"
msgid "Release"
msgstr "Release"
-msgid "Release change order"
-msgstr "Release change order"
+msgid "Release change notice"
+msgstr "Release change notice"
msgid "Release control"
msgstr "Release control"
@@ -13133,6 +13136,12 @@ msgstr "These jobs have operations assigned to this work center:"
msgid "These journal entries are still Draft, so their debits and credits aren't in the ledger for this period. Post each one, or re-date it into a later open period."
msgstr "These journal entries are still Draft, so their debits and credits aren't in the ledger for this period. Post each one, or re-date it into a later open period."
+msgid "This change notice is being implemented, so its changes are locked. Reopen it to edit."
+msgstr "This change notice is being implemented, so its changes are locked. Reopen it to edit."
+
+msgid "This change notice is closed, so its changes are read-only."
+msgstr "This change notice is closed, so its changes are read-only."
+
msgid "This completes the Discovery step."
msgstr "This completes the Discovery step."
@@ -13217,11 +13226,11 @@ msgstr "This period has no journal entries posted to it and can be permanently d
msgid "This Quarter"
msgstr "This Quarter"
-msgid "This revision is released (Production). Changes should normally flow through a change order."
-msgstr "This revision is released (Production). Changes should normally flow through a change order."
+msgid "This revision is released (Production). Changes should normally flow through a change notice."
+msgstr "This revision is released (Production). Changes should normally flow through a change notice."
-msgid "This revision is released (Production). Open a change order to modify it."
-msgstr "This revision is released (Production). Open a change order to modify it."
+msgid "This revision is released (Production). Open a change notice to modify it."
+msgstr "This revision is released (Production). Open a change notice to modify it."
msgid "This sales order has associated jobs. Choose what to do with them."
msgstr "This sales order has associated jobs. Choose what to do with them."
@@ -13239,6 +13248,13 @@ msgstr "this supplier"
msgid "This updates the theme for all users of the application"
msgstr "This updates the theme for all users of the application"
+msgid "This version belongs to an open <0>change notice</0>. Edit it there."
+msgstr "This version belongs to an open <0>change notice</0>. Edit it there."
+
+#. placeholder {0}: lock.readableId
+msgid "This version belongs to change notice <0>{0}</0>. Edit it there."
+msgstr "This version belongs to change notice <0>{0}</0>. Edit it there."
+
msgid "This will make this version read-only and replace any material make methods with this version."
msgstr "This will make this version read-only and replace any material make methods with this version."
@@ -14658,6 +14674,9 @@ msgstr "Why is the expiration being changed?"
msgid "Why is this included?"
msgstr "Why is this included?"
+msgid "Why is this locked?"
+msgstr "Why is this locked?"
+
msgid "Why stock is changing — Positive (found), Negative (lost/scrap), or Set (replace count with a measured value)."
msgstr "Why stock is changing — Positive (found), Negative (lost/scrap), or Set (replace count with a measured value)."
@@ -14813,6 +14832,9 @@ msgstr ""
msgid "You don't have permission to edit this bill of material."
msgstr "You don't have permission to edit this bill of material."
+msgid "You don't have permission to edit this bill of process."
+msgstr "You don't have permission to edit this bill of process."
+
msgid "You drive it; we make sure it's done right. Expert eyes on your setup, data, and go-live."
msgstr "You drive it; we make sure it's done right. Expert eyes on your setup, data, and go-live."
@@ -14847,8 +14869,8 @@ msgstr "You've been clocked in for {hoursElapsed} hours. Did you forget to clock
msgid "Your books and how money flows."
msgstr "Your books and how money flows."
-msgid "Your changes go into a new draft version released with this change order."
-msgstr "Your changes go into a new draft version released with this change order."
+msgid "Your changes go into a new draft version released with this change notice."
+msgstr "Your changes go into a new draft version released with this change notice."
msgid "Your Console PIN"
msgstr "Your Console PIN"
diff --git a/packages/locale/locales/es/erp.po b/packages/locale/locales/es/erp.po
index 387d41c65b..289db94d67 100644
--- a/packages/locale/locales/es/erp.po
+++ b/packages/locale/locales/es/erp.po
@@ -45,8 +45,8 @@ msgid "(excluded for this customer)"
msgstr "(excluido para este cliente)"
#. placeholder {0}: open.length
-msgid "{0, plural, one {This part is on 1 open change order} other {This part is on # open change orders}}"
-msgstr "{0, plural, one {Esta parte está en 1 orden de cambio abierta} other {Esta parte está en # órdenes de cambio abiertas}}"
+msgid "{0, plural, one {This part is on 1 open change notice} other {This part is on # open change notices}}"
+msgstr "{0, plural, one {Esta parte está en 1 aviso de cambio abierto} other {Esta parte está en # avisos de cambio abiertos}}"
#. placeholder {0}: ar.count
msgid "{0} customers with a balance"
@@ -224,8 +224,8 @@ msgstr "90 días"
msgid "A Carbon-run data migration — you load your own data"
msgstr "Una migración de datos ejecutada por Carbon — usted carga sus propios datos"
-msgid "A change order tracks a controlled engineering or manufacturing change through review and implementation."
-msgstr "Una orden de cambio rastrea un cambio de ingeniería o fabricación controlado a través de revisión e implementación."
+msgid "A change notice tracks a controlled engineering or manufacturing change through review and implementation."
+msgstr "Un aviso de cambio rastrea un cambio de ingeniería o fabricación controlado a través de revisión e implementación."
msgid "A clearing account holding the value of goods received but not yet billed; the supplier invoice clears it."
msgstr "Una cuenta de compensación que mantiene el valor de bienes recibidos pero aún no facturados; la factura del proveedor la cancela."
@@ -1145,7 +1145,7 @@ msgstr "¿Estás seguro de que deseas activar el proceso: {name}? Volverá a apa
msgid "Are you sure you want to activate this gauge?."
msgstr "¿Está seguro de que desea activar este calibrador?."
-#. placeholder {0}: routeData?.changeOrder?.changeOrderId ?? ""
+#. placeholder {0}: routeData?.changeNotice?.changeOrderId ?? ""
msgid "Are you sure you want to cancel {0}? It will be closed and read-only until you reopen it."
msgstr "¿Estás seguro de que deseas cancelar {0}? Se cerrará y será de solo lectura hasta que lo vuelvas a abrir."
@@ -1245,12 +1245,12 @@ msgid "Are you sure you want to delete the asset class: {0}? This cannot be undo
msgstr "¿Está seguro de que desea eliminar la clase de activos: {0}? Esto no se puede deshacer."
#. placeholder {0}: requiredAction.name
-msgid "Are you sure you want to delete the change order action: {0}? This cannot be undone."
-msgstr "¿Estás seguro de que deseas eliminar la acción de la orden de cambio: {0}? Esto no se puede deshacer."
+msgid "Are you sure you want to delete the change notice action: {0}? This cannot be undone."
+msgstr "¿Está seguro de que desea eliminar la acción del aviso de cambio: {0}? Esto no se puede deshacer."
-#. placeholder {0}: changeOrderType.name
-msgid "Are you sure you want to delete the change order category: {0}? This cannot be undone."
-msgstr "¿Está seguro de que desea eliminar la categoría de orden de cambio: {0}? Esto no se puede deshacer."
+#. placeholder {0}: changeNoticeType.name
+msgid "Are you sure you want to delete the change notice category: {0}? This cannot be undone."
+msgstr "¿Está seguro de que desea eliminar la categoría del aviso de cambio: {0}? Esto no se puede deshacer."
msgid "Are you sure you want to delete the contractor: {name}? This cannot be undone."
msgstr "¿Estás seguro de que deseas eliminar el contratista: {name}? Esto no se puede deshacer."
@@ -1410,8 +1410,8 @@ msgstr "¿Estás seguro de que deseas eliminar el webhook: {0}? Esto no se puede
msgid "Are you sure you want to delete this approval rule? This cannot be undone."
msgstr "¿Está seguro de que desea eliminar esta regla de aprobación? Esto no se puede deshacer."
-msgid "Are you sure you want to delete this change order?"
-msgstr "¿Está seguro de que desea eliminar esta orden de cambio?"
+msgid "Are you sure you want to delete this change notice?"
+msgstr "¿Está seguro de que desea eliminar este aviso de cambio?"
msgid "Are you sure you want to delete this gauge?"
msgstr "¿Estás seguro de que deseas eliminar este calibrador?"
@@ -2052,11 +2052,11 @@ msgstr "No se puede descargar este archivo"
msgid "Cancel"
msgstr "Cancelar"
-msgid "Cancel change order"
-msgstr "Cancelar orden de cambio"
+msgid "Cancel change notice"
+msgstr "Cancelar aviso de cambio"
-msgid "Cancel Change Order"
-msgstr "Cancelar Orden de Cambio"
+msgid "Cancel Change Notice"
+msgstr "Cancelar Aviso de Cambio"
msgid "Cancel Job"
msgstr "Cancelar Trabajo"
@@ -2232,20 +2232,20 @@ msgstr "Cambiar Documento"
msgid "Change Inspection Plan"
msgstr "Cambiar plan de inspección"
-msgid "Change order"
-msgstr "Orden de cambio"
+msgid "Change notice"
+msgstr "Aviso de cambio"
-msgid "Change Order"
-msgstr "Orden de Cambio"
+msgid "Change Notice"
+msgstr "Aviso de Cambio"
-msgid "Change Order Actions"
-msgstr "Acciones de orden de cambio"
+msgid "Change Notice Actions"
+msgstr "Acciones del Aviso de Cambio"
-msgid "Change Order Types"
-msgstr "Tipos de Orden de Cambio"
+msgid "Change Notice Types"
+msgstr "Tipos de Aviso de Cambio"
-msgid "Change Orders"
-msgstr "Órdenes de Cambio"
+msgid "Change Notices"
+msgstr "Avisos de Cambio"
msgid "Change status"
msgstr "Cambiar estado"
@@ -2840,8 +2840,8 @@ msgstr "Copiar número de trabajo"
msgid "Copy link"
msgstr "Copiar enlace"
-msgid "Copy link to change order"
-msgstr "Copiar enlace a orden de cambio"
+msgid "Copy link to change notice"
+msgstr "Copiar enlace al aviso de cambio"
msgid "Copy link to consumable"
msgstr "Copiar enlace al consumible"
@@ -3064,8 +3064,8 @@ msgstr "Crear {0} valores"
msgid "Create & Snapshot"
msgstr "Crear y Capturar"
-msgid "Create a change order for the new revision and open it"
-msgstr "Crear una orden de cambio para la nueva revisión y abrirla"
+msgid "Create a change notice for the new revision and open it"
+msgstr "Crear un aviso de cambio para la nueva revisión y abrirlo"
msgid "Create a new kanban card for scan-based replenishment."
msgstr "Crea una nueva tarjeta kanban para reabastecimiento basado en escaneo."
@@ -3094,8 +3094,8 @@ msgstr "Crear y aprobar órdenes de compra"
msgid "Create audit trail entries"
msgstr "Crear entradas de pista de auditoría"
-msgid "Create Change Order"
-msgstr "Crear Orden de Cambio"
+msgid "Create Change Notice"
+msgstr "Crear Aviso de Cambio"
msgid "Create Issue"
msgstr "Crear Problema"
@@ -3151,11 +3151,11 @@ msgstr "Creado el"
msgid "Created By"
msgstr "Creado por"
-msgid "Created change order action"
-msgstr "Acción de orden de cambio creada"
+msgid "Created change notice action"
+msgstr "Acción del aviso de cambio creada"
-msgid "Created change order type"
-msgstr "Tipo de orden de cambio creado"
+msgid "Created change notice type"
+msgstr "Tipo de aviso de cambio creado"
msgid "Created consumable"
msgstr "Consumible creado"
@@ -3825,8 +3825,8 @@ msgstr "Eliminar Atributo"
msgid "Delete Category"
msgstr "Eliminar Categoría"
-msgid "Delete Change Order"
-msgstr "Eliminar Orden de Cambio"
+msgid "Delete Change Notice"
+msgstr "Eliminar Aviso de Cambio"
msgid "Delete Consumable"
msgstr "Eliminar Consumible"
@@ -4555,14 +4555,14 @@ msgstr "Editar Categoría de Atributo"
msgid "Edit Category"
msgstr "Editar Categoría"
-msgid "Edit Change Order"
-msgstr "Editar Orden de Cambio"
+msgid "Edit Change Notice"
+msgstr "Editar Aviso de Cambio"
-msgid "Edit Change Order Action"
-msgstr "Editar acción de orden de cambio"
+msgid "Edit Change Notice Action"
+msgstr "Editar Acción del Aviso de Cambio"
-msgid "Edit Change Order Type"
-msgstr "Editar Tipo de Orden de Cambio"
+msgid "Edit Change Notice Type"
+msgstr "Editar Tipo de Aviso de Cambio"
msgid "Edit column visibility"
msgstr "Editar visibilidad de columnas"
@@ -7990,14 +7990,14 @@ msgstr "Nuevo Atributo"
msgid "New Attribute Category"
msgstr "Nueva Categoría de Atributo"
-msgid "New Change Order"
-msgstr "Nueva orden de cambio"
+msgid "New Change Notice"
+msgstr "Nuevo Aviso de Cambio"
-msgid "New Change Order Action"
-msgstr "Nueva acción de orden de cambio"
+msgid "New Change Notice Action"
+msgstr "Nueva Acción del Aviso de Cambio"
-msgid "New Change Order Type"
-msgstr "Nuevo Tipo de Orden de Cambio"
+msgid "New Change Notice Type"
+msgstr "Nuevo Tipo de Aviso de Cambio"
msgid "New Consumable"
msgstr "Nuevo Consumible"
@@ -8341,6 +8341,9 @@ msgstr "No se encontraron entidades rastreadas disponibles"
msgid "No BOM input has a shelf-life policy"
msgstr "Ninguna entrada de BOM tiene una política de vida útil"
+msgid "No CAD model to preview."
+msgstr "No hay modelo CAD para previsualizar."
+
msgid "No calibration records found"
msgstr "No se encontraron registros de calibración"
@@ -8782,8 +8785,8 @@ msgstr "¡Oops! El enlace que intentas acceder no es válido."
msgid "Open"
msgstr "Abrir"
-msgid "Open a change order"
-msgstr "Abrir una orden de cambio"
+msgid "Open a change notice"
+msgstr "Abrir un aviso de cambio"
msgid "Open Actions"
msgstr "Acciones Abiertas"
@@ -8800,8 +8803,8 @@ msgstr "AR abierto"
msgid "Open Audit Log"
msgstr "Abrir Registro de Auditoría"
-msgid "Open change orders affecting this part"
-msgstr "Órdenes de cambio abiertas que afectan esta parte"
+msgid "Open change notices affecting this part"
+msgstr "Abrir avisos de cambio que afecten esta parte"
msgid "Open Date"
msgstr "Fecha de Apertura"
@@ -8812,11 +8815,11 @@ msgstr "Despachos Abiertos"
msgid "Open in Carbon"
msgstr "Abrir en Carbon"
-msgid "Open in change order {ids}. Release it to create new versions or revisions."
-msgstr "Abierto en orden de cambio {ids}. Libérelo para crear nuevas versiones o revisiones."
+msgid "Open in change notice {ids}. Release it to create new versions or revisions."
+msgstr "Abierto en aviso de cambio {ids}. Libérelo para crear nuevas versiones o revisiones."
-msgid "Open in change orders {ids}. Release them to create new versions or revisions."
-msgstr "Abrir en órdenes de cambio {ids}. Libéralas para crear nuevas versiones o revisiones."
+msgid "Open in change notices {ids}. Release them to create new versions or revisions."
+msgstr "Abierto en avisos de cambio {ids}. Libérelos para crear nuevas versiones o revisiones."
msgid "Open in MES"
msgstr "Abrir en MES"
@@ -10342,8 +10345,8 @@ msgstr "Cronograma relativo · fechas por confirmar"
msgid "Release"
msgstr "Liberar"
-msgid "Release change order"
-msgstr "Liberar orden de cambio"
+msgid "Release change notice"
+msgstr "Liberar aviso de cambio"
msgid "Release control"
msgstr "Control de lanzamiento"
@@ -13133,6 +13136,12 @@ msgstr "Estos trabajos tienen operaciones asignadas a este centro de trabajo:"
msgid "These journal entries are still Draft, so their debits and credits aren't in the ledger for this period. Post each one, or re-date it into a later open period."
msgstr "Estos asientos de diario aún están en Borrador, por lo que sus débitos y créditos no están en el libro mayor para este período. Contabilice cada uno, o reescalone a un período abierto posterior."
+msgid "This change notice is being implemented, so its changes are locked. Reopen it to edit."
+msgstr "Esta notificación de cambio está siendo implementada, por lo que sus cambios están bloqueados. Reabrala para editar."
+
+msgid "This change notice is closed, so its changes are read-only."
+msgstr "Esta notificación de cambio está cerrada, por lo que sus cambios son de solo lectura."
+
msgid "This completes the Discovery step."
msgstr "Esto completa el paso de Descubrimiento."
@@ -13217,11 +13226,11 @@ msgstr "Este período no tiene asientos de diario registrados en él y puede eli
msgid "This Quarter"
msgstr "Este Trimestre"
-msgid "This revision is released (Production). Changes should normally flow through a change order."
-msgstr "Esta revisión está liberada (Producción). Los cambios normalmente deben fluir a través de una orden de cambio."
+msgid "This revision is released (Production). Changes should normally flow through a change notice."
+msgstr "Esta revisión se ha liberado (Producción). Los cambios normalmente deben fluir a través de un aviso de cambio."
-msgid "This revision is released (Production). Open a change order to modify it."
-msgstr "Esta revisión está liberada (Producción). Abra una orden de cambio para modificarla."
+msgid "This revision is released (Production). Open a change notice to modify it."
+msgstr "Esta revisión se ha liberado (Producción). Abra un aviso de cambio para modificarla."
msgid "This sales order has associated jobs. Choose what to do with them."
msgstr "Este pedido de venta tiene trabajos asociados. Elige qué hacer con ellos."
@@ -13239,6 +13248,13 @@ msgstr "este proveedor"
msgid "This updates the theme for all users of the application"
msgstr "Esto actualiza el tema para todos los usuarios de la aplicación"
+msgid "This version belongs to an open <0>change notice</0>. Edit it there."
+msgstr "Esta versión pertenece a un <0>aviso de cambio</0> abierto. Edítala allí."
+
+#. placeholder {0}: lock.readableId
+msgid "This version belongs to change notice <0>{0}</0>. Edit it there."
+msgstr "Esta versión pertenece al aviso de cambio <0>{0}</0>. Edítala allí."
+
msgid "This will make this version read-only and replace any material make methods with this version."
msgstr "Esto hará que esta versión sea de solo lectura y reemplazará cualquier método de fabricación de material con esta versión."
@@ -14658,6 +14674,9 @@ msgstr "¿Por qué se está cambiando la fecha de vencimiento?"
msgid "Why is this included?"
msgstr "¿Por qué se incluye esto?"
+msgid "Why is this locked?"
+msgstr "¿Por qué está bloqueado?"
+
msgid "Why stock is changing — Positive (found), Negative (lost/scrap), or Set (replace count with a measured value)."
msgstr "Por qué el stock está cambiando — Positivo (encontrado), Negativo (perdido/scrap) o Establecer (reemplazar cantidad con un valor medido)."
@@ -14809,6 +14828,9 @@ msgstr "Completaste {leftoverQuantity} más {0} que la cantidad ordenada de {1}.
msgid "You don't have permission to edit this bill of material."
msgstr "No tiene permiso para editar esta lista de materiales."
+msgid "You don't have permission to edit this bill of process."
+msgstr "No tiene permiso para editar esta lista de operaciones."
+
msgid "You drive it; we make sure it's done right. Expert eyes on your setup, data, and go-live."
msgstr "Tú lo diriges; nos aseguramos de que se haga bien. Ojos expertos en tu configuración, datos y lanzamiento."
@@ -14843,8 +14865,8 @@ msgstr "Has estado marcado durante {hoursElapsed} horas. ¿Olvidaste marcar la s
msgid "Your books and how money flows."
msgstr "Tus libros y cómo fluye el dinero."
-msgid "Your changes go into a new draft version released with this change order."
-msgstr "Sus cambios van a una nueva versión borrador lanzada con esta orden de cambio."
+msgid "Your changes go into a new draft version released with this change notice."
+msgstr "Sus cambios van a una nueva versión de borrador liberada con este aviso de cambio."
msgid "Your Console PIN"
msgstr "Tu PIN de Consola"
diff --git a/packages/locale/locales/fr/erp.po b/packages/locale/locales/fr/erp.po
index a356ea9296..b21236114a 100644
--- a/packages/locale/locales/fr/erp.po
+++ b/packages/locale/locales/fr/erp.po
@@ -45,8 +45,8 @@ msgid "(excluded for this customer)"
msgstr "(exclu pour ce client)"
#. placeholder {0}: open.length
-msgid "{0, plural, one {This part is on 1 open change order} other {This part is on # open change orders}}"
-msgstr "{0, plural, one {Cette pièce est sur 1 ordre de modification ouvert} other {Cette pièce est sur # ordres de modification ouverts}}"
+msgid "{0, plural, one {This part is on 1 open change notice} other {This part is on # open change notices}}"
+msgstr "{0, plural, one {Cette pièce est sur 1 avis de modification ouvert} other {Cette pièce est sur # avis de modification ouverts}}"
#. placeholder {0}: ar.count
msgid "{0} customers with a balance"
@@ -224,8 +224,8 @@ msgstr "90 jours"
msgid "A Carbon-run data migration — you load your own data"
msgstr "Une migration de données gérée par Carbon — vous chargez vos propres données"
-msgid "A change order tracks a controlled engineering or manufacturing change through review and implementation."
-msgstr "Un ordre de modification suit une modification technique ou manufacturière contrôlée tout au long de l'examen et de la mise en œuvre."
+msgid "A change notice tracks a controlled engineering or manufacturing change through review and implementation."
+msgstr "Un avis de modification suit un changement d'ingénierie ou de fabrication contrôlé à travers l'examen et la mise en œuvre."
msgid "A clearing account holding the value of goods received but not yet billed; the supplier invoice clears it."
msgstr "Un compte de compensation tenant la valeur des marchandises reçues mais non encore facturées ; la facture du fournisseur l'apure."
@@ -1145,7 +1145,7 @@ msgstr "Êtes-vous sûr de vouloir activer le processus : {name} ? Il réappara
msgid "Are you sure you want to activate this gauge?."
msgstr "Êtes-vous sûr de vouloir activer cette jauge ?."
-#. placeholder {0}: routeData?.changeOrder?.changeOrderId ?? ""
+#. placeholder {0}: routeData?.changeNotice?.changeOrderId ?? ""
msgid "Are you sure you want to cancel {0}? It will be closed and read-only until you reopen it."
msgstr "Êtes-vous sûr de vouloir annuler {0} ? Il sera fermé et en lecture seule jusqu'à ce que vous le rouvriez."
@@ -1245,12 +1245,12 @@ msgid "Are you sure you want to delete the asset class: {0}? This cannot be undo
msgstr "Êtes-vous sûr de vouloir supprimer la classe d'actifs : {0} ? Cette action ne peut pas être annulée."
#. placeholder {0}: requiredAction.name
-msgid "Are you sure you want to delete the change order action: {0}? This cannot be undone."
-msgstr "Êtes-vous sûr de vouloir supprimer l'action d'ordre de modification : {0} ? Cela ne peut pas être annulé."
+msgid "Are you sure you want to delete the change notice action: {0}? This cannot be undone."
+msgstr "Êtes-vous sûr de vouloir supprimer l'action d'avis de modification : {0} ? Cela ne peut pas être annulé."
-#. placeholder {0}: changeOrderType.name
-msgid "Are you sure you want to delete the change order category: {0}? This cannot be undone."
-msgstr "Êtes-vous sûr de vouloir supprimer la catégorie d'ordre de modification : {0} ? Cette action ne peut pas être annulée."
+#. placeholder {0}: changeNoticeType.name
+msgid "Are you sure you want to delete the change notice category: {0}? This cannot be undone."
+msgstr "Êtes-vous sûr de vouloir supprimer la catégorie d'avis de modification : {0} ? Cela ne peut pas être annulé."
msgid "Are you sure you want to delete the contractor: {name}? This cannot be undone."
msgstr "Êtes-vous sûr de vouloir supprimer l'entrepreneur : {name} ? Cette action ne peut pas être annulée."
@@ -1410,8 +1410,8 @@ msgstr "Êtes-vous sûr de vouloir supprimer le webhook : {0} ? Cette action ne
msgid "Are you sure you want to delete this approval rule? This cannot be undone."
msgstr "Êtes-vous sûr de vouloir supprimer cette règle d'approbation ? Cette action ne peut pas être annulée."
-msgid "Are you sure you want to delete this change order?"
-msgstr "Êtes-vous sûr de vouloir supprimer cet ordre de modification ?"
+msgid "Are you sure you want to delete this change notice?"
+msgstr "Êtes-vous sûr de vouloir supprimer cet avis de modification ?"
msgid "Are you sure you want to delete this gauge?"
msgstr "Êtes-vous sûr de vouloir supprimer ce jauge ?"
@@ -2052,11 +2052,11 @@ msgstr "Impossible de télécharger ce fichier"
msgid "Cancel"
msgstr "Annuler"
-msgid "Cancel change order"
-msgstr "Annuler le bon de modification"
+msgid "Cancel change notice"
+msgstr "Annuler l'avis de modification"
-msgid "Cancel Change Order"
-msgstr "Annuler le bon de modification"
+msgid "Cancel Change Notice"
+msgstr "Annuler l'avis de modification"
msgid "Cancel Job"
msgstr "Annuler le travail"
@@ -2232,20 +2232,20 @@ msgstr "Modifier le document"
msgid "Change Inspection Plan"
msgstr "Modifier le plan d'inspection"
-msgid "Change order"
-msgstr "Ordre de modification"
+msgid "Change notice"
+msgstr "Avis de modification"
-msgid "Change Order"
-msgstr "Ordre de modification"
+msgid "Change Notice"
+msgstr "Avis de modification"
-msgid "Change Order Actions"
-msgstr "Actions d'ordre de modification"
+msgid "Change Notice Actions"
+msgstr "Actions d'avis de modification"
-msgid "Change Order Types"
-msgstr "Types d'ordres de modification"
+msgid "Change Notice Types"
+msgstr "Types d'avis de modification"
-msgid "Change Orders"
-msgstr "Ordres de modification"
+msgid "Change Notices"
+msgstr "Avis de modification"
msgid "Change status"
msgstr "Modifier le statut"
@@ -2840,8 +2840,8 @@ msgstr "Copier le numéro de travail"
msgid "Copy link"
msgstr "Copier le lien"
-msgid "Copy link to change order"
-msgstr "Copier le lien vers l'ordre de modification"
+msgid "Copy link to change notice"
+msgstr "Copier le lien vers l'avis de modification"
msgid "Copy link to consumable"
msgstr "Copier le lien vers le consommable"
@@ -3064,8 +3064,8 @@ msgstr "Créer {0} valeurs"
msgid "Create & Snapshot"
msgstr "Créer et capturer"
-msgid "Create a change order for the new revision and open it"
-msgstr "Créer un ordre de modification pour la nouvelle révision et l'ouvrir"
+msgid "Create a change notice for the new revision and open it"
+msgstr "Créer un avis de modification pour la nouvelle révision et l'ouvrir"
msgid "Create a new kanban card for scan-based replenishment."
msgstr "Créer une nouvelle carte kanban pour le réapprovisionnement basé sur la numérisation."
@@ -3094,8 +3094,8 @@ msgstr "Créer et approuver les commandes d'achat"
msgid "Create audit trail entries"
msgstr "Créer des entrées de piste d'audit"
-msgid "Create Change Order"
-msgstr "Créer un ordre de modification"
+msgid "Create Change Notice"
+msgstr "Créer un avis de modification"
msgid "Create Issue"
msgstr "Créer un problème"
@@ -3151,11 +3151,11 @@ msgstr "Créé le"
msgid "Created By"
msgstr "Créé par"
-msgid "Created change order action"
-msgstr "Action d'ordre de modification créée"
+msgid "Created change notice action"
+msgstr "Action d'avis de modification créée"
-msgid "Created change order type"
-msgstr "Type de bon de modification créé"
+msgid "Created change notice type"
+msgstr "Type d'avis de modification créé"
msgid "Created consumable"
msgstr "Consommable créé"
@@ -3825,8 +3825,8 @@ msgstr "Supprimer l'attribut"
msgid "Delete Category"
msgstr "Supprimer la catégorie"
-msgid "Delete Change Order"
-msgstr "Supprimer l'ordre de modification"
+msgid "Delete Change Notice"
+msgstr "Supprimer l'avis de modification"
msgid "Delete Consumable"
msgstr "Supprimer la consommable"
@@ -4555,14 +4555,14 @@ msgstr "Modifier la catégorie d'attribut"
msgid "Edit Category"
msgstr "Modifier la catégorie"
-msgid "Edit Change Order"
-msgstr "Modifier l'ordre de modification"
+msgid "Edit Change Notice"
+msgstr "Modifier l'avis de modification"
-msgid "Edit Change Order Action"
-msgstr "Modifier l'action d'ordre de modification"
+msgid "Edit Change Notice Action"
+msgstr "Modifier l'action d'avis de modification"
-msgid "Edit Change Order Type"
-msgstr "Modifier le type de bon de modification"
+msgid "Edit Change Notice Type"
+msgstr "Modifier le type d'avis de modification"
msgid "Edit column visibility"
msgstr "Modifier la visibilité des colonnes"
@@ -7990,14 +7990,14 @@ msgstr "Nouvel Attribut"
msgid "New Attribute Category"
msgstr "Nouvelle Catégorie d'Attribut"
-msgid "New Change Order"
-msgstr "Nouvelle demande de modification"
+msgid "New Change Notice"
+msgstr "Nouvel avis de modification"
-msgid "New Change Order Action"
-msgstr "Nouvelle action d'ordre de modification"
+msgid "New Change Notice Action"
+msgstr "Nouvelle action d'avis de modification"
-msgid "New Change Order Type"
-msgstr "Nouveau type de bon de modification"
+msgid "New Change Notice Type"
+msgstr "Nouveau type d'avis de modification"
msgid "New Consumable"
msgstr "Nouveau consommable"
@@ -8341,6 +8341,9 @@ msgstr "Aucune entité suivie disponible trouvée"
msgid "No BOM input has a shelf-life policy"
msgstr "Aucune entrée de nomenclature n'a de politique de durée de vie"
+msgid "No CAD model to preview."
+msgstr "Aucun modèle CAD à prévisualiser."
+
msgid "No calibration records found"
msgstr "Aucun enregistrement d'étalonnage trouvé"
@@ -8782,8 +8785,8 @@ msgstr "Oups ! Le lien auquel vous essayez d'accéder n'est pas valide."
msgid "Open"
msgstr "Ouvrir"
-msgid "Open a change order"
-msgstr "Ouvrir un ordre de modification"
+msgid "Open a change notice"
+msgstr "Ouvrir un avis de modification"
msgid "Open Actions"
msgstr "Actions ouvertes"
@@ -8800,8 +8803,8 @@ msgstr "AR ouvert"
msgid "Open Audit Log"
msgstr "Ouvrir le journal d'audit"
-msgid "Open change orders affecting this part"
-msgstr "Demandes de modification ouvertes affectant cette pièce"
+msgid "Open change notices affecting this part"
+msgstr "Ouvrir les avis de modification affectant cette pièce"
msgid "Open Date"
msgstr "Date d'ouverture"
@@ -8812,11 +8815,11 @@ msgstr "Dépannages Ouverts"
msgid "Open in Carbon"
msgstr "Ouvrir dans Carbon"
-msgid "Open in change order {ids}. Release it to create new versions or revisions."
-msgstr "Ouvert dans la demande de changement {ids}. Libérez-la pour créer de nouvelles versions ou révisions."
+msgid "Open in change notice {ids}. Release it to create new versions or revisions."
+msgstr "Ouvert dans l'avis de modification {ids}. Relâchez-le pour créer de nouvelles versions ou révisions."
-msgid "Open in change orders {ids}. Release them to create new versions or revisions."
-msgstr "Ouvrir dans les ordres de modification {ids}. Libérez-les pour créer de nouvelles versions ou révisions."
+msgid "Open in change notices {ids}. Release them to create new versions or revisions."
+msgstr "Ouverts dans les avis de modification {ids}. Relâchez-les pour créer de nouvelles versions ou révisions."
msgid "Open in MES"
msgstr "Ouvrir dans MES"
@@ -10342,8 +10345,8 @@ msgstr "Chronologie relative · dates à confirmer"
msgid "Release"
msgstr "Libération"
-msgid "Release change order"
-msgstr "Publier l'ordre de changement"
+msgid "Release change notice"
+msgstr "Publier l'avis de modification"
msgid "Release control"
msgstr "Contrôle de la version"
@@ -13133,6 +13136,12 @@ msgstr "Ces travaux ont des opérations assignées à ce centre de travail :"
msgid "These journal entries are still Draft, so their debits and credits aren't in the ledger for this period. Post each one, or re-date it into a later open period."
msgstr "Ces écritures de journal sont encore Brouillon, de sorte que leurs débits et crédits ne se trouvent pas dans le grand livre pour cette période. Comptabilisez chacune ou redatez-la à une période ouverte ultérieure."
+msgid "This change notice is being implemented, so its changes are locked. Reopen it to edit."
+msgstr "Cette notice de modification est en cours de mise en œuvre, donc ses modifications sont verrouillées. Rouvrez-la pour la modifier."
+
+msgid "This change notice is closed, so its changes are read-only."
+msgstr "Cette notice de modification est fermée, donc ses modifications sont en lecture seule."
+
msgid "This completes the Discovery step."
msgstr "Cela complète l'étape de découverte."
@@ -13217,11 +13226,11 @@ msgstr "Cette période n'a aucune écriture de journal comptabilisée et peut ê
msgid "This Quarter"
msgstr "Ce trimestre"
-msgid "This revision is released (Production). Changes should normally flow through a change order."
-msgstr "Cette révision est libérée (Production). Les modifications doivent normalement transiter par un ordre de changement."
+msgid "This revision is released (Production). Changes should normally flow through a change notice."
+msgstr "Cette révision est publiée (Production). Les modifications doivent normalement passer par un avis de modification."
-msgid "This revision is released (Production). Open a change order to modify it."
-msgstr "Cette révision est libérée (Production). Ouvrez un ordre de changement pour la modifier."
+msgid "This revision is released (Production). Open a change notice to modify it."
+msgstr "Cette révision est publiée (Production). Ouvrez un avis de modification pour la modifier."
msgid "This sales order has associated jobs. Choose what to do with them."
msgstr "Cette commande client a des tâches associées. Choisissez ce que vous souhaitez en faire."
@@ -13239,6 +13248,13 @@ msgstr "ce fournisseur"
msgid "This updates the theme for all users of the application"
msgstr "Cela met à jour le thème pour tous les utilisateurs de l'application"
+msgid "This version belongs to an open <0>change notice</0>. Edit it there."
+msgstr "Cette version appartient à un <0>change notice</0> ouvert. Modifiez-le là."
+
+#. placeholder {0}: lock.readableId
+msgid "This version belongs to change notice <0>{0}</0>. Edit it there."
+msgstr "Cette version appartient au change notice <0>{0}</0>. Modifiez-le là."
+
msgid "This will make this version read-only and replace any material make methods with this version."
msgstr "Cela rendra cette version en lecture seule et remplacera toutes les méthodes de fabrication de matériaux par cette version."
@@ -14658,6 +14674,9 @@ msgstr "Pourquoi la date d'expiration est-elle modifiée ?"
msgid "Why is this included?"
msgstr "Pourquoi est-ce inclus ?"
+msgid "Why is this locked?"
+msgstr "Pourquoi est-ce verrouillé ?"
+
msgid "Why stock is changing — Positive (found), Negative (lost/scrap), or Set (replace count with a measured value)."
msgstr "Pourquoi le stock change — Positif (trouvé), Négatif (perdu/rebut) ou Défini (remplacer la quantité par une valeur mesurée)."
@@ -14809,6 +14828,9 @@ msgstr "Vous avez complété {leftoverQuantity} {0} de plus que la quantité com
msgid "You don't have permission to edit this bill of material."
msgstr "Vous n'avez pas la permission de modifier cette nomenclature."
+msgid "You don't have permission to edit this bill of process."
+msgstr "Vous n'avez pas la permission de modifier ce bon de fabrication."
+
msgid "You drive it; we make sure it's done right. Expert eyes on your setup, data, and go-live."
msgstr "Vous pilotez ; nous veillons à ce que ce soit fait correctement. Un regard expert sur votre configuration, vos données et votre mise en ligne."
@@ -14843,8 +14865,8 @@ msgstr "Vous êtes connecté depuis {hoursElapsed} heures. Avez-vous oublié de
msgid "Your books and how money flows."
msgstr "Vos livres et la circulation de l'argent."
-msgid "Your changes go into a new draft version released with this change order."
-msgstr "Vos modifications s'ajoutent à une nouvelle version brouillon livrée avec ce bon de modification."
+msgid "Your changes go into a new draft version released with this change notice."
+msgstr "Vos modifications sont mises dans une nouvelle version brouillon publiée avec cet avis de modification."
msgid "Your Console PIN"
msgstr "Votre PIN Console"
diff --git a/packages/locale/locales/hi/erp.po b/packages/locale/locales/hi/erp.po
index a0f6c8673f..1ac91279e5 100644
--- a/packages/locale/locales/hi/erp.po
+++ b/packages/locale/locales/hi/erp.po
@@ -45,8 +45,8 @@ msgid "(excluded for this customer)"
msgstr "(इस ग्राहक के लिए बाहर रखा गया)"
#. placeholder {0}: open.length
-msgid "{0, plural, one {This part is on 1 open change order} other {This part is on # open change orders}}"
-msgstr "{0, plural, one {यह भाग 1 खुले परिवर्तन आदेश पर है} other {यह भाग # खुले परिवर्तन आदेशों पर है}}"
+msgid "{0, plural, one {This part is on 1 open change notice} other {This part is on # open change notices}}"
+msgstr "{0, plural, one {यह भाग 1 खुली परिवर्तन सूचना पर है} other {यह भाग # खुली परिवर्तन सूचनाओं पर है}}"
#. placeholder {0}: ar.count
msgid "{0} customers with a balance"
@@ -224,8 +224,8 @@ msgstr "90 दिन"
msgid "A Carbon-run data migration — you load your own data"
msgstr "एक कार्बन-चलाया गया डेटा माइग्रेशन — आप अपना डेटा लोड करते हैं"
-msgid "A change order tracks a controlled engineering or manufacturing change through review and implementation."
-msgstr "एक परिवर्तन आदेश समीक्षा और कार्यान्वयन के माध्यम से नियंत्रित इंजीनियरिंग या विनिर्माण परिवर्तन को ट्रैक करता है।"
+msgid "A change notice tracks a controlled engineering or manufacturing change through review and implementation."
+msgstr "एक परिवर्तन सूचना समीक्षा और कार्यान्वयन के माध्यम से एक नियंत्रित इंजीनियरिंग या विनिर्माण परिवर्तन को ट्रैक करती है।"
msgid "A clearing account holding the value of goods received but not yet billed; the supplier invoice clears it."
msgstr "एक क्लीयरिंग खाता जो प्राप्त किए गए लेकिन अभी तक चालान नहीं किए गए सामान का मूल्य रखता है; आपूर्तिकर्ता चालान इसे साफ करता है।"
@@ -1145,7 +1145,7 @@ msgstr "क्या आप सुनिश्चित हैं कि आप
msgid "Are you sure you want to activate this gauge?."
msgstr "क्या आप सुनिश्चित हैं कि आप इस गेज को सक्रिय करना चाहते हैं?"
-#. placeholder {0}: routeData?.changeOrder?.changeOrderId ?? ""
+#. placeholder {0}: routeData?.changeNotice?.changeOrderId ?? ""
msgid "Are you sure you want to cancel {0}? It will be closed and read-only until you reopen it."
msgstr "क्या आप सुनिश्चित हैं कि आप {0} को रद्द करना चाहते हैं? यह बंद हो जाएगा और जब तक आप इसे फिर से नहीं खोलते तब तक यह केवल पढ़ने के लिए होगा।"
@@ -1245,12 +1245,12 @@ msgid "Are you sure you want to delete the asset class: {0}? This cannot be undo
msgstr "क्या आप निश्चित हैं कि आप परिसंपत्ति वर्ग हटाना चाहते हैं: {0}? यह पूर्ववत नहीं किया जा सकता।"
#. placeholder {0}: requiredAction.name
-msgid "Are you sure you want to delete the change order action: {0}? This cannot be undone."
-msgstr "क्या आप वाकई परिवर्तन आदेश कार्रवाई को हटाना चाहते हैं: {0}? यह पूर्ववत नहीं किया जा सकता।"
+msgid "Are you sure you want to delete the change notice action: {0}? This cannot be undone."
+msgstr "क्या आप परिवर्तन सूचना कार्रवाई को हटाना सुनिश्चित हैं: {0}? यह पूर्ववत नहीं किया जा सकता।"
-#. placeholder {0}: changeOrderType.name
-msgid "Are you sure you want to delete the change order category: {0}? This cannot be undone."
-msgstr "क्या आप परिवर्तन आदेश श्रेणी को हटाना चाहते हैं: {0}? यह पूर्ववत नहीं किया जा सकता।"
+#. placeholder {0}: changeNoticeType.name
+msgid "Are you sure you want to delete the change notice category: {0}? This cannot be undone."
+msgstr "क्या आप परिवर्तन सूचना श्रेणी को हटाना सुनिश्चित हैं: {0}? यह पूर्ववत नहीं किया जा सकता।"
msgid "Are you sure you want to delete the contractor: {name}? This cannot be undone."
msgstr "क्या आप सुनिश्चित हैं कि आप ठेकेदार को हटाना चाहते हैं: {name}? यह पूर्ववत नहीं किया जा सकता।"
@@ -1410,8 +1410,8 @@ msgstr "क्या आप सुनिश्चित हैं कि आप
msgid "Are you sure you want to delete this approval rule? This cannot be undone."
msgstr "क्या आप सुनिश्चित हैं कि आप इस अनुमोदन नियम को हटाना चाहते हैं? यह पूर्ववत नहीं किया जा सकता।"
-msgid "Are you sure you want to delete this change order?"
-msgstr "क्या आप इस परिवर्तन आदेश को हटाना चाहते हैं?"
+msgid "Are you sure you want to delete this change notice?"
+msgstr "क्या आप इस परिवर्तन सूचना को हटाना सुनिश्चित हैं?"
msgid "Are you sure you want to delete this gauge?"
msgstr "क्या आप सुनिश्चित हैं कि आप इस गेज को हटाना चाहते हैं?"
@@ -2052,11 +2052,11 @@ msgstr "इस फ़ाइल को डाउनलोड नहीं कर
msgid "Cancel"
msgstr "रद्द करें"
-msgid "Cancel change order"
-msgstr "परिवर्तन आदेश रद्द करें"
+msgid "Cancel change notice"
+msgstr "परिवर्तन सूचना को रद्द करें"
-msgid "Cancel Change Order"
-msgstr "परिवर्तन आदेश रद्द करें"
+msgid "Cancel Change Notice"
+msgstr "परिवर्तन सूचना को रद्द करें"
msgid "Cancel Job"
msgstr "नौकरी रद्द करें"
@@ -2232,20 +2232,20 @@ msgstr "परिवर्तन दस्तावेज़"
msgid "Change Inspection Plan"
msgstr "निरीक्षण योजना बदलें"
-msgid "Change order"
-msgstr "परिवर्तन आदेश"
+msgid "Change notice"
+msgstr "परिवर्तन सूचना"
-msgid "Change Order"
-msgstr "परिवर्तन आदेश"
+msgid "Change Notice"
+msgstr "परिवर्तन सूचना"
-msgid "Change Order Actions"
-msgstr "परिवर्तन आदेश कार्रवाई"
+msgid "Change Notice Actions"
+msgstr "परिवर्तन सूचना कार्रवाई"
-msgid "Change Order Types"
-msgstr "परिवर्तन आदेश प्रकार"
+msgid "Change Notice Types"
+msgstr "परिवर्तन सूचना प्रकार"
-msgid "Change Orders"
-msgstr "परिवर्तन आदेश"
+msgid "Change Notices"
+msgstr "परिवर्तन सूचनाएं"
msgid "Change status"
msgstr "स्थिति बदलें"
@@ -2840,8 +2840,8 @@ msgstr "जॉब नंबर कॉपी करें"
msgid "Copy link"
msgstr "लिंक कॉपी करें"
-msgid "Copy link to change order"
-msgstr "परिवर्तन आदेश के लिए लिंक कॉपी करें"
+msgid "Copy link to change notice"
+msgstr "परिवर्तन सूचना के लिंक की प्रतिलिपि बनाएं"
msgid "Copy link to consumable"
msgstr "उपभोग्य के लिए लिंक कॉपी करें"
@@ -3064,8 +3064,8 @@ msgstr "{0} मान बनाएं"
msgid "Create & Snapshot"
msgstr "बनाएं और स्नैपशॉट लें"
-msgid "Create a change order for the new revision and open it"
-msgstr "नए संशोधन के लिए एक परिवर्तन आदेश बनाएं और इसे खोलें"
+msgid "Create a change notice for the new revision and open it"
+msgstr "नई संशोधन के लिए एक परिवर्तन सूचना बनाएं और इसे खोलें"
msgid "Create a new kanban card for scan-based replenishment."
msgstr "स्कैन-आधारित पुनःपूर्ति के लिए एक नया कानबन कार्ड बनाएं।"
@@ -3094,8 +3094,8 @@ msgstr "क्रय आदेश बनाएं और मंजूरी द
msgid "Create audit trail entries"
msgstr "ऑडिट ट्रेल प्रविष्टियां बनाएं"
-msgid "Create Change Order"
-msgstr "परिवर्तन आदेश बनाएं"
+msgid "Create Change Notice"
+msgstr "परिवर्तन सूचना बनाएं"
msgid "Create Issue"
msgstr "समस्या बनाएं"
@@ -3151,11 +3151,11 @@ msgstr "बनाया गया"
msgid "Created By"
msgstr "द्वारा बनाया गया"
-msgid "Created change order action"
-msgstr "बनाई गई परिवर्तन आदेश कार्रवाई"
+msgid "Created change notice action"
+msgstr "परिवर्तन सूचना कार्रवाई बनाई गई"
-msgid "Created change order type"
-msgstr "बनाया गया परिवर्तन आदेश प्रकार"
+msgid "Created change notice type"
+msgstr "परिवर्तन सूचना प्रकार बनाया गया"
msgid "Created consumable"
msgstr "उपभोग्य बनाया गया"
@@ -3825,8 +3825,8 @@ msgstr "विशेषता हटाएं"
msgid "Delete Category"
msgstr "श्रेणी हटाएं"
-msgid "Delete Change Order"
-msgstr "परिवर्तन आदेश हटाएं"
+msgid "Delete Change Notice"
+msgstr "परिवर्तन सूचना हटाएं"
msgid "Delete Consumable"
msgstr "उपभोग्य हटाएं"
@@ -4555,14 +4555,14 @@ msgstr "विशेषता श्रेणी संपादित करे
msgid "Edit Category"
msgstr "श्रेणी संपादित करें"
-msgid "Edit Change Order"
-msgstr "परिवर्तन आदेश संपादित करें"
+msgid "Edit Change Notice"
+msgstr "परिवर्तन सूचना संपादित करें"
-msgid "Edit Change Order Action"
-msgstr "परिवर्तन आदेश कार्रवाई संपादित करें"
+msgid "Edit Change Notice Action"
+msgstr "परिवर्तन सूचना कार्रवाई संपादित करें"
-msgid "Edit Change Order Type"
-msgstr "परिवर्तन आदेश प्रकार संपादित करें"
+msgid "Edit Change Notice Type"
+msgstr "परिवर्तन सूचना प्रकार संपादित करें"
msgid "Edit column visibility"
msgstr "कॉलम दृश्यता संपादित करें"
@@ -7990,14 +7990,14 @@ msgstr "नई विशेषता"
msgid "New Attribute Category"
msgstr "नई विशेषता श्रेणी"
-msgid "New Change Order"
-msgstr "नया परिवर्तन आदेश"
+msgid "New Change Notice"
+msgstr "नई परिवर्तन सूचना"
-msgid "New Change Order Action"
-msgstr "नई परिवर्तन आदेश कार्रवाई"
+msgid "New Change Notice Action"
+msgstr "नई परिवर्तन सूचना कार्रवाई"
-msgid "New Change Order Type"
-msgstr "नया परिवर्तन आदेश प्रकार"
+msgid "New Change Notice Type"
+msgstr "नई परिवर्तन सूचना प्रकार"
msgid "New Consumable"
msgstr "नया उपभोग्य"
@@ -8341,6 +8341,9 @@ msgstr "कोई उपलब्ध ट्रैक किए गए इका
msgid "No BOM input has a shelf-life policy"
msgstr "कोई BOM इनपुट शेल्फ-लाइफ नीति नहीं है"
+msgid "No CAD model to preview."
+msgstr "पूर्वावलोकन के लिए कोई CAD मॉडल नहीं है।"
+
msgid "No calibration records found"
msgstr "कोई अंशांकन रिकॉर्ड नहीं मिला"
@@ -8782,8 +8785,8 @@ msgstr "अरे! आप जिस लिंक को एक्सेस क
msgid "Open"
msgstr "खोलें"
-msgid "Open a change order"
-msgstr "एक परिवर्तन आदेश खोलें"
+msgid "Open a change notice"
+msgstr "एक परिवर्तन सूचना खोलें"
msgid "Open Actions"
msgstr "खुली कार्रवाइयाँ"
@@ -8800,8 +8803,8 @@ msgstr "खुला AR"
msgid "Open Audit Log"
msgstr "ऑडिट लॉग खोलें"
-msgid "Open change orders affecting this part"
-msgstr "इस हिस्से को प्रभावित करने वाले खुले परिवर्तन आदेश"
+msgid "Open change notices affecting this part"
+msgstr "इस भाग को प्रभावित करने वाली परिवर्तन सूचनाएं खोलें"
msgid "Open Date"
msgstr "खुली तारीख"
@@ -8812,11 +8815,11 @@ msgstr "खुली डिस्पैच"
msgid "Open in Carbon"
msgstr "Carbon में खोलें"
-msgid "Open in change order {ids}. Release it to create new versions or revisions."
-msgstr "परिवर्तन आदेश {ids} में खुला। नए संस्करण या संशोधन बनाने के लिए इसे जारी करें।"
+msgid "Open in change notice {ids}. Release it to create new versions or revisions."
+msgstr "परिवर्तन सूचना {ids} में खोलें। नए संस्करण या संशोधन बनाने के लिए इसे जारी करें।"
-msgid "Open in change orders {ids}. Release them to create new versions or revisions."
-msgstr "{ids} में परिवर्तन आदेश खोलें। नई संस्करणें या संशोधन बनाने के लिए उन्हें जारी करें।"
+msgid "Open in change notices {ids}. Release them to create new versions or revisions."
+msgstr "परिवर्तन सूचनाओं {ids} में खोलें। नए संस्करण या संशोधन बनाने के लिए उन्हें जारी करें।"
msgid "Open in MES"
msgstr "MES में खोलें"
@@ -10295,7 +10298,7 @@ msgid "Refresh exchange rate"
msgstr "विनिमय दर को ताज़ा करें"
msgid "Regenerate"
-msgstr "पुनः उत्पन्न करें"
+msgstr "पुनः जेनरेट करें"
msgid "Regenerating thumbnail…"
msgstr "थंबनेल को पुनः उत्पन्न किया जा रहा है…"
@@ -10342,8 +10345,8 @@ msgstr "सापेक्ष समयरेखा · तारीखें प
msgid "Release"
msgstr "रिलीज़"
-msgid "Release change order"
-msgstr "परिवर्तन आदेश जारी करें"
+msgid "Release change notice"
+msgstr "परिवर्तन सूचना जारी करें"
msgid "Release control"
msgstr "जारी करने का नियंत्रण"
@@ -13133,6 +13136,12 @@ msgstr "इन कार्यों के पास इस कार्य क
msgid "These journal entries are still Draft, so their debits and credits aren't in the ledger for this period. Post each one, or re-date it into a later open period."
msgstr "ये जर्नल प्रविष्टियाँ अभी भी ड्राफ्ट हैं, इसलिए उनके डेबिट और क्रेडिट इस अवधि के लिए लेजर में नहीं हैं। प्रत्येक को पोस्ट करें, या इसे बाद की खुली अवधि में पुनः दिनांकित करें।"
+msgid "This change notice is being implemented, so its changes are locked. Reopen it to edit."
+msgstr "यह परिवर्तन सूचना लागू की जा रही है, इसलिए इसके परिवर्तन लॉक हैं। इसे संपादित करने के लिए फिर से खोलें।"
+
+msgid "This change notice is closed, so its changes are read-only."
+msgstr "यह परिवर्तन सूचना बंद है, इसलिए इसके परिवर्तन केवल पढ़ने के लिए हैं।"
+
msgid "This completes the Discovery step."
msgstr "यह Discovery चरण को पूरा करता है।"
@@ -13217,11 +13226,11 @@ msgstr "इस अवधि में कोई जर्नल प्रवि
msgid "This Quarter"
msgstr "इस त्रैमासिक"
-msgid "This revision is released (Production). Changes should normally flow through a change order."
-msgstr "यह संशोधन जारी है (Production)। परिवर्तन सामान्यतः एक चेंज ऑर्डर के माध्यम से होने चाहिए।"
+msgid "This revision is released (Production). Changes should normally flow through a change notice."
+msgstr "यह संशोधन जारी किया गया है (उत्पादन)। परिवर्तन सामान्यतः एक परिवर्तन सूचना के माध्यम से होने चाहिए।"
-msgid "This revision is released (Production). Open a change order to modify it."
-msgstr "यह संशोधन जारी है (Production)। इसे संशोधित करने के लिए एक चेंज ऑर्डर खोलें।"
+msgid "This revision is released (Production). Open a change notice to modify it."
+msgstr "यह संशोधन जारी किया गया है (उत्पादन)। इसे संशोधित करने के लिए एक परिवर्तन सूचना खोलें।"
msgid "This sales order has associated jobs. Choose what to do with them."
msgstr "इस बिक्रय आदेश के संबंधित कार्य हैं। उनके साथ क्या करना है यह चुनें।"
@@ -13239,6 +13248,13 @@ msgstr "यह आपूर्तिकर्ता"
msgid "This updates the theme for all users of the application"
msgstr "यह एप्लिकेशन के सभी उपयोगकर्ताओं के लिए थीम को अपडेट करता है"
+msgid "This version belongs to an open <0>change notice</0>. Edit it there."
+msgstr "यह संस्करण एक खुली <0>परिवर्तन सूचना</0> के अंतर्गत है। इसे वहाँ संपादित करें।"
+
+#. placeholder {0}: lock.readableId
+msgid "This version belongs to change notice <0>{0}</0>. Edit it there."
+msgstr "यह संस्करण परिवर्तन सूचना <0>{0}</0> के अंतर्गत है। इसे वहाँ संपादित करें।"
+
msgid "This will make this version read-only and replace any material make methods with this version."
msgstr "यह इस संस्करण को केवल-पढ़ने योग्य बनाएगा और किसी भी सामग्री निर्माण विधि को इस संस्करण से बदल देगा।"
@@ -14658,6 +14674,9 @@ msgstr "समाप्ति क्यों बदली जा रही ह
msgid "Why is this included?"
msgstr "यह क्यों शामिल है?"
+msgid "Why is this locked?"
+msgstr "यह क्यों लॉक है?"
+
msgid "Why stock is changing — Positive (found), Negative (lost/scrap), or Set (replace count with a measured value)."
msgstr "स्टॉक क्यों बदल रहा है — सकारात्मक (पाया गया), नकारात्मक (खोया/स्क्रैप) या सेट करें (गिनती को मापा मूल्य से बदलें)।"
@@ -14809,6 +14828,9 @@ msgstr "आपने {leftoverQuantity} अधिक {0} पूरा किय
msgid "You don't have permission to edit this bill of material."
msgstr "आपको इस सामग्री सूची को संपादित करने की अनुमति नहीं है।"
+msgid "You don't have permission to edit this bill of process."
+msgstr "आपके पास इस प्रक्रिया बिल को संपादित करने की अनुमति नहीं है।"
+
msgid "You drive it; we make sure it's done right. Expert eyes on your setup, data, and go-live."
msgstr "आप इसे चलाएं; हम सुनिश्चित करते हैं कि यह सही तरीके से किया जाए। आपके सेटअप, डेटा और गो-लाइव पर विशेषज्ञ की नजर।"
@@ -14843,8 +14865,8 @@ msgstr "आप {hoursElapsed} घंटे के लिए क्लॉक इ
msgid "Your books and how money flows."
msgstr "आपकी किताबें और पैसा कैसे बहता है।"
-msgid "Your changes go into a new draft version released with this change order."
-msgstr "आपके परिवर्तन इस परिवर्तन आदेश के साथ जारी एक नए ड्राफ्ट संस्करण में जाते हैं।"
+msgid "Your changes go into a new draft version released with this change notice."
+msgstr "आपके परिवर्तन इस परिवर्तन सूचना के साथ जारी किए गए एक नए मसौदा संस्करण में जाते हैं।"
msgid "Your Console PIN"
msgstr "आपका कंसोल PIN"
diff --git a/packages/locale/locales/it/erp.po b/packages/locale/locales/it/erp.po
index 608b347aa2..ebc60bb693 100644
--- a/packages/locale/locales/it/erp.po
+++ b/packages/locale/locales/it/erp.po
@@ -45,8 +45,8 @@ msgid "(excluded for this customer)"
msgstr "(escluso per questo cliente)"
#. placeholder {0}: open.length
-msgid "{0, plural, one {This part is on 1 open change order} other {This part is on # open change orders}}"
-msgstr "{0, plural, one {Questa parte è in 1 ordine di modifica aperto} other {Questa parte è in # ordini di modifica aperti}}"
+msgid "{0, plural, one {This part is on 1 open change notice} other {This part is on # open change notices}}"
+msgstr "{0, plural, one {Questa parte è in 1 avviso di modifica aperto} other {Questa parte è in # avvisi di modifica aperti}}"
#. placeholder {0}: ar.count
msgid "{0} customers with a balance"
@@ -224,8 +224,8 @@ msgstr "90 giorni"
msgid "A Carbon-run data migration — you load your own data"
msgstr "Una migrazione dati gestita da Carbon — tu carichi i tuoi dati"
-msgid "A change order tracks a controlled engineering or manufacturing change through review and implementation."
-msgstr "Un ordine di modifica traccia una modifica ingegneristica o manifatturiera controllata attraverso la revisione e l'implementazione."
+msgid "A change notice tracks a controlled engineering or manufacturing change through review and implementation."
+msgstr "Un avviso di modifica traccia un cambiamento controllato di ingegneria o produzione attraverso la revisione e l'implementazione."
msgid "A clearing account holding the value of goods received but not yet billed; the supplier invoice clears it."
msgstr "Un conto di compensazione che tiene il valore della merce ricevuta ma non ancora fatturata; la fattura del fornitore la compensa."
@@ -1145,7 +1145,7 @@ msgstr "Sei sicuro di voler attivare il processo: {name}? Apparirà di nuovo nei
msgid "Are you sure you want to activate this gauge?."
msgstr "Sei sicuro di voler attivare questo calibro?."
-#. placeholder {0}: routeData?.changeOrder?.changeOrderId ?? ""
+#. placeholder {0}: routeData?.changeNotice?.changeOrderId ?? ""
msgid "Are you sure you want to cancel {0}? It will be closed and read-only until you reopen it."
msgstr "Sei sicuro di voler cancellare {0}? Sarà chiuso e in sola lettura fino a quando non lo riapri."
@@ -1245,12 +1245,12 @@ msgid "Are you sure you want to delete the asset class: {0}? This cannot be undo
msgstr "Sei sicuro di voler eliminare la classe di beni: {0}? Questa azione non può essere annullata."
#. placeholder {0}: requiredAction.name
-msgid "Are you sure you want to delete the change order action: {0}? This cannot be undone."
-msgstr "Sei sicuro di voler eliminare l'azione dell'ordine di modifica: {0}? Non è possibile annullare."
+msgid "Are you sure you want to delete the change notice action: {0}? This cannot be undone."
+msgstr "Sei sicuro di voler eliminare l'azione dell'avviso di modifica: {0}? Questa operazione non può essere annullata."
-#. placeholder {0}: changeOrderType.name
-msgid "Are you sure you want to delete the change order category: {0}? This cannot be undone."
-msgstr "Sei sicuro di voler eliminare la categoria di ordine di modifica: {0}? Questa azione non può essere annullata."
+#. placeholder {0}: changeNoticeType.name
+msgid "Are you sure you want to delete the change notice category: {0}? This cannot be undone."
+msgstr "Sei sicuro di voler eliminare la categoria dell'avviso di modifica: {0}? Questa operazione non può essere annullata."
msgid "Are you sure you want to delete the contractor: {name}? This cannot be undone."
msgstr "Sei sicuro di voler eliminare l'appaltatore: {name}? Questa azione non può essere annullata."
@@ -1410,8 +1410,8 @@ msgstr "Sei sicuro di voler eliminare il webhook: {0}? Questa azione non può es
msgid "Are you sure you want to delete this approval rule? This cannot be undone."
msgstr "Sei sicuro di voler eliminare questa regola di approvazione? Questa azione non può essere annullata."
-msgid "Are you sure you want to delete this change order?"
-msgstr "Sei sicuro di voler eliminare questo ordine di modifica?"
+msgid "Are you sure you want to delete this change notice?"
+msgstr "Sei sicuro di voler eliminare questo avviso di modifica?"
msgid "Are you sure you want to delete this gauge?"
msgstr "Sei sicuro di voler eliminare questo calibro?"
@@ -2052,11 +2052,11 @@ msgstr "Impossibile scaricare questo file"
msgid "Cancel"
msgstr "Annulla"
-msgid "Cancel change order"
-msgstr "Annulla ordine di modifica"
+msgid "Cancel change notice"
+msgstr "Annulla avviso di modifica"
-msgid "Cancel Change Order"
-msgstr "Annulla Ordine di Modifica"
+msgid "Cancel Change Notice"
+msgstr "Annulla avviso di modifica"
msgid "Cancel Job"
msgstr "Annulla Lavoro"
@@ -2232,20 +2232,20 @@ msgstr "Modifica Documento"
msgid "Change Inspection Plan"
msgstr "Modifica Piano di Ispezione"
-msgid "Change order"
-msgstr "Ordine di modifica"
+msgid "Change notice"
+msgstr "Avviso di modifica"
-msgid "Change Order"
-msgstr "Ordine di Modifica"
+msgid "Change Notice"
+msgstr "Avviso di modifica"
-msgid "Change Order Actions"
-msgstr "Azioni dell'ordine di modifica"
+msgid "Change Notice Actions"
+msgstr "Azioni dell'avviso di modifica"
-msgid "Change Order Types"
-msgstr "Tipi di Ordini di Modifica"
+msgid "Change Notice Types"
+msgstr "Tipi di avviso di modifica"
-msgid "Change Orders"
-msgstr "Ordini di Modifica"
+msgid "Change Notices"
+msgstr "Avvisi di modifica"
msgid "Change status"
msgstr "Cambia stato"
@@ -2840,8 +2840,8 @@ msgstr "Copia numero lavoro"
msgid "Copy link"
msgstr "Copia link"
-msgid "Copy link to change order"
-msgstr "Copia link all'ordine di modifica"
+msgid "Copy link to change notice"
+msgstr "Copia il collegamento all'avviso di modifica"
msgid "Copy link to consumable"
msgstr "Copia il collegamento al consumabile"
@@ -3064,8 +3064,8 @@ msgstr "Crea {0} valori"
msgid "Create & Snapshot"
msgstr "Crea e Snapshot"
-msgid "Create a change order for the new revision and open it"
-msgstr "Crea un ordine di modifica per la nuova revisione e aprilo"
+msgid "Create a change notice for the new revision and open it"
+msgstr "Crea un avviso di modifica per la nuova revisione e aprilo"
msgid "Create a new kanban card for scan-based replenishment."
msgstr "Crea una nuova scheda kanban per il rifornimento basato su scansione."
@@ -3094,8 +3094,8 @@ msgstr "Creare e approvare ordini di acquisto"
msgid "Create audit trail entries"
msgstr "Crea voci di audit trail"
-msgid "Create Change Order"
-msgstr "Crea Ordine di Modifica"
+msgid "Create Change Notice"
+msgstr "Crea avviso di modifica"
msgid "Create Issue"
msgstr "Crea Problema"
@@ -3151,11 +3151,11 @@ msgstr "Creato il"
msgid "Created By"
msgstr "Creato da"
-msgid "Created change order action"
-msgstr "Azione dell'ordine di modifica creata"
+msgid "Created change notice action"
+msgstr "Azione dell'avviso di modifica creata"
-msgid "Created change order type"
-msgstr "Tipo di ordine di modifica creato"
+msgid "Created change notice type"
+msgstr "Tipo di avviso di modifica creato"
msgid "Created consumable"
msgstr "Consumabile creato"
@@ -3825,8 +3825,8 @@ msgstr "Elimina Attributo"
msgid "Delete Category"
msgstr "Elimina Categoria"
-msgid "Delete Change Order"
-msgstr "Elimina Ordine di Modifica"
+msgid "Delete Change Notice"
+msgstr "Elimina avviso di modifica"
msgid "Delete Consumable"
msgstr "Elimina Consumabile"
@@ -4555,14 +4555,14 @@ msgstr "Modifica Categoria Attributo"
msgid "Edit Category"
msgstr "Modifica Categoria"
-msgid "Edit Change Order"
-msgstr "Modifica Ordine di Modifica"
+msgid "Edit Change Notice"
+msgstr "Modifica avviso di modifica"
-msgid "Edit Change Order Action"
-msgstr "Modifica azione dell'ordine di modifica"
+msgid "Edit Change Notice Action"
+msgstr "Modifica azione dell'avviso di modifica"
-msgid "Edit Change Order Type"
-msgstr "Modifica Tipo di Ordine di Modifica"
+msgid "Edit Change Notice Type"
+msgstr "Modifica tipo di avviso di modifica"
msgid "Edit column visibility"
msgstr "Modifica visibilità colonna"
@@ -7990,14 +7990,14 @@ msgstr "Nuovo Attributo"
msgid "New Attribute Category"
msgstr "Nuova Categoria Attributo"
-msgid "New Change Order"
-msgstr "Nuovo Ordine di Modifica"
+msgid "New Change Notice"
+msgstr "Nuovo avviso di modifica"
-msgid "New Change Order Action"
-msgstr "Nuova azione dell'ordine di modifica"
+msgid "New Change Notice Action"
+msgstr "Nuova azione dell'avviso di modifica"
-msgid "New Change Order Type"
-msgstr "Nuovo Tipo di Ordine di Modifica"
+msgid "New Change Notice Type"
+msgstr "Nuovo tipo di avviso di modifica"
msgid "New Consumable"
msgstr "Nuovo Consumabile"
@@ -8341,6 +8341,9 @@ msgstr "Nessuna entità tracciata disponibile trovata"
msgid "No BOM input has a shelf-life policy"
msgstr "Nessun input della distinta base ha una politica di shelf-life"
+msgid "No CAD model to preview."
+msgstr "Nessun modello CAD da visualizzare."
+
msgid "No calibration records found"
msgstr "Nessun record di calibrazione trovato"
@@ -8782,8 +8785,8 @@ msgstr "Oops! Il link che stai cercando di accedere non è valido."
msgid "Open"
msgstr "Apri"
-msgid "Open a change order"
-msgstr "Apri un ordine di modifica"
+msgid "Open a change notice"
+msgstr "Apri un avviso di modifica"
msgid "Open Actions"
msgstr "Azioni Aperte"
@@ -8800,8 +8803,8 @@ msgstr "AR aperto"
msgid "Open Audit Log"
msgstr "Apri Registro di Audit"
-msgid "Open change orders affecting this part"
-msgstr "Ordini di modifica aperti che interessano questa parte"
+msgid "Open change notices affecting this part"
+msgstr "Apri gli avvisi di modifica che interessano questa parte"
msgid "Open Date"
msgstr "Data di apertura"
@@ -8812,11 +8815,11 @@ msgstr "Spedizioni Aperte"
msgid "Open in Carbon"
msgstr "Apri in Carbon"
-msgid "Open in change order {ids}. Release it to create new versions or revisions."
-msgstr "Aperto nell'ordine di modifica {ids}. Rilasciarlo per creare nuove versioni o revisioni."
+msgid "Open in change notice {ids}. Release it to create new versions or revisions."
+msgstr "Apri nell'avviso di modifica {ids}. Rilascialo per creare nuove versioni o revisioni."
-msgid "Open in change orders {ids}. Release them to create new versions or revisions."
-msgstr "Apri in ordini di modifica {ids}. Rilasciali per creare nuove versioni o revisioni."
+msgid "Open in change notices {ids}. Release them to create new versions or revisions."
+msgstr "Apri negli avvisi di modifica {ids}. Rilasciali per creare nuove versioni o revisioni."
msgid "Open in MES"
msgstr "Apri in MES"
@@ -10295,7 +10298,7 @@ msgid "Refresh exchange rate"
msgstr "Aggiorna tasso di cambio"
msgid "Regenerate"
-msgstr "Rigenera"
+msgstr "Rigenerare"
msgid "Regenerating thumbnail…"
msgstr "Rigenerazione dell'anteprima…"
@@ -10342,8 +10345,8 @@ msgstr "Cronologia relativa · date da confermare"
msgid "Release"
msgstr "Rilascio"
-msgid "Release change order"
-msgstr "Rilascia ordine di modifica"
+msgid "Release change notice"
+msgstr "Rilascia avviso di modifica"
msgid "Release control"
msgstr "Controllo rilascio"
@@ -13133,6 +13136,12 @@ msgstr "Questi lavori hanno operazioni assegnate a questo centro di lavoro:"
msgid "These journal entries are still Draft, so their debits and credits aren't in the ledger for this period. Post each one, or re-date it into a later open period."
msgstr "Queste registrazioni contabili sono ancora in Bozza, quindi i loro debiti e crediti non sono nella contabilità generale per questo periodo. Registra ciascuna o rivalutala in un periodo aperto successivo."
+msgid "This change notice is being implemented, so its changes are locked. Reopen it to edit."
+msgstr "Questo avviso di modifica è in corso di implementazione, quindi le sue modifiche sono bloccate. Riaprilo per modificare."
+
+msgid "This change notice is closed, so its changes are read-only."
+msgstr "Questo avviso di modifica è chiuso, quindi le sue modifiche sono di sola lettura."
+
msgid "This completes the Discovery step."
msgstr "Questo completa il passaggio Discovery."
@@ -13217,11 +13226,11 @@ msgstr "Questo periodo non ha movimenti di diario registrati e può essere elimi
msgid "This Quarter"
msgstr "Questo Trimestre"
-msgid "This revision is released (Production). Changes should normally flow through a change order."
-msgstr "Questa revisione è rilasciata (Produzione). Le modifiche dovrebbero normalmente fluire attraverso un ordine di modifica."
+msgid "This revision is released (Production). Changes should normally flow through a change notice."
+msgstr "Questa revisione è rilasciata (Produzione). I cambiamenti dovrebbero normalmente passare attraverso un avviso di modifica."
-msgid "This revision is released (Production). Open a change order to modify it."
-msgstr "Questa revisione è rilasciata (Produzione). Aprire un ordine di modifica per modificarla."
+msgid "This revision is released (Production). Open a change notice to modify it."
+msgstr "Questa revisione è rilasciata (Produzione). Apri un avviso di modifica per modificarla."
msgid "This sales order has associated jobs. Choose what to do with them."
msgstr "Questo ordine di vendita ha processi associati. Scegli cosa fare con loro."
@@ -13239,6 +13248,13 @@ msgstr "questo fornitore"
msgid "This updates the theme for all users of the application"
msgstr "Questo aggiorna il tema per tutti gli utenti dell'applicazione"
+msgid "This version belongs to an open <0>change notice</0>. Edit it there."
+msgstr "Questa versione appartiene a un <0>avviso di modifica</0> aperto. Modificalo lì."
+
+#. placeholder {0}: lock.readableId
+msgid "This version belongs to change notice <0>{0}</0>. Edit it there."
+msgstr "Questa versione appartiene all'avviso di modifica <0>{0}</0>. Modificalo lì."
+
msgid "This will make this version read-only and replace any material make methods with this version."
msgstr "Questo renderà questa versione di sola lettura e sostituirà tutti i metodi di produzione dei materiali con questa versione."
@@ -14658,6 +14674,9 @@ msgstr "Perché la data di scadenza viene modificata?"
msgid "Why is this included?"
msgstr "Perché è incluso?"
+msgid "Why is this locked?"
+msgstr "Perché è bloccato?"
+
msgid "Why stock is changing — Positive (found), Negative (lost/scrap), or Set (replace count with a measured value)."
msgstr "Perché il magazzino sta cambiando — Positivo (trovato), Negativo (perso/scrap) o Impostare (sostituire la quantità con un valore misurato)."
@@ -14809,6 +14828,9 @@ msgstr "Hai completato {leftoverQuantity} {0} in più rispetto alla quantità or
msgid "You don't have permission to edit this bill of material."
msgstr "Non hai il permesso di modificare questa distinta base."
+msgid "You don't have permission to edit this bill of process."
+msgstr "Non hai i permessi per modificare questo ciclo di lavorazione."
+
msgid "You drive it; we make sure it's done right. Expert eyes on your setup, data, and go-live."
msgstr "Tu lo guidi; noi ci assicuriamo che sia fatto bene. Occhi esperti sulla tua configurazione, dati e lancio."
@@ -14843,8 +14865,8 @@ msgstr "Sei stato registrato per {hoursElapsed} ore. Hai dimenticato di registra
msgid "Your books and how money flows."
msgstr "I tuoi libri e come scorre il denaro."
-msgid "Your changes go into a new draft version released with this change order."
-msgstr "Le tue modifiche vanno in una nuova versione bozza rilasciata con questo ordine di modifica."
+msgid "Your changes go into a new draft version released with this change notice."
+msgstr "Le tue modifiche vengono inserite in una nuova versione bozza rilasciata con questo avviso di modifica."
msgid "Your Console PIN"
msgstr "Il tuo PIN Console"
diff --git a/packages/locale/locales/ja/erp.po b/packages/locale/locales/ja/erp.po
index 6432d5f028..9ec9101224 100644
--- a/packages/locale/locales/ja/erp.po
+++ b/packages/locale/locales/ja/erp.po
@@ -45,8 +45,8 @@ msgid "(excluded for this customer)"
msgstr "(このお客様では除外されています)"
#. placeholder {0}: open.length
-msgid "{0, plural, one {This part is on 1 open change order} other {This part is on # open change orders}}"
-msgstr "{0, plural, one {このパーツは1件のオープンな変更指示に含まれています} other {このパーツは#件のオープンな変更指示に含まれています}}"
+msgid "{0, plural, one {This part is on 1 open change notice} other {This part is on # open change notices}}"
+msgstr "{0, plural, one {このパーツは1つの開いた変更通知に含まれています} other {このパーツは#つの開いた変更通知に含まれています}}"
#. placeholder {0}: ar.count
msgid "{0} customers with a balance"
@@ -224,8 +224,8 @@ msgstr "90日"
msgid "A Carbon-run data migration — you load your own data"
msgstr "Carbon実行のデータ移行 — あなたが自分のデータをロードします"
-msgid "A change order tracks a controlled engineering or manufacturing change through review and implementation."
-msgstr "変更指示は、レビューと実装を通じて管理されたエンジニアリングまたは製造上の変更を追跡します。"
+msgid "A change notice tracks a controlled engineering or manufacturing change through review and implementation."
+msgstr "変更通知は、レビューと実装を通じて制御されたエンジニアリングまたは製造上の変更を追跡します。"
msgid "A clearing account holding the value of goods received but not yet billed; the supplier invoice clears it."
msgstr "受け取ったが請求されていない商品の価値を保有するクリアリング勘定。仕入先請求書がそれを結済します。"
@@ -1145,7 +1145,7 @@ msgstr "プロセス「{name}」を有効化してもよろしいですか?ド
msgid "Are you sure you want to activate this gauge?."
msgstr "このゲージを有効化してもよろしいですか?"
-#. placeholder {0}: routeData?.changeOrder?.changeOrderId ?? ""
+#. placeholder {0}: routeData?.changeNotice?.changeOrderId ?? ""
msgid "Are you sure you want to cancel {0}? It will be closed and read-only until you reopen it."
msgstr "{0}をキャンセルしてもよろしいですか?閉じられて、再度開くまで読み取り専用になります。"
@@ -1245,12 +1245,12 @@ msgid "Are you sure you want to delete the asset class: {0}? This cannot be undo
msgstr "資産クラス {0} を削除してもよろしいですか。この操作は元に戻せません。"
#. placeholder {0}: requiredAction.name
-msgid "Are you sure you want to delete the change order action: {0}? This cannot be undone."
-msgstr "変更オーダーアクション「{0}」を削除してもよろしいですか?この操作は取り消せません。"
+msgid "Are you sure you want to delete the change notice action: {0}? This cannot be undone."
+msgstr "変更通知アクション「{0}」を削除してもよろしいですか?この操作は取り消せません。"
-#. placeholder {0}: changeOrderType.name
-msgid "Are you sure you want to delete the change order category: {0}? This cannot be undone."
-msgstr "変更指示カテゴリ「{0}」を削除してもよろしいですか?この操作は取り消せません。"
+#. placeholder {0}: changeNoticeType.name
+msgid "Are you sure you want to delete the change notice category: {0}? This cannot be undone."
+msgstr "変更通知カテゴリ「{0}」を削除してもよろしいですか?この操作は取り消せません。"
msgid "Are you sure you want to delete the contractor: {name}? This cannot be undone."
msgstr "本当に契約者 {name} を削除してもよろしいですか?この操作は取り消せません。"
@@ -1410,8 +1410,8 @@ msgstr "本当にウェブフック: {0} を削除してもよろしいですか
msgid "Are you sure you want to delete this approval rule? This cannot be undone."
msgstr "このアプリケーション承認ルールを削除してもよろしいですか?この操作は取り消せません。"
-msgid "Are you sure you want to delete this change order?"
-msgstr "この変更指示を削除してもよろしいですか?"
+msgid "Are you sure you want to delete this change notice?"
+msgstr "この変更通知を削除してもよろしいですか?"
msgid "Are you sure you want to delete this gauge?"
msgstr "このゲージを削除してもよろしいですか?"
@@ -2052,11 +2052,11 @@ msgstr "このファイルをダウンロードできません"
msgid "Cancel"
msgstr "キャンセル"
-msgid "Cancel change order"
-msgstr "変更指示をキャンセル"
+msgid "Cancel change notice"
+msgstr "変更通知をキャンセル"
-msgid "Cancel Change Order"
-msgstr "変更指示をキャンセル"
+msgid "Cancel Change Notice"
+msgstr "変更通知をキャンセル"
msgid "Cancel Job"
msgstr "ジョブをキャンセル"
@@ -2232,20 +2232,20 @@ msgstr "ドキュメント変更"
msgid "Change Inspection Plan"
msgstr "検査計画を変更"
-msgid "Change order"
-msgstr "変更オーダー"
+msgid "Change notice"
+msgstr "変更通知"
-msgid "Change Order"
-msgstr "変更指示"
+msgid "Change Notice"
+msgstr "変更通知"
-msgid "Change Order Actions"
-msgstr "変更オーダーアクション"
+msgid "Change Notice Actions"
+msgstr "変更通知アクション"
-msgid "Change Order Types"
-msgstr "変更指示タイプ"
+msgid "Change Notice Types"
+msgstr "変更通知タイプ"
-msgid "Change Orders"
-msgstr "変更指示"
+msgid "Change Notices"
+msgstr "変更通知"
msgid "Change status"
msgstr "ステータスを変更"
@@ -2840,8 +2840,8 @@ msgstr "ジョブ番号をコピー"
msgid "Copy link"
msgstr "リンクをコピー"
-msgid "Copy link to change order"
-msgstr "変更指示へのリンクをコピー"
+msgid "Copy link to change notice"
+msgstr "変更通知へのリンクをコピー"
msgid "Copy link to consumable"
msgstr "消耗品へのリンクをコピー"
@@ -3064,8 +3064,8 @@ msgstr "{0}個の値を作成"
msgid "Create & Snapshot"
msgstr "作成とスナップショット"
-msgid "Create a change order for the new revision and open it"
-msgstr "新しいリビジョンの変更オーダーを作成して開く"
+msgid "Create a change notice for the new revision and open it"
+msgstr "新しいリビジョンの変更通知を作成して開く"
msgid "Create a new kanban card for scan-based replenishment."
msgstr "スキャンベースの補充用に新しいかんばんカードを作成します。"
@@ -3094,8 +3094,8 @@ msgstr "購買注文を作成して承認する"
msgid "Create audit trail entries"
msgstr "監査証跡エントリを作成"
-msgid "Create Change Order"
-msgstr "変更指示を作成"
+msgid "Create Change Notice"
+msgstr "変更通知を作成"
msgid "Create Issue"
msgstr "問題を作成"
@@ -3151,11 +3151,11 @@ msgstr "作成日時"
msgid "Created By"
msgstr "作成者"
-msgid "Created change order action"
-msgstr "変更オーダーアクションを作成"
+msgid "Created change notice action"
+msgstr "変更通知アクションを作成しました"
-msgid "Created change order type"
-msgstr "変更指示タイプを作成"
+msgid "Created change notice type"
+msgstr "変更通知タイプを作成しました"
msgid "Created consumable"
msgstr "消耗品を作成しました"
@@ -3825,8 +3825,8 @@ msgstr "属性を削除"
msgid "Delete Category"
msgstr "カテゴリを削除"
-msgid "Delete Change Order"
-msgstr "変更指示を削除"
+msgid "Delete Change Notice"
+msgstr "変更通知を削除"
msgid "Delete Consumable"
msgstr "消耗品を削除"
@@ -4555,14 +4555,14 @@ msgstr "属性カテゴリを編集"
msgid "Edit Category"
msgstr "カテゴリを編集"
-msgid "Edit Change Order"
-msgstr "変更指示を編集"
+msgid "Edit Change Notice"
+msgstr "変更通知を編集"
-msgid "Edit Change Order Action"
-msgstr "変更オーダーアクションを編集"
+msgid "Edit Change Notice Action"
+msgstr "変更通知アクションを編集"
-msgid "Edit Change Order Type"
-msgstr "変更指示タイプを編集"
+msgid "Edit Change Notice Type"
+msgstr "変更通知タイプを編集"
msgid "Edit column visibility"
msgstr "列の表示/非表示を編集"
@@ -7990,14 +7990,14 @@ msgstr "新しい属性"
msgid "New Attribute Category"
msgstr "新しい属性カテゴリ"
-msgid "New Change Order"
-msgstr "新しい変更指示"
+msgid "New Change Notice"
+msgstr "新規変更通知"
-msgid "New Change Order Action"
-msgstr "新しい変更オーダーアクション"
+msgid "New Change Notice Action"
+msgstr "新規変更通知アクション"
-msgid "New Change Order Type"
-msgstr "新しい変更指示タイプ"
+msgid "New Change Notice Type"
+msgstr "新規変更通知タイプ"
msgid "New Consumable"
msgstr "新しい消耗品"
@@ -8341,6 +8341,9 @@ msgstr "利用可能な追跡対象エンティティが見つかりません"
msgid "No BOM input has a shelf-life policy"
msgstr "BOMインプットに棚卸資産有効期限ポリシーがありません"
+msgid "No CAD model to preview."
+msgstr "プレビューするCADモデルがありません。"
+
msgid "No calibration records found"
msgstr "キャリブレーション記録が見つかりません"
@@ -8782,8 +8785,8 @@ msgstr "申し訳ございません。アクセスしようとしているリン
msgid "Open"
msgstr "開く"
-msgid "Open a change order"
-msgstr "変更オーダーを開く"
+msgid "Open a change notice"
+msgstr "変更通知を開く"
msgid "Open Actions"
msgstr "オープンアクション"
@@ -8800,8 +8803,8 @@ msgstr "未払い売掛金"
msgid "Open Audit Log"
msgstr "監査ログを開く"
-msgid "Open change orders affecting this part"
-msgstr "この部品に影響を与える開いている変更指示"
+msgid "Open change notices affecting this part"
+msgstr "このパーツに影響する開いた変更通知を開く"
msgid "Open Date"
msgstr "開始日"
@@ -8812,11 +8815,11 @@ msgstr "オープンディスパッチ"
msgid "Open in Carbon"
msgstr "Carbonで開く"
-msgid "Open in change order {ids}. Release it to create new versions or revisions."
-msgstr "変更注文 {ids} で開いています。新しいバージョンまたはリビジョンを作成するためにリリースしてください。"
+msgid "Open in change notice {ids}. Release it to create new versions or revisions."
+msgstr "変更通知{ids}で開いています。新しいバージョンまたはリビジョンを作成するには、それをリリースしてください。"
-msgid "Open in change orders {ids}. Release them to create new versions or revisions."
-msgstr "変更注文 {ids} で開きます。新しいバージョンまたはリビジョンを作成するためにそれらをリリースしてください。"
+msgid "Open in change notices {ids}. Release them to create new versions or revisions."
+msgstr "変更通知{ids}で開いています。新しいバージョンまたはリビジョンを作成するには、それらをリリースしてください。"
msgid "Open in MES"
msgstr "MESで開く"
@@ -10342,8 +10345,8 @@ msgstr "相対的なタイムライン · 日付は確認待ちです"
msgid "Release"
msgstr "リリース"
-msgid "Release change order"
-msgstr "変更オーダーをリリース"
+msgid "Release change notice"
+msgstr "変更通知をリリース"
msgid "Release control"
msgstr "リリース管理"
@@ -13133,6 +13136,12 @@ msgstr "これらのジョブにはこのワークセンターに割り当てら
msgid "These journal entries are still Draft, so their debits and credits aren't in the ledger for this period. Post each one, or re-date it into a later open period."
msgstr "これらの仕訳はまだ下書きであるため、それらの借方と貸方は当期の元帳に含まれていません。各仕訳を転記するか、後の開いている期間に再度日付を付け直してください。"
+msgid "This change notice is being implemented, so its changes are locked. Reopen it to edit."
+msgstr "この変更通知は実装中であるため、変更がロックされています。編集するために再度開いてください。"
+
+msgid "This change notice is closed, so its changes are read-only."
+msgstr "この変更通知は閉じられているため、変更は読み取り専用です。"
+
msgid "This completes the Discovery step."
msgstr "これはDiscoveryステップを完了します。"
@@ -13217,11 +13226,11 @@ msgstr "この期間には転記された仕訳がなく、永久に削除でき
msgid "This Quarter"
msgstr "今四半期"
-msgid "This revision is released (Production). Changes should normally flow through a change order."
-msgstr "このリビジョンは本番環境にリリースされています。変更は通常、変更注文を通じて行われるべきです。"
+msgid "This revision is released (Production). Changes should normally flow through a change notice."
+msgstr "このリビジョンはリリース済み(本番環境)です。変更は通常、変更通知を通じて実施されるべきです。"
-msgid "This revision is released (Production). Open a change order to modify it."
-msgstr "このリビジョンは本番環境にリリースされています。これを変更するには、変更注文を開いてください。"
+msgid "This revision is released (Production). Open a change notice to modify it."
+msgstr "このリビジョンはリリース済み(本番環境)です。変更通知を開いて変更してください。"
msgid "This sales order has associated jobs. Choose what to do with them."
msgstr "この販売注文には関連するジョブがあります。それらをどうするかを選択してください。"
@@ -13239,6 +13248,13 @@ msgstr "このサプライヤー"
msgid "This updates the theme for all users of the application"
msgstr "これはアプリケーションのすべてのユーザーのテーマを更新します"
+msgid "This version belongs to an open <0>change notice</0>. Edit it there."
+msgstr "このバージョンはオープンな<0>変更通知</0>に属しています。そこで編集してください。"
+
+#. placeholder {0}: lock.readableId
+msgid "This version belongs to change notice <0>{0}</0>. Edit it there."
+msgstr "このバージョンは変更通知<0>{0}</0>に属しています。そこで編集してください。"
+
msgid "This will make this version read-only and replace any material make methods with this version."
msgstr "このバージョンは読み取り専用になり、すべての材料製造方法がこのバージョンに置き換わります。"
@@ -14658,6 +14674,9 @@ msgstr "有効期限が変更されるのはなぜですか?"
msgid "Why is this included?"
msgstr "なぜこれが含まれていますか?"
+msgid "Why is this locked?"
+msgstr "なぜこれはロックされていますか?"
+
msgid "Why stock is changing — Positive (found), Negative (lost/scrap), or Set (replace count with a measured value)."
msgstr "在庫が変わる理由 — ポジティブ(見つかった)、ネガティブ(失われた/スクラップ)、または設定(カウントを測定値に置き換え)。"
@@ -14809,6 +14828,9 @@ msgstr "あなたは注文数量 {1} より {leftoverQuantity} 個多く {0} を
msgid "You don't have permission to edit this bill of material."
msgstr "この部品表を編集する権限がありません。"
+msgid "You don't have permission to edit this bill of process."
+msgstr "このプロセス一覧を編集する権限がありません。"
+
msgid "You drive it; we make sure it's done right. Expert eyes on your setup, data, and go-live."
msgstr "あなたが主導し、私たちが確実に正しく実行します。セットアップ、データ、本番稼働に関する専門家の目が入ります。"
@@ -14843,8 +14865,8 @@ msgstr "あなたは{hoursElapsed}時間クロックインしています。ク
msgid "Your books and how money flows."
msgstr "あなたの帳簿とお金の流れ。"
-msgid "Your changes go into a new draft version released with this change order."
-msgstr "変更は、このチェンジオーダーとともにリリースされる新しいドラフトバージョンに入ります。"
+msgid "Your changes go into a new draft version released with this change notice."
+msgstr "変更内容は、この変更通知でリリースされた新しいドラフトバージョンに反映されます。"
msgid "Your Console PIN"
msgstr "あなたのコンソールPIN"
diff --git a/packages/locale/locales/ko/erp.po b/packages/locale/locales/ko/erp.po
index 8a9c3ebd7d..b628a0380d 100644
--- a/packages/locale/locales/ko/erp.po
+++ b/packages/locale/locales/ko/erp.po
@@ -45,8 +45,8 @@ msgid "(excluded for this customer)"
msgstr "(이 고객에게는 제외됨)"
#. placeholder {0}: open.length
-msgid "{0, plural, one {This part is on 1 open change order} other {This part is on # open change orders}}"
-msgstr "{0, plural, one {이 부품은 1개의 미처리 변경주문에 있습니다} other {이 부품은 #개의 미처리 변경주문에 있습니다}}"
+msgid "{0, plural, one {This part is on 1 open change notice} other {This part is on # open change notices}}"
+msgstr "{0, plural, one {이 부품은 1개의 미완료 변경 공지에 포함되어 있습니다} other {이 부품은 #개의 미완료 변경 공지에 포함되어 있습니다}}"
#. placeholder {0}: ar.count
msgid "{0} customers with a balance"
@@ -224,8 +224,8 @@ msgstr "90일"
msgid "A Carbon-run data migration — you load your own data"
msgstr "Carbon이 진행하는 데이터 마이그레이션 — 직접 데이터를 업로드"
-msgid "A change order tracks a controlled engineering or manufacturing change through review and implementation."
-msgstr "변경주문은 검토 및 시행을 통해 제어되는 엔지니어링 또는 제조 변경사항을 추적합니다."
+msgid "A change notice tracks a controlled engineering or manufacturing change through review and implementation."
+msgstr "변경 공지는 엔지니어링 또는 제조 변경 사항을 검토 및 구현 단계를 거쳐 추적합니다."
msgid "A clearing account holding the value of goods received but not yet billed; the supplier invoice clears it."
msgstr "입고되었으나 아직 청구되지 않은 재화의 금액을 보관하는 경과 계정으로, 공급업체 인보이스가 처리되면 정산됩니다."
@@ -1145,7 +1145,7 @@ msgstr "공정 {name}을(를) 활성화하시겠습니까? 드롭다운에 다
msgid "Are you sure you want to activate this gauge?."
msgstr "이 측정기를 활성화하시겠습니까?"
-#. placeholder {0}: routeData?.changeOrder?.changeOrderId ?? ""
+#. placeholder {0}: routeData?.changeNotice?.changeOrderId ?? ""
msgid "Are you sure you want to cancel {0}? It will be closed and read-only until you reopen it."
msgstr "{0}을(를) 취소하시겠습니까? 취소되면 다시 열 때까지 닫힌 상태로 읽기 전용이 됩니다."
@@ -1245,12 +1245,12 @@ msgid "Are you sure you want to delete the asset class: {0}? This cannot be undo
msgstr "자산 클래스: {0}를 삭제하시겠습니까? 이 작업은 실행 취소할 수 없습니다."
#. placeholder {0}: requiredAction.name
-msgid "Are you sure you want to delete the change order action: {0}? This cannot be undone."
-msgstr "변경 주문 작업 '{0}'을(를) 삭제하시겠습니까? 이 작업은 실행 취소할 수 없습니다."
+msgid "Are you sure you want to delete the change notice action: {0}? This cannot be undone."
+msgstr "변경 공지 작업 {0}을(를) 삭제하시겠습니까? 이 작업은 실행 취소할 수 없습니다."
-#. placeholder {0}: changeOrderType.name
-msgid "Are you sure you want to delete the change order category: {0}? This cannot be undone."
-msgstr "변경주문 카테고리 {0}을(를) 삭제하시겠습니까? 이는 실행 취소할 수 없습니다."
+#. placeholder {0}: changeNoticeType.name
+msgid "Are you sure you want to delete the change notice category: {0}? This cannot be undone."
+msgstr "변경 공지 카테고리 {0}을(를) 삭제하시겠습니까? 이 작업은 실행 취소할 수 없습니다."
msgid "Are you sure you want to delete the contractor: {name}? This cannot be undone."
msgstr "계약직 {name}을(를) 삭제하시겠습니까? 이 작업은 되돌릴 수 없습니다."
@@ -1410,8 +1410,8 @@ msgstr "웹훅 {0}을(를) 삭제하시겠습니까? 이 작업은 되돌릴 수
msgid "Are you sure you want to delete this approval rule? This cannot be undone."
msgstr "이 승인 규칙을 삭제하시겠습니까? 이 작업은 되돌릴 수 없습니다."
-msgid "Are you sure you want to delete this change order?"
-msgstr "이 변경주문을 삭제하시겠습니까?"
+msgid "Are you sure you want to delete this change notice?"
+msgstr "이 변경 공지를 삭제하시겠습니까?"
msgid "Are you sure you want to delete this gauge?"
msgstr "이 측정기를 삭제하시겠습니까?"
@@ -2052,11 +2052,11 @@ msgstr "이 파일을 다운로드할 수 없습니다"
msgid "Cancel"
msgstr "취소"
-msgid "Cancel change order"
-msgstr "변경 주문 취소"
+msgid "Cancel change notice"
+msgstr "변경 공지 취소"
-msgid "Cancel Change Order"
-msgstr "변경 주문 취소"
+msgid "Cancel Change Notice"
+msgstr "변경 공지 취소"
msgid "Cancel Job"
msgstr "작업 취소"
@@ -2232,20 +2232,20 @@ msgstr "문서 변경"
msgid "Change Inspection Plan"
msgstr "검사 계획 변경"
-msgid "Change order"
-msgstr "변경 주문"
+msgid "Change notice"
+msgstr "변경 공지"
-msgid "Change Order"
-msgstr "변경주문"
+msgid "Change Notice"
+msgstr "변경 공지"
-msgid "Change Order Actions"
-msgstr "변경 주문 작업"
+msgid "Change Notice Actions"
+msgstr "변경 공지 작업"
-msgid "Change Order Types"
-msgstr "변경주문 유형"
+msgid "Change Notice Types"
+msgstr "변경 공지 유형"
-msgid "Change Orders"
-msgstr "변경주문"
+msgid "Change Notices"
+msgstr "변경 공지"
msgid "Change status"
msgstr "상태 변경"
@@ -2840,8 +2840,8 @@ msgstr "작업 번호 복사"
msgid "Copy link"
msgstr "링크 복사"
-msgid "Copy link to change order"
-msgstr "변경주문 링크 복사"
+msgid "Copy link to change notice"
+msgstr "변경 공지 링크 복사"
msgid "Copy link to consumable"
msgstr "소모품 링크 복사"
@@ -3064,8 +3064,8 @@ msgstr "{0} 값 생성"
msgid "Create & Snapshot"
msgstr "생성 및 스냅샷"
-msgid "Create a change order for the new revision and open it"
-msgstr "새 개정에 대한 변경 주문을 만들고 열기"
+msgid "Create a change notice for the new revision and open it"
+msgstr "새 개정본을 위한 변경 공지를 만들고 엽니다"
msgid "Create a new kanban card for scan-based replenishment."
msgstr "스캔 기반 보충을 위한 새 칸반 카드를 생성합니다."
@@ -3094,8 +3094,8 @@ msgstr "구매주문 생성 및 승인"
msgid "Create audit trail entries"
msgstr "감사 추적 항목 생성"
-msgid "Create Change Order"
-msgstr "변경주문 생성"
+msgid "Create Change Notice"
+msgstr "변경 공지 만들기"
msgid "Create Issue"
msgstr "이슈 생성"
@@ -3151,11 +3151,11 @@ msgstr "생성일"
msgid "Created By"
msgstr "생성자"
-msgid "Created change order action"
-msgstr "변경 주문 작업 생성됨"
+msgid "Created change notice action"
+msgstr "변경 공지 작업 생성됨"
-msgid "Created change order type"
-msgstr "생성된 변경 주문 유형"
+msgid "Created change notice type"
+msgstr "변경 공지 유형 생성됨"
msgid "Created consumable"
msgstr "소모품 생성됨"
@@ -3825,8 +3825,8 @@ msgstr "속성 삭제"
msgid "Delete Category"
msgstr "카테고리 삭제"
-msgid "Delete Change Order"
-msgstr "변경주문 삭제"
+msgid "Delete Change Notice"
+msgstr "변경 공지 삭제"
msgid "Delete Consumable"
msgstr "소모품 삭제"
@@ -4555,14 +4555,14 @@ msgstr "속성 카테고리 수정"
msgid "Edit Category"
msgstr "카테고리 수정"
-msgid "Edit Change Order"
-msgstr "변경주문 편집"
+msgid "Edit Change Notice"
+msgstr "변경 공지 편집"
-msgid "Edit Change Order Action"
-msgstr "변경 주문 작업 편집"
+msgid "Edit Change Notice Action"
+msgstr "변경 공지 작업 편집"
-msgid "Edit Change Order Type"
-msgstr "변경 주문 유형 편집"
+msgid "Edit Change Notice Type"
+msgstr "변경 공지 유형 편집"
msgid "Edit column visibility"
msgstr "열 표시 여부 수정"
@@ -7990,14 +7990,14 @@ msgstr "신규 속성"
msgid "New Attribute Category"
msgstr "신규 속성 카테고리"
-msgid "New Change Order"
-msgstr "새 변경 주문"
+msgid "New Change Notice"
+msgstr "새 변경 공지"
-msgid "New Change Order Action"
-msgstr "새 변경 주문 작업"
+msgid "New Change Notice Action"
+msgstr "새 변경 공지 작업"
-msgid "New Change Order Type"
-msgstr "새 변경 주문 유형"
+msgid "New Change Notice Type"
+msgstr "새 변경 공지 유형"
msgid "New Consumable"
msgstr "신규 소모품"
@@ -8341,6 +8341,9 @@ msgstr "사용 가능한 추적 개체가 없습니다"
msgid "No BOM input has a shelf-life policy"
msgstr "BOM 투입 항목 중 유효기간 정책이 설정된 항목이 없습니다"
+msgid "No CAD model to preview."
+msgstr "미리 볼 수 있는 CAD 모델이 없습니다."
+
msgid "No calibration records found"
msgstr "교정 기록이 없습니다"
@@ -8782,8 +8785,8 @@ msgstr "이런! 접근하려는 링크가 유효하지 않습니다."
msgid "Open"
msgstr "열림"
-msgid "Open a change order"
-msgstr "변경 주문 열기"
+msgid "Open a change notice"
+msgstr "변경 공지 열기"
msgid "Open Actions"
msgstr "미결 조치"
@@ -8800,8 +8803,8 @@ msgstr "미결 매출채권"
msgid "Open Audit Log"
msgstr "감사 로그 열기"
-msgid "Open change orders affecting this part"
-msgstr "이 부품에 영향을 미치는 개방된 변경 주문"
+msgid "Open change notices affecting this part"
+msgstr "이 부품에 영향을 주는 미완료 변경 공지 열기"
msgid "Open Date"
msgstr "개설일"
@@ -8812,11 +8815,11 @@ msgstr "미결 작업지시"
msgid "Open in Carbon"
msgstr "Carbon에서 열기"
-msgid "Open in change order {ids}. Release it to create new versions or revisions."
-msgstr "변경 주문 {ids}에서 열기. 새 버전 또는 개정을 만들려면 릴리스하세요."
+msgid "Open in change notice {ids}. Release it to create new versions or revisions."
+msgstr "변경 공지 {ids}에서 열기. 새 버전 또는 개정본을 만들려면 이를 릴리스하십시오."
-msgid "Open in change orders {ids}. Release them to create new versions or revisions."
-msgstr "변경 요청 {ids}에서 열기. 이들을 릴리스하여 새로운 버전 또는 개정판을 생성합니다."
+msgid "Open in change notices {ids}. Release them to create new versions or revisions."
+msgstr "변경 공지 {ids}에서 열기. 새 버전 또는 개정본을 만들려면 이들을 릴리스하십시오."
msgid "Open in MES"
msgstr "MES에서 열기"
@@ -10342,8 +10345,8 @@ msgstr "상대적 타임라인 · 날짜 확정 예정"
msgid "Release"
msgstr "릴리즈"
-msgid "Release change order"
-msgstr "변경 주문 릴리스"
+msgid "Release change notice"
+msgstr "변경 공지 릴리스"
msgid "Release control"
msgstr "릴리스 제어"
@@ -13133,6 +13136,12 @@ msgstr "다음 작업에 이 작업장이 지정된 공정작업이 있습니다
msgid "These journal entries are still Draft, so their debits and credits aren't in the ledger for this period. Post each one, or re-date it into a later open period."
msgstr "이 분개들은 아직 임시이므로 그 차변과 대변이 이 기간의 총계정원장에 없습니다. 각각을 전기하거나 나중의 개방된 기간으로 재날짜하세요."
+msgid "This change notice is being implemented, so its changes are locked. Reopen it to edit."
+msgstr "이 변경 사항은 구현 중이므로 변경 사항이 잠겨 있습니다. 편집하려면 다시 열어주세요."
+
+msgid "This change notice is closed, so its changes are read-only."
+msgstr "이 변경 사항은 닫혀 있으므로 변경 사항이 읽기 전용입니다."
+
msgid "This completes the Discovery step."
msgstr "이것으로 발견(Discovery) 단계가 완료됩니다."
@@ -13217,11 +13226,11 @@ msgstr "이 기간에는 게시된 분개가 없으며 영구적으로 삭제할
msgid "This Quarter"
msgstr "이번 분기"
-msgid "This revision is released (Production). Changes should normally flow through a change order."
-msgstr "이 리뷰는 릴리스 상태입니다(프로덕션). 변경 사항은 일반적으로 변경 주문을 통해 진행되어야 합니다."
+msgid "This revision is released (Production). Changes should normally flow through a change notice."
+msgstr "이 개정본이 릴리스되었습니다(프로덕션). 변경 사항은 일반적으로 변경 공지를 통해 처리되어야 합니다."
-msgid "This revision is released (Production). Open a change order to modify it."
-msgstr "이 리뷰는 릴리스 상태입니다(프로덕션). 수정하려면 변경 주문을 열어주세요."
+msgid "This revision is released (Production). Open a change notice to modify it."
+msgstr "이 개정본이 릴리스되었습니다(프로덕션). 수정하려면 변경 공지를 열어주십시오."
msgid "This sales order has associated jobs. Choose what to do with them."
msgstr "이 판매주문에는 연결된 작업이 있습니다. 처리 방법을 선택하세요."
@@ -13239,6 +13248,13 @@ msgstr "이 공급업체"
msgid "This updates the theme for all users of the application"
msgstr "이 설정은 애플리케이션의 모든 사용자에 대한 테마를 업데이트합니다"
+msgid "This version belongs to an open <0>change notice</0>. Edit it there."
+msgstr "이 버전은 열려 있는 <0>변경 공지</0>에 속합니다. 거기서 편집하세요."
+
+#. placeholder {0}: lock.readableId
+msgid "This version belongs to change notice <0>{0}</0>. Edit it there."
+msgstr "이 버전은 변경 공지 <0>{0}</0>에 속합니다. 거기서 편집하세요."
+
msgid "This will make this version read-only and replace any material make methods with this version."
msgstr "이렇게 하면 이 버전이 읽기 전용으로 전환되고, 자재 제조 방법이 모두 이 버전으로 교체됩니다."
@@ -14658,6 +14674,9 @@ msgstr "유효기한을 변경하는 이유는 무엇입니까?"
msgid "Why is this included?"
msgstr "이것이 포함된 이유는 무엇입니까?"
+msgid "Why is this locked?"
+msgstr "왜 이것이 잠겨 있나요?"
+
msgid "Why stock is changing — Positive (found), Negative (lost/scrap), or Set (replace count with a measured value)."
msgstr "재고가 변경되는 이유 — 양수(발견), 음수(분실/스크랩), 또는 설정(측정값으로 수량 대체)."
@@ -14809,6 +14828,9 @@ msgstr "주문 수량 {1}보다 {leftoverQuantity}개 더 많은 {0}을(를) 완
msgid "You don't have permission to edit this bill of material."
msgstr "이 자재명세서를 수정할 권한이 없습니다."
+msgid "You don't have permission to edit this bill of process."
+msgstr "이 프로세스 명세서를 편집할 권한이 없습니다."
+
msgid "You drive it; we make sure it's done right. Expert eyes on your setup, data, and go-live."
msgstr "귀사가 주도하고, 저희가 제대로 되도록 확인합니다. 설정, 데이터, 도입 전반을 전문가가 점검합니다."
@@ -14843,8 +14865,8 @@ msgstr "{hoursElapsed}시간 동안 출근 상태입니다. 퇴근 처리를 잊
msgid "Your books and how money flows."
msgstr "귀사의 장부와 자금 흐름."
-msgid "Your changes go into a new draft version released with this change order."
-msgstr "변경 사항이 이 변경 주문과 함께 릴리스되는 새로운 초안 버전으로 이동합니다."
+msgid "Your changes go into a new draft version released with this change notice."
+msgstr "변경 사항이 이 변경 공지와 함께 릴리스된 새 초안 버전으로 이동합니다."
msgid "Your Console PIN"
msgstr "콘솔 PIN"
diff --git a/packages/locale/locales/pl/erp.po b/packages/locale/locales/pl/erp.po
index 267dac08ba..02f03f1d66 100644
--- a/packages/locale/locales/pl/erp.po
+++ b/packages/locale/locales/pl/erp.po
@@ -45,8 +45,8 @@ msgid "(excluded for this customer)"
msgstr "(wykluczone dla tego klienta)"
#. placeholder {0}: open.length
-msgid "{0, plural, one {This part is on 1 open change order} other {This part is on # open change orders}}"
-msgstr "{0, plural, one {Ta część znajduje się na 1 otwartym zleceniu zmian} other {Ta część znajduje się na # otwartych zleceniach zmian}}"
+msgid "{0, plural, one {This part is on 1 open change notice} other {This part is on # open change notices}}"
+msgstr "{0, plural, one {Ta część znajduje się na 1 otwartym zgłoszeniu zmian} other {Ta część znajduje się na # otwartych zgłoszeniach zmian}}"
#. placeholder {0}: ar.count
msgid "{0} customers with a balance"
@@ -224,8 +224,8 @@ msgstr "90 dni"
msgid "A Carbon-run data migration — you load your own data"
msgstr "Migracja danych prowadzona przez Carbon — ty ładujesz swoje dane"
-msgid "A change order tracks a controlled engineering or manufacturing change through review and implementation."
-msgstr "Zlecenie zmian śledzi kontrolowaną zmianę inżynieryjną lub produkcyjną poprzez przegląd i wdrożenie."
+msgid "A change notice tracks a controlled engineering or manufacturing change through review and implementation."
+msgstr "Zgłoszenie zmian śledzi kontrolowaną zmianę inżynieryjną lub produkcyjną w procesie przeglądu i wdrażania."
msgid "A clearing account holding the value of goods received but not yet billed; the supplier invoice clears it."
msgstr "Konto kompensacyjne zawierające wartość towarów otrzymanych, ale jeszcze niezafakturowanych; faktura dostawcy go wyzerowuje."
@@ -1145,7 +1145,7 @@ msgstr "Czy na pewno chcesz aktywować proces: {name}? Pojawi się ponownie w li
msgid "Are you sure you want to activate this gauge?."
msgstr "Czy na pewno chcesz aktywować ten miernik?."
-#. placeholder {0}: routeData?.changeOrder?.changeOrderId ?? ""
+#. placeholder {0}: routeData?.changeNotice?.changeOrderId ?? ""
msgid "Are you sure you want to cancel {0}? It will be closed and read-only until you reopen it."
msgstr "Czy na pewno chcesz anulować {0}? Będzie zamknięte i tylko do odczytu do momentu, gdy je ponownie otworzysz."
@@ -1245,12 +1245,12 @@ msgid "Are you sure you want to delete the asset class: {0}? This cannot be undo
msgstr "Czy na pewno chcesz usunąć klasę aktywów: {0}? Tej czynności nie można cofnąć."
#. placeholder {0}: requiredAction.name
-msgid "Are you sure you want to delete the change order action: {0}? This cannot be undone."
-msgstr "Czy na pewno chcesz usunąć akcję zmian zamówienia: {0}? Nie można tego cofnąć."
+msgid "Are you sure you want to delete the change notice action: {0}? This cannot be undone."
+msgstr "Czy na pewno chcesz usunąć działanie zgłoszenia zmian: {0}? Tej czynności nie można cofnąć."
-#. placeholder {0}: changeOrderType.name
-msgid "Are you sure you want to delete the change order category: {0}? This cannot be undone."
-msgstr "Czy na pewno chcesz usunąć kategorię zlecenia zmian: {0}? Nie można tego cofnąć."
+#. placeholder {0}: changeNoticeType.name
+msgid "Are you sure you want to delete the change notice category: {0}? This cannot be undone."
+msgstr "Czy na pewno chcesz usunąć kategorię zgłoszenia zmian: {0}? Tej czynności nie można cofnąć."
msgid "Are you sure you want to delete the contractor: {name}? This cannot be undone."
msgstr "Czy na pewno chcesz usunąć wykonawcę: {name}? Tej czynności nie można cofnąć."
@@ -1410,8 +1410,8 @@ msgstr "Czy na pewno chcesz usunąć webhook: {0}? Tej czynności nie można cof
msgid "Are you sure you want to delete this approval rule? This cannot be undone."
msgstr "Czy na pewno chcesz usunąć tę regułę zatwierdzania? Tej operacji nie można cofnąć."
-msgid "Are you sure you want to delete this change order?"
-msgstr "Czy na pewno chcesz usunąć to zlecenie zmian?"
+msgid "Are you sure you want to delete this change notice?"
+msgstr "Czy na pewno chcesz usunąć to zgłoszenie zmian?"
msgid "Are you sure you want to delete this gauge?"
msgstr "Czy na pewno chcesz usunąć ten miernik?"
@@ -2052,11 +2052,11 @@ msgstr "Nie można pobrać tego pliku"
msgid "Cancel"
msgstr "Anuluj"
-msgid "Cancel change order"
-msgstr "Anuluj zamówienie zmian"
+msgid "Cancel change notice"
+msgstr "Anuluj zgłoszenie zmian"
-msgid "Cancel Change Order"
-msgstr "Anuluj Zamówienie Zmian"
+msgid "Cancel Change Notice"
+msgstr "Anuluj Zgłoszenie Zmian"
msgid "Cancel Job"
msgstr "Anuluj zadanie"
@@ -2232,20 +2232,20 @@ msgstr "Zmień dokument"
msgid "Change Inspection Plan"
msgstr "Zmień plan inspekcji"
-msgid "Change order"
-msgstr "Zmiana zamówienia"
+msgid "Change notice"
+msgstr "Zgłoszenie zmian"
-msgid "Change Order"
-msgstr "Zlecenie Zmian"
+msgid "Change Notice"
+msgstr "Zgłoszenie Zmian"
-msgid "Change Order Actions"
-msgstr "Akcje zmiany zamówienia"
+msgid "Change Notice Actions"
+msgstr "Działania Zgłoszenia Zmian"
-msgid "Change Order Types"
-msgstr "Typy Zleceń Zmian"
+msgid "Change Notice Types"
+msgstr "Typy Zgłoszeń Zmian"
-msgid "Change Orders"
-msgstr "Zlecenia Zmian"
+msgid "Change Notices"
+msgstr "Zgłoszenia Zmian"
msgid "Change status"
msgstr "Zmień status"
@@ -2840,8 +2840,8 @@ msgstr "Skopiuj numer zadania"
msgid "Copy link"
msgstr "Skopiuj link"
-msgid "Copy link to change order"
-msgstr "Skopiuj link do zlecenia zmian"
+msgid "Copy link to change notice"
+msgstr "Skopiuj link do zgłoszenia zmian"
msgid "Copy link to consumable"
msgstr "Skopiuj link do materiału"
@@ -3064,8 +3064,8 @@ msgstr "Utwórz {0} wartości"
msgid "Create & Snapshot"
msgstr "Utwórz i Snapshot"
-msgid "Create a change order for the new revision and open it"
-msgstr "Utwórz zmianę zamówienia dla nowej wersji i otwórz ją"
+msgid "Create a change notice for the new revision and open it"
+msgstr "Utwórz zgłoszenie zmian dla nowej wersji i otwórz je"
msgid "Create a new kanban card for scan-based replenishment."
msgstr "Utwórz nową kartę kanban do uzupełniania opartego na skanowaniu."
@@ -3094,8 +3094,8 @@ msgstr "Twórz i zatwierdzaj zamówienia zakupu"
msgid "Create audit trail entries"
msgstr "Utwórz wpisy dziennika audytu"
-msgid "Create Change Order"
-msgstr "Utwórz Zlecenie Zmian"
+msgid "Create Change Notice"
+msgstr "Utwórz Zgłoszenie Zmian"
msgid "Create Issue"
msgstr "Utwórz problem"
@@ -3151,11 +3151,11 @@ msgstr "Utworzono"
msgid "Created By"
msgstr "Utworzono przez"
-msgid "Created change order action"
-msgstr "Akcja zmiany zamówienia została utworzona"
+msgid "Created change notice action"
+msgstr "Utworzone działanie zgłoszenia zmian"
-msgid "Created change order type"
-msgstr "Utworzono typ zamówienia zmian"
+msgid "Created change notice type"
+msgstr "Utworzony typ zgłoszenia zmian"
msgid "Created consumable"
msgstr "Utworzono materiał zużywalny"
@@ -3825,8 +3825,8 @@ msgstr "Usuń atrybut"
msgid "Delete Category"
msgstr "Usuń kategorię"
-msgid "Delete Change Order"
-msgstr "Usuń Zlecenie Zmian"
+msgid "Delete Change Notice"
+msgstr "Usuń Zgłoszenie Zmian"
msgid "Delete Consumable"
msgstr "Usuń materiał eksploatacyjny"
@@ -4555,14 +4555,14 @@ msgstr "Edytuj kategorię atrybutu"
msgid "Edit Category"
msgstr "Edytuj kategorię"
-msgid "Edit Change Order"
-msgstr "Edytuj Zlecenie Zmian"
+msgid "Edit Change Notice"
+msgstr "Edytuj Zgłoszenie Zmian"
-msgid "Edit Change Order Action"
-msgstr "Edytuj akcję zmiany zamówienia"
+msgid "Edit Change Notice Action"
+msgstr "Edytuj Działanie Zgłoszenia Zmian"
-msgid "Edit Change Order Type"
-msgstr "Edytuj typ zamówienia zmian"
+msgid "Edit Change Notice Type"
+msgstr "Edytuj Typ Zgłoszenia Zmian"
msgid "Edit column visibility"
msgstr "Edytuj widoczność kolumn"
@@ -7990,14 +7990,14 @@ msgstr "Nowy atrybut"
msgid "New Attribute Category"
msgstr "Nowa Kategoria Atrybutu"
-msgid "New Change Order"
-msgstr "Nowe Zlecenie Zmiany"
+msgid "New Change Notice"
+msgstr "Nowe Zgłoszenie Zmian"
-msgid "New Change Order Action"
-msgstr "Nowa akcja zmiany zamówienia"
+msgid "New Change Notice Action"
+msgstr "Nowe Działanie Zgłoszenia Zmian"
-msgid "New Change Order Type"
-msgstr "Nowy typ zamówienia zmian"
+msgid "New Change Notice Type"
+msgstr "Nowy Typ Zgłoszenia Zmian"
msgid "New Consumable"
msgstr "Nowy materiał zużywalny"
@@ -8341,6 +8341,9 @@ msgstr "Nie znaleziono dostępnych śledzonych jednostek"
msgid "No BOM input has a shelf-life policy"
msgstr "Żadne wejście BOM nie ma polityki przydatności do spożycia"
+msgid "No CAD model to preview."
+msgstr "Brak modelu CAD do podglądu."
+
msgid "No calibration records found"
msgstr "Nie znaleziono rekordów kalibracji"
@@ -8782,8 +8785,8 @@ msgstr "Ups! Link, do którego próbujesz uzyskać dostęp, jest nieprawidłowy.
msgid "Open"
msgstr "Otwórz"
-msgid "Open a change order"
-msgstr "Otwórz zmianę zamówienia"
+msgid "Open a change notice"
+msgstr "Otwórz zgłoszenie zmian"
msgid "Open Actions"
msgstr "Otwarte Działania"
@@ -8800,8 +8803,8 @@ msgstr "Otwarte należności"
msgid "Open Audit Log"
msgstr "Otwórz dziennik audytu"
-msgid "Open change orders affecting this part"
-msgstr "Otwarte Zlecenia Zmian wpływające na tę część"
+msgid "Open change notices affecting this part"
+msgstr "Otwórz zgłoszenia zmian dotyczące tej części"
msgid "Open Date"
msgstr "Data otwarcia"
@@ -8812,11 +8815,11 @@ msgstr "Otwarte Dyspozycje"
msgid "Open in Carbon"
msgstr "Otwórz w Carbon"
-msgid "Open in change order {ids}. Release it to create new versions or revisions."
-msgstr "Otwórz w zleceniu zmiany {ids}. Wydaj je, aby utworzyć nowe wersje lub poprawki."
+msgid "Open in change notice {ids}. Release it to create new versions or revisions."
+msgstr "Otwórz w zgłoszeniu zmian {ids}. Wydaj je, aby utworzyć nowe wersje lub rewizje."
-msgid "Open in change orders {ids}. Release them to create new versions or revisions."
-msgstr "Otwórz w rokazach zmian {ids}. Zwolnij je, aby utworzyć nowe wersje lub rewizje."
+msgid "Open in change notices {ids}. Release them to create new versions or revisions."
+msgstr "Otwórz w zgłoszeniach zmian {ids}. Wydaj je, aby utworzyć nowe wersje lub rewizje."
msgid "Open in MES"
msgstr "Otwórz w MES"
@@ -10342,8 +10345,8 @@ msgstr "Względna oś czasu · daty do potwierdzenia"
msgid "Release"
msgstr "Zwolnienie"
-msgid "Release change order"
-msgstr "Wydaj zlecenie zmian"
+msgid "Release change notice"
+msgstr "Wydaj zgłoszenie zmian"
msgid "Release control"
msgstr "Kontrola wydania"
@@ -13133,6 +13136,12 @@ msgstr "Te zadania mają operacje przypisane do tego centrum pracy:"
msgid "These journal entries are still Draft, so their debits and credits aren't in the ledger for this period. Post each one, or re-date it into a later open period."
msgstr "Te wpisy dziennika są wciąż w wersji roboczej, więc ich obciążenia i kredyty nie znajdują się w księdze w tym okresie. Opublikuj każdy lub przedatuj go na późniejszy otwarty okres."
+msgid "This change notice is being implemented, so its changes are locked. Reopen it to edit."
+msgstr "Ta notacja zmiany jest wdrażana, więc jej zmiany są zablokowane. Otwórz ją ponownie, aby edytować."
+
+msgid "This change notice is closed, so its changes are read-only."
+msgstr "Ta notacja zmiany jest zamknięta, więc jej zmiany są tylko do odczytu."
+
msgid "This completes the Discovery step."
msgstr "To uzupełnia krok Discovery."
@@ -13217,11 +13226,11 @@ msgstr "Ten okres nie ma żadnych wpisów w dzienniku i może być trwale usuni
msgid "This Quarter"
msgstr "Ten Kwartał"
-msgid "This revision is released (Production). Changes should normally flow through a change order."
-msgstr "Ta wersja jest opublikowana (Produkcja). Zmiany powinny zwykle przechodzić przez zamówienie zmian."
+msgid "This revision is released (Production). Changes should normally flow through a change notice."
+msgstr "Ta wersja jest wydana (Produkcja). Zmiany powinny normalnie przebiegać przez zgłoszenie zmian."
-msgid "This revision is released (Production). Open a change order to modify it."
-msgstr "Ta wersja jest opublikowana (Produkcja). Otwórz zamówienie zmian, aby ją zmodyfikować."
+msgid "This revision is released (Production). Open a change notice to modify it."
+msgstr "Ta wersja jest wydana (Produkcja). Otwórz zgłoszenie zmian, aby go zmodyfikować."
msgid "This sales order has associated jobs. Choose what to do with them."
msgstr "To zamówienie sprzedaży ma powiązane zadania. Wybierz, co z nimi zrobić."
@@ -13239,6 +13248,13 @@ msgstr "ten dostawca"
msgid "This updates the theme for all users of the application"
msgstr "To aktualizuje motyw dla wszystkich użytkowników aplikacji"
+msgid "This version belongs to an open <0>change notice</0>. Edit it there."
+msgstr "Ta wersja należy do otwartego <0>zmiany powiadomienia</0>. Edytuj tam."
+
+#. placeholder {0}: lock.readableId
+msgid "This version belongs to change notice <0>{0}</0>. Edit it there."
+msgstr "Ta wersja należy do zmiany powiadomienia <0>{0}</0>. Edytuj tam."
+
msgid "This will make this version read-only and replace any material make methods with this version."
msgstr "To spowoduje, że ta wersja będzie tylko do odczytu i zastąpi wszystkie metody produkcji materiałów tą wersją."
@@ -14658,6 +14674,9 @@ msgstr "Dlaczego data wygaśnięcia jest zmieniana?"
msgid "Why is this included?"
msgstr "Dlaczego to jest uwzględnione?"
+msgid "Why is this locked?"
+msgstr "Dlaczego to jest zablokowane?"
+
msgid "Why stock is changing — Positive (found), Negative (lost/scrap), or Set (replace count with a measured value)."
msgstr "Dlaczego zapasy się zmieniają — Pozytywnie (znaleźli), Negatywnie (zgubieni/złom) lub Ustawić (zamień ilość zmierzoną wartością)."
@@ -14809,6 +14828,9 @@ msgstr "Ukończyłeś {leftoverQuantity} więcej {0} niż zamówiona ilość {1}
msgid "You don't have permission to edit this bill of material."
msgstr "Nie masz uprawnień do edytowania tej listy materiałów."
+msgid "You don't have permission to edit this bill of process."
+msgstr "Nie masz uprawnień do edycji tego zamawiania technologicznego."
+
msgid "You drive it; we make sure it's done right. Expert eyes on your setup, data, and go-live."
msgstr "Ty kierujesz; my upewniamy się, że wszystko jest zrobione prawidłowo. Fachowe spojrzenie na Twoją konfigurację, dane i wdrożenie."
@@ -14843,8 +14865,8 @@ msgstr "Jesteś zalogowany od {hoursElapsed} godzin. Czy zapomniałeś się wylo
msgid "Your books and how money flows."
msgstr "Twoje księgi i przepływ pieniędzy."
-msgid "Your changes go into a new draft version released with this change order."
-msgstr "Twoje zmiany trafiają do nowej wersji roboczej wydanej z tym zamówieniem zmian."
+msgid "Your changes go into a new draft version released with this change notice."
+msgstr "Twoje zmiany trafiają do nowej wersji roboczej wydanej wraz z tym zgłoszeniem zmian."
msgid "Your Console PIN"
msgstr "Twój PIN konsoli"
diff --git a/packages/locale/locales/pt/erp.po b/packages/locale/locales/pt/erp.po
index bda9a0ded6..33ae53d1f5 100644
--- a/packages/locale/locales/pt/erp.po
+++ b/packages/locale/locales/pt/erp.po
@@ -45,8 +45,8 @@ msgid "(excluded for this customer)"
msgstr "(excluído para este cliente)"
#. placeholder {0}: open.length
-msgid "{0, plural, one {This part is on 1 open change order} other {This part is on # open change orders}}"
-msgstr "{0, plural, one {Esta peça está em 1 ordem de alteração aberta} other {Esta peça está em # ordens de alteração abertas}}"
+msgid "{0, plural, one {This part is on 1 open change notice} other {This part is on # open change notices}}"
+msgstr "{0, plural, one {Esta parte está em 1 aviso de mudança aberto} other {Esta parte está em # avisos de mudança abertos}}"
#. placeholder {0}: ar.count
msgid "{0} customers with a balance"
@@ -224,8 +224,8 @@ msgstr "90 dias"
msgid "A Carbon-run data migration — you load your own data"
msgstr "Uma migração de dados executada pela Carbon — você carrega seus próprios dados"
-msgid "A change order tracks a controlled engineering or manufacturing change through review and implementation."
-msgstr "Uma ordem de alteração rastreia uma mudança de engenharia ou fabricação controlada através de revisão e implementação."
+msgid "A change notice tracks a controlled engineering or manufacturing change through review and implementation."
+msgstr "Um aviso de mudança rastreia uma mudança de engenharia ou fabricação controlada através de revisão e implementação."
msgid "A clearing account holding the value of goods received but not yet billed; the supplier invoice clears it."
msgstr "Uma conta de compensação que mantém o valor das mercadorias recebidas mas ainda não faturadas; a fatura do fornecedor a limpa."
@@ -1145,7 +1145,7 @@ msgstr "Tem a certeza de que deseja ativar o processo: {name}? Ele aparecerá no
msgid "Are you sure you want to activate this gauge?."
msgstr "Tem certeza de que deseja ativar este medidor?."
-#. placeholder {0}: routeData?.changeOrder?.changeOrderId ?? ""
+#. placeholder {0}: routeData?.changeNotice?.changeOrderId ?? ""
msgid "Are you sure you want to cancel {0}? It will be closed and read-only until you reopen it."
msgstr "Tem certeza de que deseja cancelar {0}? Será fechado e somente leitura até que você o reabra."
@@ -1245,12 +1245,12 @@ msgid "Are you sure you want to delete the asset class: {0}? This cannot be undo
msgstr "Tem certeza que deseja deletar a classe de ativo: {0}? Isso não pode ser desfeito."
#. placeholder {0}: requiredAction.name
-msgid "Are you sure you want to delete the change order action: {0}? This cannot be undone."
-msgstr "Tem certeza de que deseja excluir a ação da ordem de mudança: {0}? Isso não pode ser desfeito."
+msgid "Are you sure you want to delete the change notice action: {0}? This cannot be undone."
+msgstr "Tem certeza de que deseja excluir a ação do aviso de mudança: {0}? Isso não pode ser desfeito."
-#. placeholder {0}: changeOrderType.name
-msgid "Are you sure you want to delete the change order category: {0}? This cannot be undone."
-msgstr "Tem certeza que deseja deletar a categoria de ordem de alteração: {0}? Isso não pode ser desfeito."
+#. placeholder {0}: changeNoticeType.name
+msgid "Are you sure you want to delete the change notice category: {0}? This cannot be undone."
+msgstr "Tem certeza de que deseja excluir a categoria de aviso de mudança: {0}? Isso não pode ser desfeito."
msgid "Are you sure you want to delete the contractor: {name}? This cannot be undone."
msgstr "Tem a certeza de que deseja eliminar o contratante: {name}? Esta ação não pode ser desfeita."
@@ -1410,8 +1410,8 @@ msgstr "Tem a certeza de que deseja eliminar o webhook: {0}? Esta ação não po
msgid "Are you sure you want to delete this approval rule? This cannot be undone."
msgstr "Tem a certeza de que deseja eliminar esta regra de aprovação? Isto não pode ser desfeito."
-msgid "Are you sure you want to delete this change order?"
-msgstr "Tem certeza que deseja deletar esta ordem de alteração?"
+msgid "Are you sure you want to delete this change notice?"
+msgstr "Tem certeza de que deseja excluir este aviso de mudança?"
msgid "Are you sure you want to delete this gauge?"
msgstr "Tem certeza de que deseja excluir este medidor?"
@@ -2052,11 +2052,11 @@ msgstr "Não é possível baixar este arquivo"
msgid "Cancel"
msgstr "Cancelar"
-msgid "Cancel change order"
-msgstr "Cancelar ordem de mudança"
+msgid "Cancel change notice"
+msgstr "Cancelar aviso de mudança"
-msgid "Cancel Change Order"
-msgstr "Cancelar Ordem de Mudança"
+msgid "Cancel Change Notice"
+msgstr "Cancelar Aviso de Mudança"
msgid "Cancel Job"
msgstr "Cancelar Trabalho"
@@ -2232,20 +2232,20 @@ msgstr "Alterar Documento"
msgid "Change Inspection Plan"
msgstr "Alterar Plano de Inspeção"
-msgid "Change order"
-msgstr "Ordem de mudança"
+msgid "Change notice"
+msgstr "Aviso de mudança"
-msgid "Change Order"
-msgstr "Ordem de Alteração"
+msgid "Change Notice"
+msgstr "Aviso de Mudança"
-msgid "Change Order Actions"
-msgstr "Ações de Ordem de Mudança"
+msgid "Change Notice Actions"
+msgstr "Ações do Aviso de Mudança"
-msgid "Change Order Types"
-msgstr "Tipos de Ordem de Alteração"
+msgid "Change Notice Types"
+msgstr "Tipos de Aviso de Mudança"
-msgid "Change Orders"
-msgstr "Ordens de Alteração"
+msgid "Change Notices"
+msgstr "Avisos de Mudança"
msgid "Change status"
msgstr "Alterar status"
@@ -2840,8 +2840,8 @@ msgstr "Copiar número do trabalho"
msgid "Copy link"
msgstr "Copiar ligação"
-msgid "Copy link to change order"
-msgstr "Copiar link para ordem de alteração"
+msgid "Copy link to change notice"
+msgstr "Copiar link para aviso de mudança"
msgid "Copy link to consumable"
msgstr "Copiar link para consumível"
@@ -3064,8 +3064,8 @@ msgstr "Criar {0} valores"
msgid "Create & Snapshot"
msgstr "Criar e Capturar"
-msgid "Create a change order for the new revision and open it"
-msgstr "Criar uma ordem de mudança para a nova revisão e abri-la"
+msgid "Create a change notice for the new revision and open it"
+msgstr "Criar um aviso de mudança para a nova revisão e abri-lo"
msgid "Create a new kanban card for scan-based replenishment."
msgstr "Crie um novo cartão kanban para reabastecimento baseado em varredura."
@@ -3094,8 +3094,8 @@ msgstr "Criar e aprovar pedidos de compra"
msgid "Create audit trail entries"
msgstr "Criar entradas de trilha de auditoria"
-msgid "Create Change Order"
-msgstr "Criar Ordem de Alteração"
+msgid "Create Change Notice"
+msgstr "Criar Aviso de Mudança"
msgid "Create Issue"
msgstr "Criar Problema"
@@ -3151,11 +3151,11 @@ msgstr "Criado em"
msgid "Created By"
msgstr "Criado por"
-msgid "Created change order action"
-msgstr "Ação de ordem de mudança criada"
+msgid "Created change notice action"
+msgstr "Ação de aviso de mudança criada"
-msgid "Created change order type"
-msgstr "Tipo de ordem de mudança criado"
+msgid "Created change notice type"
+msgstr "Tipo de aviso de mudança criado"
msgid "Created consumable"
msgstr "Consumível criado"
@@ -3825,8 +3825,8 @@ msgstr "Eliminar Atributo"
msgid "Delete Category"
msgstr "Eliminar Categoria"
-msgid "Delete Change Order"
-msgstr "Deletar Ordem de Alteração"
+msgid "Delete Change Notice"
+msgstr "Excluir Aviso de Mudança"
msgid "Delete Consumable"
msgstr "Eliminar Consumível"
@@ -4555,14 +4555,14 @@ msgstr "Editar Categoria de Atributo"
msgid "Edit Category"
msgstr "Editar Categoria"
-msgid "Edit Change Order"
-msgstr "Editar Ordem de Alteração"
+msgid "Edit Change Notice"
+msgstr "Editar Aviso de Mudança"
-msgid "Edit Change Order Action"
-msgstr "Editar Ação de Ordem de Mudança"
+msgid "Edit Change Notice Action"
+msgstr "Editar Ação do Aviso de Mudança"
-msgid "Edit Change Order Type"
-msgstr "Editar Tipo de Ordem de Mudança"
+msgid "Edit Change Notice Type"
+msgstr "Editar Tipo de Aviso de Mudança"
msgid "Edit column visibility"
msgstr "Editar visibilidade da coluna"
@@ -7990,14 +7990,14 @@ msgstr "Novo Atributo"
msgid "New Attribute Category"
msgstr "Nova Categoria de Atributo"
-msgid "New Change Order"
-msgstr "Nova Ordem de Mudança"
+msgid "New Change Notice"
+msgstr "Novo Aviso de Mudança"
-msgid "New Change Order Action"
-msgstr "Nova Ação de Ordem de Mudança"
+msgid "New Change Notice Action"
+msgstr "Nova Ação de Aviso de Mudança"
-msgid "New Change Order Type"
-msgstr "Novo Tipo de Ordem de Mudança"
+msgid "New Change Notice Type"
+msgstr "Novo Tipo de Aviso de Mudança"
msgid "New Consumable"
msgstr "Novo Consumível"
@@ -8341,6 +8341,9 @@ msgstr "Nenhuma entidade rastreada disponível encontrada"
msgid "No BOM input has a shelf-life policy"
msgstr "Nenhuma entrada de BOM tem uma política de vida útil"
+msgid "No CAD model to preview."
+msgstr "Nenhum modelo CAD para visualizar."
+
msgid "No calibration records found"
msgstr "Nenhum registro de calibração encontrado"
@@ -8782,8 +8785,8 @@ msgstr "Oops! O link que está tentando acessar não é válido."
msgid "Open"
msgstr "Abrir"
-msgid "Open a change order"
-msgstr "Abrir uma ordem de mudança"
+msgid "Open a change notice"
+msgstr "Abrir um aviso de mudança"
msgid "Open Actions"
msgstr "Ações Abertas"
@@ -8800,8 +8803,8 @@ msgstr "AR aberto"
msgid "Open Audit Log"
msgstr "Abrir Registro de Auditoria"
-msgid "Open change orders affecting this part"
-msgstr "Ordens de mudança abertas que afetam esta peça"
+msgid "Open change notices affecting this part"
+msgstr "Abrir avisos de mudança que afetam esta parte"
msgid "Open Date"
msgstr "Data de Abertura"
@@ -8812,11 +8815,11 @@ msgstr "Despachos Abertos"
msgid "Open in Carbon"
msgstr "Abrir no Carbon"
-msgid "Open in change order {ids}. Release it to create new versions or revisions."
-msgstr "Aberto na ordem de mudança {ids}. Libere-a para criar novas versões ou revisões."
+msgid "Open in change notice {ids}. Release it to create new versions or revisions."
+msgstr "Aberto no aviso de mudança {ids}. Libere-o para criar novas versões ou revisões."
-msgid "Open in change orders {ids}. Release them to create new versions or revisions."
-msgstr "Abrir nas ordens de mudança {ids}. Libere-as para criar novas versões ou revisões."
+msgid "Open in change notices {ids}. Release them to create new versions or revisions."
+msgstr "Aberto nos avisos de mudança {ids}. Libere-os para criar novas versões ou revisões."
msgid "Open in MES"
msgstr "Abrir no MES"
@@ -10342,8 +10345,8 @@ msgstr "Cronograma relativo · datas a confirmar"
msgid "Release"
msgstr "Liberação"
-msgid "Release change order"
-msgstr "Liberar ordem de alteração"
+msgid "Release change notice"
+msgstr "Liberar aviso de mudança"
msgid "Release control"
msgstr "Controle de lançamento"
@@ -13133,6 +13136,12 @@ msgstr "Estes trabalhos têm operações atribuídas a este centro de trabalho:"
msgid "These journal entries are still Draft, so their debits and credits aren't in the ledger for this period. Post each one, or re-date it into a later open period."
msgstr "Estes lançamentos de diário ainda estão em Rascunho, portanto seus débitos e créditos não estão no livro-razão para este período. Lance cada um, ou redatē-o para um período aberto posterior."
+msgid "This change notice is being implemented, so its changes are locked. Reopen it to edit."
+msgstr "Este aviso de mudança está sendo implementado, portanto suas alterações estão bloqueadas. Reabra-o para editar."
+
+msgid "This change notice is closed, so its changes are read-only."
+msgstr "Este aviso de mudança está fechado, portanto suas alterações são somente leitura."
+
msgid "This completes the Discovery step."
msgstr "Isto completa a etapa de Descoberta."
@@ -13217,11 +13226,11 @@ msgstr "Este período não tem lançamentos de diário nele e pode ser deletado
msgid "This Quarter"
msgstr "Este Trimestre"
-msgid "This revision is released (Production). Changes should normally flow through a change order."
-msgstr "Esta revisão foi lançada (Produção). As alterações devem normalmente passar por uma ordem de alteração."
+msgid "This revision is released (Production). Changes should normally flow through a change notice."
+msgstr "Esta revisão foi liberada (Produção). As mudanças devem normalmente passar por um aviso de mudança."
-msgid "This revision is released (Production). Open a change order to modify it."
-msgstr "Esta revisão foi lançada (Produção). Abra uma ordem de alteração para modificá-la."
+msgid "This revision is released (Production). Open a change notice to modify it."
+msgstr "Esta revisão foi liberada (Produção). Abra um aviso de mudança para modificá-la."
msgid "This sales order has associated jobs. Choose what to do with them."
msgstr "Esta ordem de venda tem trabalhos associados. Escolha o que fazer com eles."
@@ -13239,6 +13248,13 @@ msgstr "este fornecedor"
msgid "This updates the theme for all users of the application"
msgstr "Isto atualiza o tema para todos os utilizadores da aplicação"
+msgid "This version belongs to an open <0>change notice</0>. Edit it there."
+msgstr "Esta versão pertence a um <0>aviso de alteração</0> aberto. Edite-a lá."
+
+#. placeholder {0}: lock.readableId
+msgid "This version belongs to change notice <0>{0}</0>. Edit it there."
+msgstr "Esta versão pertence ao aviso de alteração <0>{0}</0>. Edite-a lá."
+
msgid "This will make this version read-only and replace any material make methods with this version."
msgstr "Isto tornará esta versão somente leitura e substituirá quaisquer métodos de fabricação de material por esta versão."
@@ -14658,6 +14674,9 @@ msgstr "Por que a expiração está sendo alterada?"
msgid "Why is this included?"
msgstr "Por que isto está incluído?"
+msgid "Why is this locked?"
+msgstr "Por que isso está bloqueado?"
+
msgid "Why stock is changing — Positive (found), Negative (lost/scrap), or Set (replace count with a measured value)."
msgstr "Por que o estoque está mudando — Positivo (encontrado), Negativo (perdido/scrap) ou Definir (substituir quantidade com valor medido)."
@@ -14809,6 +14828,9 @@ msgstr "Você completou {leftoverQuantity} {0} a mais do que a quantidade solici
msgid "You don't have permission to edit this bill of material."
msgstr "Você não tem permissão para editar esta lista de materiais."
+msgid "You don't have permission to edit this bill of process."
+msgstr "Você não tem permissão para editar este fluxo de processo."
+
msgid "You drive it; we make sure it's done right. Expert eyes on your setup, data, and go-live."
msgstr "Você conduz; nós garantimos que seja feito corretamente. Olhos especialistas na sua configuração, dados e lançamento."
@@ -14843,8 +14865,8 @@ msgstr "Você está marcado há {hoursElapsed} horas. Esqueceu de marcar a saíd
msgid "Your books and how money flows."
msgstr "Seus livros e como o dinheiro flui."
-msgid "Your changes go into a new draft version released with this change order."
-msgstr "Suas alterações entram em uma nova versão rascunho lançada com esta ordem de mudança."
+msgid "Your changes go into a new draft version released with this change notice."
+msgstr "Suas mudanças vão para uma nova versão de rascunho lançada com este aviso de mudança."
msgid "Your Console PIN"
msgstr "Seu PIN do Console"
diff --git a/packages/locale/locales/ru/erp.po b/packages/locale/locales/ru/erp.po
index bfcac3b516..c3561c0244 100644
--- a/packages/locale/locales/ru/erp.po
+++ b/packages/locale/locales/ru/erp.po
@@ -45,8 +45,8 @@ msgid "(excluded for this customer)"
msgstr "(исключено для этого клиента)"
#. placeholder {0}: open.length
-msgid "{0, plural, one {This part is on 1 open change order} other {This part is on # open change orders}}"
-msgstr "{0, plural, one {Эта деталь находится в 1 открытом приказе об изменении} other {Эта деталь находится в # открытых приказах об изменении}}"
+msgid "{0, plural, one {This part is on 1 open change notice} other {This part is on # open change notices}}"
+msgstr "{0, plural, one {Эта деталь находится на 1 открытой уведомлении об изменении} other {Эта деталь находится на # открытых уведомлениях об изменении}}"
#. placeholder {0}: ar.count
msgid "{0} customers with a balance"
@@ -224,8 +224,8 @@ msgstr "90 дней"
msgid "A Carbon-run data migration — you load your own data"
msgstr "Миграция данных, управляемая Carbon — вы загружаете свои собственные данные"
-msgid "A change order tracks a controlled engineering or manufacturing change through review and implementation."
-msgstr "Приказ об изменении отслеживает контролируемое инженерное или производственное изменение на этапах проверки и внедрения."
+msgid "A change notice tracks a controlled engineering or manufacturing change through review and implementation."
+msgstr "Уведомление об изменении отслеживает контролируемое инженерное или производственное изменение через проверку и реализацию."
msgid "A clearing account holding the value of goods received but not yet billed; the supplier invoice clears it."
msgstr "Расчетный счет, содержащий стоимость полученных, но не выставленных счетом товаров; счет поставщика его закрывает."
@@ -1145,7 +1145,7 @@ msgstr "Вы уверены, что хотите активировать про
msgid "Are you sure you want to activate this gauge?."
msgstr "Вы уверены, что хотите активировать этот прибор?."
-#. placeholder {0}: routeData?.changeOrder?.changeOrderId ?? ""
+#. placeholder {0}: routeData?.changeNotice?.changeOrderId ?? ""
msgid "Are you sure you want to cancel {0}? It will be closed and read-only until you reopen it."
msgstr "Вы уверены, что хотите отменить {0}? Он будет закрыт и доступен только для чтения, пока вы его не откроете."
@@ -1245,12 +1245,12 @@ msgid "Are you sure you want to delete the asset class: {0}? This cannot be undo
msgstr "Вы уверены, что хотите удалить класс активов: {0}? Это невозможно отменить."
#. placeholder {0}: requiredAction.name
-msgid "Are you sure you want to delete the change order action: {0}? This cannot be undone."
-msgstr "Вы уверены, что хотите удалить действие приказа об изменении: {0}? Это невозможно отменить."
+msgid "Are you sure you want to delete the change notice action: {0}? This cannot be undone."
+msgstr "Вы уверены, что хотите удалить действие уведомления об изменении: {0}? Это невозможно отменить."
-#. placeholder {0}: changeOrderType.name
-msgid "Are you sure you want to delete the change order category: {0}? This cannot be undone."
-msgstr "Вы уверены, что хотите удалить категорию приказа об изменении: {0}? Это действие невозможно отменить."
+#. placeholder {0}: changeNoticeType.name
+msgid "Are you sure you want to delete the change notice category: {0}? This cannot be undone."
+msgstr "Вы уверены, что хотите удалить категорию уведомления об изменении: {0}? Это невозможно отменить."
msgid "Are you sure you want to delete the contractor: {name}? This cannot be undone."
msgstr "Вы уверены, что хотите удалить подрядчика: {name}? Это действие невозможно отменить."
@@ -1410,8 +1410,8 @@ msgstr "Вы уверены, что хотите удалить webhook: {0}? Э
msgid "Are you sure you want to delete this approval rule? This cannot be undone."
msgstr "Вы уверены, что хотите удалить это правило утверждения? Это действие невозможно отменить."
-msgid "Are you sure you want to delete this change order?"
-msgstr "Вы уверены, что хотите удалить этот приказ об изменении?"
+msgid "Are you sure you want to delete this change notice?"
+msgstr "Вы уверены, что хотите удалить это уведомление об изменении?"
msgid "Are you sure you want to delete this gauge?"
msgstr "Вы уверены, что хотите удалить этот манометр?"
@@ -2052,11 +2052,11 @@ msgstr "Не удается загрузить этот файл"
msgid "Cancel"
msgstr "Отмена"
-msgid "Cancel change order"
-msgstr "Отменить заказ на внесение изменений"
+msgid "Cancel change notice"
+msgstr "Отменить уведомление об изменении"
-msgid "Cancel Change Order"
-msgstr "Отменить заказ на внесение изменений"
+msgid "Cancel Change Notice"
+msgstr "Отменить уведомление об изменении"
msgid "Cancel Job"
msgstr "Отменить задание"
@@ -2232,20 +2232,20 @@ msgstr "Изменить документ"
msgid "Change Inspection Plan"
msgstr "Изменить план контроля"
-msgid "Change order"
-msgstr "Приказ об изменении"
+msgid "Change notice"
+msgstr "Уведомление об изменении"
-msgid "Change Order"
-msgstr "Приказ об изменении"
+msgid "Change Notice"
+msgstr "Уведомление об изменении"
-msgid "Change Order Actions"
-msgstr "Действия приказа об изменении"
+msgid "Change Notice Actions"
+msgstr "Действия уведомлений об изменении"
-msgid "Change Order Types"
-msgstr "Типы приказов об изменении"
+msgid "Change Notice Types"
+msgstr "Типы уведомлений об изменении"
-msgid "Change Orders"
-msgstr "Приказы об изменении"
+msgid "Change Notices"
+msgstr "Уведомления об изменении"
msgid "Change status"
msgstr "Изменить статус"
@@ -2840,8 +2840,8 @@ msgstr "Скопировать номер задания"
msgid "Copy link"
msgstr "Копировать ссылку"
-msgid "Copy link to change order"
-msgstr "Скопировать ссылку на приказ об изменении"
+msgid "Copy link to change notice"
+msgstr "Скопировать ссылку на уведомление об изменении"
msgid "Copy link to consumable"
msgstr "Скопировать ссылку на расходный материал"
@@ -3064,8 +3064,8 @@ msgstr "Создать {0} значений"
msgid "Create & Snapshot"
msgstr "Создать и снимок"
-msgid "Create a change order for the new revision and open it"
-msgstr "Создать приказ об изменении для новой редакции и открыть его"
+msgid "Create a change notice for the new revision and open it"
+msgstr "Создать уведомление об изменении для новой редакции и открыть его"
msgid "Create a new kanban card for scan-based replenishment."
msgstr "Создайте новую карточку канбана для пополнения на основе сканирования."
@@ -3094,8 +3094,8 @@ msgstr "Создавать и утверждать заказы на покуп
msgid "Create audit trail entries"
msgstr "Создать записи в журнале аудита"
-msgid "Create Change Order"
-msgstr "Создать приказ об изменении"
+msgid "Create Change Notice"
+msgstr "Создать уведомление об изменении"
msgid "Create Issue"
msgstr "Создать проблему"
@@ -3151,11 +3151,11 @@ msgstr "Создано"
msgid "Created By"
msgstr "Создано"
-msgid "Created change order action"
-msgstr "Создано действие приказа об изменении"
+msgid "Created change notice action"
+msgstr "Создано действие уведомления об изменении"
-msgid "Created change order type"
-msgstr "Создан тип заказа на внесение изменений"
+msgid "Created change notice type"
+msgstr "Создан тип уведомления об изменении"
msgid "Created consumable"
msgstr "Расходный материал создан"
@@ -3825,8 +3825,8 @@ msgstr "Удалить атрибут"
msgid "Delete Category"
msgstr "Удалить категорию"
-msgid "Delete Change Order"
-msgstr "Удалить приказ об изменении"
+msgid "Delete Change Notice"
+msgstr "Удалить уведомление об изменении"
msgid "Delete Consumable"
msgstr "Удалить расходный материал"
@@ -4555,14 +4555,14 @@ msgstr "Редактировать категорию атрибута"
msgid "Edit Category"
msgstr "Редактировать категорию"
-msgid "Edit Change Order"
-msgstr "Редактировать приказ об изменении"
+msgid "Edit Change Notice"
+msgstr "Редактировать уведомление об изменении"
-msgid "Edit Change Order Action"
-msgstr "Редактировать действие приказа об изменении"
+msgid "Edit Change Notice Action"
+msgstr "Редактировать действие уведомления об изменении"
-msgid "Edit Change Order Type"
-msgstr "Редактировать тип заказа на внесение изменений"
+msgid "Edit Change Notice Type"
+msgstr "Редактировать тип уведомления об изменении"
msgid "Edit column visibility"
msgstr "Изменить видимость столбцов"
@@ -7990,14 +7990,14 @@ msgstr "Новый атрибут"
msgid "New Attribute Category"
msgstr "Новая категория атрибутов"
-msgid "New Change Order"
-msgstr "Новый приказ на изменение"
+msgid "New Change Notice"
+msgstr "Новое уведомление об изменении"
-msgid "New Change Order Action"
-msgstr "Новое действие приказа об изменении"
+msgid "New Change Notice Action"
+msgstr "Новое действие уведомления об изменении"
-msgid "New Change Order Type"
-msgstr "Новый тип заказа на внесение изменений"
+msgid "New Change Notice Type"
+msgstr "Новый тип уведомления об изменении"
msgid "New Consumable"
msgstr "Новый расходный материал"
@@ -8341,6 +8341,9 @@ msgstr "Не найдено доступных отслеживаемых объ
msgid "No BOM input has a shelf-life policy"
msgstr "Ни один вход BOM не имеет политики срока хранения"
+msgid "No CAD model to preview."
+msgstr "Нет модели CAD для предпросмотра."
+
msgid "No calibration records found"
msgstr "Записи о калибровке не найдены"
@@ -8782,8 +8785,8 @@ msgstr "Упс! Ссылка, которую вы пытаетесь откры
msgid "Open"
msgstr "Открыть"
-msgid "Open a change order"
-msgstr "Открыть приказ об изменении"
+msgid "Open a change notice"
+msgstr "Открыть уведомление об изменении"
msgid "Open Actions"
msgstr "Открытые действия"
@@ -8800,8 +8803,8 @@ msgstr "Открытая дебиторская задолженность"
msgid "Open Audit Log"
msgstr "Открыть журнал аудита"
-msgid "Open change orders affecting this part"
-msgstr "Открытые приказы на изменение, влияющие на эту деталь"
+msgid "Open change notices affecting this part"
+msgstr "Открытые уведомления об изменении, влияющие на эту деталь"
msgid "Open Date"
msgstr "Дата открытия"
@@ -8812,11 +8815,11 @@ msgstr "Открытые наряды"
msgid "Open in Carbon"
msgstr "Открыть в Carbon"
-msgid "Open in change order {ids}. Release it to create new versions or revisions."
-msgstr "Открыть в приказе об изменении {ids}. Выпустить его для создания новых версий или редакций."
+msgid "Open in change notice {ids}. Release it to create new versions or revisions."
+msgstr "Открыто в уведомлении об изменении {ids}. Выпустите его, чтобы создать новые версии или редакции."
-msgid "Open in change orders {ids}. Release them to create new versions or revisions."
-msgstr "Открыть в заказах изменений {ids}. Выпустите их, чтобы создать новые версии или редакции."
+msgid "Open in change notices {ids}. Release them to create new versions or revisions."
+msgstr "Открыто в уведомлениях об изменении {ids}. Выпустите их, чтобы создать новые версии или редакции."
msgid "Open in MES"
msgstr "Открыть в MES"
@@ -10295,7 +10298,7 @@ msgid "Refresh exchange rate"
msgstr "Обновить курс обмена"
msgid "Regenerate"
-msgstr "Повторно создать"
+msgstr "Переген​ерировать"
msgid "Regenerating thumbnail…"
msgstr "Создание миниатюры…"
@@ -10342,8 +10345,8 @@ msgstr "Относительная шкала времени · даты буд
msgid "Release"
msgstr "Выпуск"
-msgid "Release change order"
-msgstr "Выпустить заказ на изменение"
+msgid "Release change notice"
+msgstr "Выпустить уведомление об изменении"
msgid "Release control"
msgstr "Контроль выпуска"
@@ -13133,6 +13136,12 @@ msgstr "Эти задания имеют операции, назначенны
msgid "These journal entries are still Draft, so their debits and credits aren't in the ledger for this period. Post each one, or re-date it into a later open period."
msgstr "Эти записи в журнале всё ещё находятся в статусе «Черновик», поэтому их дебеты и кредиты не находятся в главной книге за этот период. Опубликуйте каждую или переделируйте её на более поздний открытый период."
+msgid "This change notice is being implemented, so its changes are locked. Reopen it to edit."
+msgstr "Это уведомление об изменении реализуется, поэтому его изменения заблокированы. Откройте его повторно, чтобы отредактировать."
+
+msgid "This change notice is closed, so its changes are read-only."
+msgstr "Это уведомление об изменении закрыто, поэтому его изменения доступны только для чтения."
+
msgid "This completes the Discovery step."
msgstr "Это завершает этап Discovery."
@@ -13217,11 +13226,11 @@ msgstr "В этот период не размещены записи журна
msgid "This Quarter"
msgstr "Этот квартал"
-msgid "This revision is released (Production). Changes should normally flow through a change order."
-msgstr "Эта версия выпущена (Production). Изменения должны обычно проходить через заказ на изменение."
+msgid "This revision is released (Production). Changes should normally flow through a change notice."
+msgstr "Эта редакция выпущена (Производство). Изменения должны нормально проходить через уведомление об изменении."
-msgid "This revision is released (Production). Open a change order to modify it."
-msgstr "Эта версия выпущена (Production). Откройте заказ на изменение, чтобы изменить её."
+msgid "This revision is released (Production). Open a change notice to modify it."
+msgstr "Эта редакция выпущена (Производство). Откройте уведомление об изменении, чтобы изменить его."
msgid "This sales order has associated jobs. Choose what to do with them."
msgstr "Этот заказ на продажу имеет связанные работы. Выберите, что с ними делать."
@@ -13239,6 +13248,13 @@ msgstr "этот поставщик"
msgid "This updates the theme for all users of the application"
msgstr "Это обновляет тему для всех пользователей приложения"
+msgid "This version belongs to an open <0>change notice</0>. Edit it there."
+msgstr "Эта версия принадлежит открытому <0>уведомлению об изменении</0>. Отредактируйте его там."
+
+#. placeholder {0}: lock.readableId
+msgid "This version belongs to change notice <0>{0}</0>. Edit it there."
+msgstr "Эта версия принадлежит уведомлению об изменении <0>{0}</0>. Отредактируйте его там."
+
msgid "This will make this version read-only and replace any material make methods with this version."
msgstr "Это сделает эту версию доступной только для чтения и заменит все методы производства материалов на эту версию."
@@ -14658,6 +14674,9 @@ msgstr "Почему истекает срок действия?"
msgid "Why is this included?"
msgstr "Почему это включено?"
+msgid "Why is this locked?"
+msgstr "Почему это заблокировано?"
+
msgid "Why stock is changing — Positive (found), Negative (lost/scrap), or Set (replace count with a measured value)."
msgstr "Почему запас меняется — Положительный (найден), Отрицательный (потеря/отходы) или Установить (заменить количество измеренным значением)."
@@ -14809,6 +14828,9 @@ msgstr "Вы завершили {leftoverQuantity} больше {0}, чем за
msgid "You don't have permission to edit this bill of material."
msgstr "У вас нет разрешения на редактирование этой ведомости материалов."
+msgid "You don't have permission to edit this bill of process."
+msgstr "У вас нет разрешения на редактирование этой технологической карты."
+
msgid "You drive it; we make sure it's done right. Expert eyes on your setup, data, and go-live."
msgstr "Вы управляете процессом; мы следим, чтобы всё было сделано правильно. Опытный взгляд на вашу настройку, данные и запуск."
@@ -14843,8 +14865,8 @@ msgstr "Вы отметились на работу {hoursElapsed} часов н
msgid "Your books and how money flows."
msgstr "Ваши книги и движение денежных средств."
-msgid "Your changes go into a new draft version released with this change order."
-msgstr "Ваши изменения переходят в новую черновую версию, выпущенную с этим приказом об изменении."
+msgid "Your changes go into a new draft version released with this change notice."
+msgstr "Ваши изменения переходят в новую черновую версию, выпущенную с этим уведомлением об изменении."
msgid "Your Console PIN"
msgstr "Ваш PIN консоли"
diff --git a/packages/locale/locales/tr/erp.po b/packages/locale/locales/tr/erp.po
index fb5a204674..396fa05f7e 100644
--- a/packages/locale/locales/tr/erp.po
+++ b/packages/locale/locales/tr/erp.po
@@ -45,8 +45,8 @@ msgid "(excluded for this customer)"
msgstr "(bu müşteri için hariç tutulmuş)"
#. placeholder {0}: open.length
-msgid "{0, plural, one {This part is on 1 open change order} other {This part is on # open change orders}}"
-msgstr "{0, plural, one {Bu parça 1 açık değişiklik emrinde} other {Bu parça # açık değişiklik emrinde}}"
+msgid "{0, plural, one {This part is on 1 open change notice} other {This part is on # open change notices}}"
+msgstr "{0, plural, one {Bu parça 1 açık değişiklik bildirisinde yer alıyor} other {Bu parça # açık değişiklik bildirisinde yer alıyor}}"
#. placeholder {0}: ar.count
msgid "{0} customers with a balance"
@@ -224,8 +224,8 @@ msgstr "90G"
msgid "A Carbon-run data migration — you load your own data"
msgstr "Bir Carbon tarafından yönetilen veri taşıması — kendi verilerinizi yüklersiniz"
-msgid "A change order tracks a controlled engineering or manufacturing change through review and implementation."
-msgstr "Değişiklik emri, kontrollü bir mühendislik veya üretim değişikliğini inceleme ve uygulanmasında takip eder."
+msgid "A change notice tracks a controlled engineering or manufacturing change through review and implementation."
+msgstr "Bir değişiklik bildirisi, gözden geçirme ve uygulamadan geçen kontrollü bir mühendislik veya üretim değişikliğini izler."
msgid "A clearing account holding the value of goods received but not yet billed; the supplier invoice clears it."
msgstr "Alınan ancak henüz faturalanmayan malların değerini tutan bir takas hesabı; tedarikçi faturası bunu temizler."
@@ -1145,7 +1145,7 @@ msgstr "İş akışını etkinleştirmek istediğinizden emin misiniz: {name}? T
msgid "Are you sure you want to activate this gauge?."
msgstr "Bu kalibratörü etkinleştirmek istediğinizden emin misiniz?."
-#. placeholder {0}: routeData?.changeOrder?.changeOrderId ?? ""
+#. placeholder {0}: routeData?.changeNotice?.changeOrderId ?? ""
msgid "Are you sure you want to cancel {0}? It will be closed and read-only until you reopen it."
msgstr "{0} öğesini iptal etmek istediğinizden emin misiniz? Yeniden açana kadar kapalı ve salt okunur durumda olacaktır."
@@ -1245,12 +1245,12 @@ msgid "Are you sure you want to delete the asset class: {0}? This cannot be undo
msgstr "Varlık Sınıfını silmek istediğinizden emin misiniz: {0}? Bu işlem geri alınamaz."
#. placeholder {0}: requiredAction.name
-msgid "Are you sure you want to delete the change order action: {0}? This cannot be undone."
-msgstr "Değişiklik emri işlemini silmek istediğinizden emin misiniz: {0}? Bu geri alınamaz."
+msgid "Are you sure you want to delete the change notice action: {0}? This cannot be undone."
+msgstr "{0} değişiklik bildirisi işlemini silmek istediğinizden emin misiniz? Bu işlem geri alınamaz."
-#. placeholder {0}: changeOrderType.name
-msgid "Are you sure you want to delete the change order category: {0}? This cannot be undone."
-msgstr "Değişiklik emri kategorisini silmek istediğinizden emin misiniz: {0}? Bu işlem geri alınamaz."
+#. placeholder {0}: changeNoticeType.name
+msgid "Are you sure you want to delete the change notice category: {0}? This cannot be undone."
+msgstr "{0} değişiklik bildirisi kategorisini silmek istediğinizden emin misiniz? Bu işlem geri alınamaz."
msgid "Are you sure you want to delete the contractor: {name}? This cannot be undone."
msgstr "Yükleniciyi silmek istediğinizden emin misiniz: {name}? Bu geri alınamaz."
@@ -1410,8 +1410,8 @@ msgstr "Webhook'u silmek istediğinizden emin misiniz: {0}? Bu geri alınamaz."
msgid "Are you sure you want to delete this approval rule? This cannot be undone."
msgstr "Bu onay kuralını silmek istediğinizden emin misiniz? Bu geri alınamaz."
-msgid "Are you sure you want to delete this change order?"
-msgstr "Bu değişiklik emrini silmek istediğinizden emin misiniz?"
+msgid "Are you sure you want to delete this change notice?"
+msgstr "Bu değişiklik bildirisini silmek istediğinizden emin misiniz?"
msgid "Are you sure you want to delete this gauge?"
msgstr "Bu kalibratörü silmek istediğinizden emin misiniz?"
@@ -2052,11 +2052,11 @@ msgstr "Bu dosya indirilemiyor"
msgid "Cancel"
msgstr "İptal"
-msgid "Cancel change order"
-msgstr "Değişiklik emrini iptal et"
+msgid "Cancel change notice"
+msgstr "Değişiklik bildirisini iptal et"
-msgid "Cancel Change Order"
-msgstr "Değişiklik Emrini İptal Et"
+msgid "Cancel Change Notice"
+msgstr "Değişiklik Bildirisini İptal Et"
msgid "Cancel Job"
msgstr "İşi İptal Et"
@@ -2232,20 +2232,20 @@ msgstr "Belgeyi Değiştir"
msgid "Change Inspection Plan"
msgstr "Muayene Planını Değiştir"
-msgid "Change order"
-msgstr "Değişiklik emri"
+msgid "Change notice"
+msgstr "Değişiklik bildirisi"
-msgid "Change Order"
-msgstr "Değişiklik Emri"
+msgid "Change Notice"
+msgstr "Değişiklik Bildirisi"
-msgid "Change Order Actions"
-msgstr "Değişiklik Emri İşlemleri"
+msgid "Change Notice Actions"
+msgstr "Değişiklik Bildirisi İşlemleri"
-msgid "Change Order Types"
-msgstr "Değişiklik Emri Türleri"
+msgid "Change Notice Types"
+msgstr "Değişiklik Bildirisi Türleri"
-msgid "Change Orders"
-msgstr "Değişiklik Emirleri"
+msgid "Change Notices"
+msgstr "Değişiklik Bildirimleri"
msgid "Change status"
msgstr "Durum değiştir"
@@ -2840,8 +2840,8 @@ msgstr "İş Numarasını Kopyala"
msgid "Copy link"
msgstr "Bağlantıyı kopyala"
-msgid "Copy link to change order"
-msgstr "Değişiklik emri bağlantısını kopyala"
+msgid "Copy link to change notice"
+msgstr "Değişiklik bildirisi bağlantısını kopyala"
msgid "Copy link to consumable"
msgstr "Tüketilebilir bağlantısını kopyala"
@@ -3064,8 +3064,8 @@ msgstr "{0} değerleri oluştur"
msgid "Create & Snapshot"
msgstr "Oluştur & Anlık Görüntü"
-msgid "Create a change order for the new revision and open it"
-msgstr "Yeni revizyon için bir değişiklik emri oluşturun ve açın"
+msgid "Create a change notice for the new revision and open it"
+msgstr "Yeni revizyon için bir değişiklik bildirisi oluştur ve aç"
msgid "Create a new kanban card for scan-based replenishment."
msgstr "Tarama tabanlı ikmal için yeni bir kanban kartı oluştur."
@@ -3094,8 +3094,8 @@ msgstr "Satın alma siparişleri oluşturun ve onaylayın"
msgid "Create audit trail entries"
msgstr "Denetim izi girdileri oluştur"
-msgid "Create Change Order"
-msgstr "Değişiklik Emri Oluştur"
+msgid "Create Change Notice"
+msgstr "Değişiklik Bildirisi Oluştur"
msgid "Create Issue"
msgstr "Sorun Oluştur"
@@ -3151,11 +3151,11 @@ msgstr "Oluşturulma Tarihi"
msgid "Created By"
msgstr "Oluşturan"
-msgid "Created change order action"
-msgstr "Oluşturulan değişiklik emri işlemi"
+msgid "Created change notice action"
+msgstr "Oluşturulan değişiklik bildirisi işlemi"
-msgid "Created change order type"
-msgstr "Oluşturulan değişiklik emri türü"
+msgid "Created change notice type"
+msgstr "Oluşturulan değişiklik bildirisi türü"
msgid "Created consumable"
msgstr "Tüketilebilir malzeme oluşturuldu"
@@ -3825,8 +3825,8 @@ msgstr "Özniteliği Sil"
msgid "Delete Category"
msgstr "Kategoriyi Sil"
-msgid "Delete Change Order"
-msgstr "Değişiklik Emrini Sil"
+msgid "Delete Change Notice"
+msgstr "Değişiklik Bildirisini Sil"
msgid "Delete Consumable"
msgstr "Tüketilebilir Malı Sil"
@@ -4555,14 +4555,14 @@ msgstr "Öznitelik Kategorisini Düzenle"
msgid "Edit Category"
msgstr "Kategoriyi Düzenle"
-msgid "Edit Change Order"
-msgstr "Değişiklik Emrini Düzenle"
+msgid "Edit Change Notice"
+msgstr "Değişiklik Bildirisini Düzenle"
-msgid "Edit Change Order Action"
-msgstr "Değişiklik Emri İşlemini Düzenle"
+msgid "Edit Change Notice Action"
+msgstr "Değişiklik Bildirisi İşlemini Düzenle"
-msgid "Edit Change Order Type"
-msgstr "Değişiklik Emri Türünü Düzenle"
+msgid "Edit Change Notice Type"
+msgstr "Değişiklik Bildirisi Türünü Düzenle"
msgid "Edit column visibility"
msgstr "Sütun görünürlüğünü düzenle"
@@ -7990,14 +7990,14 @@ msgstr "Yeni Öznitelik"
msgid "New Attribute Category"
msgstr "Yeni Öznitelik Kategorisi"
-msgid "New Change Order"
-msgstr "Yeni Değişiklik Emri"
+msgid "New Change Notice"
+msgstr "Yeni Değişiklik Bildirisi"
-msgid "New Change Order Action"
-msgstr "Yeni Değişiklik Emri İşlemi"
+msgid "New Change Notice Action"
+msgstr "Yeni Değişiklik Bildirisi İşlemi"
-msgid "New Change Order Type"
-msgstr "Yeni Değişiklik Emri Türü"
+msgid "New Change Notice Type"
+msgstr "Yeni Değişiklik Bildirisi Türü"
msgid "New Consumable"
msgstr "Yeni Sarf Malzemesi"
@@ -8341,6 +8341,9 @@ msgstr "Kullanılabilir izlenen varlık bulunamadı"
msgid "No BOM input has a shelf-life policy"
msgstr "Hiçbir BOM girdisi raf ömrü politikasına sahip değil"
+msgid "No CAD model to preview."
+msgstr "Önizlemek için CAD modeli yok."
+
msgid "No calibration records found"
msgstr "Kalibrasyon kaydı bulunamadı"
@@ -8782,8 +8785,8 @@ msgstr "Üzgünüz! Erişim sağlamaya çalıştığınız bağlantı geçerli d
msgid "Open"
msgstr "Aç"
-msgid "Open a change order"
-msgstr "Bir değişiklik emri açın"
+msgid "Open a change notice"
+msgstr "Bir değişiklik bildirisi aç"
msgid "Open Actions"
msgstr "Açık Aksiyonlar"
@@ -8800,8 +8803,8 @@ msgstr "Açık AR"
msgid "Open Audit Log"
msgstr "Denetim Kaydını Aç"
-msgid "Open change orders affecting this part"
-msgstr "Bu parçayı etkileyen açık değişiklik emirleri"
+msgid "Open change notices affecting this part"
+msgstr "Bu parçayı etkileyen açık değişiklik bildirimlerini aç"
msgid "Open Date"
msgstr "Açılış Tarihi"
@@ -8812,11 +8815,11 @@ msgstr "Açık Görevler"
msgid "Open in Carbon"
msgstr "Carbon'da Aç"
-msgid "Open in change order {ids}. Release it to create new versions or revisions."
-msgstr "Değişiklik emrinde {ids} açılmış. Yeni versiyonlar veya revizyonlar oluşturmak için bunu yayınlayın."
+msgid "Open in change notice {ids}. Release it to create new versions or revisions."
+msgstr "{ids} değişiklik bildirisinde aç. Yeni sürümler veya revizyonlar oluşturmak için bunu yayınlayın."
-msgid "Open in change orders {ids}. Release them to create new versions or revisions."
-msgstr "Değişiklik emirlerinde {ids} açın. Yeni sürümler veya revizyonlar oluşturmak için yayınlayın."
+msgid "Open in change notices {ids}. Release them to create new versions or revisions."
+msgstr "{ids} değişiklik bildirimlerinde aç. Yeni sürümler veya revizyonlar oluşturmak için bunları yayınlayın."
msgid "Open in MES"
msgstr "MES'te Aç"
@@ -10342,8 +10345,8 @@ msgstr "Göreceli zaman çizelgesi · tarihler onaylanacak"
msgid "Release"
msgstr "Serbest Bırakma"
-msgid "Release change order"
-msgstr "Değişim emrini yayınla"
+msgid "Release change notice"
+msgstr "Değişiklik bildirisini yayınla"
msgid "Release control"
msgstr "Yayın kontrolü"
@@ -13133,6 +13136,12 @@ msgstr "Bu işler bu iş merkezine atanmış işlemlere sahiptir:"
msgid "These journal entries are still Draft, so their debits and credits aren't in the ledger for this period. Post each one, or re-date it into a later open period."
msgstr "Bu muhasebe kayıtları hâlâ Taslak durumundadır, bu nedenle borç ve alacakları bu dönem için defteri kebir'de değildir. Her birini deftere geçirin veya daha sonraki bir açık döneme yeniden tarihlendiriniz."
+msgid "This change notice is being implemented, so its changes are locked. Reopen it to edit."
+msgstr "Bu değişiklik bildirimi uygulanmakta olduğundan, değişiklikleri kilitlidir. Düzenlemek için yeniden açın."
+
+msgid "This change notice is closed, so its changes are read-only."
+msgstr "Bu değişiklik bildirimi kapalı olduğundan, değişiklikleri salt okunurdur."
+
msgid "This completes the Discovery step."
msgstr "Bu, Keşif adımını tamamlar."
@@ -13217,11 +13226,11 @@ msgstr "Bu döneme nakledilen günlük girişi yoktur ve kalıcı olarak silineb
msgid "This Quarter"
msgstr "Bu Çeyrek"
-msgid "This revision is released (Production). Changes should normally flow through a change order."
-msgstr "Bu revizyon yayımlandı (Üretim). Değişiklikler normalde bir değişiklik siparişi aracılığıyla akmalıdır."
+msgid "This revision is released (Production). Changes should normally flow through a change notice."
+msgstr "Bu revizyon yayınlanmıştır (Üretim). Değişiklikler normalde bir değişiklik bildirisi yoluyla akmalıdır."
-msgid "This revision is released (Production). Open a change order to modify it."
-msgstr "Bu revizyon yayımlandı (Üretim). Bunu değiştirmek için bir değişiklik siparişi açın."
+msgid "This revision is released (Production). Open a change notice to modify it."
+msgstr "Bu revizyon yayınlanmıştır (Üretim). Bunu değiştirmek için bir değişiklik bildirisi açın."
msgid "This sales order has associated jobs. Choose what to do with them."
msgstr "Bu satış siparişi ilgili işlere sahiptir. Onlarla ne yapılacağına karar verin."
@@ -13239,6 +13248,13 @@ msgstr "bu tedarikçi"
msgid "This updates the theme for all users of the application"
msgstr "Bu, uygulamanın tüm kullanıcıları için temayı günceller"
+msgid "This version belongs to an open <0>change notice</0>. Edit it there."
+msgstr "Bu sürüm açık bir <0>değişiklik bildirimine</0> aittir. Orada düzenleyin."
+
+#. placeholder {0}: lock.readableId
+msgid "This version belongs to change notice <0>{0}</0>. Edit it there."
+msgstr "Bu sürüm değişiklik bildirimi <0>{0}</0> ile ilgilidir. Orada düzenleyin."
+
msgid "This will make this version read-only and replace any material make methods with this version."
msgstr "Bu sürümü salt okunur yapacak ve herhangi bir malzeme üretim yöntemini bu sürümle değiştirecektir."
@@ -14658,6 +14674,9 @@ msgstr "Geçiş tarihi neden değiştiriliyor?"
msgid "Why is this included?"
msgstr "Neden dahil edildi?"
+msgid "Why is this locked?"
+msgstr "Bu neden kilitli?"
+
msgid "Why stock is changing — Positive (found), Negative (lost/scrap), or Set (replace count with a measured value)."
msgstr "Stok neden değişiyor — Pozitif (bulundu), Negatif (kayıp/hurda) veya Ayarla (sayıyı ölçülen değerle değiştir)."
@@ -14809,6 +14828,9 @@ msgstr "Sipariş edilen miktardan {leftoverQuantity} fazla {0} tamamladınız. F
msgid "You don't have permission to edit this bill of material."
msgstr "Bu malzeme listesini düzenleme izniniz yok."
+msgid "You don't have permission to edit this bill of process."
+msgstr "Bu proses faturasını düzenlemek için izniniz yok."
+
msgid "You drive it; we make sure it's done right. Expert eyes on your setup, data, and go-live."
msgstr "Siz yönetirsiniz; biz doğru yapıldığından emin oluruz. Kurulumunuz, verileriniz ve canlı yayına geçişiniz üzerinde uzman gözler."
@@ -14843,8 +14865,8 @@ msgstr "Ne kadar süredir giriş yaptınız? Çıkış yapmayı unuttunuz mu?"
msgid "Your books and how money flows."
msgstr "Muhasebe defterleriniz ve paranın akışı."
-msgid "Your changes go into a new draft version released with this change order."
-msgstr "Değişiklikleriniz bu değişiklik emri ile yayınlanan yeni bir taslak sürüme girecektir."
+msgid "Your changes go into a new draft version released with this change notice."
+msgstr "Değişiklikleriniz bu değişiklik bildirisi ile yayınlanan yeni taslak sürüme girer."
msgid "Your Console PIN"
msgstr "Konsol PIN'iniz"
diff --git a/packages/locale/locales/zh/erp.po b/packages/locale/locales/zh/erp.po
index 359d5f1884..2a295a3951 100644
--- a/packages/locale/locales/zh/erp.po
+++ b/packages/locale/locales/zh/erp.po
@@ -45,8 +45,8 @@ msgid "(excluded for this customer)"
msgstr "(已为此客户排除)"
#. placeholder {0}: open.length
-msgid "{0, plural, one {This part is on 1 open change order} other {This part is on # open change orders}}"
-msgstr "{0, plural, one {此部件在1个开放的变更单上} other {此部件在#个开放的变更单上}}"
+msgid "{0, plural, one {This part is on 1 open change notice} other {This part is on # open change notices}}"
+msgstr "{0, plural, one {此零件包含在1个开放的更改单中} other {此零件包含在#个开放的更改单中}}"
#. placeholder {0}: ar.count
msgid "{0} customers with a balance"
@@ -224,8 +224,8 @@ msgstr "90天"
msgid "A Carbon-run data migration — you load your own data"
msgstr "Carbon 运行的数据迁移 — 您加载自己的数据"
-msgid "A change order tracks a controlled engineering or manufacturing change through review and implementation."
-msgstr "变更单跟踪受控的工程或制造变更,从审查到实施。"
+msgid "A change notice tracks a controlled engineering or manufacturing change through review and implementation."
+msgstr "更改单跟踪受控工程或制造变更的审核和实施过程。"
msgid "A clearing account holding the value of goods received but not yet billed; the supplier invoice clears it."
msgstr "持有已收但未开票商品价值的结算账户;供应商发票将其结清。"
@@ -1145,7 +1145,7 @@ msgstr "您确定要激活流程:{name}?它将再次出现在下拉菜单中
msgid "Are you sure you want to activate this gauge?."
msgstr "您确定要激活此量规吗?"
-#. placeholder {0}: routeData?.changeOrder?.changeOrderId ?? ""
+#. placeholder {0}: routeData?.changeNotice?.changeOrderId ?? ""
msgid "Are you sure you want to cancel {0}? It will be closed and read-only until you reopen it."
msgstr "您确定要取消 {0} 吗?在您重新打开之前,它将被关闭并处于只读状态。"
@@ -1245,12 +1245,12 @@ msgid "Are you sure you want to delete the asset class: {0}? This cannot be undo
msgstr "确定要删除资产类别: {0}吗?此操作无法撤销。"
#. placeholder {0}: requiredAction.name
-msgid "Are you sure you want to delete the change order action: {0}? This cannot be undone."
-msgstr "您确定要删除变更单操作:{0}?这无法撤销。"
+msgid "Are you sure you want to delete the change notice action: {0}? This cannot be undone."
+msgstr "您确定要删除更改单操作:{0}?此操作无法撤销。"
-#. placeholder {0}: changeOrderType.name
-msgid "Are you sure you want to delete the change order category: {0}? This cannot be undone."
-msgstr "您确定要删除变更单类别:{0}吗?此操作无法撤消。"
+#. placeholder {0}: changeNoticeType.name
+msgid "Are you sure you want to delete the change notice category: {0}? This cannot be undone."
+msgstr "您确定要删除更改单类别:{0}?此操作无法撤销。"
msgid "Are you sure you want to delete the contractor: {name}? This cannot be undone."
msgstr "您确定要删除承包商:{name}?此操作无法撤销。"
@@ -1410,8 +1410,8 @@ msgstr "您确定要删除webhook: {0}吗?此操作无法撤销。"
msgid "Are you sure you want to delete this approval rule? This cannot be undone."
msgstr "你确定要删除此审批规则吗?此操作无法撤销。"
-msgid "Are you sure you want to delete this change order?"
-msgstr "您确定要删除此变更单吗?"
+msgid "Are you sure you want to delete this change notice?"
+msgstr "您确定要删除此更改单?"
msgid "Are you sure you want to delete this gauge?"
msgstr "你确定要删除此量规吗?"
@@ -2052,11 +2052,11 @@ msgstr "无法下载此文件"
msgid "Cancel"
msgstr "取消"
-msgid "Cancel change order"
-msgstr "取消变更单"
+msgid "Cancel change notice"
+msgstr "取消更改单"
-msgid "Cancel Change Order"
-msgstr "取消变更单"
+msgid "Cancel Change Notice"
+msgstr "取消更改单"
msgid "Cancel Job"
msgstr "取消工作"
@@ -2232,20 +2232,20 @@ msgstr "变更文档"
msgid "Change Inspection Plan"
msgstr "更改检验计划"
-msgid "Change order"
-msgstr "变更单"
+msgid "Change notice"
+msgstr "更改单"
-msgid "Change Order"
-msgstr "变更单"
+msgid "Change Notice"
+msgstr "更改单"
-msgid "Change Order Actions"
-msgstr "变更单操作"
+msgid "Change Notice Actions"
+msgstr "更改单操作"
-msgid "Change Order Types"
-msgstr "变更单类型"
+msgid "Change Notice Types"
+msgstr "更改单类型"
-msgid "Change Orders"
-msgstr "变更单"
+msgid "Change Notices"
+msgstr "更改单"
msgid "Change status"
msgstr "更改状态"
@@ -2840,8 +2840,8 @@ msgstr "复制工作单号"
msgid "Copy link"
msgstr "复制链接"
-msgid "Copy link to change order"
-msgstr "复制变更单链接"
+msgid "Copy link to change notice"
+msgstr "复制更改单链接"
msgid "Copy link to consumable"
msgstr "复制消耗品链接"
@@ -3064,8 +3064,8 @@ msgstr "创建 {0} 个值"
msgid "Create & Snapshot"
msgstr "创建并快照"
-msgid "Create a change order for the new revision and open it"
-msgstr "为新修订版本创建变更单并打开它"
+msgid "Create a change notice for the new revision and open it"
+msgstr "为新版本创建更改单并打开它"
msgid "Create a new kanban card for scan-based replenishment."
msgstr "为扫描式补货创建新的看板卡。"
@@ -3094,8 +3094,8 @@ msgstr "创建并批准采购订单"
msgid "Create audit trail entries"
msgstr "创建审计跟踪条目"
-msgid "Create Change Order"
-msgstr "创建变更单"
+msgid "Create Change Notice"
+msgstr "创建更改单"
msgid "Create Issue"
msgstr "创建问题"
@@ -3151,11 +3151,11 @@ msgstr "创建于"
msgid "Created By"
msgstr "由...创建"
-msgid "Created change order action"
-msgstr "已创建变更单操作"
+msgid "Created change notice action"
+msgstr "已创建更改单操作"
-msgid "Created change order type"
-msgstr "已创建变更单类型"
+msgid "Created change notice type"
+msgstr "已创建更改单类型"
msgid "Created consumable"
msgstr "已创建易耗品"
@@ -3825,8 +3825,8 @@ msgstr "删除属性"
msgid "Delete Category"
msgstr "删除分类"
-msgid "Delete Change Order"
-msgstr "删除变更单"
+msgid "Delete Change Notice"
+msgstr "删除更改单"
msgid "Delete Consumable"
msgstr "删除耗材"
@@ -4555,14 +4555,14 @@ msgstr "编辑属性类别"
msgid "Edit Category"
msgstr "编辑分类"
-msgid "Edit Change Order"
-msgstr "编辑变更单"
+msgid "Edit Change Notice"
+msgstr "编辑更改单"
-msgid "Edit Change Order Action"
-msgstr "编辑变更单操作"
+msgid "Edit Change Notice Action"
+msgstr "编辑更改单操作"
-msgid "Edit Change Order Type"
-msgstr "编辑变更单类型"
+msgid "Edit Change Notice Type"
+msgstr "编辑更改单类型"
msgid "Edit column visibility"
msgstr "编辑列可见性"
@@ -7990,14 +7990,14 @@ msgstr "新属性"
msgid "New Attribute Category"
msgstr "新属性类别"
-msgid "New Change Order"
-msgstr "新建变更单"
+msgid "New Change Notice"
+msgstr "新建更改单"
-msgid "New Change Order Action"
-msgstr "新变更单操作"
+msgid "New Change Notice Action"
+msgstr "新建更改单操作"
-msgid "New Change Order Type"
-msgstr "新建变更单类型"
+msgid "New Change Notice Type"
+msgstr "新建更改单类型"
msgid "New Consumable"
msgstr "新消耗品"
@@ -8341,6 +8341,9 @@ msgstr "未找到可用的追踪实体"
msgid "No BOM input has a shelf-life policy"
msgstr "没有物料清单输入具有保质期政策"
+msgid "No CAD model to preview."
+msgstr "没有CAD模型可预览。"
+
msgid "No calibration records found"
msgstr "未找到校准记录"
@@ -8782,8 +8785,8 @@ msgstr "哎呀!您尝试访问的链接无效。"
msgid "Open"
msgstr "打开"
-msgid "Open a change order"
-msgstr "打开变更单"
+msgid "Open a change notice"
+msgstr "打开更改单"
msgid "Open Actions"
msgstr "开放操作"
@@ -8800,8 +8803,8 @@ msgstr "未结应收"
msgid "Open Audit Log"
msgstr "打开审计日志"
-msgid "Open change orders affecting this part"
-msgstr "影响此零件的未结变更单"
+msgid "Open change notices affecting this part"
+msgstr "打开影响此零件的更改单"
msgid "Open Date"
msgstr "开放日期"
@@ -8812,11 +8815,11 @@ msgstr "未结派工单"
msgid "Open in Carbon"
msgstr "在 Carbon 中打开"
-msgid "Open in change order {ids}. Release it to create new versions or revisions."
-msgstr "在变更单 {ids} 中打开。发放它以创建新的版本或修订版本。"
+msgid "Open in change notice {ids}. Release it to create new versions or revisions."
+msgstr "在更改单{ids}中打开。发布它以创建新版本或修订版。"
-msgid "Open in change orders {ids}. Release them to create new versions or revisions."
-msgstr "在更改订单 {ids} 中打开。释放它们以创建新版本或修订。"
+msgid "Open in change notices {ids}. Release them to create new versions or revisions."
+msgstr "在更改单{ids}中打开。发布它们以创建新版本或修订版。"
msgid "Open in MES"
msgstr "在MES中打开"
@@ -10342,8 +10345,8 @@ msgstr "相对时间线 · 日期待确认"
msgid "Release"
msgstr "释放"
-msgid "Release change order"
-msgstr "发布变更单"
+msgid "Release change notice"
+msgstr "发布更改单"
msgid "Release control"
msgstr "发布控制"
@@ -13133,6 +13136,12 @@ msgstr "这些工作有分配给此工作中心的操作:"
msgid "These journal entries are still Draft, so their debits and credits aren't in the ledger for this period. Post each one, or re-date it into a later open period."
msgstr "这些日记账条目仍为草稿状态,因此其借贷金额不在本期分类账中。过账每一份,或将其重新标记日期至较晚的开放期间。"
+msgid "This change notice is being implemented, so its changes are locked. Reopen it to edit."
+msgstr "此变更通知正在实施中,因此其更改已锁定。重新打开它进行编辑。"
+
+msgid "This change notice is closed, so its changes are read-only."
+msgstr "此变更通知已关闭,因此其更改为只读。"
+
msgid "This completes the Discovery step."
msgstr "这完成了发现步骤。"
@@ -13217,11 +13226,11 @@ msgstr "此期间未过账任何日记账分录,可以永久删除。此操作
msgid "This Quarter"
msgstr "本季度"
-msgid "This revision is released (Production). Changes should normally flow through a change order."
-msgstr "此版本已发布(生产)。更改应通常通过变更订单流转。"
+msgid "This revision is released (Production). Changes should normally flow through a change notice."
+msgstr "此修订版已发布(生产版)。更改应该通过更改单进行。"
-msgid "This revision is released (Production). Open a change order to modify it."
-msgstr "此版本已发布(生产)。打开变更订单进行修改。"
+msgid "This revision is released (Production). Open a change notice to modify it."
+msgstr "此修订版已发布(生产版)。打开更改单以修改它。"
msgid "This sales order has associated jobs. Choose what to do with them."
msgstr "此销售订单有关联的工作。选择如何处理它们。"
@@ -13239,6 +13248,13 @@ msgstr "此供应商"
msgid "This updates the theme for all users of the application"
msgstr "这会更新应用程序所有用户的主题"
+msgid "This version belongs to an open <0>change notice</0>. Edit it there."
+msgstr "此版本属于开放的<0>变更通知</0>。请在那里编辑。"
+
+#. placeholder {0}: lock.readableId
+msgid "This version belongs to change notice <0>{0}</0>. Edit it there."
+msgstr "此版本属于变更通知<0>{0}</0>。请在那里编辑。"
+
msgid "This will make this version read-only and replace any material make methods with this version."
msgstr "这将使此版本为只读,并用此版本替换任何物料制造方法。"
@@ -14658,6 +14674,9 @@ msgstr "为什么要更改过期日期?"
msgid "Why is this included?"
msgstr "为什么包括这个?"
+msgid "Why is this locked?"
+msgstr "为什么这被锁定了?"
+
msgid "Why stock is changing — Positive (found), Negative (lost/scrap), or Set (replace count with a measured value)."
msgstr "库存为何变化 — 正数(已找到)、负数(丢失/报废)或设置(用测量值替换计数)。"
@@ -14809,6 +14828,9 @@ msgstr "您完成了 {leftoverQuantity} 个以上的 {0},超过了订购数量
msgid "You don't have permission to edit this bill of material."
msgstr "您没有编辑此物料清单的权限。"
+msgid "You don't have permission to edit this bill of process."
+msgstr "您没有权限编辑此工艺流程单。"
+
msgid "You drive it; we make sure it's done right. Expert eyes on your setup, data, and go-live."
msgstr "你来主导;我们确保一切正确无误。我们的专家会审视你的设置、数据和上线过程。"
@@ -14843,8 +14865,8 @@ msgstr "您已打卡 {hoursElapsed} 小时。您忘记打卡下班了吗?"
msgid "Your books and how money flows."
msgstr "您的账簿和资金流向。"
-msgid "Your changes go into a new draft version released with this change order."
-msgstr "您的更改将进入随此变更单发布的新草稿版本。"
+msgid "Your changes go into a new draft version released with this change notice."
+msgstr "您的更改将进入与此更改单一起发布的新草稿版本中。"
msgid "Your Console PIN"
msgstr "您的控制台PIN"
diff --git a/packages/notifications/src/index.ts b/packages/notifications/src/index.ts
index 0a969f556c..f7fbc626f7 100644
--- a/packages/notifications/src/index.ts
+++ b/packages/notifications/src/index.ts
@@ -8,10 +8,12 @@ export enum NotificationEvent {
ApprovalApproved = "approval-approved",
ApprovalRejected = "approval-rejected",
ApprovalRequested = "approval-requested",
- // Change-order stage broadcasts (the only CO events; no approval flow in v1).
- ChangeOrderStarted = "change-order-started",
- ChangeOrderImplementation = "change-order-implementation",
- ChangeOrderDone = "change-order-done",
+ // Change-notice stage broadcasts (the only CN events; no approval flow in v1).
+ // Values are persisted in `notification.event`, so they keep the legacy
+ // "change-order" spelling.
+ ChangeNoticeStarted = "change-order-started",
+ ChangeNoticeImplementation = "change-order-implementation",
+ ChangeNoticeDone = "change-order-done",
DigitalQuoteResponse = "digital-quote-response",
GaugeCalibrationExpired = "gauge-calibration-expired",
JobAssignment = "job-assignment",
@@ -155,9 +157,9 @@ export function getNotificationTopic(
case NotificationEvent.ApprovalRejected:
case NotificationEvent.ApprovalRequested:
return NotificationTopic.Approval;
- case NotificationEvent.ChangeOrderStarted:
- case NotificationEvent.ChangeOrderImplementation:
- case NotificationEvent.ChangeOrderDone:
+ case NotificationEvent.ChangeNoticeStarted:
+ case NotificationEvent.ChangeNoticeImplementation:
+ case NotificationEvent.ChangeNoticeDone:
return NotificationTopic.Items;
default:
return NotificationTopic.General;
@@ -230,12 +232,12 @@ export function getNotificationEmailHeading(event: NotificationEvent): string {
return "Your request was approved";
case NotificationEvent.ApprovalRejected:
return "Your request was rejected";
- case NotificationEvent.ChangeOrderStarted:
- return "Change order started";
- case NotificationEvent.ChangeOrderImplementation:
- return "Change order in implementation";
- case NotificationEvent.ChangeOrderDone:
- return "Change order complete";
+ case NotificationEvent.ChangeNoticeStarted:
+ return "Change notice started";
+ case NotificationEvent.ChangeNoticeImplementation:
+ return "Change notice in implementation";
+ case NotificationEvent.ChangeNoticeDone:
+ return "Change notice complete";
default:
return "You have a new notification";
}
@@ -250,10 +252,10 @@ export function getNotificationEmailCtaLabel(event: NotificationEvent): string {
case NotificationEvent.ApprovalApproved:
case NotificationEvent.ApprovalRejected:
return "View decision";
- case NotificationEvent.ChangeOrderStarted:
- case NotificationEvent.ChangeOrderImplementation:
- case NotificationEvent.ChangeOrderDone:
- return "View change order";
+ case NotificationEvent.ChangeNoticeStarted:
+ case NotificationEvent.ChangeNoticeImplementation:
+ case NotificationEvent.ChangeNoticeDone:
+ return "View change notice";
case NotificationEvent.JobCompleted:
return "View job";
case NotificationEvent.SuggestionResponse: