Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.
TypeScript ai-agentsbill-of-materialserpinventory-managementleanmanufacturingmanufacturing-execution-systemmcp-servermesmrpopen-source-erppostgresqlproduction-planningqmsquality-management-systemreact-routerself-hostedsupabasetraceabilitytypescript
feat(mount): show push outcomes, push in batches, push daily
Raulc912e311d197
diff --git a/apps/erp/app/modules/settings/settings.server.ts b/apps/erp/app/modules/settings/settings.server.tsindex dfe97be441..c6e6d8000d 100644--- a/apps/erp/app/modules/settings/settings.server.ts+++ b/apps/erp/app/modules/settings/settings.server.ts@@ -8,6 +8,7 @@ import type { Database, Json } from "@carbon/database";import {getIntegrationConfigById,getIntegrationIdsByRole,+ type IntegrationHealthcheckResult,type IntegrationID,resolveIntegrationSecrets,splitSecrets@@ -477,6 +478,12 @@ export type IntegrationHealthStatus =| "inactive"| "sync-off";+type IntegrationHealthFields = {+ health: IntegrationHealthStatus;+ /** Why an unhealthy check failed, when the integration says. */+ healthReason: string | null;+};+/*** Connection health, plus `sync-off` for an accounting integration whose* connection works but whose sync switch is off (a new connection still being@@ -486,7 +493,7 @@ export type IntegrationHealthStatus =export async function getIntegrationHealth(companyId: string,integration: Integration-): Promise<Integration & { health: IntegrationHealthStatus }> {+): Promise<Integration & IntegrationHealthFields> {const result = await getConnectionHealth(companyId, integration);if (result.health === "healthy" &&@@ -503,11 +510,15 @@ export async function getIntegrationHealth(async function getConnectionHealth(companyId: string,integration: Integration-): Promise<Integration & { health: "healthy" | "unhealthy" | "inactive" }> {+): Promise<+ Integration &+ IntegrationHealthFields & { health: "healthy" | "unhealthy" | "inactive" }+> {if (!integration.active) {return {...integration,- health: "inactive"+ health: "inactive",+ healthReason: null};}@@ -518,7 +529,8 @@ async function getConnectionHealth(if (!healthcheck) {return {...integration,- health: "healthy"+ health: "healthy",+ healthReason: null};}@@ -530,7 +542,8 @@ async function getConnectionHealth(if (cached === "1") {return {...integration,- health: "healthy"+ health: "healthy",+ healthReason: null};}@@ -553,22 +566,26 @@ async function getConnectionHealth(} catch {return {...integration,- health: "unhealthy"+ health: "unhealthy",+ healthReason: null};}- const status = await (+ const result = await (healthcheck as (companyId: string,metadata: Record<string, any>- ) => Promise<boolean>+ ) => Promise<boolean | IntegrationHealthcheckResult>)(companyId, resolvedMetadata);+ const healthy = typeof result === "boolean" ? result : result.healthy;+ const reason = typeof result === "boolean" ? null : (result.reason ?? null);- await redis.set(key, status ? "1" : "0", "EX", INTEGRATION_CACHE_TTL * 5); // Cache for 5 minutes+ await redis.set(key, healthy ? "1" : "0", "EX", INTEGRATION_CACHE_TTL * 5); // Cache for 5 hoursreturn {...integration,- health: status ? "healthy" : "unhealthy"+ health: healthy ? "healthy" : "unhealthy",+ healthReason: healthy ? null : reason};}diff --git a/apps/erp/app/modules/settings/ui/Integrations/IntegrationCard.tsx b/apps/erp/app/modules/settings/ui/Integrations/IntegrationCard.tsxindex 873fcb71c8..99d6dc6aa2 100644--- a/apps/erp/app/modules/settings/ui/Integrations/IntegrationCard.tsx+++ b/apps/erp/app/modules/settings/ui/Integrations/IntegrationCard.tsx@@ -13,6 +13,9 @@ import {CardHeader,CardTitle,cn,+ Tooltip,+ TooltipContent,+ TooltipTrigger,useRouteData} from "@carbon/react";import { Trans, useLingui } from "@lingui/react/macro";@@ -34,6 +37,8 @@ export type IntegrationHealth = {id: string;active: boolean;health: IntegrationHealthStatus;+ /** Why the last check failed, when the integration says. */+ healthReason?: string | null;/*** Which install mode this one is in, resolved SERVER-side.*@@ -237,7 +242,10 @@ export function IntegrationCard({</span>)}{installed && integration.active && (- <StatusBadge status={installed.health} />+ <StatusBadge+ status={installed.health}+ reason={installed.healthReason}+ />)}</CardFooter>{showModeDialog && (@@ -252,7 +260,13 @@ export function IntegrationCard({);}-const StatusBadge = ({ status }: { status: IntegrationHealthStatus }) => {+const StatusBadge = ({+ status,+ reason+}: {+ status: IntegrationHealthStatus;+ reason?: string | null;+}) => {const { t } = useLingui();const colors = {@@ -279,7 +293,7 @@ const StatusBadge = ({ status }: { status: IntegrationHealthStatus }) => {} as const;const ping = colors[status] || "text-gray-400";- return (+ const badge = (<Badgevariant={badgeVariants[status]}className="flex items-center mr-auto gap-x-2 py-0.5"@@ -301,4 +315,12 @@ const StatusBadge = ({ status }: { status: IntegrationHealthStatus }) => {{labels[status]}</Badge>);++ if (!reason) return badge;+ return (+ <Tooltip>+ <TooltipTrigger asChild>{badge}</TooltipTrigger>+ <TooltipContent className="max-w-xs">{reason}</TooltipContent>+ </Tooltip>+ );};diff --git a/apps/erp/app/modules/settings/ui/Integrations/IntegrationForm.tsx b/apps/erp/app/modules/settings/ui/Integrations/IntegrationForm.tsxindex 5d2ea366eb..35dfd8fde1 100644--- a/apps/erp/app/modules/settings/ui/Integrations/IntegrationForm.tsx+++ b/apps/erp/app/modules/settings/ui/Integrations/IntegrationForm.tsx@@ -59,12 +59,29 @@ import { MethodIcon, TrackingTypeIcon } from "~/components/Icons";import { usePermissions, useUser } from "~/hooks";import { path } from "~/utils/path";+/**+ * Live state an installed integration supplies for one of its actions. With it+ * the button follows the run on the server — running until the run ends, then+ * Run again — instead of the click-local "Started", and `detail` shows the+ * last run's outcome under the action.+ */+export type IntegrationActionState = {+ running?: boolean;+ /** Button text while running. */+ runningLabel?: ReactNode;+ detail?: ReactNode;+};+function IntegrationActionButton({action,- isDisabled+ isDisabled,+ state,+ onStarted}: {action: IntegrationAction;isDisabled: boolean;+ state?: IntegrationActionState;+ onStarted?: (actionId: string, response: Record<string, unknown>) => void;}) {const [isLoading, setIsLoading] = useState(false);const [status, setStatus] = useState<"idle" | "running" | "completed">(@@ -89,7 +106,12 @@ function IntegrationActionButton({if (data?.success) {toast.success(`${action.label} started`);- setStatus("completed");+ if (state) {+ setStatus("idle");+ onStarted?.(action.id, data);+ } else {+ setStatus("completed");+ }} else {setStatus("idle");toast.error(data?.error || `Failed to start ${action.label}`);@@ -100,25 +122,38 @@ function IntegrationActionButton({} finally {setIsLoading(false);}- }, [action]);+ }, [action, state, onStarted]);++ const running = state?.running === true;return (- <div className="flex items-center justify-between gap-4 p-3 border rounded-lg w-full">- <div className="flex flex-col flex-1 min-w-0">- <p className="text-sm font-medium">{action.label}</p>- <p className="text-xs text-muted-foreground">{action.description}</p>- </div>- <div className="shrink-0">- <Button- variant="secondary"- size="sm"- onClick={handleClick}- isLoading={isLoading}- isDisabled={isDisabled || status === "running"}- >- {status === "completed" ? "Started" : "Run"}- </Button>+ <div className="flex flex-col gap-2 p-3 border rounded-lg w-full">+ <div className="flex items-center justify-between gap-4">+ <div className="flex flex-col flex-1 min-w-0">+ <p className="text-sm font-medium">{action.label}</p>+ {action.description && (+ <p className="text-xs text-muted-foreground">+ {action.description}+ </p>+ )}+ </div>+ <div className="shrink-0">+ <Button+ variant="secondary"+ size="sm"+ onClick={handleClick}+ isLoading={isLoading || running}+ isDisabled={isDisabled || status === "running" || running}+ >+ {running+ ? (state?.runningLabel ?? "Running")+ : status === "completed"+ ? "Started"+ : "Run"}+ </Button>+ </div></div>+ {state?.detail}</div>);}@@ -126,16 +161,14 @@ function IntegrationActionButton({// Wraps an action gated by a boolean setting (`enabledWhenSetting`), reading the// LIVE form value so it appears/disappears as the toggle changes — not only after// save. Renders nothing when the setting is off.-function GatedIntegrationActionButton({- action,- isDisabled-}: {- action: IntegrationAction;- isDisabled: boolean;-}) {- const [value] = useControlField<boolean>(action.enabledWhenSetting as string);+function GatedIntegrationActionButton(+ props: Parameters<typeof IntegrationActionButton>[0]+) {+ const [value] = useControlField<boolean>(+ props.action.enabledWhenSetting as string+ );if (value !== true) return null;- return <IntegrationActionButton action={action} isDisabled={isDisabled} />;+ return <IntegrationActionButton {...props} />;}/**@@ -590,6 +623,15 @@ interface IntegrationFormProps {/** Rendered in the header under the connection details of an installed* integration (e.g. an accounting integration's sync switch). */headerExtra?: ReactNode;+ /** Live state per action id; an action without an entry keeps the plain+ * Run → Started button. */+ actionStates?: Record<string, IntegrationActionState>;+ /** Called with the action route's response when an action with a state+ * entry has started. */+ onActionStarted?: (+ actionId: string,+ response: Record<string, unknown>+ ) => void;}export function IntegrationForm({@@ -601,7 +643,9 @@ export function IntegrationForm({dynamicOptions = {},tabs = [],defaultTab,- headerExtra+ headerExtra,+ actionStates,+ onActionStarted}: IntegrationFormProps) {const { t } = useLingui();const permissions = usePermissions();@@ -865,12 +909,16 @@ export function IntegrationForm({key={action.id}action={action}isDisabled={isDisabled}+ state={actionStates?.[action.id]}+ onStarted={onActionStarted}/>) : (<IntegrationActionButtonkey={action.id}action={action}isDisabled={isDisabled}+ state={actionStates?.[action.id]}+ onStarted={onActionStarted}/>))}diff --git a/apps/erp/app/modules/settings/ui/Integrations/MountPublishStatus.tsx b/apps/erp/app/modules/settings/ui/Integrations/MountPublishStatus.tsxnew file mode 100644index 0000000000..e03606a93c--- /dev/null+++ b/apps/erp/app/modules/settings/ui/Integrations/MountPublishStatus.tsx@@ -0,0 +1,229 @@+// SPDX-License-Identifier: AGPL-3.0-only+// Carbon (github.com/crbnos/carbon). Modified or adapted versions of this file,+// including ports, remain AGPLv3; serving them over a network requires releasing their source.++import {+ MOUNT_PUBLISH_ACTION_IDS,+ type MountEntityType,+ type MountPublishRecord,+ parseMountPublishRecords,+ publishNeedsAttention+} from "@carbon/ee/mount";+import { useRevalidator } from "@carbon/query";+import { toast } from "@carbon/react";+import { Plural, Trans, useLingui } from "@lingui/react/macro";+import { useCallback, useEffect, useMemo, useRef, useState } from "react";+import { Link } from "react-router";+import { useDateFormatter } from "~/hooks";+import { path } from "~/utils/path";+import type { IntegrationActionState } from "./IntegrationForm";++const POLL_INTERVAL_MS = 3000;+const ISSUES_SHOWN = 5;++const ACTIONS = Object.entries(MOUNT_PUBLISH_ACTION_IDS) as Array<+ [MountEntityType, string]+>;++/**+ * Action states for the Mount integration's Push buttons, read from the run+ * records the publish job keeps on the integration's metadata. While a run is+ * starting or running the page revalidates, so the button and the outcome+ * follow the job without a reload.+ */+export function useMountActionStates(metadata: Record<string, unknown>) {+ const { t } = useLingui();+ const { revalidate } = useRevalidator();+ const records = useMemo(() => parseMountPublishRecords(metadata), [metadata]);++ // The request id of the run this page started, per action. It is what+ // the person did here, not a copy of the loader data.+ const [started, setStarted] = useState<Record<string, string>>({});+ const announced = useRef(new Set<string>());++ const actionStates: Record<string, IntegrationActionState> = {};+ let polling = false;+ for (const [entityType, actionId] of ACTIONS) {+ const record = records[entityType];+ const requestId = started[actionId];+ // Started here, but the job has not picked it up yet.+ const starting = requestId !== undefined && record?.requestId !== requestId;+ const running = starting || record?.status === "running";+ if (running) polling = true;++ actionStates[actionId] = {+ running,+ runningLabel: starting ? <Trans>Starting</Trans> : <Trans>Running</Trans>,+ // While a run is starting or running the button's label is the whole+ // story; the outcome shows once it ends.+ detail:+ record && !running ? (+ <MountPublishDetail entityType={entityType} record={record} />+ ) : null+ };+ }++ useEffect(() => {+ if (!polling) return;+ const id = setInterval(() => revalidate(), POLL_INTERVAL_MS);+ return () => clearInterval(id);+ }, [polling, revalidate]);++ // Say when a run this page started has ended.+ useEffect(() => {+ for (const [entityType, actionId] of ACTIONS) {+ const requestId = started[actionId];+ const record = records[entityType];+ if (+ !requestId ||+ record?.requestId !== requestId ||+ record.status === "running" ||+ announced.current.has(requestId)+ ) {+ continue;+ }+ announced.current.add(requestId);+ if (record.status === "failed") {+ toast.error(t`The push to Mount failed`);+ } else if (publishNeedsAttention(record)) {+ toast.warning(+ t`The push to Mount finished. Some records need attention`+ );+ } else {+ toast.success(t`The push to Mount finished`);+ }+ }+ }, [records, started, t]);++ const onActionStarted = useCallback(+ (actionId: string, response: Record<string, unknown>) => {+ const requestId = response.requestId;+ if (typeof requestId !== "string") return;+ setStarted((current) => ({ ...current, [actionId]: requestId }));+ revalidate();+ },+ [revalidate]+ );++ return { actionStates, onActionStarted };+}++type Issue = {+ entityId: string;+ identifier?: string | null;+ reason: string;+};++function MountPublishDetail({+ entityType,+ record+}: {+ entityType: MountEntityType;+ record: MountPublishRecord;+}) {+ const { t } = useLingui();+ const { formatDateTime } = useDateFormatter();+ const when = record.at ? formatDateTime(record.at) : "";+ const created = record.created;+ const updated = record.updated;++ const issues: Issue[] = [+ ...record.ambiguous.map((entry) => {+ const matches = entry.matches;+ return {+ entityId: entry.entityId,+ identifier: entry.identifier,+ reason: t`Mount has ${matches} records with this identifier. Delete or merge the extra ones in Mount, then push again.`+ };+ }),+ ...record.failed+ ];+ const hidden = issues.length - ISSUES_SHOWN;++ return (+ <div className="flex flex-col gap-1 text-xs">+ {record.status === "failed" ? (+ <p className="text-destructive">+ <Trans>+ Last push {when} failed: {record.error}+ </Trans>+ </p>+ ) : (+ <p className="text-muted-foreground">+ {record.trigger === "schedule" ? (+ <Trans>Last scheduled push {when}:</Trans>+ ) : (+ <Trans>Last push {when}:</Trans>+ )}{" "}+ <Trans>+ {created} created, {updated} updated.+ </Trans>+ </p>+ )}+ {record.more && (+ <p className="text-foreground">+ <Trans>More records are waiting. Push again to continue.</Trans>+ </p>+ )}+ {record.warnings.map((warning) => (+ <p key={warning} className="text-foreground">+ {warning}+ </p>+ ))}+ {issues.length > 0 && (+ <div className="flex flex-col gap-1">+ <p className="font-medium text-foreground">+ <Plural+ value={issues.length}+ one="# record needs attention"+ other="# records need attention"+ />+ </p>+ <ul className="flex flex-col gap-1">+ {issues.slice(0, ISSUES_SHOWN).map((issue) => (+ <li key={issue.entityId} className="text-muted-foreground">+ <IssueRecord entityType={entityType} issue={issue} />+ </li>+ ))}+ </ul>+ {hidden > 0 && (+ <p className="text-muted-foreground">+ <Plural+ value={hidden}+ one="And # more record."+ other="And # more records."+ />+ </p>+ )}+ </div>+ )}+ </div>+ );+}++function IssueRecord({+ entityType,+ issue+}: {+ entityType: MountEntityType;+ issue: Issue;+}) {+ // A failure that stopped the whole run names no record.+ if (issue.entityId === "*") return <>{issue.reason}</>;++ const to =+ entityType === "item"+ ? path.to.part(issue.entityId)+ : entityType === "customer"+ ? path.to.customer(issue.entityId)+ : path.to.supplier(issue.entityId);++ return (+ <>+ <Link to={to} className="font-medium text-foreground underline">+ {issue.identifier ?? issue.entityId}+ </Link>+ : {issue.reason}+ </>+ );+}diff --git a/apps/erp/app/routes/api+/integrations.mount.publish.ts b/apps/erp/app/routes/api+/integrations.mount.publish.tsindex 2739e62259..db3c984050 100644--- a/apps/erp/app/routes/api+/integrations.mount.publish.ts+++ b/apps/erp/app/routes/api+/integrations.mount.publish.ts@@ -7,6 +7,7 @@ import { requirePermissions } from "@carbon/auth/auth.server";import { getMountIntegration } from "@carbon/ee/mount.server";import { trigger } from "@carbon/jobs";import { getLogger } from "@carbon/logger";+import { nanoid } from "nanoid";import type { ActionFunctionArgs } from "react-router";import { data } from "react-router";import { z } from "zod";@@ -23,7 +24,7 @@ const PublishRequestSchema = z.object({export async function action({ request }: ActionFunctionArgs) {assertIsPost(request);- const { client, companyId } = await requirePermissions(request, {+ const { client, companyId, userId } = await requirePermissions(request, {update: "settings"});@@ -44,13 +45,20 @@ export async function action({ request }: ActionFunctionArgs) {);}+ // Returned to the page and written into the run's record, so the page can+ // tell when the run it started has begun and ended.+ const requestId = nanoid();+try {await trigger("mount-publish", {companyId,- entityTypes: [parsed.data.entityType]+ entityTypes: [parsed.data.entityType],+ userId,+ requestId,+ trigger: "manual"});- return data({ success: true, message: "Mount publish started" });+ return data({ success: true, message: "Mount publish started", requestId });} catch (error) {logger.error("Failed to start Mount publish", {companyId,diff --git a/apps/erp/app/routes/x+/settings+/integrations.$id.tsx b/apps/erp/app/routes/x+/settings+/integrations.$id.tsxindex 187519c195..6682d5bfba 100644--- a/apps/erp/app/routes/x+/settings+/integrations.$id.tsx+++ b/apps/erp/app/routes/x+/settings+/integrations.$id.tsx@@ -130,6 +130,7 @@ import { AccountingSyncControl } from "~/modules/settings/ui/Integrations/Accounimport { AccountMapping } from "~/modules/settings/ui/Integrations/AccountMapping";import { DimensionMapping } from "~/modules/settings/ui/Integrations/DimensionMapping";import type { IntegrationFormTab } from "~/modules/settings/ui/Integrations/IntegrationForm";+import { useMountActionStates } from "~/modules/settings/ui/Integrations/MountPublishStatus";import { PostingSyncSettings } from "~/modules/settings/ui/Integrations/PostingSyncSettings";import type { SyncReconciliationReport } from "~/modules/settings/ui/Integrations/SyncActivity";import { getDatabaseClient } from "~/services/database.server";@@ -2158,6 +2159,7 @@ export default function IntegrationRoute() {const { id: integrationId } = useParams();const collapseSettings = integrationId === "mount" && installed;+ const mountActions = useMountActionStates(metadata);// Accounting-category integrations get Account Mapping, Posting, Dimensions// and Sync Activity tabs next to the Settings form (deep-linkable via@@ -2271,6 +2273,12 @@ export default function IntegrationRoute() {/>) : undefined}+ {...(integrationId === "mount" && installed+ ? {+ actionStates: mountActions.actionStates,+ onActionStarted: mountActions.onActionStarted+ }+ : {})}onClose={() => navigate(path.to.integrations)}/>);diff --git a/apps/erp/app/routes/x+/settings+/integrations.tsx b/apps/erp/app/routes/x+/settings+/integrations.tsxindex 2f0c250797..3a5afda13a 100644--- a/apps/erp/app/routes/x+/settings+/integrations.tsx+++ b/apps/erp/app/routes/x+/settings+/integrations.tsx@@ -53,6 +53,7 @@ export async function loader({ request }: LoaderFunctionArgs) {id: i.id!,active: i.active!,health: i.health,+ healthReason: i.healthReason,installMode: i.active? config?.resolveInstallMode?.(i.metadata)?.id: undefineddiff --git a/packages/ee/src/index.ts b/packages/ee/src/index.tsindex a5ed9d5a60..e77352f27a 100644--- a/packages/ee/src/index.ts+++ b/packages/ee/src/index.ts@@ -25,6 +25,7 @@ export type {IntegrationAction,IntegrationClientHooks,IntegrationConfig,+ IntegrationHealthcheckResult,IntegrationOptions,IntegrationServerHooks,IntegrationSetting,diff --git a/packages/ee/src/mount/config.tsx b/packages/ee/src/mount/config.tsxindex a4d7301ffb..fe6e757919 100644--- a/packages/ee/src/mount/config.tsx+++ b/packages/ee/src/mount/config.tsx@@ -5,18 +5,24 @@import type { ComponentProps } from "react";import { z } from "zod";import { defineIntegration } from "../fns";-import { MOUNT_DEFAULT_BASE_URL } from "./lib/constants";+import {+ MOUNT_DEFAULT_BASE_URL,+ MOUNT_PUBLISH_ACTION_IDS+} from "./lib/constants";const MountSettingsSchema = z.object({clientId: z.string().min(1),clientSecret: z.string(),- // A plain string check, not a refinement: zod v4 skips refinements for a- // `.default()` value (conformance: no-default-on-effects).+ // Empty means Mount's own API: the client falls back to the default.baseUrl: z- .string()- .url()- .startsWith("https://", { message: "Must be an HTTPS URL" })- .default(MOUNT_DEFAULT_BASE_URL),+ .literal("")+ .or(+ z+ .string()+ .url()+ .startsWith("https://", { message: "Must be an HTTPS URL" })+ )+ .optional(),tenant: z.string().min(1),scope: z.string().optional(),partDefinitionSlug: z.string().min(1),@@ -91,10 +97,11 @@ export const Mount = defineIntegration({{name: "baseUrl",label: "API URL",+ description: `Leave empty to use Mount's API at ${MOUNT_DEFAULT_BASE_URL}. Change it only if Mount gave you a different address.`,group: "Connection",type: "text" as const,required: false,- value: MOUNT_DEFAULT_BASE_URL+ value: ""},{name: "partDefinitionSlug",@@ -110,44 +117,38 @@ export const Mount = defineIntegration({name: "customerTypeTitle",label: "Customer company type",description:- "Optional, but without it published customers appear under All rather than the Customers tab. The type's title, exactly as Mount lists it.",+ "Leave empty to use Mount's Customer type. Enter a type's title or identifier only if your tenant names it differently.",group: "Mapping",type: "text" as const,required: false,- value: "Customer"+ value: ""},{name: "supplierTypeTitle",label: "Supplier company type",description:- "Optional, but without it published suppliers appear under All rather than the Suppliers tab. The type's title, exactly as Mount lists it.",+ "Leave empty to use Mount's Supplier type. Enter a type's title or identifier only if your tenant names it differently.",group: "Mapping",type: "text" as const,required: false,- value: "Supplier"+ value: ""}],schema: MountSettingsSchema,actions: [{- id: "push-customers",+ id: MOUNT_PUBLISH_ACTION_IDS.customer,label: "Push customers",- description:- "Send customers Mount does not have yet, or holds out of date, as Companies of the customer type",endpoint: "/api/integrations/mount/publish?entityType=customer"},{- id: "push-suppliers",+ id: MOUNT_PUBLISH_ACTION_IDS.supplier,label: "Push suppliers",- description:- "Send suppliers Mount does not have yet, or holds out of date, as Companies of the supplier type",endpoint: "/api/integrations/mount/publish?entityType=supplier"},{- id: "push-parts",+ id: MOUNT_PUBLISH_ACTION_IDS.item,label: "Push parts",- description:- "Send parts Mount does not have yet, or holds out of date, as Objects under the part definition",endpoint: "/api/integrations/mount/publish?entityType=item"}]@@ -195,16 +196,16 @@ function SetupInstructions() {means the slug is <span className="font-mono">parts</span>.</p><p className="mt-3 text-sm text-muted-foreground">- 7. For the company types, go to Settings → Types → Company types and- copy the titles used for customers and suppliers exactly as shown,- creating them with New if needed. Without them, published companies- appear under All but under neither the Customers nor the Suppliers tab.+ 7. Customers and suppliers are sent as Companies of Mount's Customer and+ Supplier types. Leave the two company type fields empty unless your+ tenant names those types differently under Settings → Types → Company+ types; then enter its titles there.</p><p className="mt-3 text-sm text-muted-foreground">- If the integration reports unhealthy after saving, re-check the Member- ID in step 2 — a client with no member is refused on every request.- Saving these settings again re-runs the check immediately; otherwise the- status refreshes within five minutes.+ If the integration reports unhealthy, hover the Unhealthy badge on its+ card for the reason. A client with no Member ID (step 2) is refused on+ every request. After fixing something in Mount, press Update here to run+ the check again.</p></>);diff --git a/packages/ee/src/mount/lib/client.ts b/packages/ee/src/mount/lib/client.tsindex 22ec511635..410ce3d9c8 100644--- a/packages/ee/src/mount/lib/client.ts+++ b/packages/ee/src/mount/lib/client.ts@@ -11,8 +11,14 @@ import {MOUNT_API_VERSION,MOUNT_DEFAULT_BASE_URL} from "./constants";+import {+ describeHealthcheckFailure,+ type MountHealthcheckStep,+ toMountApiError+} from "./errors";import { getMountIntegration, MOUNT_INTEGRATION_ID } from "./service";import {+ MountApiError,type MountChange,type MountCompany,type MountCompanyInput,@@ -42,6 +48,12 @@ type CachedToken = {accessToken: string;expiresAt: number;connection: string;+ /**+ * A 403 on this token is Mount's real answer: the token was issued for a+ * health check or right after a 403, so it already carries the client's+ * current Member ID and permissions.+ */+ forbiddenIsFinal: boolean;};const TOKEN_EXPIRY_MARGIN_MS = 60_000;@@ -56,6 +68,8 @@ export class MountClient {>();/** Domain setting (identifier or title) -> id, per company. */private domainIds = new Map<string, string>();+ /** Companies whose next token is exchanged because of a 403. */+ private reissueAfterForbidden = new Set<string>();constructor() {this.instance = axios.create({@@ -94,7 +108,14 @@ export class MountClient {return await pending.exchange;}- const exchange = this.exchangeToken(companyId, settings, connection);+ const forbiddenIsFinal =+ force || this.reissueAfterForbidden.delete(companyId);+ const exchange = this.exchangeToken(+ companyId,+ settings,+ connection,+ forbiddenIsFinal+ );this.inflight.set(companyId, { connection, exchange });try {return await exchange;@@ -108,7 +129,8 @@ export class MountClient {private async exchangeToken(companyId: string,settings: MountSettings,- connection: string+ connection: string,+ forbiddenIsFinal: boolean): Promise<string> {const body = new URLSearchParams({grant_type: "client_credentials",@@ -116,19 +138,23 @@ export class MountClient {client_secret: settings.clientSecret});- const response = await this.instance.request<{- accessToken: string;- expiresAt: string;- }>({- method: "POST",- baseURL: settings.baseUrl || MOUNT_DEFAULT_BASE_URL,- url: "/auth/v2/token",- data: body.toString(),- headers: {- "Content-Type": "application/x-www-form-urlencoded",- "X-Tenant": settings.tenant- }- });+ const response = await this.instance+ .request<{+ accessToken: string;+ expiresAt: string;+ }>({+ method: "POST",+ baseURL: settings.baseUrl || MOUNT_DEFAULT_BASE_URL,+ url: "/auth/v2/token",+ data: body.toString(),+ headers: {+ "Content-Type": "application/x-www-form-urlencoded",+ "X-Tenant": settings.tenant+ }+ })+ .catch((error) => {+ throw toMountApiError(error);+ });const { accessToken, expiresAt } = response.data;if (!accessToken) {@@ -138,7 +164,8 @@ export class MountClient {this.tokens.set(companyId, {accessToken,expiresAt: Date.parse(expiresAt),- connection+ connection,+ forbiddenIsFinal});return accessToken;@@ -264,34 +291,56 @@ export class MountClient {return response.data;} catch (error) {+ const status = axios.isAxiosError(error)+ ? error.response?.status+ : undefined;// A token revoked or invalidated mid-life reads as 401. Re-exchange once// and replay; a second 401 is a real credential problem, not staleness.- if (- retryOnUnauthorized &&- axios.isAxiosError(error) &&- error.response?.status === 401- ) {+ // Mount fixes a token's member when it issues it, so a 403 can also be a+ // token from before an admin set the client's Member ID or granted that+ // member access. Re-exchange once per token for that; a 403 on a token+ // issued after one is a real permission problem.+ const staleForbidden =+ status === 403 && !this.tokens.get(companyId)?.forbiddenIsFinal;+ if (retryOnUnauthorized && (status === 401 || staleForbidden)) {this.invalidateToken(companyId);+ if (staleForbidden) this.reissueAfterForbidden.add(companyId);return await this.request<T>(companyId, config, {retryOnUnauthorized: false,withDomain});}- throw error;+ throw toMountApiError(error);}}- async healthcheck(companyId: string) {+ /**+ * Whether Carbon can reach the tenant with the saved settings and, when it+ * cannot, why. Always exchanges a new token: a cached one says whether the+ * connection worked when it was issued, and fixes made in Mount, such as+ * setting the client's Member ID, only reach a new token.+ */+ async healthcheck(+ companyId: string+ ): Promise<{ healthy: boolean; reason?: string }> {+ let step: MountHealthcheckStep = "settings";try {+ const settings = await this.getSettings(companyId);+ step = "token";+ await this.getAccessToken(companyId, settings, { force: true });+ step = "read";await this.request(companyId, {method: "GET",path: "/Companies",params: { $top: 1 }});- return true;+ return { healthy: true };} catch (error) {- logger.error("Mount healthcheck failed", { companyId, error });- return false;+ logger.error("Mount healthcheck failed", { companyId, step, error });+ return {+ healthy: false,+ reason: describeHealthcheckFailure(step, error)+ };}}@@ -318,19 +367,6 @@ export class MountClient {return match ?? null;}- async findCompanyTypeByTitle(- companyId: string,- title: string- ): Promise<MountCompanyType | null> {- const data = await this.request<unknown[]>(companyId, {- method: "GET",- path: "/CompanyTypes",- params: { $filter: `title eq '${escapeODataString(title)}'` }- });- const [match] = MountCompanyTypeSchema.array().parse(data);- return match ?? null;- }-async listCompanyTypes(companyId: string): Promise<MountCompanyType[]> {const data = await this.request<unknown[]>(companyId, {method: "GET",@@ -426,7 +462,7 @@ export class MountClient {data: input});} catch (error) {- if (axios.isAxiosError(error) && error.response?.status === 404) {+ if (error instanceof MountApiError && error.status === 404) {throw new MountNotFoundError(collection, mountId);}throw error;diff --git a/packages/ee/src/mount/lib/constants.ts b/packages/ee/src/mount/lib/constants.tsindex e46b4f45a5..4503834557 100644--- a/packages/ee/src/mount/lib/constants.ts+++ b/packages/ee/src/mount/lib/constants.ts@@ -16,6 +16,13 @@ export const MOUNT_API_VERSION = "2026-06-01";export const MOUNT_INTEGRATION_ID = "mount";+/** The integration's action ids, by the entity type each one publishes. */+export const MOUNT_PUBLISH_ACTION_IDS = {+ customer: "push-customers",+ supplier: "push-suppliers",+ item: "push-parts"+} as const;+export function isHttpsUrl(value: string) {try {return new URL(value).protocol === "https:";diff --git a/packages/ee/src/mount/lib/errors.test.ts b/packages/ee/src/mount/lib/errors.test.tsnew file mode 100644index 0000000000..ed83ff9e89--- /dev/null+++ b/packages/ee/src/mount/lib/errors.test.ts@@ -0,0 +1,130 @@+// SPDX-License-Identifier: LicenseRef-Carbon-Commercial+// Carbon Enterprise file, licensed only under the Carbon Commercial License+// (packages/ee/LICENSE). Not AGPL. Running, modifying, or copying it beyond those terms requires a commercial license.++import { AxiosError, AxiosHeaders, type AxiosResponse } from "axios";+import { describe, expect, it } from "vitest";+import {+ describeHealthcheckFailure,+ describeMountErrorBody,+ toMountApiError+} from "./errors";+import { MountApiError } from "./types";++function answered(status: number, data: unknown) {+ const config = { headers: new AxiosHeaders() };+ const response = {+ status,+ statusText: "",+ data,+ headers: {},+ config+ } as AxiosResponse;+ return new AxiosError(+ `Request failed with status code ${status}`,+ "ERR_BAD_REQUEST",+ config,+ {},+ response+ );+}++describe("toMountApiError", () => {+ it("replaces axios's generic message with what Mount said", () => {+ const error = toMountApiError(+ answered(400, {+ title: "One or more validation errors occurred.",+ errors: { Title: ["The Title field is required."] }+ })+ );++ expect(error).toBeInstanceOf(MountApiError);+ expect((error as MountApiError).status).toBe(400);+ expect((error as MountApiError).message).toBe(+ "Mount answered 400: One or more validation errors occurred. Title: The Title field is required."+ );+ });++ it("keeps the status so a deleted record can still be told apart", () => {+ const error = toMountApiError(answered(404, ""));+ expect((error as MountApiError).status).toBe(404);+ expect((error as MountApiError).message).toBe("Mount answered 404");+ });++ it("says Mount could not be reached when there was no answer", () => {+ const error = toMountApiError(+ new AxiosError("timeout of 30000ms exceeded", "ECONNABORTED")+ );+ expect((error as MountApiError).status).toBeNull();+ expect((error as MountApiError).message).toBe(+ "Could not reach Mount (ECONNABORTED)"+ );+ });++ it("passes anything else through untouched", () => {+ const original = new Error("not from axios");+ expect(toMountApiError(original)).toBe(original);+ });+});++describe("describeMountErrorBody", () => {+ it("reads an OAuth error from the token endpoint", () => {+ expect(+ describeMountErrorBody({+ error: "invalid_client",+ error_description: "Client authentication failed"+ })+ ).toBe("Client authentication failed");+ });++ it("drops an HTML page from a proxy", () => {+ expect(+ describeMountErrorBody("<!DOCTYPE html><html>502 Bad Gateway</html>")+ ).toBeNull();+ });++ it("caps a long body so one record cannot flood the page", () => {+ const text = describeMountErrorBody({ message: "x".repeat(1000) });+ expect(text).toHaveLength(301);+ expect(text?.endsWith("…")).toBe(true);+ });+});++describe("describeHealthcheckFailure", () => {+ it("points a refused token at the credentials", () => {+ const error = new MountApiError("Mount answered 401: invalid_client", 401);++ expect(describeHealthcheckFailure("token", error)).toBe(+ "Mount answered 401: invalid_client. Check the client ID, client secret and tenant, and that the secret has not expired in Mount."+ );+ });++ it("points a bodiless 403 at the client's member", () => {+ const error = new MountApiError("Mount answered 403", 403);++ expect(describeHealthcheckFailure("read", error)).toContain(+ "Mount answered 403. Mount accepted the client but refused the request: set a Member ID"+ );+ });++ it("points an unreachable host at the API URL", () => {+ const error = new MountApiError("Could not reach Mount (ENOTFOUND)", null);++ expect(describeHealthcheckFailure("token", error)).toBe(+ "Could not reach Mount (ENOTFOUND). Check the API URL."+ );+ });++ it("passes a settings problem through as it is", () => {+ expect(+ describeHealthcheckFailure(+ "read",+ new Error(+ 'Mount domain "qa" not found. Use its identifier or title, as listed in Mount.'+ )+ )+ ).toBe(+ 'Mount domain "qa" not found. Use its identifier or title, as listed in Mount.'+ );+ });+});diff --git a/packages/ee/src/mount/lib/errors.ts b/packages/ee/src/mount/lib/errors.tsnew file mode 100644index 0000000000..a9c438aeda--- /dev/null+++ b/packages/ee/src/mount/lib/errors.ts@@ -0,0 +1,116 @@+// SPDX-License-Identifier: LicenseRef-Carbon-Commercial+// Carbon Enterprise file, licensed only under the Carbon Commercial License+// (packages/ee/LICENSE). Not AGPL. Running, modifying, or copying it beyond those terms requires a commercial license.++import axios from "axios";+import { MountApiError } from "./types";++const MAX_ERROR_DETAIL_LENGTH = 300;++/**+ * Turn an axios failure into a `MountApiError` whose message names what Mount+ * said. Anything that is not an axios error passes through untouched.+ */+export function toMountApiError(error: unknown): unknown {+ if (!axios.isAxiosError(error)) return error;++ const status = error.response?.status ?? null;+ if (status === null) {+ return new MountApiError(+ `Could not reach Mount (${error.code ?? error.message})`,+ null+ );+ }++ const detail = describeMountErrorBody(error.response?.data);+ return new MountApiError(+ detail ? `Mount answered ${status}: ${detail}` : `Mount answered ${status}`,+ status+ );+}++/**+ * Mount's spec documents no error responses, so the body is read defensively:+ * the usual summary fields (problem details, OAuth errors, plain messages),+ * then any per-field validation errors. An HTML page from a proxy says+ * nothing useful and is dropped.+ */+export function describeMountErrorBody(body: unknown): string | null {+ if (typeof body === "string") {+ const text = body.trim();+ return text && !text.startsWith("<") ? truncate(text) : null;+ }+ if (!body || typeof body !== "object") return null;++ const record = body as Record<string, unknown>;+ const summary = ["detail", "message", "error_description", "title", "error"]+ .map((key) => record[key])+ .find(+ (value): value is string =>+ typeof value === "string" && value.trim().length > 0+ );+ const fieldErrors = describeFieldErrors(record.errors);++ const text = [summary?.trim(), fieldErrors].filter(Boolean).join(" ");+ return text ? truncate(text) : null;+}++function describeFieldErrors(errors: unknown): string | null {+ if (Array.isArray(errors)) {+ const messages = errors+ .map((entry) =>+ typeof entry === "string"+ ? entry+ : entry && typeof entry === "object"+ ? ((entry as Record<string, unknown>).message ??+ (entry as Record<string, unknown>).description)+ : null+ )+ .filter((message): message is string => typeof message === "string");+ return messages.length > 0 ? messages.join("; ") : null;+ }+ if (errors && typeof errors === "object") {+ const messages = Object.entries(errors).map(+ ([field, value]) =>+ `${field}: ${Array.isArray(value) ? value.join(", ") : String(value)}`+ );+ return messages.length > 0 ? messages.join("; ") : null;+ }+ return null;+}++function truncate(text: string) {+ return text.length > MAX_ERROR_DETAIL_LENGTH+ ? `${text.slice(0, MAX_ERROR_DETAIL_LENGTH)}…`+ : text;+}++/** The part of the health check that failed. */+export type MountHealthcheckStep = "settings" | "token" | "read";++/**+ * Why the health check failed, in a sentence the person fixing it can act+ * on: what Mount said, then where the fix is. Mount's 403s carry no body, so+ * the status alone has to point at the client's member.+ */+export function describeHealthcheckFailure(+ step: MountHealthcheckStep,+ error: unknown+): string {+ const said = (error instanceof Error ? error.message : String(error)).replace(+ /\.$/,+ ""+ );+ if (!(error instanceof MountApiError)) return `${said}.`;+ if (error.status === null) return `${said}. Check the API URL.`;++ if (step === "token") {+ return error.status === 400 || error.status === 401+ ? `${said}. Check the client ID, client secret and tenant, and that the secret has not expired in Mount.`+ : `${said} when asked for an access token. Check the API URL and tenant.`;+ }+ if (error.status === 403) {+ return `${said}. Mount accepted the client but refused the request: set a Member ID on the API client in Mount, and check that member can view and edit companies and objects.`;+ }+ return `${said}.`;+}diff --git a/packages/ee/src/mount/lib/index.server.ts b/packages/ee/src/mount/lib/index.server.tsindex 881787fed6..30a0df8b13 100644--- a/packages/ee/src/mount/lib/index.server.ts+++ b/packages/ee/src/mount/lib/index.server.ts@@ -4,7 +4,9 @@export * from "./client";export * from "./constants";+export * from "./errors";export * from "./mappers";+export * from "./outcome";export * from "./publish";export * from "./push";export * from "./run";diff --git a/packages/ee/src/mount/lib/index.ts b/packages/ee/src/mount/lib/index.tsindex e457feb5e4..7b6e69a83e 100644--- a/packages/ee/src/mount/lib/index.ts+++ b/packages/ee/src/mount/lib/index.ts@@ -4,4 +4,5 @@export * from "./constants";export * from "./mappers";+export * from "./outcome";export * from "./types";diff --git a/packages/ee/src/mount/lib/outcome.test.ts b/packages/ee/src/mount/lib/outcome.test.tsnew file mode 100644index 0000000000..16c6cd97a2--- /dev/null+++ b/packages/ee/src/mount/lib/outcome.test.ts@@ -0,0 +1,276 @@+// SPDX-License-Identifier: LicenseRef-Carbon-Commercial+// Carbon Enterprise file, licensed only under the Carbon Commercial License+// (packages/ee/LICENSE). Not AGPL. Running, modifying, or copying it beyond those terms requires a commercial license.++import { describe, expect, it } from "vitest";+import {+ applyBatchToRecord,+ describePublishForNotification,+ failPublishRecord,+ isFinalBatch,+ MOUNT_PUBLISH_MAX_BATCHES,+ type MountPublishRun,+ startPublishRecord+} from "./outcome";+import type { MountPublishSummary } from "./publish";++const RUN: MountPublishRun = {+ runId: "run_1",+ requestId: "req_1",+ trigger: "manual",+ startedAt: "2026-10-08T10:00:00.000Z"+};++function summary(+ overrides: Partial<MountPublishSummary> = {}+): MountPublishSummary {+ return {+ entityType: "item",+ created: 0,+ updated: 0,+ ambiguous: [],+ failed: [],+ warnings: [],+ more: false,+ deferred: [],+ ...overrides+ };+}++describe("startPublishRecord", () => {+ it("starts counting from nothing but keeps the ids that keep failing", () => {+ const previous = {+ ...startPublishRecord(undefined, { ...RUN, runId: "run_0" }),+ status: "completed" as const,+ created: 40,+ failed: [{ entityId: "i9", reason: "rejected" }],+ deferred: ["i9"]+ };++ const record = startPublishRecord(previous, RUN);++ expect(record.status).toBe("running");+ expect(record.runId).toBe("run_1");+ expect(record.requestId).toBe("req_1");+ expect(record.created).toBe(0);+ expect(record.failed).toEqual([]);+ expect(record.deferred).toEqual(["i9"]);+ });+});++describe("applyBatchToRecord", () => {+ it("reports the whole run, not its last batch", () => {+ let record = startPublishRecord(undefined, RUN);+ record = applyBatchToRecord(record, summary({ created: 200, more: true }), {+ final: false,+ at: "t1"+ });+ expect(record.status).toBe("running");++ record = applyBatchToRecord(record, summary({ created: 30, updated: 5 }), {+ final: true,+ at: "t2"+ });++ expect(record.status).toBe("completed");+ expect(record.created).toBe(230);+ expect(record.updated).toBe(5);+ expect(record.more).toBe(false);+ expect(record.at).toBe("t2");+ });++ it("drops a record from the list once a later batch publishes it", () => {+ let record = startPublishRecord(undefined, RUN);+ record = applyBatchToRecord(+ record,+ summary({+ created: 1,+ failed: [{ entityId: "i0", identifier: "P-0", reason: "timeout" }],+ deferred: ["i0"],+ more: true+ }),+ { final: false, at: "t1" }+ );++ // The last batch had room for the deferred record and it went through.+ record = applyBatchToRecord(record, summary({ updated: 1 }), {+ final: true,+ at: "t2"+ });++ expect(record.failed).toEqual([]);+ expect(record.deferred).toEqual([]);+ });++ it("keeps an earlier failure the later batch did not reach", () => {+ let record = startPublishRecord(undefined, RUN);+ record = applyBatchToRecord(+ record,+ summary({+ created: 1,+ failed: [{ entityId: "i0", identifier: "P-0", reason: "rejected" }],+ deferred: ["i0"],+ more: true+ }),+ { final: false, at: "t1" }+ );++ record = applyBatchToRecord(+ record,+ summary({ created: 2, deferred: ["i0"], more: true }),+ { final: true, at: "t2" }+ );++ expect(record.failed).toEqual([+ { entityId: "i0", identifier: "P-0", reason: "rejected" }+ ]);+ expect(record.more).toBe(true);+ });++ it("reports a record once when it fails again in a later batch", () => {+ let record = startPublishRecord(undefined, RUN);+ const failure = { entityId: "i0", identifier: "P-0", reason: "rejected" };+ record = applyBatchToRecord(+ record,+ summary({ created: 1, failed: [failure], deferred: ["i0"], more: true }),+ { final: false, at: "t1" }+ );+ record = applyBatchToRecord(+ record,+ summary({ failed: [failure], deferred: ["i0"] }),+ { final: true, at: "t2" }+ );++ expect(record.failed).toEqual([failure]);+ });++ it("reports a setting that stopped the batch as the run's error, not a record", () => {+ const reason = 'Part definition slug "partz" isn\'t in Mount.';+ const batch = summary({ failed: [{ entityId: "*", reason }] });++ const record = applyBatchToRecord(+ startPublishRecord(undefined, RUN),+ batch,+ { final: isFinalBatch(batch, 0), at: "t1" }+ );++ expect(record.status).toBe("failed");+ expect(record.error).toBe(reason);+ expect(record.failed).toEqual([]);+ expect(+ describePublishForNotification([{ entityType: "item", record }])+ ).toEqual({+ title: "Mount push failed",+ body: `Parts: the push failed. ${reason} Open the Mount integration for details.`+ });+ });+});++describe("isFinalBatch", () => {+ it("keeps going while records remain and the batch published some", () => {+ expect(isFinalBatch(summary({ created: 200, more: true }), 0)).toBe(false);+ });++ it("stops when nothing is left", () => {+ expect(isFinalBatch(summary({ created: 12 }), 0)).toBe(true);+ });++ it("stops when a whole batch published nothing", () => {+ const failed = Array.from({ length: 200 }, (_, i) => ({+ entityId: `i${i}`,+ reason: "Title is required"+ }));+ expect(isFinalBatch(summary({ failed, more: true }), 0)).toBe(true);+ });++ it("stops at the batch limit even with records left", () => {+ expect(+ isFinalBatch(+ summary({ created: 200, more: true }),+ MOUNT_PUBLISH_MAX_BATCHES - 1+ )+ ).toBe(true);+ });+});++describe("failPublishRecord", () => {+ it("keeps what the run already counted", () => {+ const running = applyBatchToRecord(+ startPublishRecord(undefined, RUN),+ summary({ created: 200, more: true }),+ { final: false, at: "t1" }+ );++ const record = failPublishRecord(running, RUN, "Mount answered 503", "t2");++ expect(record.status).toBe("failed");+ expect(record.created).toBe(200);+ expect(record.error).toBe("Mount answered 503");+ });++ it("does not report another run's counts as this one's", () => {+ const previous = applyBatchToRecord(+ startPublishRecord(undefined, { ...RUN, runId: "run_0" }),+ summary({ created: 80, deferred: ["i3"] }),+ { final: true, at: "t0" }+ );++ const record = failPublishRecord(previous, RUN, "Mount answered 401", "t1");++ expect(record.runId).toBe("run_1");+ expect(record.created).toBe(0);+ expect(record.deferred).toEqual(["i3"]);+ });+});++describe("describePublishForNotification", () => {+ it("stays quiet when the run needs nothing", () => {+ const record = applyBatchToRecord(+ startPublishRecord(undefined, RUN),+ summary({ created: 12 }),+ { final: true, at: "t1" }+ );++ expect(+ describePublishForNotification([{ entityType: "item", record }])+ ).toBeNull();+ });++ it("names the stuck records and what is left", () => {+ const record = applyBatchToRecord(+ startPublishRecord(undefined, RUN),+ summary({+ created: 10,+ updated: 2,+ failed: [{ entityId: "i1", reason: "rejected" }],+ ambiguous: [{ entityId: "i2", identifier: "P-2", matches: 2 }],+ deferred: ["i1", "i2"],+ more: true+ }),+ { final: true, at: "t1" }+ );++ expect(+ describePublishForNotification([{ entityType: "item", record }])+ ).toEqual({+ title: "Mount push needs attention",+ body: "Parts: 12 sent, 2 records need attention, more remain. Open the Mount integration for details."+ });+ });++ it("leads with the failure when the run failed", () => {+ const record = failPublishRecord(+ undefined,+ RUN,+ "Mount answered 401: invalid_client",+ "t1"+ );++ expect(+ describePublishForNotification([{ entityType: "customer", record }])+ ).toEqual({+ title: "Mount push failed",+ body: "Customers: the push failed. Mount answered 401: invalid_client Open the Mount integration for details."+ });+ });+});diff --git a/packages/ee/src/mount/lib/outcome.ts b/packages/ee/src/mount/lib/outcome.tsnew file mode 100644index 0000000000..69035d0861--- /dev/null+++ b/packages/ee/src/mount/lib/outcome.ts@@ -0,0 +1,182 @@+// SPDX-License-Identifier: LicenseRef-Carbon-Commercial+// Carbon Enterprise file, licensed only under the Carbon Commercial License+// (packages/ee/LICENSE). Not AGPL. Running, modifying, or copying it beyond those terms requires a commercial license.++/**+ * The run record each publish run keeps under `lastPublish.{entityType}`, and+ * the decisions made from it. Pure: the job and `run.ts` own the reads and+ * writes, so the rules here are testable on plain values.+ *+ * One press of a Push button is one run. A run walks the stale set in batches+ * of `MOUNT_PUBLISH_BATCH_SIZE`, one Inngest step each, and the record adds+ * every batch up so the page reports the whole run rather than its last+ * 200 records.+ */++import type { MountPublishSummary } from "./publish";+import type { MountEntityType, MountPublishRecord } from "./types";++/**+ * Batches one run takes per entity type before it stops and reports that+ * more remain: 50 × 200 = 10,000 records per press.+ */+export const MOUNT_PUBLISH_MAX_BATCHES = 50;++export type MountPublishRun = {+ runId: string;+ requestId?: string | null;+ trigger: "manual" | "schedule";+ startedAt: string;+};++export const MOUNT_ENTITY_LABELS: Record<MountEntityType, string> = {+ customer: "Customers",+ supplier: "Suppliers",+ item: "Parts"+};++/**+ * The record written before a run's first batch: running, nothing counted.+ * The deferred ids carry over — they are what sorts records that keep failing+ * behind the rest.+ */+export function startPublishRecord(+ previous: MountPublishRecord | undefined,+ run: MountPublishRun+): MountPublishRecord {+ return {+ status: "running",+ trigger: run.trigger,+ runId: run.runId,+ requestId: run.requestId ?? null,+ startedAt: run.startedAt,+ at: run.startedAt,+ created: 0,+ updated: 0,+ more: false,+ ambiguous: [],+ failed: [],+ warnings: [],+ error: null,+ deferred: previous?.deferred ?? []+ };+}++/** Whether the run stops after this batch. */+export function isFinalBatch(summary: MountPublishSummary, batch: number) {+ if (summary.failed.some((entry) => entry.entityId === "*")) return true;+ if (!summary.more) return true;+ if (batch + 1 >= MOUNT_PUBLISH_MAX_BATCHES) return true;+ // A batch that published nothing is failing for a reason the next batch+ // most likely shares — a field Mount requires, a definition deleted. Stop+ // and report rather than walk every record into the same error.+ return summary.created + summary.updated === 0;+}++/**+ * Add one batch to the run's record. Counts accumulate; the records that need+ * attention are the ones still blocked after this batch (`summary.deferred`),+ * so a record that failed in an early batch and published in a later one drops+ * off the list.+ *+ * A failure that names no record (`entityId: "*"`, e.g. a part definition slug+ * Mount does not have) stopped the batch before any record was tried. It is+ * the run's error, not a record to fix, so the run is reported as failed.+ */+export function applyBatchToRecord(+ current: MountPublishRecord,+ summary: MountPublishSummary,+ { final, at }: { final: boolean; at: string }+): MountPublishRecord {+ const blocker = summary.failed.find((entry) => entry.entityId === "*");+ const failed = summary.failed.filter((entry) => entry.entityId !== "*");+ const stuck = new Set(summary.deferred);+ const latestIds = new Set(+ [...failed, ...summary.ambiguous].map((entry) => entry.entityId)+ );+ const carried = <T extends { entityId: string }>(previous: T[]) =>+ previous.filter(+ (entry) => !latestIds.has(entry.entityId) && stuck.has(entry.entityId)+ );++ return {+ ...current,+ status: blocker ? "failed" : final ? "completed" : "running",+ at,+ created: current.created + summary.created,+ updated: current.updated + summary.updated,+ more: summary.more,+ ambiguous: [...carried(current.ambiguous), ...summary.ambiguous],+ failed: [...carried(current.failed), ...failed],+ warnings: [...new Set([...current.warnings, ...summary.warnings])],+ error: blocker?.reason ?? null,+ deferred: summary.deferred+ };+}++/**+ * The record for a run that failed outright. What the run already counted+ * stays; a run that never reached this entity type starts from nothing.+ */+export function failPublishRecord(+ current: MountPublishRecord | undefined,+ run: MountPublishRun,+ error: string,+ at: string+): MountPublishRecord {+ const base =+ current?.runId === run.runId ? current : startPublishRecord(current, run);+ return { ...base, status: "failed", error, at };+}++export function publishNeedsAttention(record: MountPublishRecord) {+ return (+ record.status === "failed" ||+ record.failed.length > 0 ||+ record.ambiguous.length > 0 ||+ record.warnings.length > 0 ||+ record.more+ );+}++/**+ * The in-app notification for the person who pressed Push, or null when the+ * run needs nothing from them. The integration page carries the detail; the+ * notification only says where to look.+ */+export function describePublishForNotification(+ records: Array<{ entityType: MountEntityType; record: MountPublishRecord }>+): { title: string; body: string } | null {+ const attention = records.filter(({ record }) =>+ publishNeedsAttention(record)+ );+ if (attention.length === 0) return null;++ const lines = attention.map(({ entityType, record }) => {+ const label = MOUNT_ENTITY_LABELS[entityType];+ if (record.status === "failed") {+ return `${label}: the push failed. ${record.error ?? ""}`.trim();+ }+ const parts = [`${record.created + record.updated} sent`];+ const blocked = record.failed.length + record.ambiguous.length;+ if (blocked > 0) {+ parts.push(+ `${blocked} ${blocked === 1 ? "record needs" : "records need"} attention`+ );+ }+ if (record.warnings.length > 0) {+ parts.push(+ `${record.warnings.length} ${record.warnings.length === 1 ? "setting" : "settings"} not found in Mount`+ );+ }+ if (record.more) parts.push("more remain");+ return `${label}: ${parts.join(", ")}.`;+ });++ return {+ title: attention.some(({ record }) => record.status === "failed")+ ? "Mount push failed"+ : "Mount push needs attention",+ body: `${lines.join(" ")} Open the Mount integration for details.`+ };+}diff --git a/packages/ee/src/mount/lib/publish.test.ts b/packages/ee/src/mount/lib/publish.test.tsindex 4ac48a4021..7ff13d18aa 100644--- a/packages/ee/src/mount/lib/publish.test.ts+++ b/packages/ee/src/mount/lib/publish.test.ts@@ -5,6 +5,7 @@import { describe, expect, it } from "vitest";import {type MountPublishSource,+ matchCompanyType,type PublishablePart,publishEntityType} from "./publish";@@ -111,7 +112,32 @@ describe("publishEntityType", () => {);expect(summary.failed).toHaveLength(1);- expect(summary.failed[0]?.reason).toContain("part object definition");+ expect(summary.failed[0]?.reason).toContain("Part definition slug");+ expect(objects).toHaveLength(0);+ });++ it("names the slug when Mount has no definition for it", async () => {+ const { api, objects } = createFakeMount();+ const { mappings } = createFakeMappings();++ const summary = await publishEntityType(+ partSource([{ id: "i1", readableId: "P-1", name: "Bracket" }]),+ mappings,+ api,+ COMPANY_ID,+ "item",+ {+ partDefinitionSlug: "partz",+ partDefinitionId: null,+ availablePartDefinitionSlugs: ["parts", "equipment"]+ }+ );++ expect(summary.failed).toHaveLength(1);+ expect(summary.failed[0]?.reason).toBe(+ 'Part definition slug "partz" isn\'t in Mount. Mount has: parts, equipment.'+ );+ expect(summary.more).toBe(false);expect(objects).toHaveLength(0);});@@ -164,7 +190,7 @@ describe("publishEntityType", () => {expect(summary.created).toBe(2);expect(summary.failed).toEqual([- { entityId: "i2", reason: "Mount said no" }+ { entityId: "i2", identifier: "P-2", reason: "Mount said no" }]);expect(objects).toHaveLength(0); // the overridden create does not record});@@ -277,7 +303,9 @@ describe("publishEntityType", () => {);expect(summary.created).toBe(3);- expect(summary.failed).toEqual([{ entityId: "i0", reason: "rejected" }]);+ expect(summary.failed).toEqual([+ { entityId: "i0", identifier: "P-0", reason: "rejected" }+ ]);expect(summary.more).toBe(false);expect(summary.deferred.sort()).toEqual(["i0", "i1"]);});@@ -302,3 +330,22 @@ describe("publishEntityType", () => {});});});++describe("matchCompanyType", () => {+ const types = [+ { id: "t1", title: "Kunde", identifier: "Customer" },+ { id: "t2", title: "Supplier", identifier: "vendor" }+ ];++ it("prefers the identifier, which survives a renamed title", () => {+ expect(matchCompanyType(types, "customer")?.id).toBe("t1");+ });++ it("falls back to the title", () => {+ expect(matchCompanyType(types, "Supplier")?.id).toBe("t2");+ });++ it("finds nothing when neither matches", () => {+ expect(matchCompanyType(types, "Partner")).toBeNull();+ });+});diff --git a/packages/ee/src/mount/lib/publish.ts b/packages/ee/src/mount/lib/publish.tsindex 7c881c16f5..34830c44cc 100644--- a/packages/ee/src/mount/lib/publish.ts+++ b/packages/ee/src/mount/lib/publish.ts@@ -52,7 +52,11 @@ export type MountPublishSource = {};export type MountPublishSettings = {+ /** The slug as entered in settings, to name it when Mount has no match. */+ partDefinitionSlug?: string | null;partDefinitionId?: string | null;+ /** Mount's definition slugs, read only when the setting matched none. */+ availablePartDefinitionSlugs?: string[] | null;customerTypeId?: string | null;supplierTypeId?: string | null;};@@ -62,7 +66,9 @@ export type MountPublishSummary = {created: number;updated: number;ambiguous: Array<{ entityId: string; identifier: string; matches: number }>;- failed: Array<{ entityId: string; reason: string }>;+ failed: Array<{ entityId: string; identifier?: string; reason: string }>;+ /** Settings that resolved to nothing in Mount but did not stop the run. */+ warnings: string[];more: boolean;deferred: string[];};@@ -85,6 +91,7 @@ export async function publishEntityType(updated: 0,ambiguous: [],failed: [],+ warnings: [],more: false,deferred: deferIds};@@ -95,8 +102,9 @@ export async function publishEntityType(// not a side effect of pressing Publish.summary.failed.push({entityId: "*",- reason:- "No Mount part object definition configured. Set one in the integration settings."+ reason: settings.partDefinitionSlug+ ? `Part definition slug "${settings.partDefinitionSlug}" isn't in Mount.${describeMountHas(settings.availablePartDefinitionSlugs)}`+ : "Part definition slug isn't set. Set it in the integration settings."});return summary;}@@ -138,6 +146,7 @@ export async function publishEntityType(// record that failed is still stale next time.summary.failed.push({entityId: record.id,+ ...(record.readableId ? { identifier: record.readableId } : {}),reason:error instanceof MissingIdentifierError? error.message@@ -215,3 +224,30 @@ async function publishOne(}export { MOUNT_INTEGRATION_ID };++/**+ * What Mount offers instead of a setting it could not match, so the person+ * can correct the setting without opening Mount. Empty when Mount could not+ * be asked.+ */+export function describeMountHas(names: string[] | null | undefined) {+ if (!names) return "";+ if (names.length === 0) return " Mount has none.";+ return ` Mount has: ${names.join(", ")}.`;+}++/**+ * The company type a name refers to: by identifier first, then by title,+ * ignoring case. Identifiers are what Mount keeps stable when a type's title+ * is translated or reworded.+ */+export function matchCompanyType<+ T extends { title: string; identifier?: string | null }+>(types: T[], name: string): T | null {+ const wanted = name.trim().toLowerCase();+ return (+ types.find((type) => type.identifier?.toLowerCase() === wanted) ??+ types.find((type) => type.title.toLowerCase() === wanted) ??+ null+ );+}diff --git a/packages/ee/src/mount/lib/run.ts b/packages/ee/src/mount/lib/run.tsindex da273e1217..a461674e90 100644--- a/packages/ee/src/mount/lib/run.ts+++ b/packages/ee/src/mount/lib/run.ts@@ -8,34 +8,63 @@ import { getLogger } from "@carbon/logger";import { datetime } from "@carbon/utils";import type { SupabaseClient } from "@supabase/supabase-js";import { createMappingService } from "../../accounting/core/external-mapping";+import { patchIntegrationState } from "../../integrations/secrets";import { getMountClient } from "./client";import { MOUNT_INTEGRATION_ID } from "./constants";import {+ applyBatchToRecord,+ failPublishRecord,+ isFinalBatch,+ type MountPublishRun,+ startPublishRecord+} from "./outcome";+import {+ describeMountHas,MOUNT_PUBLISH_BATCH_SIZE,type MountPublishSettings,- type MountPublishSummary,+ matchCompanyType,publishEntityType} from "./publish";import { getMountIntegration } from "./service";import { createMountPublishSource } from "./source";-import type { MountEntityType } from "./types";+import {+ type MountEntityType,+ type MountPublishRecord,+ parseMountPublishRecords+} from "./types";const logger = getLogger("ee", "mount");-export async function runMountPublish({+type StoredSettings = {+ partDefinitionSlug?: string;+ customerTypeTitle?: string;+ supplierTypeTitle?: string;+};++/**+ * One batch of one entity type's publish run. The first batch marks the run+ * as running before it pushes anything, so the page can show it; every batch+ * then adds its outcome to the run's record. `final` tells the job to stop.+ */+export async function runMountPublishBatch({serviceRole,db,companyId,- entityTypes,+ entityType,+ run,+ batch,limit = MOUNT_PUBLISH_BATCH_SIZE}: {serviceRole: SupabaseClient<Database>;db: Kysely<KyselyDatabase>;companyId: string;- entityTypes: MountEntityType[];+ entityType: MountEntityType;+ run: MountPublishRun;+ batch: number;limit?: number;}): Promise<- { status: "inactive" } | { status: "ran"; summaries: MountPublishSummary[] }+ | { status: "inactive" }+ | { status: "ran"; record: MountPublishRecord; final: boolean }> {const integration = await getMountIntegration(serviceRole, companyId);// A failed lookup is not "inactive": throw so the job step retries.@@ -50,108 +79,201 @@ export async function runMountPublish({return { status: "inactive" };}- const stored = (integration.data[0].metadata ?? {}) as {- partDefinitionSlug?: string;- customerTypeTitle?: string;- supplierTypeTitle?: string;- lastPublish?: Partial<- Record<MountEntityType, { deferred?: string[] } | undefined>- >;- };+ const metadata = integration.data[0].metadata;+ const stored = (metadata ?? {}) as StoredSettings;- const api = getMountClient();+ let current = parseMountPublishRecords(metadata)[entityType];+ if (batch === 0 || current?.runId !== run.runId) {+ current = startPublishRecord(current, run);+ await writePublishRecord(serviceRole, companyId, entityType, current);+ }- // Settings hold what a Mount user can actually see — the definition's slug- // and the company types' titles. Resolve them to ids per run rather than- // storing ids the user has no way to read back.- const [definition, customerType, supplierType] = await Promise.all([- stored.partDefinitionSlug- ? api.findObjectDefinitionBySlug(companyId, stored.partDefinitionSlug)- : null,- stored.customerTypeTitle- ? api.findCompanyTypeByTitle(companyId, stored.customerTypeTitle)- : null,- stored.supplierTypeTitle- ? api.findCompanyTypeByTitle(companyId, stored.supplierTypeTitle)- : null- ]);-- const settings: MountPublishSettings = {- partDefinitionId: definition?.id ?? null,- customerTypeId: customerType?.id ?? null,- supplierTypeId: supplierType?.id ?? null- };+ const { settings, warnings } = await resolveSettings(+ companyId,+ entityType,+ stored+ );++ const summary = await publishEntityType(+ createMountPublishSource(db, companyId),+ createMappingService(db, companyId),+ getMountClient(),+ companyId,+ entityType,+ settings,+ limit,+ current.deferred+ );+ summary.warnings.push(...warnings);- const mappings = createMappingService(db, companyId);- const source = createMountPublishSource(db, companyId);+ const final = isFinalBatch(summary, batch);+ const record = applyBatchToRecord(current, summary, {+ final,+ at: datetime.timestamp()+ });+ await writePublishRecord(serviceRole, companyId, entityType, record);++ return { status: "ran", record, final };+}++/**+ * Record a run that failed outright (its retries ran out). Entity types the+ * run already finished, completed or stopped by a setting, keep their result.+ * Returns what it wrote, so the job can tell the person who started the run.+ */+export async function markMountPublishFailed({+ serviceRole,+ companyId,+ entityTypes,+ run,+ error+}: {+ serviceRole: SupabaseClient<Database>;+ companyId: string;+ entityTypes: MountEntityType[];+ run: MountPublishRun;+ error: string;+}): Promise<+ Array<{ entityType: MountEntityType; record: MountPublishRecord }>+> {+ const integration = await getMountIntegration(serviceRole, companyId);+ if (integration.error || !integration.data?.[0]) {+ logger.error("Failed to read Mount integration to record a failed run", {+ companyId,+ error: integration.error+ });+ return [];+ }++ const records = parseMountPublishRecords(integration.data[0].metadata);+ const at = datetime.timestamp();+ const written: Array<{+ entityType: MountEntityType;+ record: MountPublishRecord;+ }> = [];- const summaries: MountPublishSummary[] = [];for (const entityType of entityTypes) {- summaries.push(- await publishEntityType(- source,- mappings,- api,- companyId,- entityType,- settings,- limit,- stored.lastPublish?.[entityType]?.deferred ?? []- )- );+ const current = records[entityType];+ if (current?.runId === run.runId && current.status !== "running") {+ continue;+ }+ const record = failPublishRecord(current, run, error, at);+ await writePublishRecord(serviceRole, companyId, entityType, record);+ written.push({ entityType, record });+ }++ return written;+}++/**+ * Settings hold what a Mount user can see — the definition's slug and the+ * company types' titles or identifiers. They are resolved to ids per batch,+ * and only the ones this entity type uses, so a parts push never fails on a+ * company-type lookup.+ */+async function resolveSettings(+ companyId: string,+ entityType: MountEntityType,+ stored: StoredSettings+): Promise<{ settings: MountPublishSettings; warnings: string[] }> {+ const api = getMountClient();++ if (entityType === "item") {+ const definition = stored.partDefinitionSlug+ ? await api.findObjectDefinitionBySlug(+ companyId,+ stored.partDefinitionSlug+ )+ : null;+ const availablePartDefinitionSlugs =+ stored.partDefinitionSlug && !definition+ ? await listForMessage(companyId, async () =>+ (await api.listObjectDefinitions(companyId)).flatMap((entry) =>+ entry.slug ? [entry.slug] : []+ )+ )+ : null;+ return {+ settings: {+ partDefinitionSlug: stored.partDefinitionSlug ?? null,+ partDefinitionId: definition?.id ?? null,+ availablePartDefinitionSlugs+ },+ warnings: []+ };}- await recordOutcome(serviceRole, companyId, summaries);+ // The setting is an override. Empty, it picks Mount's own Customer or+ // Supplier type, which every tenant seen so far has.+ const isCustomer = entityType === "customer";+ const setting = (+ isCustomer ? stored.customerTypeTitle : stored.supplierTypeTitle+ )?.trim();+ const name = setting || (isCustomer ? "Customer" : "Supplier");+ const types = await api.listCompanyTypes(companyId);+ const type = matchCompanyType(types, name);+ const warnings: string[] = [];+ if (!type) {+ const label = isCustomer ? "Customer" : "Supplier";+ const has = describeMountHas(types.map((entry) => entry.title));+ const sent = `${isCustomer ? "Customers" : "Suppliers"} were sent without a type.`;+ warnings.push(+ setting+ ? `${label} company type "${setting}" isn't in Mount.${has} ${sent}`+ : `Mount has no company type called "${name}".${has} ${sent} Set ${label} company type in the integration settings to choose one.`+ );+ }- return { status: "ran", summaries };+ return {+ settings:+ entityType === "customer"+ ? { customerTypeId: type?.id ?? null }+ : { supplierTypeId: type?.id ?? null },+ warnings+ };}-async function recordOutcome(- serviceRole: SupabaseClient<Database>,+/**+ * Read what Mount has, to name it beside a setting that matched nothing. The+ * message is still useful without it, so a failed read is logged, not thrown.+ */+async function listForMessage(companyId: string,- summaries: MountPublishSummary[]-) {- // Throw rather than carry on: writing back without the stored metadata- // would drop the saved settings, and a lost write drops the deferred ids.- // A throw fails the job step, which Inngest retries.- const current = await getMountIntegration(serviceRole, companyId);- if (current.error || !current.data?.[0]) {- logger.error("Failed to read Mount integration to record publish outcome", {+ read: () => Promise<string[]>+): Promise<string[] | null> {+ try {+ return await read();+ } catch (error) {+ logger.warn("Failed to list Mount options for a settings message", {companyId,- error: current.error+ error});- throw new Error("Failed to read Mount integration");+ return null;}- const metadata = (current.data[0].metadata ?? {}) as Record<string, unknown>;-- const lastPublish = {- ...((metadata.lastPublish as Record<string, unknown>) ?? {}),- ...Object.fromEntries(- summaries.map((summary) => [- summary.entityType,- {- at: datetime.timestamp(),- created: summary.created,- updated: summary.updated,- more: summary.more,- ambiguous: summary.ambiguous,- failed: summary.failed,- deferred: summary.deferred- }- ])- )- };-- const update = await serviceRole- .from("companyIntegration")- .update({ metadata: { ...metadata, lastPublish } as never })- .eq("companyId", companyId)- .eq("id", MOUNT_INTEGRATION_ID);+}- if (update.error) {+/**+ * Write one entity type's record through the atomic patch, so a settings save+ * landing mid-run is neither overwritten nor overwrites the record.+ */+async function writePublishRecord(+ serviceRole: SupabaseClient<Database>,+ companyId: string,+ entityType: MountEntityType,+ record: MountPublishRecord+) {+ try {+ await patchIntegrationState(serviceRole, companyId, MOUNT_INTEGRATION_ID, {+ metadata: { [`lastPublish.${entityType}`]: record as never }+ });+ } catch (error) {+ // Throw rather than carry on: a lost write drops the deferred ids and+ // leaves the page reporting a run that is not happening. A throw fails the+ // job step, which Inngest retries.logger.error("Failed to record Mount publish outcome", {companyId,- error: update.error+ entityType,+ error});throw new Error("Failed to record Mount publish outcome");}diff --git a/packages/ee/src/mount/lib/types.ts b/packages/ee/src/mount/lib/types.tsindex b267003e1e..d6d4a5bf0f 100644--- a/packages/ee/src/mount/lib/types.ts+++ b/packages/ee/src/mount/lib/types.ts@@ -50,7 +50,8 @@ export const MountDomainSchema = z.object({export const MountCompanyTypeSchema = z.object({id: z.string(),- title: z.string()+ title: z.string(),+ identifier: z.string().nullish()});export type MountCompany = z.infer<typeof MountCompanySchema>;@@ -88,3 +89,84 @@ export class MountNotFoundError extends Error {this.name = "MountNotFoundError";}}++/**+ * A request Mount refused or never answered. The message carries Mount's own+ * explanation from the response body, because it is shown to the user next to+ * the record it blocked and "Request failed with status code 400" says nothing+ * they can act on.+ */+export class MountApiError extends Error {+ status: number | null;++ constructor(message: string, status: number | null) {+ super(message);+ this.name = "MountApiError";+ this.status = status;+ }+}++/**+ * The outcome of the latest publish run for one entity type, kept on the+ * integration's metadata under `lastPublish.{entityType}`. The job writes it+ * when a run starts, after every batch and when the run ends; the integration+ * page reads it to show progress and what needs attention.+ *+ * Fields added after the first release are optional: records written before+ * them parse as a completed run.+ */+export const MountPublishRecordSchema = z.object({+ status: z.enum(["running", "completed", "failed"]).nullish(),+ trigger: z.enum(["manual", "schedule"]).nullish(),+ runId: z.string().nullish(),+ /** Set by the action route, so the page can tell its own run apart. */+ requestId: z.string().nullish(),+ startedAt: z.string().nullish(),+ at: z.string().nullish(),+ created: z.number().default(0),+ updated: z.number().default(0),+ more: z.boolean().default(false),+ ambiguous: z+ .array(+ z.object({+ entityId: z.string(),+ identifier: z.string(),+ matches: z.number()+ })+ )+ .default([]),+ failed: z+ .array(+ z.object({+ entityId: z.string(),+ identifier: z.string().nullish(),+ reason: z.string()+ })+ )+ .default([]),+ warnings: z.array(z.string()).default([]),+ /** Why the whole run failed, when it did. */+ error: z.string().nullish(),+ deferred: z.array(z.string()).default([])+});++export type MountPublishRecord = z.infer<typeof MountPublishRecordSchema>;++export function parseMountPublishRecords(+ metadata: unknown+): Partial<Record<MountEntityType, MountPublishRecord>> {+ const lastPublish =+ metadata && typeof metadata === "object"+ ? (metadata as { lastPublish?: unknown }).lastPublish+ : undefined;+ if (!lastPublish || typeof lastPublish !== "object") return {};++ const records: Partial<Record<MountEntityType, MountPublishRecord>> = {};+ for (const entityType of MOUNT_ENTITY_TYPES) {+ const parsed = MountPublishRecordSchema.safeParse(+ (lastPublish as Record<string, unknown>)[entityType]+ );+ if (parsed.success) records[entityType] = parsed.data;+ }+ return records;+}diff --git a/packages/ee/src/types.ts b/packages/ee/src/types.tsindex 6ce22ca159..e53e01a13f 100644--- a/packages/ee/src/types.ts+++ b/packages/ee/src/types.ts@@ -11,7 +11,8 @@ import type {export type IntegrationAction = {id: string;label: string;- description: string;+ /** Shown under the label. Omit when the label says enough. */+ description?: string;endpoint: string;/*** Name of a boolean setting that must be enabled for this action to be shown.@@ -171,12 +172,19 @@ export type IntegrationServerHooks = {onUninstall?: (companyId: string) => void | Promise<void>;/*** Server-side validation hook to check integration health/credentials.- * Returns true if the integration is healthy, false otherwise.+ * Returns true if the integration is healthy, false otherwise, or a result+ * whose `reason` tells the person what failed and where to fix it.*/onHealthcheck?: (companyId: string,metadata: Record<string, unknown>- ) => Promise<boolean>;+ ) => Promise<boolean | IntegrationHealthcheckResult>;+};++export type IntegrationHealthcheckResult = {+ healthy: boolean;+ /** Shown with an unhealthy status. */+ reason?: string;};/**diff --git a/packages/jobs/AGENTS.md b/packages/jobs/AGENTS.mdindex 54fa5871f9..c520666ef3 100644--- a/packages/jobs/AGENTS.md+++ b/packages/jobs/AGENTS.md@@ -57,6 +57,8 @@ pnpm --filter @carbon/jobs plan:company -- --company <id> --user <id> # MRP +| `accounting-reconciliation` | `0 3 * * 1` | Remote presence/tie-out checks || `ramp-sync` | `carbon/ramp-sync` | Company-serialized Ramp family sync || `ramp-sweep` | `0 * * * *` | Dispatch Ramp sync for every active install |+| `mount-publish` | `carbon/mount-publish` | One company's push to Mount: a step per batch of 200 until nothing is stale, a batch publishes nothing, or 50 batches; progress and outcome in `companyIntegration.metadata.lastPublish.{entityType}`, which the integration page reads |+| `mount-sweep` | `30 2 * * *` | Dispatch a scheduled `mount-publish` for every active Mount install || `workflow-run` | `carbon/workflow-run.queued` | Execute one owner-scoped workflow graph || `workflows-scheduler` | `carbon/workflow-scheduler.wake` | Self-chaining scheduled-workflow dispatcher || `recurring-billing` | `0 5 * * *` | The one daily job for every recurring-invoice source: rental agreements and AR contracts. One query finds every company with an Active rental agreement or Active `customerContract`. Per company, as of the company's today, `userId "system"`: a `rental-billing-<id>` step (the `create-rental-invoices` server function), then a `contract-billing-<id>` step (`create-contract-invoices`, same `asOf`); a failed source never skips the other. Then an `automation-candidates-<id>` step (`findInvoicesToAutomate`) reads back every Draft — or Pending, a crashed claim — invoice the job created (`createdBy "system"`) with no hold whose source mode is not Draft Only, so drafts from a failed or retried drafting step are still automated; the drafting steps' results only report this run's planner holds. Per candidate a `post-<id>` step (`postSalesInvoiceUnattended`), a `pdf-<id>` step once it is posted (`attachPostedInvoicePdf` — every posting mode files the invoice PDF under its opportunity, as a manual Post does; the email step reuses that file rather than recording a second), and, by the source's effective mode, an `email-<id>` step (`emailPostedInvoice`, `Post and Email`) or a `stripe-<id>` step (`sendPostedInvoiceViaStripe`, `Post and Send via Stripe`; counts as sent in the digest), all in `src/invoicing/automate-invoice.ts`. Then one "Recurring invoicing" digest per owner (agreement or contract `salesPersonId ?? createdBy`) plus the company's `invoiceNotificationGroup` (`buildRecurringInvoicingDigests`, `src/invoicing/digest.ts`) |diff --git a/packages/jobs/src/inngest/functions/integrations/index.ts b/packages/jobs/src/inngest/functions/integrations/index.tsindex be1122e01b..dc2b9aa7c6 100644--- a/packages/jobs/src/inngest/functions/integrations/index.ts+++ b/packages/jobs/src/inngest/functions/integrations/index.ts@@ -11,6 +11,7 @@ export { accountingReconciliationFunction } from "./accounting-reconciliation";export { jiraSyncFunction, syncIssueFromJiraSchema } from "./jira";export { linearSyncFunction, syncIssueFromLinearSchema } from "./linear";export { mountPublishFunction } from "./mount-publish";+export { mountSweepFunction } from "./mount-sweep";export { onshapeBackfillFunction } from "./onshape-backfill";export { onshapeRevisionSyncFunction } from "./onshape-revision-sync";export { paperlessPartsFunction } from "./paperless-parts";diff --git a/packages/jobs/src/inngest/functions/integrations/mount-publish.ts b/packages/jobs/src/inngest/functions/integrations/mount-publish.tsindex 92d6848222..57985b932a 100644--- a/packages/jobs/src/inngest/functions/integrations/mount-publish.ts+++ b/packages/jobs/src/inngest/functions/integrations/mount-publish.ts@@ -3,12 +3,24 @@// including ports, remain AGPLv3; serving them over a network requires releasing their source.import { getCarbonServiceRole } from "@carbon/auth/client.server";-import { runMountPublish } from "@carbon/ee/mount.server";+import {+ describePublishForNotification,+ MOUNT_ENTITY_TYPES,+ MOUNT_INTEGRATION_ID,+ MOUNT_PUBLISH_MAX_BATCHES,+ type MountEntityType,+ type MountPublishRecord,+ markMountPublishFailed,+ runMountPublishBatch+} from "@carbon/ee/mount.server";+import { trigger } from "@carbon/lib/trigger";import { getLogger } from "@carbon/logger";+import { NotificationEvent } from "@carbon/notifications";+import { datetime } from "@carbon/utils";import z from "zod";/*** Mount publish sweep — the "Push customers / suppliers / parts" actions on- * the Mount integration's detail page.+ * the Mount integration's detail page, and the daily `mount-sweep`.** Carbon is the master for all three; Mount is a downstream mirror that is* never read back. The sweep finds records Mount is missing or holds stale@@ -20,9 +32,11 @@ import z from "zod";* deliberately less machinery than the accounting sync, which needs provable* completeness because it moves money.*- * Started from the integration's actions today. A cron is a second trigger on- * this same function, iterating every active Mount integration; nothing here- * assumes a human started it.+ * Each batch of 200 is its own step, and a run keeps taking batches until the+ * stale set is empty, a batch publishes nothing, or it reaches+ * MOUNT_PUBLISH_MAX_BATCHES. Progress and the outcome are written to+ * `lastPublish.{entityType}` on the integration, which the integration page+ * reads. A manual run that needs attention notifies the person who started it.*/import { getJobDatabaseClient } from "../../../db";import { inngest } from "../../client";@@ -32,11 +46,16 @@ const log = getLogger("jobs", "mount-publish");const MountPublishPayloadSchema = z.object({companyId: z.string(),entityTypes: z- .array(z.enum(["customer", "supplier", "item"]))+ .array(z.enum(MOUNT_ENTITY_TYPES)).min(1)- .default(["customer", "supplier", "item"])+ .default([...MOUNT_ENTITY_TYPES]),+ userId: z.string().optional(),+ requestId: z.string().optional(),+ trigger: z.enum(["manual", "schedule"]).default("manual")});+type MountPublishPayload = z.infer<typeof MountPublishPayloadSchema>;+export const mountPublishFunction = inngest.createFunction({id: "mount-publish",@@ -44,42 +63,134 @@ export const mountPublishFunction = inngest.createFunction(// One publish run per company at a time. Two overlapping runs would race// on the same stale set and double-POST records Mount cannot de-duplicate// for us — it has no idempotency key.- concurrency: { key: "event.data.companyId", limit: 1 }+ concurrency: { key: "event.data.companyId", limit: 1 },+ onFailure: async ({ event, step }) => {+ const parsed = MountPublishPayloadSchema.safeParse(event.data.event.data);+ if (!parsed.success) return;+ const payload = parsed.data;++ const written = await step.run("record-failure", async () =>+ markMountPublishFailed({+ serviceRole: getCarbonServiceRole(),+ companyId: payload.companyId,+ entityTypes: payload.entityTypes,+ run: {+ runId: event.data.run_id,+ requestId: payload.requestId ?? null,+ trigger: payload.trigger,+ startedAt: datetime.timestamp()+ },+ error: event.data.error.message+ })+ );++ await step.run("notify-failure", async () =>+ notifyPublisher(payload, written as PublishedRecords)+ );+ }},{ event: "carbon/mount-publish" },- async ({ event, step }) => {- const { companyId, entityTypes } = MountPublishPayloadSchema.parse(- event.data- );-- // One step for the whole run: the sweep is idempotent, so a retry- // replaying records that already published is harmless.- const result = await step.run("publish", async () =>- runMountPublish({- serviceRole: getCarbonServiceRole(),- db: getJobDatabaseClient(),- companyId,- entityTypes- })- );-- if (result.status === "inactive") {- log.warn("Mount integration missing or inactive", { companyId });- return { skipped: "integration-inactive" as const };+ async ({ event, step, runId }) => {+ const payload = MountPublishPayloadSchema.parse(event.data);+ const { companyId } = payload;++ // A step, so every replay of this run agrees on when it started.+ const startedAt = await step.run("start", async () => datetime.timestamp());+ const run = {+ runId,+ requestId: payload.requestId ?? null,+ trigger: payload.trigger,+ startedAt+ };++ const records: PublishedRecords = [];+ for (const entityType of payload.entityTypes) {+ for (let batch = 0; batch < MOUNT_PUBLISH_MAX_BATCHES; batch++) {+ // The sweep is idempotent, so a retried batch replaying records that+ // already published is harmless.+ const result = await step.run(+ `publish-${entityType}-${batch}`,+ async () =>+ runMountPublishBatch({+ serviceRole: getCarbonServiceRole(),+ db: getJobDatabaseClient(),+ companyId,+ entityType,+ run,+ batch+ })+ );++ if (result.status === "inactive") {+ log.warn("Mount integration missing or inactive", { companyId });+ return { skipped: "integration-inactive" as const };+ }++ if (result.final) {+ records.push({+ entityType,+ record: result.record as MountPublishRecord+ });+ break;+ }+ }}log.info("Mount publish complete", {companyId,- summaries: result.summaries.map((summary) => ({- entityType: summary.entityType,- created: summary.created,- updated: summary.updated,- ambiguous: summary.ambiguous.length,- failed: summary.failed.length,- more: summary.more+ trigger: payload.trigger,+ outcomes: records.map(({ entityType, record }) => ({+ entityType,+ created: record.created,+ updated: record.updated,+ ambiguous: record.ambiguous.length,+ failed: record.failed.length,+ more: record.more}))});- return result;+ await step.run("notify", async () => notifyPublisher(payload, records));++ return { records };});++type PublishedRecords = Array<{+ entityType: MountEntityType;+ record: MountPublishRecord;+}>;++/**+ * Tell the person who pressed Push when the run needs something from them.+ * Scheduled runs notify nobody: the same stuck record would notify every day,+ * and the integration page already shows it.+ */+async function notifyPublisher(+ payload: MountPublishPayload,+ records: PublishedRecords+) {+ if (payload.trigger !== "manual" || !payload.userId) {+ return { notified: false };+ }++ const message = describePublishForNotification(records);+ if (!message) return { notified: false };++ try {+ await trigger("notify", {+ event: NotificationEvent.IntegrationSync,+ companyId: payload.companyId,+ documentId: MOUNT_INTEGRATION_ID,+ title: message.title,+ body: message.body,+ recipient: { type: "user", userId: payload.userId }+ });+ } catch (error) {+ log.error("Failed to send Mount publish notification", {+ companyId: payload.companyId,+ error+ });+ return { notified: false };+ }+ return { notified: true };+}diff --git a/packages/jobs/src/inngest/functions/integrations/mount-sweep.ts b/packages/jobs/src/inngest/functions/integrations/mount-sweep.tsnew file mode 100644index 0000000000..2a9a790bb1--- /dev/null+++ b/packages/jobs/src/inngest/functions/integrations/mount-sweep.ts@@ -0,0 +1,50 @@+// SPDX-License-Identifier: AGPL-3.0-only+// Carbon (github.com/crbnos/carbon). Modified or adapted versions of this file,+// including ports, remain AGPLv3; serving them over a network requires releasing their source.++/**+ * Mount daily sweep. Customers, suppliers and parts created or edited in+ * Carbon reach Mount without anyone pressing Push.+ *+ * Once a day it lists each company with an ACTIVE Mount integration and fires+ * one `carbon/mount-publish` event per company for every entity type+ * (`trigger: "schedule"`). The publish run is idempotent and serialised per+ * company, so a sweep landing on a manual run waits behind it.+ */+import { getCarbonServiceRole } from "@carbon/auth/client.server";+import { MOUNT_INTEGRATION_ID } from "@carbon/ee/mount";+import { inngest } from "../../client";++export const mountSweepFunction = inngest.createFunction(+ { id: "mount-sweep", retries: 2 },+ { cron: "30 2 * * *" }, // daily, 02:30 UTC+ async ({ step }) => {+ const companyIds = await step.run("find-mount-sweep-targets", async () => {+ const { data, error } = await getCarbonServiceRole()+ .from("companyIntegration")+ .select("companyId")+ .eq("id", MOUNT_INTEGRATION_ID)+ .eq("active", true);++ if (error) {+ throw new Error(`Failed to list Mount integrations: ${error.message}`);+ }++ return (data ?? []).map((row) => row.companyId);+ });++ if (companyIds.length === 0) {+ return { targets: 0 };+ }++ await step.sendEvent(+ "dispatch-mount-publish",+ companyIds.map((companyId) => ({+ name: "carbon/mount-publish" as const,+ data: { companyId, trigger: "schedule" as const }+ }))+ );++ return { targets: companyIds.length };+ }+);diff --git a/packages/jobs/src/inngest/index.ts b/packages/jobs/src/inngest/index.tsindex 056a9d725b..4a2ecdd50b 100644--- a/packages/jobs/src/inngest/index.ts+++ b/packages/jobs/src/inngest/index.ts@@ -44,6 +44,7 @@ import {jiraSyncFunction,linearSyncFunction,mountPublishFunction,+ mountSweepFunction,onshapeBackfillFunction,onshapeRevisionSyncFunction,paperlessPartsFunction,@@ -184,6 +185,7 @@ export const functions = [accountingReconciliationFunction,accountingPullSweepFunction,mountPublishFunction,+ mountSweepFunction,onshapeBackfillFunction,onshapeRevisionSyncFunction,rampSyncFunction,diff --git a/packages/lib/src/events.ts b/packages/lib/src/events.tsindex fde4cfea7c..6c2f13858a 100644--- a/packages/lib/src/events.ts+++ b/packages/lib/src/events.ts@@ -629,11 +629,17 @@ export type Events = {};// Mount publish sweep (the integration's "Push customers / suppliers /- // parts" actions): push Carbon records Mount is missing or holds stale+ // parts" actions, and the daily mount-sweep): push Carbon records Mount is+ // missing or holds stale"carbon/mount-publish": {data: {companyId: string;entityTypes?: Array<"customer" | "supplier" | "item">;+ // Who pressed Push; notified when the run needs attention.+ userId?: string;+ // Echoed into the run record so the page can find its own run.+ requestId?: string;+ trigger?: "manual" | "schedule";};};diff --git a/packages/locale/locales/de/erp.po b/packages/locale/locales/de/erp.poindex 28e29eb366..2315e27a34 100644--- a/packages/locale/locales/de/erp.po+++ b/packages/locale/locales/de/erp.po@@ -67,6 +67,10 @@ msgstr "{0, plural, one {# Tag zu kurz} other {# Tage zu kurz}}"msgid "{0, plural, one {# operation has no time standards} other {# operations have no time standards}}"msgstr "{0, plural, one {# Arbeitsgang hat keine Zeitstandards} other {# Arbeitsgänge haben keine Zeitstandards}}"+#. placeholder {0}: issues.length+msgid "{0, plural, one {# record needs attention} other {# records need attention}}"+msgstr ""+#. placeholder {0}: totalScopeRows(run.violationRowsByTable)msgid "{0, plural, one {# row links to data outside this company, so a safety copy of your current data can't be made.} other {# rows link to data outside this company, so a safety copy of your current data can't be made.}}"msgstr "{0, plural, one {# Zeile verweist auf Daten außerhalb dieses Unternehmens, daher kann keine Sicherungskopie Ihrer aktuellen Daten erstellt werden.} other {# Zeilen verweisen auf Daten außerhalb dieses Unternehmens, daher kann keine Sicherungskopie Ihrer aktuellen Daten erstellt werden.}}"@@ -400,6 +404,9 @@ msgstr "{count} von {total} Einheiten"msgid "{count} units"msgstr "{count} Einheiten"+msgid "{created} created, {updated} updated."+msgstr ""+msgid "{days}d"msgstr "{days}T"@@ -424,6 +431,9 @@ msgstr "{from}–{to} von {count}"msgid "{from}–{to} of {count} operations"msgstr "{from}–{to} von {count} Arbeitsgängen"+msgid "{hidden, plural, one {And # more record.} other {And # more records.}}"+msgstr ""+msgid "{hiddenCount} more: {hiddenNames}"msgstr "{hiddenCount} weitere: {hiddenNames}"@@ -11371,12 +11381,22 @@ msgstr "Nachname"msgid "Last Name"msgstr "Nachname"+#. placeholder {0}: record.error+msgid "Last push {when} failed: {0}"+msgstr ""++msgid "Last push {when}:"+msgstr ""+msgid "Last Quarter"msgstr "Letztes Quartal"msgid "Last Run"msgstr "Letzte Ausführung"+msgid "Last scheduled push {when}:"+msgstr ""+msgid "Last synced: <0/>"msgstr "Zuletzt synchronisiert: <0/>"@@ -12524,6 +12544,9 @@ msgstr "Weitere Optionen"msgid "More overtime"msgstr "Mehr Überstunden"+msgid "More records are waiting. Push again to continue."+msgstr ""+msgid "Morning, {name}."msgstr "Morgen, {name}."@@ -12536,6 +12559,9 @@ msgstr "Die meisten Dinge werden hier erkannt und gelöst. Benennen Sie es deutlmsgid "Motion"msgstr "Bewegung"+msgid "Mount has {matches} records with this identifier. Delete or merge the extra ones in Mount, then push again."+msgstr ""+msgid "Move"msgstr "Verschieben"@@ -19484,6 +19510,9 @@ msgstr "Beginnen Sie mit"msgid "Started"msgstr "Gestartet"+msgid "Starting"+msgstr ""+msgid "Starting…"msgstr "Wird gestartet…"@@ -21002,6 +21031,15 @@ msgstr "Der Provider bietet keine Dimensionsziele. Aktivieren Sie die Funktion zmsgid "The purchase order"msgstr "Die Bestellung"+msgid "The push to Mount failed"+msgstr ""++msgid "The push to Mount finished"+msgstr ""++msgid "The push to Mount finished. Some records need attention"+msgstr ""+msgid "The quantity breakpoints this line is priced at; each column carries its own per-unit price for buyer–supplier negotiation and for converting to downstream documents."msgstr "Die Mengenestaffeln, zu denen diese Position bewertet ist; jede Spalte hat seinen eigenen Stückpreis für Käufer–Lieferant-Verhandlungen und für die Umwandlung in nachgelagerte Dokumente."diff --git a/packages/locale/locales/en/erp.po b/packages/locale/locales/en/erp.poindex ae0007564e..4dbfc0b2a0 100644--- a/packages/locale/locales/en/erp.po+++ b/packages/locale/locales/en/erp.po@@ -67,6 +67,10 @@ msgstr "{0, plural, one {# day short} other {# days short}}"msgid "{0, plural, one {# operation has no time standards} other {# operations have no time standards}}"msgstr "{0, plural, one {# operation has no time standards} other {# operations have no time standards}}"+#. placeholder {0}: issues.length+msgid "{0, plural, one {# record needs attention} other {# records need attention}}"+msgstr "{0, plural, one {# record needs attention} other {# records need attention}}"+#. placeholder {0}: totalScopeRows(run.violationRowsByTable)msgid "{0, plural, one {# row links to data outside this company, so a safety copy of your current data can't be made.} other {# rows link to data outside this company, so a safety copy of your current data can't be made.}}"msgstr "{0, plural, one {# row links to data outside this company, so a safety copy of your current data can't be made.} other {# rows link to data outside this company, so a safety copy of your current data can't be made.}}"@@ -400,6 +404,9 @@ msgstr "{count} of {total} units"msgid "{count} units"msgstr "{count} units"+msgid "{created} created, {updated} updated."+msgstr "{created} created, {updated} updated."+msgid "{days}d"msgstr "{days}d"@@ -424,6 +431,9 @@ msgstr "{from}–{to} of {count}"msgid "{from}–{to} of {count} operations"msgstr "{from}–{to} of {count} operations"+msgid "{hidden, plural, one {And # more record.} other {And # more records.}}"+msgstr "{hidden, plural, one {And # more record.} other {And # more records.}}"+msgid "{hiddenCount} more: {hiddenNames}"msgstr "{hiddenCount} more: {hiddenNames}"@@ -11371,12 +11381,22 @@ msgstr "Last name"msgid "Last Name"msgstr "Last Name"+#. placeholder {0}: record.error+msgid "Last push {when} failed: {0}"+msgstr "Last push {when} failed: {0}"++msgid "Last push {when}:"+msgstr "Last push {when}:"+msgid "Last Quarter"msgstr "Last Quarter"msgid "Last Run"msgstr "Last Run"+msgid "Last scheduled push {when}:"+msgstr "Last scheduled push {when}:"+msgid "Last synced: <0/>"msgstr "Last synced: <0/>"@@ -12524,6 +12544,9 @@ msgstr "More options"msgid "More overtime"msgstr "More overtime"+msgid "More records are waiting. Push again to continue."+msgstr "More records are waiting. Push again to continue."+msgid "Morning, {name}."msgstr "Morning, {name}."@@ -12536,6 +12559,9 @@ msgstr "Most things get caught and resolved here. Name it plainly."msgid "Motion"msgstr "Motion"+msgid "Mount has {matches} records with this identifier. Delete or merge the extra ones in Mount, then push again."+msgstr "Mount has {matches} records with this identifier. Delete or merge the extra ones in Mount, then push again."+msgid "Move"msgstr "Move"@@ -19484,6 +19510,9 @@ msgstr "Start with"msgid "Started"msgstr "Started"+msgid "Starting"+msgstr "Starting"+msgid "Starting…"msgstr "Starting…"@@ -21002,6 +21031,15 @@ msgstr "The provider offers no dimension targets. Enable the feature in the provmsgid "The purchase order"msgstr "The purchase order"+msgid "The push to Mount failed"+msgstr "The push to Mount failed"++msgid "The push to Mount finished"+msgstr "The push to Mount finished"++msgid "The push to Mount finished. Some records need attention"+msgstr "The push to Mount finished. Some records need attention"+msgid "The quantity breakpoints this line is priced at; each column carries its own per-unit price for buyer–supplier negotiation and for converting to downstream documents."msgstr "The quantity breakpoints this line is priced at; each column carries its own per-unit price for buyer–supplier negotiation and for converting to downstream documents."diff --git a/packages/locale/locales/es/erp.po b/packages/locale/locales/es/erp.poindex e1405fe468..1bc93d4bc0 100644--- a/packages/locale/locales/es/erp.po+++ b/packages/locale/locales/es/erp.po@@ -67,6 +67,10 @@ msgstr "{0, plural, one {# día de atraso} other {# días de atraso}}"msgid "{0, plural, one {# operation has no time standards} other {# operations have no time standards}}"msgstr "{0, plural, one {# operación no tiene estándares de tiempo} other {# operaciones no tienen estándares de tiempo}}"+#. placeholder {0}: issues.length+msgid "{0, plural, one {# record needs attention} other {# records need attention}}"+msgstr ""+#. placeholder {0}: totalScopeRows(run.violationRowsByTable)msgid "{0, plural, one {# row links to data outside this company, so a safety copy of your current data can't be made.} other {# rows link to data outside this company, so a safety copy of your current data can't be made.}}"msgstr "{0, plural, one {# fila vincula a datos fuera de esta empresa, por lo que no se puede hacer una copia de seguridad de sus datos actuales.} other {# filas vinculan a datos fuera de esta empresa, por lo que no se puede hacer una copia de seguridad de sus datos actuales.}}"@@ -400,6 +404,9 @@ msgstr "{count} de {total} unidades"msgid "{count} units"msgstr "{count} unidades"+msgid "{created} created, {updated} updated."+msgstr ""+msgid "{days}d"msgstr "{days}d"@@ -424,6 +431,9 @@ msgstr "{from}–{to} de {count}"msgid "{from}–{to} of {count} operations"msgstr "{from}–{to} de {count} operaciones"+msgid "{hidden, plural, one {And # more record.} other {And # more records.}}"+msgstr ""+msgid "{hiddenCount} more: {hiddenNames}"msgstr "{hiddenCount} más: {hiddenNames}"@@ -11371,12 +11381,22 @@ msgstr "Apellido"msgid "Last Name"msgstr "Apellido"+#. placeholder {0}: record.error+msgid "Last push {when} failed: {0}"+msgstr ""++msgid "Last push {when}:"+msgstr ""+msgid "Last Quarter"msgstr "Trimestre Anterior"msgid "Last Run"msgstr "Última ejecución"+msgid "Last scheduled push {when}:"+msgstr ""+msgid "Last synced: <0/>"msgstr "Última sincronización: <0/>"@@ -12524,6 +12544,9 @@ msgstr "Más opciones"msgid "More overtime"msgstr "Más horas extra"+msgid "More records are waiting. Push again to continue."+msgstr ""+msgid "Morning, {name}."msgstr "Mañana, {name}."@@ -12536,6 +12559,9 @@ msgstr "La mayoría de las cosas se detectan y resuelven aquí. Nómbralo clarammsgid "Motion"msgstr "Movimiento"+msgid "Mount has {matches} records with this identifier. Delete or merge the extra ones in Mount, then push again."+msgstr ""+msgid "Move"msgstr "Mover"@@ -19484,6 +19510,9 @@ msgstr "Comienza con"msgid "Started"msgstr "Comenzó"+msgid "Starting"+msgstr ""+msgid "Starting…"msgstr "Iniciando…"@@ -21002,6 +21031,15 @@ msgstr "El proveedor no ofrece destinos de dimensión. Habilita la función en emsgid "The purchase order"msgstr "La orden de compra"+msgid "The push to Mount failed"+msgstr ""++msgid "The push to Mount finished"+msgstr ""++msgid "The push to Mount finished. Some records need attention"+msgstr ""+msgid "The quantity breakpoints this line is priced at; each column carries its own per-unit price for buyer–supplier negotiation and for converting to downstream documents."msgstr "Los puntos de ruptura de cantidad a los que se cotiza esta línea; cada columna lleva su propio precio por unidad para la negociación comprador-proveedor y para la conversión a documentos posteriores."diff --git a/packages/locale/locales/fr/erp.po b/packages/locale/locales/fr/erp.poindex ce7bd78c0a..6533ca7c9d 100644--- a/packages/locale/locales/fr/erp.po+++ b/packages/locale/locales/fr/erp.po@@ -67,6 +67,10 @@ msgstr "{0, plural, one {# jour de retard} other {# jours de retard}}"msgid "{0, plural, one {# operation has no time standards} other {# operations have no time standards}}"msgstr "{0, plural, one {# opération n'a pas de normes de temps} other {# opérations n'ont pas de normes de temps}}"+#. placeholder {0}: issues.length+msgid "{0, plural, one {# record needs attention} other {# records need attention}}"+msgstr ""+#. placeholder {0}: totalScopeRows(run.violationRowsByTable)msgid "{0, plural, one {# row links to data outside this company, so a safety copy of your current data can't be made.} other {# rows link to data outside this company, so a safety copy of your current data can't be made.}}"msgstr "{0, plural, one {# ligne se connecte à des données en dehors de cette Société, donc une copie de sécurité de vos données actuelles ne peut pas être créée.} other {# lignes se connectent à des données en dehors de cette Société, donc une copie de sécurité de vos données actuelles ne peut pas être créée.}}"@@ -400,6 +404,9 @@ msgstr "{count} sur {total} unités"msgid "{count} units"msgstr "{count} unités"+msgid "{created} created, {updated} updated."+msgstr ""+msgid "{days}d"msgstr "{days}j"@@ -424,6 +431,9 @@ msgstr "{from}–{to} sur {count}"msgid "{from}–{to} of {count} operations"msgstr "{from}–{to} sur {count} opérations"+msgid "{hidden, plural, one {And # more record.} other {And # more records.}}"+msgstr ""+msgid "{hiddenCount} more: {hiddenNames}"msgstr "{hiddenCount} autres : {hiddenNames}"@@ -11371,12 +11381,22 @@ msgstr "Nom"msgid "Last Name"msgstr "Nom de famille"+#. placeholder {0}: record.error+msgid "Last push {when} failed: {0}"+msgstr ""++msgid "Last push {when}:"+msgstr ""+msgid "Last Quarter"msgstr "Dernier trimestre"msgid "Last Run"msgstr "Dernière exécution"+msgid "Last scheduled push {when}:"+msgstr ""+msgid "Last synced: <0/>"msgstr "Dernière synchronisation : <0/>"@@ -12524,6 +12544,9 @@ msgstr "Plus d'options"msgid "More overtime"msgstr "Plus d'heures supplémentaires"+msgid "More records are waiting. Push again to continue."+msgstr ""+msgid "Morning, {name}."msgstr "Bon matin, {name}."@@ -12536,6 +12559,9 @@ msgstr "La plupart des choses sont détectées et résolues ici. Nommez-les claimsgid "Motion"msgstr "Motion"+msgid "Mount has {matches} records with this identifier. Delete or merge the extra ones in Mount, then push again."+msgstr ""+msgid "Move"msgstr "Déplacer"@@ -19484,6 +19510,9 @@ msgstr "Commencez par"msgid "Started"msgstr "Commencé"+msgid "Starting"+msgstr ""+msgid "Starting…"msgstr "Démarrage…"@@ -21002,6 +21031,15 @@ msgstr "Le fournisseur n'offre pas de cibles de dimension. Activez d'abord la fomsgid "The purchase order"msgstr "Le bon de commande"+msgid "The push to Mount failed"+msgstr ""++msgid "The push to Mount finished"+msgstr ""++msgid "The push to Mount finished. Some records need attention"+msgstr ""+msgid "The quantity breakpoints this line is priced at; each column carries its own per-unit price for buyer–supplier negotiation and for converting to downstream documents."msgstr "Les points d'arrêt de quantité à laquelle cette ligne est tarifée; chaque colonne porte son propre prix par unité pour la négociation acheteur-fournisseur et la conversion en documents aval."diff --git a/packages/locale/locales/hi/erp.po b/packages/locale/locales/hi/erp.poindex f293d53df1..2d3b3f8c5b 100644--- a/packages/locale/locales/hi/erp.po+++ b/packages/locale/locales/hi/erp.po@@ -67,6 +67,10 @@ msgstr "{0, plural, one {# दिन की कमी} other {# दिन कीmsgid "{0, plural, one {# operation has no time standards} other {# operations have no time standards}}"msgstr "{0, plural, one {# ऑपरेशन के लिए कोई समय मानक नहीं है} other {# ऑपरेशन के लिए कोई समय मानक नहीं हैं}}"+#. placeholder {0}: issues.length+msgid "{0, plural, one {# record needs attention} other {# records need attention}}"+msgstr ""+#. placeholder {0}: totalScopeRows(run.violationRowsByTable)msgid "{0, plural, one {# row links to data outside this company, so a safety copy of your current data can't be made.} other {# rows link to data outside this company, so a safety copy of your current data can't be made.}}"msgstr "{0, plural, one {# पंक्ति इस कंपनी के बाहर डेटा से जुड़ी है, इसलिए आपके वर्तमान डेटा की सुरक्षा प्रति नहीं बनाई जा सकती।} other {# पंक्तियाँ इस कंपनी के बाहर डेटा से जुड़ी हैं, इसलिए आपके वर्तमान डेटा की सुरक्षा प्रति नहीं बनाई जा सकती।}}"@@ -400,6 +404,9 @@ msgstr "{count} का {total} इकाइयों में से"msgid "{count} units"msgstr "{count} इकाइयाँ"+msgid "{created} created, {updated} updated."+msgstr ""+msgid "{days}d"msgstr "{days}d"@@ -424,6 +431,9 @@ msgstr "{from}–{to} में से {count}"msgid "{from}–{to} of {count} operations"msgstr "{count} ऑपरेशन में से {from}–{to}"+msgid "{hidden, plural, one {And # more record.} other {And # more records.}}"+msgstr ""+msgid "{hiddenCount} more: {hiddenNames}"msgstr "और {hiddenCount}: {hiddenNames}"@@ -11371,12 +11381,22 @@ msgstr "अंतिम नाम"msgid "Last Name"msgstr "अंतिम नाम"+#. placeholder {0}: record.error+msgid "Last push {when} failed: {0}"+msgstr ""++msgid "Last push {when}:"+msgstr ""+msgid "Last Quarter"msgstr "पिछली तिमाही"msgid "Last Run"msgstr "अंतिम रन"+msgid "Last scheduled push {when}:"+msgstr ""+msgid "Last synced: <0/>"msgstr "अंतिम सिंक: <0/>"@@ -12524,6 +12544,9 @@ msgstr "अधिक विकल्प"msgid "More overtime"msgstr "अधिक ओवरटाइम"+msgid "More records are waiting. Push again to continue."+msgstr ""+msgid "Morning, {name}."msgstr "सुबह, {name}।"@@ -12536,6 +12559,9 @@ msgstr "अधिकांश चीजें यहां पकड़ी जmsgid "Motion"msgstr "गति"+msgid "Mount has {matches} records with this identifier. Delete or merge the extra ones in Mount, then push again."+msgstr ""+msgid "Move"msgstr "स्थानांतरित करें"@@ -19484,6 +19510,9 @@ msgstr "शुरुआत करें"msgid "Started"msgstr "शुरू किया गया"+msgid "Starting"+msgstr ""+msgid "Starting…"msgstr "शुरू हो रहा है…"@@ -21002,6 +21031,15 @@ msgstr "प्रदाता कोई आयाम लक्ष्य प्msgid "The purchase order"msgstr "क्रय आदेश"+msgid "The push to Mount failed"+msgstr ""++msgid "The push to Mount finished"+msgstr ""++msgid "The push to Mount finished. Some records need attention"+msgstr ""+msgid "The quantity breakpoints this line is priced at; each column carries its own per-unit price for buyer–supplier negotiation and for converting to downstream documents."msgstr "मात्रा विभाजन बिंदु जिन पर इस पंक्ति की कीमत है; प्रत्येक कॉलम क्रेता-आपूर्तिकर्ता बातचीत और डाउनस्ट्रीम दस्तावेजों में परिवर्तित करने के लिए अपनी स्वयं की प्रति-यूनिट कीमत रखता है।"diff --git a/packages/locale/locales/it/erp.po b/packages/locale/locales/it/erp.poindex 25a4ec29df..5d0303128c 100644--- a/packages/locale/locales/it/erp.po+++ b/packages/locale/locales/it/erp.po@@ -67,6 +67,10 @@ msgstr "{0, plural, one {# giorno di ritardo} other {# giorni di ritardo}}"msgid "{0, plural, one {# operation has no time standards} other {# operations have no time standards}}"msgstr "{0, plural, one {# operazione senza standard di tempo} other {# operazioni senza standard di tempo}}"+#. placeholder {0}: issues.length+msgid "{0, plural, one {# record needs attention} other {# records need attention}}"+msgstr ""+#. placeholder {0}: totalScopeRows(run.violationRowsByTable)msgid "{0, plural, one {# row links to data outside this company, so a safety copy of your current data can't be made.} other {# rows link to data outside this company, so a safety copy of your current data can't be made.}}"msgstr "{0, plural, one {# riga si collega ai dati al di fuori di questa Azienda, quindi non è possibile fare una copia di sicurezza dei dati attuali.} other {# righe si collegano ai dati al di fuori di questa Azienda, quindi non è possibile fare una copia di sicurezza dei dati attuali.}}"@@ -400,6 +404,9 @@ msgstr "{count} di {total} unità"msgid "{count} units"msgstr "{count} unità"+msgid "{created} created, {updated} updated."+msgstr ""+msgid "{days}d"msgstr "{days}g"@@ -424,6 +431,9 @@ msgstr "{from}–{to} di {count}"msgid "{from}–{to} of {count} operations"msgstr "{from}–{to} di {count} operazioni"+msgid "{hidden, plural, one {And # more record.} other {And # more records.}}"+msgstr ""+msgid "{hiddenCount} more: {hiddenNames}"msgstr "{hiddenCount} altri: {hiddenNames}"@@ -11371,12 +11381,22 @@ msgstr "Cognome"msgid "Last Name"msgstr "Cognome"+#. placeholder {0}: record.error+msgid "Last push {when} failed: {0}"+msgstr ""++msgid "Last push {when}:"+msgstr ""+msgid "Last Quarter"msgstr "Ultimo Trimestre"msgid "Last Run"msgstr "Ultima esecuzione"+msgid "Last scheduled push {when}:"+msgstr ""+msgid "Last synced: <0/>"msgstr "Ultimo sincronismo: <0/>"@@ -12524,6 +12544,9 @@ msgstr "Altre opzioni"msgid "More overtime"msgstr "Più straordinario"+msgid "More records are waiting. Push again to continue."+msgstr ""+msgid "Morning, {name}."msgstr "Mattino, {name}."@@ -12536,6 +12559,9 @@ msgstr "La maggior parte dei problemi viene identificata e risolta qui. Nominalamsgid "Motion"msgstr "Movimento"+msgid "Mount has {matches} records with this identifier. Delete or merge the extra ones in Mount, then push again."+msgstr ""+msgid "Move"msgstr "Sposta"@@ -19484,6 +19510,9 @@ msgstr "Inizia con"msgid "Started"msgstr "Iniziato"+msgid "Starting"+msgstr ""+msgid "Starting…"msgstr "Avvio in corso…"@@ -21002,6 +21031,15 @@ msgstr "Il provider non offre target di dimensione. Abilita prima la funzione nemsgid "The purchase order"msgstr "L'ordine di acquisto"+msgid "The push to Mount failed"+msgstr ""++msgid "The push to Mount finished"+msgstr ""++msgid "The push to Mount finished. Some records need attention"+msgstr ""+msgid "The quantity breakpoints this line is priced at; each column carries its own per-unit price for buyer–supplier negotiation and for converting to downstream documents."msgstr "I punti di rottura della quantità a cui questa riga è quotata; ogni colonna ha il proprio prezzo unitario per la negoziazione acquirente-fornitore e per la conversione a documenti a valle."diff --git a/packages/locale/locales/ja/erp.po b/packages/locale/locales/ja/erp.poindex 6d287138f1..7ceba4a907 100644--- a/packages/locale/locales/ja/erp.po+++ b/packages/locale/locales/ja/erp.po@@ -67,6 +67,10 @@ msgstr "{0, plural, one {# 日の不足} other {# 日の不足}}"msgid "{0, plural, one {# operation has no time standards} other {# operations have no time standards}}"msgstr "{0, plural, one {# 工程に標準時間がない} other {# 工程に標準時間がない}}"+#. placeholder {0}: issues.length+msgid "{0, plural, one {# record needs attention} other {# records need attention}}"+msgstr ""+#. placeholder {0}: totalScopeRows(run.violationRowsByTable)msgid "{0, plural, one {# row links to data outside this company, so a safety copy of your current data can't be made.} other {# rows link to data outside this company, so a safety copy of your current data can't be made.}}"msgstr "{0, plural, one {# 行はこの会社の外部のデータにリンクしているため、現在のデータの安全なコピーを作成できません。} other {# 行はこの会社の外部のデータにリンクしているため、現在のデータの安全なコピーを作成できません。}}"@@ -400,6 +404,9 @@ msgstr "{count} / {total} 個"msgid "{count} units"msgstr "{count} 個"+msgid "{created} created, {updated} updated."+msgstr ""+msgid "{days}d"msgstr "{days}日"@@ -424,6 +431,9 @@ msgstr "{from}–{to} / {count}"msgid "{from}–{to} of {count} operations"msgstr "{from}–{to} / {count} 件の工程"+msgid "{hidden, plural, one {And # more record.} other {And # more records.}}"+msgstr ""+msgid "{hiddenCount} more: {hiddenNames}"msgstr "{hiddenCount} 件さらに表示: {hiddenNames}"@@ -11371,12 +11381,22 @@ msgstr "姓"msgid "Last Name"msgstr "姓"+#. placeholder {0}: record.error+msgid "Last push {when} failed: {0}"+msgstr ""++msgid "Last push {when}:"+msgstr ""+msgid "Last Quarter"msgstr "前四半期"msgid "Last Run"msgstr "最終実行"+msgid "Last scheduled push {when}:"+msgstr ""+msgid "Last synced: <0/>"msgstr "最後に同期: <0/>"@@ -12524,6 +12544,9 @@ msgstr "その他のオプション"msgid "More overtime"msgstr "残業を増やす"+msgid "More records are waiting. Push again to continue."+msgstr ""+msgid "Morning, {name}."msgstr "朝、{name}さん。"@@ -12536,6 +12559,9 @@ msgstr "ほとんどのことはここで発見され、解決されます。明msgid "Motion"msgstr "モーション"+msgid "Mount has {matches} records with this identifier. Delete or merge the extra ones in Mount, then push again."+msgstr ""+msgid "Move"msgstr "移動"@@ -19484,6 +19510,9 @@ msgstr "まず"msgid "Started"msgstr "開始"+msgid "Starting"+msgstr ""+msgid "Starting…"msgstr "開始中…"@@ -21002,6 +21031,15 @@ msgstr "プロバイダーはディメンションターゲットを提供してmsgid "The purchase order"msgstr "発注書"+msgid "The push to Mount failed"+msgstr ""++msgid "The push to Mount finished"+msgstr ""++msgid "The push to Mount finished. Some records need attention"+msgstr ""+msgid "The quantity breakpoints this line is priced at; each column carries its own per-unit price for buyer–supplier negotiation and for converting to downstream documents."msgstr "この明細が価格設定される数量ブレークポイント。各列は買い手と仕入先の交渉および下流文書への変換用に、独自の単価を持ちます。"diff --git a/packages/locale/locales/ko/erp.po b/packages/locale/locales/ko/erp.poindex 9d1227e395..bd58816487 100644--- a/packages/locale/locales/ko/erp.po+++ b/packages/locale/locales/ko/erp.po@@ -67,6 +67,10 @@ msgstr "{0, plural, one {# 일 부족} other {# 일 부족}}"msgid "{0, plural, one {# operation has no time standards} other {# operations have no time standards}}"msgstr "{0, plural, one {# 공정에 표준시간이 없습니다} other {# 공정에 표준시간이 없습니다}}"+#. placeholder {0}: issues.length+msgid "{0, plural, one {# record needs attention} other {# records need attention}}"+msgstr ""+#. placeholder {0}: totalScopeRows(run.violationRowsByTable)msgid "{0, plural, one {# row links to data outside this company, so a safety copy of your current data can't be made.} other {# rows link to data outside this company, so a safety copy of your current data can't be made.}}"msgstr "{0, plural, one {# 행은 이 회사 외부의 데이터에 연결되어 있어서 현재 데이터의 안전한 사본을 만들 수 없습니다.} other {# 행은 이 회사 외부의 데이터에 연결되어 있어서 현재 데이터의 안전한 사본을 만들 수 없습니다.}}"@@ -400,6 +404,9 @@ msgstr "{count}/{total} 개"msgid "{count} units"msgstr "{count}개"+msgid "{created} created, {updated} updated."+msgstr ""+msgid "{days}d"msgstr "{days}일"@@ -424,6 +431,9 @@ msgstr "{count}개 중 {from}–{to}"msgid "{from}–{to} of {count} operations"msgstr "{from}–{to}/{count} 공정"+msgid "{hidden, plural, one {And # more record.} other {And # more records.}}"+msgstr ""+msgid "{hiddenCount} more: {hiddenNames}"msgstr "{hiddenCount}개 추가: {hiddenNames}"@@ -11371,12 +11381,22 @@ msgstr "성"msgid "Last Name"msgstr "성"+#. placeholder {0}: record.error+msgid "Last push {when} failed: {0}"+msgstr ""++msgid "Last push {when}:"+msgstr ""+msgid "Last Quarter"msgstr "지난 분기"msgid "Last Run"msgstr "마지막 실행"+msgid "Last scheduled push {when}:"+msgstr ""+msgid "Last synced: <0/>"msgstr "마지막 동기화: <0/>"@@ -12524,6 +12544,9 @@ msgstr "추가 옵션"msgid "More overtime"msgstr "초과 근무 증가"+msgid "More records are waiting. Push again to continue."+msgstr ""+msgid "Morning, {name}."msgstr "{name}님, 아침이군요."@@ -12536,6 +12559,9 @@ msgstr "대부분의 문제는 여기서 발견되고 해결됩니다. 명확하msgid "Motion"msgstr "모션"+msgid "Mount has {matches} records with this identifier. Delete or merge the extra ones in Mount, then push again."+msgstr ""+msgid "Move"msgstr "이동"@@ -19484,6 +19510,9 @@ msgstr "…부터 시작"msgid "Started"msgstr "시작됨"+msgid "Starting"+msgstr ""+msgid "Starting…"msgstr "시작 중…"@@ -21002,6 +21031,15 @@ msgstr "제공자가 차원 대상을 제공하지 않습니다. 먼저 제공msgid "The purchase order"msgstr "발주서"+msgid "The push to Mount failed"+msgstr ""++msgid "The push to Mount finished"+msgstr ""++msgid "The push to Mount finished. Some records need attention"+msgstr ""+msgid "The quantity breakpoints this line is priced at; each column carries its own per-unit price for buyer–supplier negotiation and for converting to downstream documents."msgstr "이 라인의 가격 책정 수량 구간점; 각 열은 구매자-공급업체 협상 및 다운스트림 문서로 변환하기 위한 자체 단가를 포함합니다."diff --git a/packages/locale/locales/pl/erp.po b/packages/locale/locales/pl/erp.poindex 0bf6b22a7b..e9018e706f 100644--- a/packages/locale/locales/pl/erp.po+++ b/packages/locale/locales/pl/erp.po@@ -67,6 +67,10 @@ msgstr "{0, plural, one {# dzień za krótko} few {# dni za krótko} many {# dnimsgid "{0, plural, one {# operation has no time standards} other {# operations have no time standards}}"msgstr "{0, plural, one {# operacja nie ma standardów czasu} few {# operacje nie mają standardów czasu} many {# operacji nie ma standardów czasu} other {# operacji nie ma standardów czasu}}"+#. placeholder {0}: issues.length+msgid "{0, plural, one {# record needs attention} other {# records need attention}}"+msgstr ""+#. placeholder {0}: totalScopeRows(run.violationRowsByTable)msgid "{0, plural, one {# row links to data outside this company, so a safety copy of your current data can't be made.} other {# rows link to data outside this company, so a safety copy of your current data can't be made.}}"msgstr "{0, plural, one {# wiersz łączy się z danymi spoza tej firmy, dlatego nie można utworzyć kopii bezpieczeństwa bieżących danych.} other {# wierszy łączy się z danymi spoza tej firmy, dlatego nie można utworzyć kopii bezpieczeństwa bieżących danych.}}"@@ -400,6 +404,9 @@ msgstr "{count} z {total} sztuk"msgid "{count} units"msgstr "{count} sztuk"+msgid "{created} created, {updated} updated."+msgstr ""+msgid "{days}d"msgstr "{days}d"@@ -424,6 +431,9 @@ msgstr "{from}–{to} z {count}"msgid "{from}–{to} of {count} operations"msgstr "{from}–{to} z {count} operacji"+msgid "{hidden, plural, one {And # more record.} other {And # more records.}}"+msgstr ""+msgid "{hiddenCount} more: {hiddenNames}"msgstr "{hiddenCount} więcej: {hiddenNames}"@@ -11371,12 +11381,22 @@ msgstr "Nazwisko"msgid "Last Name"msgstr "Nazwisko"+#. placeholder {0}: record.error+msgid "Last push {when} failed: {0}"+msgstr ""++msgid "Last push {when}:"+msgstr ""+msgid "Last Quarter"msgstr "Ostatni kwartał"msgid "Last Run"msgstr "Ostatnie uruchomienie"+msgid "Last scheduled push {when}:"+msgstr ""+msgid "Last synced: <0/>"msgstr "Ostatnia synchronizacja: <0/>"@@ -12524,6 +12544,9 @@ msgstr "Więcej opcji"msgid "More overtime"msgstr "Więcej nadgodzin"+msgid "More records are waiting. Push again to continue."+msgstr ""+msgid "Morning, {name}."msgstr "Poranek, {name}."@@ -12536,6 +12559,9 @@ msgstr "Większość rzeczy zostaje tutaj wychwycona i rozwiązana. Nazwij to jamsgid "Motion"msgstr "Ruch"+msgid "Mount has {matches} records with this identifier. Delete or merge the extra ones in Mount, then push again."+msgstr ""+msgid "Move"msgstr "Przenieś"@@ -19484,6 +19510,9 @@ msgstr "Zacznij od"msgid "Started"msgstr "Rozpoczęto"+msgid "Starting"+msgstr ""+msgid "Starting…"msgstr "Uruchamianie…"@@ -21002,6 +21031,15 @@ msgstr "Dostawca nie oferuje celów wymiarów. Najpierw włącz funkcję u dostamsgid "The purchase order"msgstr "Zamówienie zakupu"+msgid "The push to Mount failed"+msgstr ""++msgid "The push to Mount finished"+msgstr ""++msgid "The push to Mount finished. Some records need attention"+msgstr ""+msgid "The quantity breakpoints this line is priced at; each column carries its own per-unit price for buyer–supplier negotiation and for converting to downstream documents."msgstr "Punkty graniczne ilości, przy których ta pozycja jest wyceniona; każda kolumna nosi własną cenę za sztukę do negocjacji kupiec–dostawca i do konwersji na dokumenty następujące."diff --git a/packages/locale/locales/pt/erp.po b/packages/locale/locales/pt/erp.poindex 8595c05359..316d35df4d 100644--- a/packages/locale/locales/pt/erp.po+++ b/packages/locale/locales/pt/erp.po@@ -67,6 +67,10 @@ msgstr "{0, plural, one {# dia de falta} other {# dias de falta}}"msgid "{0, plural, one {# operation has no time standards} other {# operations have no time standards}}"msgstr "{0, plural, one {# operação não tem padrões de tempo} other {# operações não têm padrões de tempo}}"+#. placeholder {0}: issues.length+msgid "{0, plural, one {# record needs attention} other {# records need attention}}"+msgstr ""+#. placeholder {0}: totalScopeRows(run.violationRowsByTable)msgid "{0, plural, one {# row links to data outside this company, so a safety copy of your current data can't be made.} other {# rows link to data outside this company, so a safety copy of your current data can't be made.}}"msgstr "{0, plural, one {# linha vincula dados fora desta empresa, portanto uma cópia de segurança de seus dados atuais não pode ser feita.} other {# linhas vinculam dados fora desta empresa, portanto uma cópia de segurança de seus dados atuais não pode ser feita.}}"@@ -400,6 +404,9 @@ msgstr "{count} de {total} unidades"msgid "{count} units"msgstr "{count} unidades"+msgid "{created} created, {updated} updated."+msgstr ""+msgid "{days}d"msgstr "{days}d"@@ -424,6 +431,9 @@ msgstr "{from}–{to} de {count}"msgid "{from}–{to} of {count} operations"msgstr "{from}–{to} de {count} operações"+msgid "{hidden, plural, one {And # more record.} other {And # more records.}}"+msgstr ""+msgid "{hiddenCount} more: {hiddenNames}"msgstr "{hiddenCount} mais: {hiddenNames}"@@ -11371,12 +11381,22 @@ msgstr "Sobrenome"msgid "Last Name"msgstr "Sobrenome"+#. placeholder {0}: record.error+msgid "Last push {when} failed: {0}"+msgstr ""++msgid "Last push {when}:"+msgstr ""+msgid "Last Quarter"msgstr "Último Trimestre"msgid "Last Run"msgstr "Última execução"+msgid "Last scheduled push {when}:"+msgstr ""+msgid "Last synced: <0/>"msgstr "Última sincronização: <0/>"@@ -12524,6 +12544,9 @@ msgstr "Mais opções"msgid "More overtime"msgstr "Mais horas extras"+msgid "More records are waiting. Push again to continue."+msgstr ""+msgid "Morning, {name}."msgstr "Bom dia, {name}."@@ -12536,6 +12559,9 @@ msgstr "A maioria das coisas é detectada e resolvida aqui. Nomeie-a claramente.msgid "Motion"msgstr "Movimento"+msgid "Mount has {matches} records with this identifier. Delete or merge the extra ones in Mount, then push again."+msgstr ""+msgid "Move"msgstr "Mover"@@ -19484,6 +19510,9 @@ msgstr "Comece com"msgid "Started"msgstr "Iniciado"+msgid "Starting"+msgstr ""+msgid "Starting…"msgstr "Iniciando…"@@ -21002,6 +21031,15 @@ msgstr "O provedor não oferece alvos de dimensão. Habilite o recurso no provedmsgid "The purchase order"msgstr "O pedido de compra"+msgid "The push to Mount failed"+msgstr ""++msgid "The push to Mount finished"+msgstr ""++msgid "The push to Mount finished. Some records need attention"+msgstr ""+msgid "The quantity breakpoints this line is priced at; each column carries its own per-unit price for buyer–supplier negotiation and for converting to downstream documents."msgstr "Os pontos de ruptura de quantidade em que essa linha é precificada; cada coluna possui seu próprio preço por unidade para negociação comprador-fornecedor e conversão para documentos posteriores."diff --git a/packages/locale/locales/ru/erp.po b/packages/locale/locales/ru/erp.poindex 90e23e04d4..2269d33fcf 100644--- a/packages/locale/locales/ru/erp.po+++ b/packages/locale/locales/ru/erp.po@@ -67,6 +67,10 @@ msgstr "{0, plural, one {# день недостатка} few {# дня недоmsgid "{0, plural, one {# operation has no time standards} other {# operations have no time standards}}"msgstr "{0, plural, one {# операция не имеет временных нормативов} few {# операции не имеют временных нормативов} many {# операций не имеют временных нормативов} other {# операций не имеют временных нормативов}}"+#. placeholder {0}: issues.length+msgid "{0, plural, one {# record needs attention} other {# records need attention}}"+msgstr ""+#. placeholder {0}: totalScopeRows(run.violationRowsByTable)msgid "{0, plural, one {# row links to data outside this company, so a safety copy of your current data can't be made.} other {# rows link to data outside this company, so a safety copy of your current data can't be made.}}"msgstr "{0, plural, one {# строка связана с данными вне этой организации, поэтому резервная копия ваших текущих данных не может быть создана.} other {# строк связаны с данными вне этой организации, поэтому резервная копия ваших текущих данных не может быть создана.}}"@@ -400,6 +404,9 @@ msgstr "{count} из {total} единиц"msgid "{count} units"msgstr "{count} единиц"+msgid "{created} created, {updated} updated."+msgstr ""+msgid "{days}d"msgstr "{days}д"@@ -424,6 +431,9 @@ msgstr "{from}–{to} из {count}"msgid "{from}–{to} of {count} operations"msgstr "{from}–{to} из {count} операций"+msgid "{hidden, plural, one {And # more record.} other {And # more records.}}"+msgstr ""+msgid "{hiddenCount} more: {hiddenNames}"msgstr "{hiddenCount} еще: {hiddenNames}"@@ -11371,12 +11381,22 @@ msgstr "Фамилия"msgid "Last Name"msgstr "Фамилия"+#. placeholder {0}: record.error+msgid "Last push {when} failed: {0}"+msgstr ""++msgid "Last push {when}:"+msgstr ""+msgid "Last Quarter"msgstr "Последний квартал"msgid "Last Run"msgstr "Последний запуск"+msgid "Last scheduled push {when}:"+msgstr ""+msgid "Last synced: <0/>"msgstr "Последняя синхронизация: <0/>"@@ -12524,6 +12544,9 @@ msgstr "Ещё опции"msgid "More overtime"msgstr "Больше переработки"+msgid "More records are waiting. Push again to continue."+msgstr ""+msgid "Morning, {name}."msgstr "Доброе утро, {name}."@@ -12536,6 +12559,9 @@ msgstr "Большинство проблем выявляются и решаюmsgid "Motion"msgstr "Движение"+msgid "Mount has {matches} records with this identifier. Delete or merge the extra ones in Mount, then push again."+msgstr ""+msgid "Move"msgstr "Переместить"@@ -19484,6 +19510,9 @@ msgstr "Начните с"msgid "Started"msgstr "Начал"+msgid "Starting"+msgstr ""+msgid "Starting…"msgstr "Начинаю…"@@ -21002,6 +21031,15 @@ msgstr "Поставщик не предлагает целевые показаmsgid "The purchase order"msgstr "Заказ поставщику"+msgid "The push to Mount failed"+msgstr ""++msgid "The push to Mount finished"+msgstr ""++msgid "The push to Mount finished. Some records need attention"+msgstr ""+msgid "The quantity breakpoints this line is priced at; each column carries its own per-unit price for buyer–supplier negotiation and for converting to downstream documents."msgstr "Точки разрыва по количеству, при которых рассчитывается цена этой строки; каждый столбец содержит свою цену за единицу для переговоров между закупщиком и поставщиком и для преобразования в последующие документы."diff --git a/packages/locale/locales/tr/erp.po b/packages/locale/locales/tr/erp.poindex edf9b22b5f..16106ab8d6 100644--- a/packages/locale/locales/tr/erp.po+++ b/packages/locale/locales/tr/erp.po@@ -67,6 +67,10 @@ msgstr "{0, plural, one {# gün gecikme} other {# gün gecikme}}"msgid "{0, plural, one {# operation has no time standards} other {# operations have no time standards}}"msgstr "{0, plural, one {# operasyon için zaman standardı yok} other {# operasyon için zaman standardı yok}}"+#. placeholder {0}: issues.length+msgid "{0, plural, one {# record needs attention} other {# records need attention}}"+msgstr ""+#. placeholder {0}: totalScopeRows(run.violationRowsByTable)msgid "{0, plural, one {# row links to data outside this company, so a safety copy of your current data can't be made.} other {# rows link to data outside this company, so a safety copy of your current data can't be made.}}"msgstr "{0, plural, one {# satır bu şirketin dışındaki verilere bağlantı kuruyor, bu nedenle mevcut verilerinizin güvenli bir kopyası oluşturulamıyor.} other {# satır bu şirketin dışındaki verilere bağlantı kuruyor, bu nedenle mevcut verilerinizin güvenli bir kopyası oluşturulamıyor.}}"@@ -400,6 +404,9 @@ msgstr "{count}/{total} adet"msgid "{count} units"msgstr "{count} adet"+msgid "{created} created, {updated} updated."+msgstr ""+msgid "{days}d"msgstr "{days}g"@@ -424,6 +431,9 @@ msgstr "{from}–{to} / {count}"msgid "{from}–{to} of {count} operations"msgstr "{from}–{to} /{count} operasyon"+msgid "{hidden, plural, one {And # more record.} other {And # more records.}}"+msgstr ""+msgid "{hiddenCount} more: {hiddenNames}"msgstr "{hiddenCount} daha: {hiddenNames}"@@ -11371,12 +11381,22 @@ msgstr "Soyadı"msgid "Last Name"msgstr "Soyadı"+#. placeholder {0}: record.error+msgid "Last push {when} failed: {0}"+msgstr ""++msgid "Last push {when}:"+msgstr ""+msgid "Last Quarter"msgstr "Son Çeyrek"msgid "Last Run"msgstr "Son Çalıştırma"+msgid "Last scheduled push {when}:"+msgstr ""+msgid "Last synced: <0/>"msgstr "Son senkronizasyon: <0/>"@@ -12524,6 +12544,9 @@ msgstr "Daha fazla seçenek"msgid "More overtime"msgstr "Daha fazla fazla mesai"+msgid "More records are waiting. Push again to continue."+msgstr ""+msgid "Morning, {name}."msgstr "Sabah, {name}."@@ -12536,6 +12559,9 @@ msgstr "Çoğu şey burada yakalanır ve çözülür. Açıkça adlandırın."msgid "Motion"msgstr "Hareket"+msgid "Mount has {matches} records with this identifier. Delete or merge the extra ones in Mount, then push again."+msgstr ""+msgid "Move"msgstr "Taşış"@@ -19484,6 +19510,9 @@ msgstr "Başla"msgid "Started"msgstr "Başlangıç"+msgid "Starting"+msgstr ""+msgid "Starting…"msgstr "Başlanıyor…"@@ -21002,6 +21031,15 @@ msgstr "Sağlayıcı boyut hedefleri sunmaz. Önce sağlayıcıda özelliği etkmsgid "The purchase order"msgstr "Satın alma siparişi"+msgid "The push to Mount failed"+msgstr ""++msgid "The push to Mount finished"+msgstr ""++msgid "The push to Mount finished. Some records need attention"+msgstr ""+msgid "The quantity breakpoints this line is priced at; each column carries its own per-unit price for buyer–supplier negotiation and for converting to downstream documents."msgstr "Bu Satırın fiyatlandırıldığı Miktar kırılım noktaları; her sütun Satın almacı–Tedarikçi müzakereleri ve aşağı yönlü belgelere dönüştürme için kendi birim başına Fiyatını taşır."diff --git a/packages/locale/locales/zh/erp.po b/packages/locale/locales/zh/erp.poindex 1bba309173..089e165e3c 100644--- a/packages/locale/locales/zh/erp.po+++ b/packages/locale/locales/zh/erp.po@@ -67,6 +67,10 @@ msgstr "{0, plural, one {缺# 天} other {缺# 天}}"msgid "{0, plural, one {# operation has no time standards} other {# operations have no time standards}}"msgstr "{0, plural, one {# 道工序无工时定额} other {# 道工序无工时定额}}"+#. placeholder {0}: issues.length+msgid "{0, plural, one {# record needs attention} other {# records need attention}}"+msgstr ""+#. placeholder {0}: totalScopeRows(run.violationRowsByTable)msgid "{0, plural, one {# row links to data outside this company, so a safety copy of your current data can't be made.} other {# rows link to data outside this company, so a safety copy of your current data can't be made.}}"msgstr "{0, plural, one {# 行链接到该公司外的数据,无法制作当前数据的安全副本。} other {# 行链接到该公司外的数据,无法制作当前数据的安全副本。}}"@@ -400,6 +404,9 @@ msgstr "{count} / {total} 件"msgid "{count} units"msgstr "{count} 件"+msgid "{created} created, {updated} updated."+msgstr ""+msgid "{days}d"msgstr "{days}天"@@ -424,6 +431,9 @@ msgstr "{from}–{to} 共 {count}"msgid "{from}–{to} of {count} operations"msgstr "第{from}–{to}个工序(共{count}个)"+msgid "{hidden, plural, one {And # more record.} other {And # more records.}}"+msgstr ""+msgid "{hiddenCount} more: {hiddenNames}"msgstr "还有{hiddenCount}个:{hiddenNames}"@@ -11371,12 +11381,22 @@ msgstr "姓氏"msgid "Last Name"msgstr "姓氏"+#. placeholder {0}: record.error+msgid "Last push {when} failed: {0}"+msgstr ""++msgid "Last push {when}:"+msgstr ""+msgid "Last Quarter"msgstr "上一季度"msgid "Last Run"msgstr "最后运行"+msgid "Last scheduled push {when}:"+msgstr ""+msgid "Last synced: <0/>"msgstr "上次同步: <0/>"@@ -12524,6 +12544,9 @@ msgstr "更多选项"msgid "More overtime"msgstr "更多加班"+msgid "More records are waiting. Push again to continue."+msgstr ""+msgid "Morning, {name}."msgstr "早上,{name}。"@@ -12536,6 +12559,9 @@ msgstr "大多数问题在这里都会被发现和解决。直言不讳地说出msgid "Motion"msgstr "运动"+msgid "Mount has {matches} records with this identifier. Delete or merge the extra ones in Mount, then push again."+msgstr ""+msgid "Move"msgstr "移动"@@ -19484,6 +19510,9 @@ msgstr "从以下开始"msgid "Started"msgstr "开始于"+msgid "Starting"+msgstr ""+msgid "Starting…"msgstr "正在启动…"@@ -21002,6 +21031,15 @@ msgstr "提供商不提供维度目标。首先在提供商中启用该功能(msgid "The purchase order"msgstr "采购订单"+msgid "The push to Mount failed"+msgstr ""++msgid "The push to Mount finished"+msgstr ""++msgid "The push to Mount finished. Some records need attention"+msgstr ""+msgid "The quantity breakpoints this line is priced at; each column carries its own per-unit price for buyer–supplier negotiation and for converting to downstream documents."msgstr "此行定价的数量断点;每一列都有自己的单位价格,用于采购方–供应商谈判和转换为下游文件。"