Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

feat: add maintenance detail execution view in mes

Brad Barbin2b24bcbe4311
diff --git a/apps/erp/app/modules/production/production.models.ts b/apps/erp/app/modules/production/production.models.ts
index a1b66138c7..41644b3dee 100644
--- a/apps/erp/app/modules/production/production.models.ts
+++ b/apps/erp/app/modules/production/production.models.ts
@@ -903,7 +903,6 @@ export const maintenanceDispatchValidator = z.object({
plannedStartTime: zfd.text(z.string().optional()),
plannedEndTime: zfd.text(z.string().optional()),
assignee: zfd.text(z.string().optional()),
- isFailure: zfd.checkbox(),
content: zfd.text(z.string().optional())
});
diff --git a/apps/erp/app/modules/production/ui/Maintenance/MaintenanceDispatchForm.tsx b/apps/erp/app/modules/production/ui/Maintenance/MaintenanceDispatchForm.tsx
index 21bb4e33b5..d6ed8d4ff1 100644
--- a/apps/erp/app/modules/production/ui/Maintenance/MaintenanceDispatchForm.tsx
+++ b/apps/erp/app/modules/production/ui/Maintenance/MaintenanceDispatchForm.tsx
@@ -1,5 +1,5 @@
import { useCarbon } from "@carbon/auth";
-import { Boolean, DateTimePicker, Select, ValidatedForm } from "@carbon/form";
+import { DateTimePicker, Select, ValidatedForm } from "@carbon/form";
import type { JSONContent } from "@carbon/react";
import {
Card,
@@ -27,7 +27,8 @@ import {
maintenanceDispatchPriority,
maintenanceDispatchValidator,
maintenanceSeverity,
- maintenanceSource
+ maintenanceSource,
+ oeeImpact
} from "../../production.models";
import MaintenanceSeverity from "./MaintenanceSeverity";
import MaintenanceSource from "./MaintenanceSource";
@@ -73,10 +74,13 @@ const MaintenanceDispatchForm = ({
: {}
);
- const [isFailure, setIsFailure] = useState<boolean>(
- initialValues?.isFailure ?? false
+ const [oeeImpactValue, setOeeImpactValue] = useState<string>(
+ initialValues?.oeeImpact ?? "No Impact"
);
+ const showFailureModes =
+ oeeImpactValue === "Down" || oeeImpactValue === "Impact";
+
const onUploadImage = async (file: File) => {
const fileType = file.name.split(".").pop();
const fileName = `${companyId}/maintenance/${nanoid()}.${fileType}`;
@@ -161,12 +165,20 @@ const MaintenanceDispatchForm = ({
}))}
/>
<WorkCenter name="workCenterId" label="Work Center" />
- <Boolean
- name="isFailure"
- label="Failure"
- onChange={(checked) => setIsFailure(checked)}
+ <Select
+ name="oeeImpact"
+ label="OEE Impact"
+ options={oeeImpact.map((impact) => ({
+ value: impact,
+ label: impact
+ }))}
+ onChange={(option) => {
+ if (option?.value) {
+ setOeeImpactValue(option.value);
+ }
+ }}
/>
- {isFailure ? (
+ {showFailureModes ? (
<Select
name="suspectedFailureModeId"
label="Suspected Failure Mode"
diff --git a/apps/erp/app/modules/production/ui/Maintenance/MaintenanceDispatchProperties.tsx b/apps/erp/app/modules/production/ui/Maintenance/MaintenanceDispatchProperties.tsx
index f99d939ca0..fe212ac9bf 100644
--- a/apps/erp/app/modules/production/ui/Maintenance/MaintenanceDispatchProperties.tsx
+++ b/apps/erp/app/modules/production/ui/Maintenance/MaintenanceDispatchProperties.tsx
@@ -1,4 +1,4 @@
-import { Boolean, DateTimePicker, Select, ValidatedForm } from "@carbon/form";
+import { DateTimePicker, Select, ValidatedForm } from "@carbon/form";
import {
Button,
HStack,
@@ -12,7 +12,6 @@ import { useCallback, useEffect, useMemo, useState } from "react";
import { LuCopy, LuKeySquare, LuLink } from "react-icons/lu";
import { useFetcher, useParams } from "react-router";
import { z } from "zod/v3";
-import { zfd } from "zod-form-data";
import {
Assignee,
EmployeeAvatar,
@@ -79,10 +78,13 @@ const MaintenanceDispatchProperties = () => {
const isCompleted = routeData?.dispatch?.status === "Completed";
- const [isFailure, setIsFailure] = useState<boolean>(
- routeData?.dispatch?.isFailure ?? false
+ const [currentOeeImpact, setCurrentOeeImpact] = useState<string>(
+ routeData?.dispatch?.oeeImpact ?? "No Impact"
);
+ const showFailureModes =
+ currentOeeImpact === "Down" || currentOeeImpact === "Impact";
+
return (
<VStack
spacing={4}
@@ -323,6 +325,7 @@ const MaintenanceDispatchProperties = () => {
}}
onChange={(value) => {
if (value) {
+ setCurrentOeeImpact(value.value);
onUpdate("oeeImpact", value.value);
}
}}
@@ -409,28 +412,7 @@ const MaintenanceDispatchProperties = () => {
/>
</ValidatedForm>
- <ValidatedForm
- defaultValues={{
- isFailure: routeData?.dispatch?.isFailure ?? false
- }}
- validator={z.object({
- isFailure: zfd.checkbox()
- })}
- className="w-full"
- >
- <Boolean
- name="isFailure"
- label="Failure"
- variant="small"
- isDisabled={!permissions.can("update", "production")}
- onChange={(checked) => {
- setIsFailure(checked);
- onUpdate("isFailure", checked.toString());
- }}
- />
- </ValidatedForm>
-
- {isFailure && (
+ {showFailureModes && (
<>
<ValidatedForm
defaultValues={{
diff --git a/apps/erp/app/routes/x+/maintenance+/new.tsx b/apps/erp/app/routes/x+/maintenance+/new.tsx
index a8331f3d6a..3110148707 100644
--- a/apps/erp/app/routes/x+/maintenance+/new.tsx
+++ b/apps/erp/app/routes/x+/maintenance+/new.tsx
@@ -73,12 +73,12 @@ export async function action({ request }: ActionFunctionArgs) {
priority: validation.data.priority,
severity: validation.data.severity || "Maintenance Required",
source: validation.data.source || "Reactive",
+ oeeImpact: validation.data.oeeImpact || "No Impact",
workCenterId: validation.data.workCenterId || undefined,
assignee: validation.data.assignee || undefined,
suspectedFailureModeId: validation.data.suspectedFailureModeId || undefined,
plannedStartTime: validation.data.plannedStartTime || undefined,
plannedEndTime: validation.data.plannedEndTime || undefined,
- isFailure: validation.data.isFailure || false,
content,
companyId,
createdBy: userId
@@ -116,7 +116,7 @@ export default function NewMaintenanceDispatchRoute() {
priority: "Medium" as const,
source: "Reactive" as const,
severity: "Maintenance Required" as const,
- isFailure: false
+ oeeImpact: "No Impact" as const
};
return (
diff --git a/apps/erp/app/routes/x+/maintenance+/update.tsx b/apps/erp/app/routes/x+/maintenance+/update.tsx
index dc6a3eebb9..75b36ae2f4 100644
--- a/apps/erp/app/routes/x+/maintenance+/update.tsx
+++ b/apps/erp/app/routes/x+/maintenance+/update.tsx
@@ -41,9 +41,6 @@ export async function action({ request }: ActionFunctionArgs) {
case "actualEndTime":
updateData[field] = value ? new Date(value).toISOString() : null;
break;
- case "isFailure":
- updateData[field] = value === "true";
- break;
default:
return {
error: { message: `Invalid field: ${field}` },
diff --git a/apps/mes/app/components/JobOperation/components/MaintenanceDispatch.tsx b/apps/mes/app/components/JobOperation/components/MaintenanceDispatch.tsx
index ba12cff5dc..950a9ca49a 100644
--- a/apps/mes/app/components/JobOperation/components/MaintenanceDispatch.tsx
+++ b/apps/mes/app/components/JobOperation/components/MaintenanceDispatch.tsx
@@ -1,6 +1,5 @@
import { useCarbon } from "@carbon/auth";
import {
- Boolean,
DateTimePicker,
Hidden,
Select,
@@ -94,9 +93,10 @@ export function MaintenanceDispatch({
const { carbon } = useCarbon();
const [content, setContent] = useState<JSONContent>({});
- const [isFailure, setIsFailure] = useState(false);
const [severity, setSeverity] =
useState<(typeof maintenanceSeverity)[number]>("Operator Performed");
+ const [oeeImpactValue, setOeeImpactValue] =
+ useState<(typeof oeeImpact)[number]>("No Impact");
const [actualStartTime, setActualStartTime] = useState<string>(
new Date().toISOString()
);
@@ -111,8 +111,8 @@ export function MaintenanceDispatch({
const onClose = () => {
setContent({});
- setIsFailure(false);
setSeverity("Operator Performed");
+ setOeeImpactValue("No Impact");
setActualStartTime(new Date().toISOString());
setActualEndTime("");
disclosure.onClose();
@@ -170,11 +170,10 @@ export function MaintenanceDispatch({
<ModalContent size="xlarge">
<ValidatedForm
method="post"
- action={path.to.maintenanceDispatch}
+ action={path.to.newMaintenanceDispatch}
validator={maintenanceDispatchValidator}
defaultValues={{
workCenterId: workCenter.id,
- isFailure: false,
priority: "Medium",
severity: "Operator Performed",
oeeImpact: "No Impact",
@@ -188,8 +187,6 @@ export function MaintenanceDispatch({
<ModalBody>
<Hidden name="workCenterId" value={workCenter.id} />
<Hidden name="content" value={JSON.stringify(content)} />
- <Hidden name="actualStartTime" value={actualStartTime} />
- <Hidden name="actualEndTime" value={actualEndTime} />
<VStack spacing={4}>
<div className="flex flex-col gap-2 w-full">
<Label>Description</Label>
@@ -231,39 +228,41 @@ export function MaintenanceDispatch({
}
}}
/>
- <Select
- name="oeeImpact"
- label="OEE Impact"
- options={oeeImpact.map((impact) => ({
- value: impact,
- label: impact
- }))}
- />
{severity === "Operator Performed" && (
<>
<DateTimePicker
- name="actualStartTimeDisplay"
+ name="actualStartTime"
label="Start Time"
- defaultValue={actualStartTime}
onChange={(value) => {
- if (value) setActualStartTime(value.toISOString());
+ if (value) setActualStartTime(value.toString());
}}
/>
<DateTimePicker
- name="actualEndTimeDisplay"
+ name="actualEndTime"
label="End Time"
onChange={(value) => {
- if (value) setActualEndTime(value.toISOString());
+ if (value) setActualEndTime(value.toString());
}}
/>
</>
)}
- <Boolean
- name="isFailure"
- label="Failure"
- onChange={(checked) => setIsFailure(checked)}
+ <Select
+ name="oeeImpact"
+ label="OEE Impact"
+ options={oeeImpact.map((impact) => ({
+ value: impact,
+ label: impact
+ }))}
+ onChange={(option) => {
+ if (option?.value) {
+ setOeeImpactValue(
+ option.value as (typeof oeeImpact)[number]
+ );
+ }
+ }}
/>
- {isFailure &&
+ {(oeeImpactValue === "Down" ||
+ oeeImpactValue === "Impact") &&
failureModes.length > 0 &&
(severity === "Operator Performed" ? (
<Select
diff --git a/apps/mes/app/routes/x+/maintenance.$dispatchId.tsx b/apps/mes/app/routes/x+/dispatch.$dispatchId.tsx
similarity index 88%
rename from apps/mes/app/routes/x+/maintenance.$dispatchId.tsx
rename to apps/mes/app/routes/x+/dispatch.$dispatchId.tsx
index 03c32dbfea..1a2aff3ad9 100644
--- a/apps/mes/app/routes/x+/maintenance.$dispatchId.tsx
+++ b/apps/mes/app/routes/x+/dispatch.$dispatchId.tsx
@@ -1,4 +1,5 @@
import { requirePermissions } from "@carbon/auth/auth.server";
+import { Database } from "@carbon/database";
import { Hidden, ValidatedForm } from "@carbon/form";
import {
Badge,
@@ -6,6 +7,7 @@ import {
Heading,
HStack,
SidebarTrigger,
+ Status,
VStack
} from "@carbon/react";
import { useEffect, useMemo } from "react";
@@ -23,6 +25,7 @@ import { z } from "zod/v3";
import { HighPriorityIcon } from "~/assets/icons/HighPriorityIcon";
import { LowPriorityIcon } from "~/assets/icons/LowPriorityIcon";
import { MediumPriorityIcon } from "~/assets/icons/MediumPriorityIcon";
+import EmployeeAvatar from "~/components/EmployeeAvatar";
import {
getActiveMaintenanceEventByEmployee,
getMaintenanceDispatch,
@@ -71,29 +74,58 @@ function getPriorityIcon(
}
}
-function getStatusBadge(status: string) {
+type MaintenanceStatusProps = {
+ status?: Database["public"]["Enums"]["maintenanceDispatchStatus"];
+ className?: string;
+};
+
+function MaintenanceStatus({ status, className }: MaintenanceStatusProps) {
switch (status) {
case "Open":
- return <Badge variant="secondary">Open</Badge>;
+ return (
+ <Status color="gray" className={className}>
+ {status}
+ </Status>
+ );
case "Assigned":
- return <Badge variant="outline">Assigned</Badge>;
+ return (
+ <Status color="yellow" className={className}>
+ {status}
+ </Status>
+ );
case "In Progress":
- return <Badge className="bg-emerald-500">In Progress</Badge>;
+ return (
+ <Status color="blue" className={className}>
+ {status}
+ </Status>
+ );
case "Completed":
- return <Badge>Completed</Badge>;
+ return (
+ <Status color="green" className={className}>
+ {status}
+ </Status>
+ );
+ case "Cancelled":
+ return (
+ <Status color="red" className={className}>
+ {status}
+ </Status>
+ );
default:
- return <Badge variant="outline">{status}</Badge>;
+ return null;
}
}
-function getOeeImpactBadge(oeeImpact: string | null) {
+function getOeeImpactBadge(
+ oeeImpact: Database["public"]["Enums"]["oeeImpact"]
+) {
switch (oeeImpact) {
case "Down":
return <Badge variant="destructive">Down</Badge>;
case "Planned":
return <Badge variant="secondary">Planned</Badge>;
case "Impact":
- return <Badge variant="outline">Impact</Badge>;
+ return <Badge variant="yellow">Impact</Badge>;
default:
return <Badge variant="outline">No Impact</Badge>;
}
@@ -116,7 +148,7 @@ const eventValidator = z.object({
});
export default function MaintenanceDetailRoute() {
- const { dispatch, events, items, activeEvent, userId } =
+ const { dispatch, events, items, activeEvent } =
useLoaderData<typeof loader>();
const fetcher = useFetcher();
@@ -159,9 +191,8 @@ export default function MaintenanceDetailRoute() {
<LuArrowLeft className="h-4 w-4" />
</Button>
</Link>
- <LuWrench className="h-4 w-4" />
<Heading size="h4">{dispatch.maintenanceDispatchId}</Heading>
- {getStatusBadge(dispatch.status)}
+ <MaintenanceStatus status={dispatch.status} />
</HStack>
<HStack>
{getPriorityIcon(
@@ -172,7 +203,7 @@ export default function MaintenanceDetailRoute() {
</header>
<main className="h-[calc(100dvh-var(--header-height))] w-full overflow-y-auto scrollbar-thin scrollbar-thumb-accent scrollbar-track-transparent p-4">
- <VStack spacing={6} className="max-w-2xl mx-auto">
+ <VStack spacing={4} className="max-w-2xl mx-auto">
{/* Work Center & OEE Impact */}
<div className="w-full p-4 bg-card rounded-lg border">
<VStack spacing={2} className="items-start">
@@ -217,7 +248,7 @@ export default function MaintenanceDetailRoute() {
<Button
type="submit"
size="lg"
- variant={isWorking ? "destructive" : "default"}
+ variant={isWorking ? "destructive" : "primary"}
className="h-16 w-16 rounded-full"
disabled={fetcher.state !== "idle"}
>
@@ -247,7 +278,7 @@ export default function MaintenanceDetailRoute() {
<Button
type="submit"
size="lg"
- variant="outline"
+ variant="secondary"
className="h-16 w-16 rounded-full"
disabled={fetcher.state !== "idle"}
>
@@ -276,10 +307,12 @@ export default function MaintenanceDetailRoute() {
key={event.id}
className="py-2 flex justify-between items-center"
>
- <VStack spacing={0} className="items-start">
- <span className="text-sm">
- {event.employee?.fullName ?? "Unknown"}
- </span>
+ <VStack spacing={2} className="items-start">
+ <EmployeeAvatar
+ employeeId={event.employeeId}
+ size="xs"
+ />
+
<span className="text-xs text-muted-foreground">
{new Date(event.startTime).toLocaleString()}
{event.endTime &&
diff --git a/apps/mes/app/routes/x+/maintenance-dispatch.tsx b/apps/mes/app/routes/x+/dispatch.new.tsx
similarity index 77%
rename from apps/mes/app/routes/x+/maintenance-dispatch.tsx
rename to apps/mes/app/routes/x+/dispatch.new.tsx
index 679197c086..75ac23f75c 100644
--- a/apps/mes/app/routes/x+/maintenance-dispatch.tsx
+++ b/apps/mes/app/routes/x+/dispatch.new.tsx
@@ -7,8 +7,11 @@ import {
import { requirePermissions } from "@carbon/auth/auth.server";
import { flash } from "@carbon/auth/session.server";
import { validationError, validator } from "@carbon/form";
-import { type ActionFunctionArgs, data } from "react-router";
+import { getLocalTimeZone, now } from "@internationalized/date";
+import { type ActionFunctionArgs, data, redirect } from "react-router";
import { maintenanceDispatchValidator } from "~/services/models";
+import { endProductionEventsByWorkCenter } from "~/services/operations.service";
+import { path } from "~/utils/path";
export async function action({ request }: ActionFunctionArgs) {
assertIsPost(request);
@@ -64,10 +67,10 @@ export async function action({ request }: ActionFunctionArgs) {
oeeImpact: validation.data.oeeImpact,
source: "Reactive", // Coming from MES is always reactive
workCenterId: validation.data.workCenterId,
+ assignee: isOperatorPerformed ? userId : undefined,
suspectedFailureModeId:
validation.data.suspectedFailureModeId || undefined,
actualFailureModeId: validation.data.actualFailureModeId || undefined,
- isFailure: validation.data.isFailure || false,
actualStartTime: validation.data.actualStartTime || undefined,
actualEndTime: validation.data.actualEndTime || undefined,
content,
@@ -88,6 +91,19 @@ export async function action({ request }: ActionFunctionArgs) {
);
}
+ // End all production events for the work center if oeeImpact is Down
+ if (validation.data.oeeImpact === "Down") {
+ await endProductionEventsByWorkCenter(serviceRole, {
+ workCenterId: validation.data.workCenterId,
+ companyId,
+ endTime: now(getLocalTimeZone()).toAbsoluteString()
+ });
+ }
+
+ if (insertDispatch.data?.id && isOperatorPerformed) {
+ throw redirect(path.to.maintenanceDetail(insertDispatch.data.id));
+ }
+
return data(
{ id: insertDispatch.data?.id },
await flash(request, success("Maintenance dispatch created"))
diff --git a/apps/mes/app/routes/x+/maintenance.tsx b/apps/mes/app/routes/x+/maintenance.tsx
index 6cb18ec801..6d509dabd1 100644
--- a/apps/mes/app/routes/x+/maintenance.tsx
+++ b/apps/mes/app/routes/x+/maintenance.tsx
@@ -1,3 +1,4 @@
+import { getCarbonServiceRole } from "@carbon/auth";
import { requirePermissions } from "@carbon/auth/auth.server";
import {
Badge,
@@ -34,8 +35,12 @@ import type { maintenanceDispatchPriority } from "~/services/models";
import { path } from "~/utils/path";
export async function loader({ request }: LoaderFunctionArgs) {
- const { client, userId } = await requirePermissions(request, {});
- const { location } = await getLocation(request, client);
+ const { client, companyId, userId } = await requirePermissions(request, {});
+ const serviceRole = await getCarbonServiceRole();
+ const { location } = await getLocation(request, serviceRole, {
+ companyId,
+ userId
+ });
const [allDispatches, assignedDispatches] = await Promise.all([
getActiveMaintenanceDispatchesByLocation(client, location),
@@ -64,7 +69,7 @@ function getPriorityIcon(
}
}
-function getStatusColor(status: string) {
+function getStatusColor(status: string | null) {
switch (status) {
case "Open":
return "bg-blue-500";
@@ -95,9 +100,12 @@ type MaintenanceDispatch = NonNullable<
>[number];
function MaintenanceCard({ dispatch }: { dispatch: MaintenanceDispatch }) {
+ if (!dispatch.id) {
+ return null;
+ }
return (
<Link to={path.to.maintenanceDetail(dispatch.id)}>
- <Card className="hover:border-primary/50 transition-colors cursor-pointer">
+ <Card className="hover:border-primary/50 transition-colors cursor-pointer p-0">
<CardHeader className="pb-2">
<HStack className="justify-between">
<HStack spacing={2}>
@@ -144,7 +152,7 @@ function EmptyState({
onClear?: () => void;
}) {
return (
- <div className="flex flex-col flex-1 w-full h-[calc(100%-var(--header-height)*2)] items-center justify-center gap-4">
+ <div className="flex flex-col flex-1 w-full h-[calc(100dvh-var(--header-height)*2-40px)] items-center justify-center gap-4">
<div className="flex justify-center items-center h-12 w-12 rounded-full bg-foreground text-background">
<LuTriangleAlert className="h-6 w-6" />
</div>
@@ -199,7 +207,6 @@ export default function MaintenanceRoute() {
<header className="sticky top-0 z-10 flex h-[var(--header-height)] shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-[[data-collapsible=icon]]/sidebar-wrapper:h-12 border-b bg-background">
<div className="flex items-center gap-2 px-2">
<SidebarTrigger />
- <LuWrench className="h-4 w-4" />
<Heading size="h4">Maintenance</Heading>
</div>
</header>
diff --git a/apps/mes/app/services/maintenance.service.ts b/apps/mes/app/services/maintenance.service.ts
index 458d53f3d7..d2c032cc93 100644
--- a/apps/mes/app/services/maintenance.service.ts
+++ b/apps/mes/app/services/maintenance.service.ts
@@ -201,12 +201,7 @@ export async function getMaintenanceDispatchEvents(
) {
return client
.from("maintenanceDispatchEvent")
- .select(
- `
- *,
- employee:employeeId (id, fullName, avatarUrl)
- `
- )
+ .select("*")
.eq("maintenanceDispatchId", dispatchId)
.order("startTime", { ascending: false });
}
diff --git a/apps/mes/app/services/models.ts b/apps/mes/app/services/models.ts
index dc47b1c501..a03548c325 100644
--- a/apps/mes/app/services/models.ts
+++ b/apps/mes/app/services/models.ts
@@ -169,7 +169,6 @@ export const maintenanceDispatchValidator = z.object({
oeeImpact: z.enum(oeeImpact, {
errorMap: () => ({ message: "OEE Impact is required" })
}),
- isFailure: zfd.checkbox(),
suspectedFailureModeId: zfd.text(z.string().optional()),
actualFailureModeId: zfd.text(z.string().optional()),
content: zfd.text(z.string().optional()),
diff --git a/apps/mes/app/services/operations.service.ts b/apps/mes/app/services/operations.service.ts
index 2095e2e8e9..cbab35e3e3 100644
--- a/apps/mes/app/services/operations.service.ts
+++ b/apps/mes/app/services/operations.service.ts
@@ -735,6 +735,20 @@ export async function endProductionEvents(
.eq("companyId", args.companyId);
}
+export async function endProductionEventsByWorkCenter(
+ client: SupabaseClient<Database>,
+ args: { workCenterId: string; companyId: string; endTime: string }
+) {
+ return client
+ .from("productionEvent")
+ .update({
+ endTime: args.endTime
+ })
+ .is("endTime", null)
+ .eq("workCenterId", args.workCenterId)
+ .eq("companyId", args.companyId);
+}
+
export async function startProductionEvent(
client: SupabaseClient<Database>,
data: Omit<
diff --git a/apps/mes/app/utils/path.ts b/apps/mes/app/utils/path.ts
index a8c66b5758..3ecea3f1b2 100644
--- a/apps/mes/app/utils/path.ts
+++ b/apps/mes/app/utils/path.ts
@@ -107,14 +107,14 @@ export const path = {
inventoryAdjustment: `${x}/adjustment`,
issue: `${x}/issue`,
issueTrackedEntity: `${x}/issue-tracked-entity`,
- maintenance: `${x}/maintenance`,
- maintenanceDetail: (id: string) => generatePath(`${x}/maintenance/${id}`),
- maintenanceDispatch: `${x}/maintenance-dispatch`,
- maintenanceEvent: `${x}/maintenance-event`,
location: `${x}/location`,
login: "/login",
logout: "/logout",
+ maintenance: `${x}/maintenance`,
+ maintenanceDetail: (id: string) => generatePath(`${x}/dispatch/${id}`),
+ maintenanceEvent: `${x}/maintenance-event`,
messagingNotify: `${x}/proxy/api/messaging/notify`,
+ newMaintenanceDispatch: `${x}/dispatch/new`,
onboarding: `${ERP_URL}/onboarding`,
operation: (id: string) => generatePath(`${x}/operation/${id}`),
operations: `${x}/operations?saved=1`,
diff --git a/package-lock.json b/package-lock.json
index af089233c9..eb88478191 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -213,15 +213,6 @@
"vite-tsconfig-paths": "^5.1.4"
}
},
- "apps/erp/node_modules/zod-to-json-schema": {
- "version": "3.25.0",
- "resolved": "https://registry.npmjs.org/zod-to-json-schema/-/zod-to-json-schema-3.25.0.tgz",
- "integrity": "sha512-HvWtU2UG41LALjajJrML6uQejQhNJx+JBO9IflpSja4R03iNWfKXrj6W2h7ljuLyc1nKS+9yDyL/9tD1U/yBnQ==",
- "license": "ISC",
- "peerDependencies": {
- "zod": "^3.25 || ^4"
- }
- },
"apps/mes": {
"dependencies": {
"@carbon/auth": "*",
@@ -2995,7 +2986,6 @@
"version": "26.6.2",
"resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-26.6.2.tgz",
"integrity": "sha512-h2bW53APG4HvkOnVMo8q3QXa6pcaNt1HkwVsOperator PerformedBV6LD/q9oSpxNSYZQYkAnjdMjrJ86UuYeLo+aEZClV6opnw==",
- "dev": true,
"license": "MIT",
"dependencies": {
"@bcoe/v8-coverage": "^0.2.3",
@@ -9062,6 +9052,15 @@
"@supabase/node-fetch": "^2.6.14"
}
},
+ "node_modules/@supabase/gotrue-js": {
+ "version": "2.62.2",
+ "resolved": "https://registry.npmjs.org/@supabase/gotrue-js/-/gotrue-js-2.62.2.tgz",
+ "integrity": "sha512-AP6e6W9rQXFTEJ7sTTNYQrNf0LCcnt1hUW+RIgUK+Uh3jbWvcIST7wAlYyNZiMlS9+PYyymWQ+Ykz/rOYSO0+A==",
+ "license": "MIT",
+ "dependencies": {
+ "@supabase/node-fetch": "^2.6.14"
+ }
+ },
"node_modules/@supabase/node-fetch": {
"version": "2.6.15",
"resolved": "https://registry.npmjs.org/@supabase/node-fetch/-/node-fetch-2.6.15.tgz",
@@ -9142,6 +9141,18 @@
"node": ">=20.0.0"
}
},
+ "node_modules/@supabase/supabase-js/node_modules/@supabase/functions-js": {
+ "version": "2.87.1",
+ "resolved": "https://registry.npmjs.org/@supabase/functions-js/-/functions-js-2.87.1.tgz",
+ "integrity": "sha512-rWmYo4gRD0XAjMhYDlz7IH67bp4TIQ1UE4VqwIQtl1gGPwtLDq6wcRnu7jLKlXx0Gtrknw/eoiHYG9//XrCTzQ==",
+ "license": "MIT",
+ "dependencies": {
+ "tslib": "2.8.1"
+ },
+ "engines": {
+ "node": ">=20.0.0"
+ }
+ },
"node_modules/@swc/helpers": {
"version": "0.5.18",
"resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.18.tgz",
@@ -11753,30 +11764,6 @@
"node": ">=12"
}
},
- "node_modules/@visx/vendor/node_modules/d3-delaunay": {
- "version": "6.0.2",
- "resolved": "https://registry.npmjs.org/d3-delaunay/-/d3-delaunay-6.0.2.tgz",
- "integrity": "sha512-IMLNldruDQScrcfT+MWnazhHbDJhcRJyOEBAJfwQnHle1RPh6WDuLvxNArUju2VSMSUuKlY5BGHRJ2cYyoFLQQ==",
- "license": "ISC",
- "dependencies": {
- "delaunator": "5"
- },
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/@visx/vendor/node_modules/d3-geo": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/d3-geo/-/d3-geo-3.1.0.tgz",
- "integrity": "sha512-JEo5HxXDdDYXCaWdwLRt79y7giK8SbhZJbFWXqbRTolCHFI5jRqteLzCsq51NKbUoX0PjBVSohxrx+NoOUujYA==",
- "license": "ISC",
- "dependencies": {
- "d3-array": "2.5.0 - 3"
- },
- "engines": {
- "node": ">=12"
- }
- },
"node_modules/@web3-storage/multipart-parser": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/@web3-storage/multipart-parser/-/multipart-parser-1.0.0.tgz",
@@ -19073,6 +19060,27 @@
"url": "https://github.com/sponsors/isaacs"
}
},
+ "node_modules/jest-config/node_modules/pretty-format": {
+ "version": "26.6.2",
+ "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.6.2.tgz",
+ "integrity": "sha512-7AeGuCYNGmycyQbCqd/3PWH4eOoX/OiCa0uphp57NVTeAGdJGaAliecxwBDHYQCIvrW7aDBZCYeNTP/WX69mkg==",
+ "license": "MIT",
+ "dependencies": {
+ "@jest/types": "^26.6.2",
+ "ansi-regex": "^5.0.0",
+ "ansi-styles": "^4.0.0",
+ "react-is": "^17.0.1"
+ },
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/jest-config/node_modules/react-is": {
+ "version": "17.0.2",
+ "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz",
+ "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==",
+ "license": "MIT"
+ },
"node_modules/jest-diff": {
"version": "26.6.2",
"resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-26.6.2.tgz",
@@ -19137,6 +19145,27 @@
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"license": "MIT"
},
+ "node_modules/jest-diff/node_modules/pretty-format": {
+ "version": "26.6.2",
+ "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.6.2.tgz",
+ "integrity": "sha512-7AeGuCYNGmycyQbCqd/3PWH4eOoX/OiCa0uphp57NVTeAGdJGaAliecxwBDHYQCIvrW7aDBZCYeNTP/WX69mkg==",
+ "license": "MIT",
+ "dependencies": {
+ "@jest/types": "^26.6.2",
+ "ansi-regex": "^5.0.0",
+ "ansi-styles": "^4.0.0",
+ "react-is": "^17.0.1"
+ },
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/jest-diff/node_modules/react-is": {
+ "version": "17.0.2",
+ "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz",
+ "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==",
+ "license": "MIT"
+ },
"node_modules/jest-docblock": {
"version": "26.0.0",
"resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-26.0.0.tgz",
@@ -19214,6 +19243,27 @@
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"license": "MIT"
},
+ "node_modules/jest-each/node_modules/pretty-format": {
+ "version": "26.6.2",
+ "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.6.2.tgz",
+ "integrity": "sha512-7AeGuCYNGmycyQbCqd/3PWH4eOoX/OiCa0uphp57NVTeAGdJGaAliecxwBDHYQCIvrW7aDBZCYeNTP/WX69mkg==",
+ "license": "MIT",
+ "dependencies": {
+ "@jest/types": "^26.6.2",
+ "ansi-regex": "^5.0.0",
+ "ansi-styles": "^4.0.0",
+ "react-is": "^17.0.1"
+ },
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/jest-each/node_modules/react-is": {
+ "version": "17.0.2",
+ "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz",
+ "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==",
+ "license": "MIT"
+ },
"node_modules/jest-environment-jsdom": {
"version": "26.6.2",
"resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-26.6.2.tgz",
@@ -19363,6 +19413,27 @@
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"license": "MIT"
},
+ "node_modules/jest-jasmine2/node_modules/pretty-format": {
+ "version": "26.6.2",
+ "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.6.2.tgz",
+ "integrity": "sha512-7AeGuCYNGmycyQbCqd/3PWH4eOoX/OiCa0uphp57NVTeAGdJGaAliecxwBDHYQCIvrW7aDBZCYeNTP/WX69mkg==",
+ "license": "MIT",
+ "dependencies": {
+ "@jest/types": "^26.6.2",
+ "ansi-regex": "^5.0.0",
+ "ansi-styles": "^4.0.0",
+ "react-is": "^17.0.1"
+ },
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/jest-jasmine2/node_modules/react-is": {
+ "version": "17.0.2",
+ "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz",
+ "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==",
+ "license": "MIT"
+ },
"node_modules/jest-leak-detector": {
"version": "26.6.2",
"resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-26.6.2.tgz",
@@ -19376,6 +19447,60 @@
"node": ">= 10.14.2"
}
},
+ "node_modules/jest-leak-detector/node_modules/ansi-styles": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
+ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+ "license": "MIT",
+ "dependencies": {
+ "color-convert": "^2.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/ansi-styles?sponsor=1"
+ }
+ },
+ "node_modules/jest-leak-detector/node_modules/color-convert": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+ "license": "MIT",
+ "dependencies": {
+ "color-name": "~1.1.4"
+ },
+ "engines": {
+ "node": ">=7.0.0"
+ }
+ },
+ "node_modules/jest-leak-detector/node_modules/color-name": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
+ "license": "MIT"
+ },
+ "node_modules/jest-leak-detector/node_modules/pretty-format": {
+ "version": "26.6.2",
+ "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.6.2.tgz",
+ "integrity": "sha512-7AeGuCYNGmycyQbCqd/3PWH4eOoX/OiCa0uphp57NVTeAGdJGaAliecxwBDHYQCIvrW7aDBZCYeNTP/WX69mkg==",
+ "license": "MIT",
+ "dependencies": {
+ "@jest/types": "^26.6.2",
+ "ansi-regex": "^5.0.0",
+ "ansi-styles": "^4.0.0",
+ "react-is": "^17.0.1"
+ },
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/jest-leak-detector/node_modules/react-is": {
+ "version": "17.0.2",
+ "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz",
+ "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==",
+ "license": "MIT"
+ },
"node_modules/jest-matcher-utils": {
"version": "26.6.2",
"resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-26.6.2.tgz",
@@ -19440,6 +19565,27 @@
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"license": "MIT"
},
+ "node_modules/jest-matcher-utils/node_modules/pretty-format": {
+ "version": "26.6.2",
+ "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.6.2.tgz",
+ "integrity": "sha512-7AeGuCYNGmycyQbCqd/3PWH4eOoX/OiCa0uphp57NVTeAGdJGaAliecxwBDHYQCIvrW7aDBZCYeNTP/WX69mkg==",
+ "license": "MIT",
+ "dependencies": {
+ "@jest/types": "^26.6.2",
+ "ansi-regex": "^5.0.0",
+ "ansi-styles": "^4.0.0",
+ "react-is": "^17.0.1"
+ },
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/jest-matcher-utils/node_modules/react-is": {
+ "version": "17.0.2",
+ "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz",
+ "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==",
+ "license": "MIT"
+ },
"node_modules/jest-message-util": {
"version": "26.6.2",
"resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-26.6.2.tgz",
@@ -19509,6 +19655,27 @@
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"license": "MIT"
},
+ "node_modules/jest-message-util/node_modules/pretty-format": {
+ "version": "26.6.2",
+ "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.6.2.tgz",
+ "integrity": "sha512-7AeGuCYNGmycyQbCqd/3PWH4eOoX/OiCa0uphp57NVTeAGdJGaAliecxwBDHYQCIvrW7aDBZCYeNTP/WX69mkg==",
+ "license": "MIT",
+ "dependencies": {
+ "@jest/types": "^26.6.2",
+ "ansi-regex": "^5.0.0",
+ "ansi-styles": "^4.0.0",
+ "react-is": "^17.0.1"
+ },
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/jest-message-util/node_modules/react-is": {
+ "version": "17.0.2",
+ "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz",
+ "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==",
+ "license": "MIT"
+ },
"node_modules/jest-message-util/node_modules/slash": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz",
@@ -19952,6 +20119,27 @@
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"license": "MIT"
},
+ "node_modules/jest-snapshot/node_modules/pretty-format": {
+ "version": "26.6.2",
+ "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.6.2.tgz",
+ "integrity": "sha512-7AeGuCYNGmycyQbCqd/3PWH4eOoX/OiCa0uphp57NVTeAGdJGaAliecxwBDHYQCIvrW7aDBZCYeNTP/WX69mkg==",
+ "license": "MIT",
+ "dependencies": {
+ "@jest/types": "^26.6.2",
+ "ansi-regex": "^5.0.0",
+ "ansi-styles": "^4.0.0",
+ "react-is": "^17.0.1"
+ },
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/jest-snapshot/node_modules/react-is": {
+ "version": "17.0.2",
+ "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz",
+ "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==",
+ "license": "MIT"
+ },
"node_modules/jest-util": {
"version": "26.6.2",
"resolved": "https://registry.npmjs.org/jest-util/-/jest-util-26.6.2.tgz",
@@ -20096,6 +20284,27 @@
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"license": "MIT"
},
+ "node_modules/jest-validate/node_modules/pretty-format": {
+ "version": "26.6.2",
+ "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.6.2.tgz",
+ "integrity": "sha512-7AeGuCYNGmycyQbCqd/3PWH4eOoX/OiCa0uphp57NVTeAGdJGaAliecxwBDHYQCIvrW7aDBZCYeNTP/WX69mkg==",
+ "license": "MIT",
+ "dependencies": {
+ "@jest/types": "^26.6.2",
+ "ansi-regex": "^5.0.0",
+ "ansi-styles": "^4.0.0",
+ "react-is": "^17.0.1"
+ },
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/jest-validate/node_modules/react-is": {
+ "version": "17.0.2",
+ "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz",
+ "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==",
+ "license": "MIT"
+ },
"node_modules/jest-watcher": {
"version": "26.6.2",
"resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-26.6.2.tgz",
@@ -29486,9 +29695,9 @@
}
},
"node_modules/tsx/node_modules/esbuild": {
- "version": "0.27.2",
- "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.2.tgz",
- "integrity": "sha512-HyNQImnsOC7X9PMNaCIeAm4ISCQXs5a5YasTXVliKv4uuBo1dKrG0A+uQS8M5eXjVMnLg3WgXaKvprHlFJQffw==",
+ "version": "0.27.1",
+ "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.1.tgz",
+ "integrity": "sha512-yY35KZckJJuVVPXpvjgxiCuVEJT67F6zDeVTv4rizyPrfGBUpZQsvmxnN+C371c2esD/hNMjj4tpBhuueLN7aA==",
"devOptional": true,
"hasInstallScript": true,
"license": "MIT",
diff --git a/packages/database/src/swagger-docs-schema.ts b/packages/database/src/swagger-docs-schema.ts
index 8ede64f86c..5f8ee5b8d8 100644
--- a/packages/database/src/swagger-docs-schema.ts
+++ b/packages/database/src/swagger-docs-schema.ts
@@ -23466,9 +23466,6 @@ export default {
{
$ref: "#/parameters/rowFilter.maintenanceDispatch.actualEndTime",
},
- {
- $ref: "#/parameters/rowFilter.maintenanceDispatch.isFailure",
- },
{
$ref: "#/parameters/rowFilter.maintenanceDispatch.duration",
},
@@ -23496,6 +23493,9 @@ export default {
{
$ref: "#/parameters/rowFilter.maintenanceDispatch.updatedAt",
},
+ {
+ $ref: "#/parameters/rowFilter.maintenanceDispatch.oeeImpact",
+ },
{
$ref: "#/parameters/select",
},
@@ -23600,9 +23600,6 @@ export default {
{
$ref: "#/parameters/rowFilter.maintenanceDispatch.actualEndTime",
},
- {
- $ref: "#/parameters/rowFilter.maintenanceDispatch.isFailure",
- },
{
$ref: "#/parameters/rowFilter.maintenanceDispatch.duration",
},
@@ -23630,6 +23627,9 @@ export default {
{
$ref: "#/parameters/rowFilter.maintenanceDispatch.updatedAt",
},
+ {
+ $ref: "#/parameters/rowFilter.maintenanceDispatch.oeeImpact",
+ },
{
$ref: "#/parameters/preferReturn",
},
@@ -23688,9 +23688,6 @@ export default {
{
$ref: "#/parameters/rowFilter.maintenanceDispatch.actualEndTime",
},
- {
- $ref: "#/parameters/rowFilter.maintenanceDispatch.isFailure",
- },
{
$ref: "#/parameters/rowFilter.maintenanceDispatch.duration",
},
@@ -23718,6 +23715,9 @@ export default {
{
$ref: "#/parameters/rowFilter.maintenanceDispatch.updatedAt",
},
+ {
+ $ref: "#/parameters/rowFilter.maintenanceDispatch.oeeImpact",
+ },
{
$ref: "#/parameters/body.maintenanceDispatch",
},
@@ -35949,6 +35949,144 @@ export default {
tags: ["employee"],
},
},
+ "/activeMaintenanceDispatchesByLocation": {
+ get: {
+ parameters: [
+ {
+ $ref: "#/parameters/rowFilter.activeMaintenanceDispatchesByLocation.id",
+ },
+ {
+ $ref: "#/parameters/rowFilter.activeMaintenanceDispatchesByLocation.maintenanceDispatchId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.activeMaintenanceDispatchesByLocation.content",
+ },
+ {
+ $ref: "#/parameters/rowFilter.activeMaintenanceDispatchesByLocation.status",
+ },
+ {
+ $ref: "#/parameters/rowFilter.activeMaintenanceDispatchesByLocation.priority",
+ },
+ {
+ $ref: "#/parameters/rowFilter.activeMaintenanceDispatchesByLocation.source",
+ },
+ {
+ $ref: "#/parameters/rowFilter.activeMaintenanceDispatchesByLocation.severity",
+ },
+ {
+ $ref: "#/parameters/rowFilter.activeMaintenanceDispatchesByLocation.oeeImpact",
+ },
+ {
+ $ref: "#/parameters/rowFilter.activeMaintenanceDispatchesByLocation.workCenterId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.activeMaintenanceDispatchesByLocation.maintenanceScheduleId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.activeMaintenanceDispatchesByLocation.suspectedFailureModeId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.activeMaintenanceDispatchesByLocation.actualFailureModeId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.activeMaintenanceDispatchesByLocation.plannedStartTime",
+ },
+ {
+ $ref: "#/parameters/rowFilter.activeMaintenanceDispatchesByLocation.plannedEndTime",
+ },
+ {
+ $ref: "#/parameters/rowFilter.activeMaintenanceDispatchesByLocation.actualStartTime",
+ },
+ {
+ $ref: "#/parameters/rowFilter.activeMaintenanceDispatchesByLocation.actualEndTime",
+ },
+ {
+ $ref: "#/parameters/rowFilter.activeMaintenanceDispatchesByLocation.duration",
+ },
+ {
+ $ref: "#/parameters/rowFilter.activeMaintenanceDispatchesByLocation.nonConformanceId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.activeMaintenanceDispatchesByLocation.completedAt",
+ },
+ {
+ $ref: "#/parameters/rowFilter.activeMaintenanceDispatchesByLocation.assignee",
+ },
+ {
+ $ref: "#/parameters/rowFilter.activeMaintenanceDispatchesByLocation.companyId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.activeMaintenanceDispatchesByLocation.createdBy",
+ },
+ {
+ $ref: "#/parameters/rowFilter.activeMaintenanceDispatchesByLocation.createdAt",
+ },
+ {
+ $ref: "#/parameters/rowFilter.activeMaintenanceDispatchesByLocation.updatedBy",
+ },
+ {
+ $ref: "#/parameters/rowFilter.activeMaintenanceDispatchesByLocation.updatedAt",
+ },
+ {
+ $ref: "#/parameters/rowFilter.activeMaintenanceDispatchesByLocation.locationId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.activeMaintenanceDispatchesByLocation.workCenterName",
+ },
+ {
+ $ref: "#/parameters/rowFilter.activeMaintenanceDispatchesByLocation.locationName",
+ },
+ {
+ $ref: "#/parameters/rowFilter.activeMaintenanceDispatchesByLocation.assigneeName",
+ },
+ {
+ $ref: "#/parameters/rowFilter.activeMaintenanceDispatchesByLocation.assigneeAvatarUrl",
+ },
+ {
+ $ref: "#/parameters/rowFilter.activeMaintenanceDispatchesByLocation.suspectedFailureModeName",
+ },
+ {
+ $ref: "#/parameters/rowFilter.activeMaintenanceDispatchesByLocation.actualFailureModeName",
+ },
+ {
+ $ref: "#/parameters/select",
+ },
+ {
+ $ref: "#/parameters/order",
+ },
+ {
+ $ref: "#/parameters/range",
+ },
+ {
+ $ref: "#/parameters/rangeUnit",
+ },
+ {
+ $ref: "#/parameters/offset",
+ },
+ {
+ $ref: "#/parameters/limit",
+ },
+ {
+ $ref: "#/parameters/preferCount",
+ },
+ ],
+ responses: {
+ "200": {
+ description: "OK",
+ schema: {
+ items: {
+ $ref: "#/definitions/activeMaintenanceDispatchesByLocation",
+ },
+ type: "array",
+ },
+ },
+ "206": {
+ description: "Partial Content",
+ },
+ },
+ tags: ["activeMaintenanceDispatchesByLocation"],
+ },
+ },
"/userAttributeValue": {
get: {
parameters: [
@@ -51417,6 +51555,111 @@ export default {
tags: ["apiKey"],
},
},
+ "/workCentersWithBlockingStatus": {
+ get: {
+ parameters: [
+ {
+ $ref: "#/parameters/rowFilter.workCentersWithBlockingStatus.id",
+ },
+ {
+ $ref: "#/parameters/rowFilter.workCentersWithBlockingStatus.name",
+ },
+ {
+ $ref: "#/parameters/rowFilter.workCentersWithBlockingStatus.description",
+ },
+ {
+ $ref: "#/parameters/rowFilter.workCentersWithBlockingStatus.laborRate",
+ },
+ {
+ $ref: "#/parameters/rowFilter.workCentersWithBlockingStatus.defaultStandardFactor",
+ },
+ {
+ $ref: "#/parameters/rowFilter.workCentersWithBlockingStatus.locationId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.workCentersWithBlockingStatus.requiredAbilityId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.workCentersWithBlockingStatus.active",
+ },
+ {
+ $ref: "#/parameters/rowFilter.workCentersWithBlockingStatus.companyId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.workCentersWithBlockingStatus.customFields",
+ },
+ {
+ $ref: "#/parameters/rowFilter.workCentersWithBlockingStatus.createdBy",
+ },
+ {
+ $ref: "#/parameters/rowFilter.workCentersWithBlockingStatus.createdAt",
+ },
+ {
+ $ref: "#/parameters/rowFilter.workCentersWithBlockingStatus.updatedBy",
+ },
+ {
+ $ref: "#/parameters/rowFilter.workCentersWithBlockingStatus.updatedAt",
+ },
+ {
+ $ref: "#/parameters/rowFilter.workCentersWithBlockingStatus.machineRate",
+ },
+ {
+ $ref: "#/parameters/rowFilter.workCentersWithBlockingStatus.overheadRate",
+ },
+ {
+ $ref: "#/parameters/rowFilter.workCentersWithBlockingStatus.tags",
+ },
+ {
+ $ref: "#/parameters/rowFilter.workCentersWithBlockingStatus.locationName",
+ },
+ {
+ $ref: "#/parameters/rowFilter.workCentersWithBlockingStatus.isBlocked",
+ },
+ {
+ $ref: "#/parameters/rowFilter.workCentersWithBlockingStatus.blockingDispatchId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.workCentersWithBlockingStatus.blockingDispatchReadableId",
+ },
+ {
+ $ref: "#/parameters/select",
+ },
+ {
+ $ref: "#/parameters/order",
+ },
+ {
+ $ref: "#/parameters/range",
+ },
+ {
+ $ref: "#/parameters/rangeUnit",
+ },
+ {
+ $ref: "#/parameters/offset",
+ },
+ {
+ $ref: "#/parameters/limit",
+ },
+ {
+ $ref: "#/parameters/preferCount",
+ },
+ ],
+ responses: {
+ "200": {
+ description: "OK",
+ schema: {
+ items: {
+ $ref: "#/definitions/workCentersWithBlockingStatus",
+ },
+ type: "array",
+ },
+ },
+ "206": {
+ description: "Partial Content",
+ },
+ },
+ tags: ["workCentersWithBlockingStatus"],
+ },
+ },
"/purchaseOrderDelivery": {
get: {
parameters: [
@@ -53964,6 +54207,102 @@ export default {
tags: ["purchaseInvoices"],
},
},
+ "/maintenanceSchedules": {
+ get: {
+ parameters: [
+ {
+ $ref: "#/parameters/rowFilter.maintenanceSchedules.id",
+ },
+ {
+ $ref: "#/parameters/rowFilter.maintenanceSchedules.name",
+ },
+ {
+ $ref: "#/parameters/rowFilter.maintenanceSchedules.description",
+ },
+ {
+ $ref: "#/parameters/rowFilter.maintenanceSchedules.workCenterId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.maintenanceSchedules.frequency",
+ },
+ {
+ $ref: "#/parameters/rowFilter.maintenanceSchedules.priority",
+ },
+ {
+ $ref: "#/parameters/rowFilter.maintenanceSchedules.estimatedDuration",
+ },
+ {
+ $ref: "#/parameters/rowFilter.maintenanceSchedules.active",
+ },
+ {
+ $ref: "#/parameters/rowFilter.maintenanceSchedules.lastGeneratedAt",
+ },
+ {
+ $ref: "#/parameters/rowFilter.maintenanceSchedules.nextDueAt",
+ },
+ {
+ $ref: "#/parameters/rowFilter.maintenanceSchedules.companyId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.maintenanceSchedules.createdBy",
+ },
+ {
+ $ref: "#/parameters/rowFilter.maintenanceSchedules.createdAt",
+ },
+ {
+ $ref: "#/parameters/rowFilter.maintenanceSchedules.updatedBy",
+ },
+ {
+ $ref: "#/parameters/rowFilter.maintenanceSchedules.updatedAt",
+ },
+ {
+ $ref: "#/parameters/rowFilter.maintenanceSchedules.locationId",
+ },
+ {
+ $ref: "#/parameters/rowFilter.maintenanceSchedules.workCenterName",
+ },
+ {
+ $ref: "#/parameters/rowFilter.maintenanceSchedules.locationName",
+ },
+ {
+ $ref: "#/parameters/select",
+ },
+ {
+ $ref: "#/parameters/order",
+ },
+ {
+ $ref: "#/parameters/range",
+ },
+ {
+ $ref: "#/parameters/rangeUnit",
+ },
+ {
+ $ref: "#/parameters/offset",
+ },
+ {
+ $ref: "#/parameters/limit",
+ },
+ {
+ $ref: "#/parameters/preferCount",
+ },
+ ],
+ responses: {
+ "200": {
+ description: "OK",
+ schema: {
+ items: {
+ $ref: "#/definitions/maintenanceSchedules",
+ },
+ type: "array",
+ },
+ },
+ "206": {
+ description: "Partial Content",
+ },
+ },
+ tags: ["maintenanceSchedules"],
+ },
+ },
"/purchaseOrderTransaction": {
get: {
parameters: [
@@ -74695,10 +75034,10 @@ export default {
"status",
"priority",
"source",
- "isFailure",
"companyId",
"createdBy",
"createdAt",
+ "oeeImpact",
],
properties: {
id: {
@@ -74733,7 +75072,12 @@ export default {
type: "string",
},
severity: {
- enum: ["Preventive", "Operator Performed", "Maintenance Required", "OEM Required"],
+ enum: [
+ "Preventive",
+ "Operator Performed",
+ "Maintenance Required",
+ "OEM Required",
+ ],
format: 'public."maintenanceSeverity"',
type: "string",
},
@@ -74777,11 +75121,6 @@ export default {
format: "timestamp with time zone",
type: "string",
},
- isFailure: {
- default: false,
- format: "boolean",
- type: "boolean",
- },
duration: {
format: "integer",
type: "integer",
@@ -74829,6 +75168,12 @@ export default {
format: "timestamp with time zone",
type: "string",
},
+ oeeImpact: {
+ default: "No Impact",
+ enum: ["Down", "Planned", "Impact", "No Impact"],
+ format: 'public."oeeImpact"',
+ type: "string",
+ },
},
type: "object",
},
@@ -80560,6 +80905,169 @@ export default {
},
type: "object",
},
+ activeMaintenanceDispatchesByLocation: {
+ properties: {
+ id: {
+ description: "Note:\nThis is a Primary Key.<pk/>",
+ format: "text",
+ type: "string",
+ },
+ maintenanceDispatchId: {
+ format: "text",
+ type: "string",
+ },
+ content: {
+ format: "json",
+ },
+ status: {
+ enum: ["Open", "Assigned", "In Progress", "Completed", "Cancelled"],
+ format: 'public."maintenanceDispatchStatus"',
+ type: "string",
+ },
+ priority: {
+ enum: ["Low", "Medium", "High", "Critical"],
+ format: 'public."maintenanceDispatchPriority"',
+ type: "string",
+ },
+ source: {
+ enum: ["Scheduled", "Reactive", "Non-Conformance"],
+ format: 'public."maintenanceSource"',
+ type: "string",
+ },
+ severity: {
+ enum: [
+ "Preventive",
+ "Operator Performed",
+ "Maintenance Required",
+ "OEM Required",
+ ],
+ format: 'public."maintenanceSeverity"',
+ type: "string",
+ },
+ oeeImpact: {
+ enum: ["Down", "Planned", "Impact", "No Impact"],
+ format: 'public."oeeImpact"',
+ type: "string",
+ },
+ workCenterId: {
+ description:
+ "Note:\nThis is a Foreign Key to `workCenter.id`.<fk table='workCenter' column='id'/>",
+ format: "text",
+ type: "string",
+ },
+ maintenanceScheduleId: {
+ description:
+ "Note:\nThis is a Foreign Key to `maintenanceSchedule.id`.<fk table='maintenanceSchedule' column='id'/>",
+ format: "text",
+ type: "string",
+ },
+ suspectedFailureModeId: {
+ description:
+ "Note:\nThis is a Foreign Key to `maintenanceFailureMode.id`.<fk table='maintenanceFailureMode' column='id'/>",
+ format: "text",
+ type: "string",
+ },
+ actualFailureModeId: {
+ description:
+ "Note:\nThis is a Foreign Key to `maintenanceFailureMode.id`.<fk table='maintenanceFailureMode' column='id'/>",
+ format: "text",
+ type: "string",
+ },
+ plannedStartTime: {
+ format: "timestamp with time zone",
+ type: "string",
+ },
+ plannedEndTime: {
+ format: "timestamp with time zone",
+ type: "string",
+ },
+ actualStartTime: {
+ format: "timestamp with time zone",
+ type: "string",
+ },
+ actualEndTime: {
+ format: "timestamp with time zone",
+ type: "string",
+ },
+ duration: {
+ format: "integer",
+ type: "integer",
+ },
+ nonConformanceId: {
+ description:
+ "Note:\nThis is a Foreign Key to `nonConformance.id`.<fk table='nonConformance' column='id'/>",
+ format: "text",
+ type: "string",
+ },
+ completedAt: {
+ format: "timestamp with time zone",
+ type: "string",
+ },
+ assignee: {
+ description:
+ "Note:\nThis is a Foreign Key to `user.id`.<fk table='user' column='id'/>",
+ format: "text",
+ type: "string",
+ },
+ companyId: {
+ description:
+ "Note:\nThis is a Foreign Key to `company.id`.<fk table='company' column='id'/>",
+ format: "text",
+ type: "string",
+ },
+ createdBy: {
+ description:
+ "Note:\nThis is a Foreign Key to `user.id`.<fk table='user' column='id'/>",
+ format: "text",
+ type: "string",
+ },
+ createdAt: {
+ format: "timestamp with time zone",
+ type: "string",
+ },
+ updatedBy: {
+ description:
+ "Note:\nThis is a Foreign Key to `user.id`.<fk table='user' column='id'/>",
+ format: "text",
+ type: "string",
+ },
+ updatedAt: {
+ format: "timestamp with time zone",
+ type: "string",
+ },
+ locationId: {
+ description:
+ "Note:\nThis is a Foreign Key to `location.id`.<fk table='location' column='id'/>",
+ format: "text",
+ type: "string",
+ },
+ workCenterName: {
+ format: "text",
+ type: "string",
+ },
+ locationName: {
+ format: "text",
+ type: "string",
+ },
+ assigneeName: {
+ format: "text",
+ type: "string",
+ },
+ assigneeAvatarUrl: {
+ format: "text",
+ type: "string",
+ },
+ suspectedFailureModeName: {
+ format: "text",
+ type: "string",
+ },
+ actualFailureModeName: {
+ format: "text",
+ type: "string",
+ },
+ },
+ type: "object",
+ },
userAttributeValue: {
required: ["id", "userAttributeId", "userId", "createdAt", "createdBy"],
properties: {
@@ -88022,6 +88530,121 @@ export default {
},
type: "object",
},
+ workCentersWithBlockingStatus: {
+ properties: {
+ id: {
+ description: "Note:\nThis is a Primary Key.<pk/>",
+ format: "text",
+ type: "string",
+ },
+ name: {
+ format: "text",
+ type: "string",
+ },
+ description: {
+ format: "text",
+ type: "string",
+ },
+ laborRate: {
+ format: "numeric",
+ type: "number",
+ },
+ defaultStandardFactor: {
+ enum: [
+ "Hours/Piece",
+ "Hours/100 Pieces",
+ "Hours/1000 Pieces",
+ "Minutes/Piece",
+ "Minutes/100 Pieces",
+ "Minutes/1000 Pieces",
+ "Pieces/Hour",
+ "Pieces/Minute",
+ "Seconds/Piece",
+ "Total Hours",
+ "Total Minutes",
+ ],
+ format: "public.factor",
+ type: "string",
+ },
+ locationId: {
+ description:
+ "Note:\nThis is a Foreign Key to `location.id`.<fk table='location' column='id'/>",
+ format: "text",
+ type: "string",
+ },
+ requiredAbilityId: {
+ description:
+ "Note:\nThis is a Foreign Key to `ability.id`.<fk table='ability' column='id'/>",
+ format: "text",
+ type: "string",
+ },
+ active: {
+ format: "boolean",
+ type: "boolean",
+ },
+ companyId: {
+ description:
+ "Note:\nThis is a Foreign Key to `company.id`.<fk table='company' column='id'/>",
+ format: "text",
+ type: "string",
+ },
+ customFields: {
+ format: "jsonb",
+ },
+ createdBy: {
+ description:
+ "Note:\nThis is a Foreign Key to `user.id`.<fk table='user' column='id'/>",
+ format: "text",
+ type: "string",
+ },
+ createdAt: {
+ format: "timestamp with time zone",
+ type: "string",
+ },
+ updatedBy: {
+ description:
+ "Note:\nThis is a Foreign Key to `user.id`.<fk table='user' column='id'/>",
+ format: "text",
+ type: "string",
+ },
+ updatedAt: {
+ format: "timestamp with time zone",
+ type: "string",
+ },
+ machineRate: {
+ format: "numeric",
+ type: "number",
+ },
+ overheadRate: {
+ format: "numeric",
+ type: "number",
+ },
+ tags: {
+ format: "text[]",
+ items: {
+ type: "string",
+ },
+ type: "array",
+ },
+ locationName: {
+ format: "text",
+ type: "string",
+ },
+ isBlocked: {
+ format: "boolean",
+ type: "boolean",
+ },
+ blockingDispatchId: {
+ format: "text",
+ type: "string",
+ },
+ blockingDispatchReadableId: {
+ format: "text",
+ type: "string",
+ },
+ },
+ type: "object",
+ },
purchaseOrderDelivery: {
required: ["id", "dropShipment", "companyId", "supplierShippingCost"],
properties: {
@@ -89514,6 +90137,96 @@ export default {
},
type: "object",
},
+ maintenanceSchedules: {
+ properties: {
+ id: {
+ description: "Note:\nThis is a Primary Key.<pk/>",
+ format: "text",
+ type: "string",
+ },
+ name: {
+ format: "text",
+ type: "string",
+ },
+ description: {
+ format: "text",
+ type: "string",
+ },
+ workCenterId: {
+ description:
+ "Note:\nThis is a Foreign Key to `workCenter.id`.<fk table='workCenter' column='id'/>",
+ format: "text",
+ type: "string",
+ },
+ frequency: {
+ enum: ["Daily", "Weekly", "Monthly", "Quarterly", "Annual"],
+ format: 'public."maintenanceFrequency"',
+ type: "string",
+ },
+ priority: {
+ enum: ["Low", "Medium", "High", "Critical"],
+ format: 'public."maintenanceDispatchPriority"',
+ type: "string",
+ },
+ estimatedDuration: {
+ format: "integer",
+ type: "integer",
+ },
+ active: {
+ format: "boolean",
+ type: "boolean",
+ },
+ lastGeneratedAt: {
+ format: "timestamp with time zone",
+ type: "string",
+ },
+ nextDueAt: {
+ format: "timestamp with time zone",
+ type: "string",
+ },
+ companyId: {
+ description:
+ "Note:\nThis is a Foreign Key to `company.id`.<fk table='company' column='id'/>",
+ format: "text",
+ type: "string",
+ },
+ createdBy: {
+ description:
+ "Note:\nThis is a Foreign Key to `user.id`.<fk table='user' column='id'/>",
+ format: "text",
+ type: "string",
+ },
+ createdAt: {
+ format: "timestamp with time zone",
+ type: "string",
+ },
+ updatedBy: {
+ description:
+ "Note:\nThis is a Foreign Key to `user.id`.<fk table='user' column='id'/>",
+ format: "text",
+ type: "string",
+ },
+ updatedAt: {
+ format: "timestamp with time zone",
+ type: "string",
+ },
+ locationId: {
+ description:
+ "Note:\nThis is a Foreign Key to `location.id`.<fk table='location' column='id'/>",
+ format: "text",
+ type: "string",
+ },
+ workCenterName: {
+ format: "text",
+ type: "string",
+ },
+ locationName: {
+ format: "text",
+ type: "string",
+ },
+ },
+ type: "object",
+ },
purchaseOrderTransaction: {
required: ["id", "purchaseOrderId", "type", "userId", "createdAt"],
properties: {
@@ -104428,12 +105141,6 @@ export default {
in: "query",
type: "string",
},
- "rowFilter.maintenanceDispatch.isFailure": {
- name: "isFailure",
- required: false,
- in: "query",
- type: "string",
- },
"rowFilter.maintenanceDispatch.duration": {
name: "duration",
required: false,
@@ -104488,6 +105195,12 @@ export default {
in: "query",
type: "string",
},
+ "rowFilter.maintenanceDispatch.oeeImpact": {
+ name: "oeeImpact",
+ required: false,
+ in: "query",
+ type: "string",
+ },
"body.openProductionOrders": {
name: "openProductionOrders",
description: "openProductionOrders",
@@ -110908,6 +111621,208 @@ export default {
in: "query",
type: "string",
},
+ "body.activeMaintenanceDispatchesByLocation": {
+ name: "activeMaintenanceDispatchesByLocation",
+ description: "activeMaintenanceDispatchesByLocation",
+ required: false,
+ in: "body",
+ schema: {
+ $ref: "#/definitions/activeMaintenanceDispatchesByLocation",
+ },
+ },
+ "rowFilter.activeMaintenanceDispatchesByLocation.id": {
+ name: "id",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.activeMaintenanceDispatchesByLocation.maintenanceDispatchId": {
+ name: "maintenanceDispatchId",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.activeMaintenanceDispatchesByLocation.content": {
+ name: "content",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.activeMaintenanceDispatchesByLocation.status": {
+ name: "status",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.activeMaintenanceDispatchesByLocation.priority": {
+ name: "priority",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.activeMaintenanceDispatchesByLocation.source": {
+ name: "source",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.activeMaintenanceDispatchesByLocation.severity": {
+ name: "severity",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.activeMaintenanceDispatchesByLocation.oeeImpact": {
+ name: "oeeImpact",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.activeMaintenanceDispatchesByLocation.workCenterId": {
+ name: "workCenterId",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.activeMaintenanceDispatchesByLocation.maintenanceScheduleId": {
+ name: "maintenanceScheduleId",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.activeMaintenanceDispatchesByLocation.suspectedFailureModeId": {
+ name: "suspectedFailureModeId",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.activeMaintenanceDispatchesByLocation.actualFailureModeId": {
+ name: "actualFailureModeId",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.activeMaintenanceDispatchesByLocation.plannedStartTime": {
+ name: "plannedStartTime",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.activeMaintenanceDispatchesByLocation.plannedEndTime": {
+ name: "plannedEndTime",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.activeMaintenanceDispatchesByLocation.actualStartTime": {
+ name: "actualStartTime",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.activeMaintenanceDispatchesByLocation.actualEndTime": {
+ name: "actualEndTime",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.activeMaintenanceDispatchesByLocation.duration": {
+ name: "duration",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.activeMaintenanceDispatchesByLocation.nonConformanceId": {
+ name: "nonConformanceId",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.activeMaintenanceDispatchesByLocation.completedAt": {
+ name: "completedAt",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.activeMaintenanceDispatchesByLocation.assignee": {
+ name: "assignee",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.activeMaintenanceDispatchesByLocation.companyId": {
+ name: "companyId",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.activeMaintenanceDispatchesByLocation.createdBy": {
+ name: "createdBy",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.activeMaintenanceDispatchesByLocation.createdAt": {
+ name: "createdAt",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.activeMaintenanceDispatchesByLocation.updatedBy": {
+ name: "updatedBy",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.activeMaintenanceDispatchesByLocation.updatedAt": {
+ name: "updatedAt",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.activeMaintenanceDispatchesByLocation.locationId": {
+ name: "locationId",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.activeMaintenanceDispatchesByLocation.workCenterName": {
+ name: "workCenterName",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.activeMaintenanceDispatchesByLocation.locationName": {
+ name: "locationName",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.activeMaintenanceDispatchesByLocation.assigneeName": {
+ name: "assigneeName",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.activeMaintenanceDispatchesByLocation.assigneeAvatarUrl": {
+ name: "assigneeAvatarUrl",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.activeMaintenanceDispatchesByLocation.suspectedFailureModeName":
+ {
+ name: "suspectedFailureModeName",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.activeMaintenanceDispatchesByLocation.actualFailureModeName": {
+ name: "actualFailureModeName",
+ required: false,
+ in: "query",
+ type: "string",
+ },
"body.userAttributeValue": {
name: "userAttributeValue",
description: "userAttributeValue",
@@ -119353,6 +120268,141 @@ export default {
in: "query",
type: "string",
},
+ "body.workCentersWithBlockingStatus": {
+ name: "workCentersWithBlockingStatus",
+ description: "workCentersWithBlockingStatus",
+ required: false,
+ in: "body",
+ schema: {
+ $ref: "#/definitions/workCentersWithBlockingStatus",
+ },
+ },
+ "rowFilter.workCentersWithBlockingStatus.id": {
+ name: "id",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.workCentersWithBlockingStatus.name": {
+ name: "name",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.workCentersWithBlockingStatus.description": {
+ name: "description",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.workCentersWithBlockingStatus.laborRate": {
+ name: "laborRate",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.workCentersWithBlockingStatus.defaultStandardFactor": {
+ name: "defaultStandardFactor",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.workCentersWithBlockingStatus.locationId": {
+ name: "locationId",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.workCentersWithBlockingStatus.requiredAbilityId": {
+ name: "requiredAbilityId",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.workCentersWithBlockingStatus.active": {
+ name: "active",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.workCentersWithBlockingStatus.companyId": {
+ name: "companyId",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.workCentersWithBlockingStatus.customFields": {
+ name: "customFields",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.workCentersWithBlockingStatus.createdBy": {
+ name: "createdBy",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.workCentersWithBlockingStatus.createdAt": {
+ name: "createdAt",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.workCentersWithBlockingStatus.updatedBy": {
+ name: "updatedBy",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.workCentersWithBlockingStatus.updatedAt": {
+ name: "updatedAt",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.workCentersWithBlockingStatus.machineRate": {
+ name: "machineRate",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.workCentersWithBlockingStatus.overheadRate": {
+ name: "overheadRate",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.workCentersWithBlockingStatus.tags": {
+ name: "tags",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.workCentersWithBlockingStatus.locationName": {
+ name: "locationName",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.workCentersWithBlockingStatus.isBlocked": {
+ name: "isBlocked",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.workCentersWithBlockingStatus.blockingDispatchId": {
+ name: "blockingDispatchId",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.workCentersWithBlockingStatus.blockingDispatchReadableId": {
+ name: "blockingDispatchReadableId",
+ required: false,
+ in: "query",
+ type: "string",
+ },
"body.purchaseOrderDelivery": {
name: "purchaseOrderDelivery",
description: "purchaseOrderDelivery",
@@ -121024,6 +122074,123 @@ export default {
in: "query",
type: "string",
},
+ "body.maintenanceSchedules": {
+ name: "maintenanceSchedules",
+ description: "maintenanceSchedules",
+ required: false,
+ in: "body",
+ schema: {
+ $ref: "#/definitions/maintenanceSchedules",
+ },
+ },
+ "rowFilter.maintenanceSchedules.id": {
+ name: "id",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.maintenanceSchedules.name": {
+ name: "name",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.maintenanceSchedules.description": {
+ name: "description",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.maintenanceSchedules.workCenterId": {
+ name: "workCenterId",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.maintenanceSchedules.frequency": {
+ name: "frequency",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.maintenanceSchedules.priority": {
+ name: "priority",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.maintenanceSchedules.estimatedDuration": {
+ name: "estimatedDuration",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.maintenanceSchedules.active": {
+ name: "active",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.maintenanceSchedules.lastGeneratedAt": {
+ name: "lastGeneratedAt",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.maintenanceSchedules.nextDueAt": {
+ name: "nextDueAt",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.maintenanceSchedules.companyId": {
+ name: "companyId",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.maintenanceSchedules.createdBy": {
+ name: "createdBy",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.maintenanceSchedules.createdAt": {
+ name: "createdAt",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.maintenanceSchedules.updatedBy": {
+ name: "updatedBy",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.maintenanceSchedules.updatedAt": {
+ name: "updatedAt",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.maintenanceSchedules.locationId": {
+ name: "locationId",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.maintenanceSchedules.workCenterName": {
+ name: "workCenterName",
+ required: false,
+ in: "query",
+ type: "string",
+ },
+ "rowFilter.maintenanceSchedules.locationName": {
+ name: "locationName",
+ required: false,
+ in: "query",
+ type: "string",
+ },
"body.purchaseOrderTransaction": {
name: "purchaseOrderTransaction",
description: "purchaseOrderTransaction",
diff --git a/packages/database/src/types.ts b/packages/database/src/types.ts
index 31930e694d..4a4bbb1ca3 100644
--- a/packages/database/src/types.ts
+++ b/packages/database/src/types.ts
@@ -10902,6 +10902,13 @@ export type Database = {
referencedRelation: "workCenters"
referencedColumns: ["id"]
},
+ {
+ foreignKeyName: "jobOperation_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCentersWithBlockingStatus"
+ referencedColumns: ["id"]
+ },
]
}
jobOperationDependency: {
@@ -12450,10 +12457,10 @@ export type Database = {
createdBy: string
duration: number | null
id: string
- isFailure: boolean
maintenanceDispatchId: string
maintenanceScheduleId: string | null
nonConformanceId: string | null
+ oeeImpact: Database["public"]["Enums"]["oeeImpact"]
plannedEndTime: string | null
plannedStartTime: string | null
priority: Database["public"]["Enums"]["maintenanceDispatchPriority"]
@@ -12477,10 +12484,10 @@ export type Database = {
createdBy: string
duration?: number | null
id?: string
- isFailure?: boolean
maintenanceDispatchId: string
maintenanceScheduleId?: string | null
nonConformanceId?: string | null
+ oeeImpact?: Database["public"]["Enums"]["oeeImpact"]
plannedEndTime?: string | null
plannedStartTime?: string | null
priority?: Database["public"]["Enums"]["maintenanceDispatchPriority"]
@@ -12504,10 +12511,10 @@ export type Database = {
createdBy?: string
duration?: number | null
id?: string
- isFailure?: boolean
maintenanceDispatchId?: string
maintenanceScheduleId?: string | null
nonConformanceId?: string | null
+ oeeImpact?: Database["public"]["Enums"]["oeeImpact"]
plannedEndTime?: string | null
plannedStartTime?: string | null
priority?: Database["public"]["Enums"]["maintenanceDispatchPriority"]
@@ -12709,6 +12716,13 @@ export type Database = {
referencedRelation: "workCenters"
referencedColumns: ["id"]
},
+ {
+ foreignKeyName: "maintenanceDispatch_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCentersWithBlockingStatus"
+ referencedColumns: ["id"]
+ },
]
}
maintenanceDispatchComment: {
@@ -12806,6 +12820,13 @@ export type Database = {
referencedRelation: "userDefaults"
referencedColumns: ["userId"]
},
+ {
+ foreignKeyName: "maintenanceDispatchComment_maintenanceDispatchId_fkey"
+ columns: ["maintenanceDispatchId"]
+ isOneToOne: false
+ referencedRelation: "activeMaintenanceDispatchesByLocation"
+ referencedColumns: ["id"]
+ },
{
foreignKeyName: "maintenanceDispatchComment_maintenanceDispatchId_fkey"
columns: ["maintenanceDispatchId"]
@@ -12995,6 +13016,13 @@ export type Database = {
referencedRelation: "userDefaults"
referencedColumns: ["userId"]
},
+ {
+ foreignKeyName: "maintenanceDispatchEvent_maintenanceDispatchId_fkey"
+ columns: ["maintenanceDispatchId"]
+ isOneToOne: false
+ referencedRelation: "activeMaintenanceDispatchesByLocation"
+ referencedColumns: ["id"]
+ },
{
foreignKeyName: "maintenanceDispatchEvent_maintenanceDispatchId_fkey"
columns: ["maintenanceDispatchId"]
@@ -13051,6 +13079,13 @@ export type Database = {
referencedRelation: "workCenters"
referencedColumns: ["id"]
},
+ {
+ foreignKeyName: "maintenanceDispatchEvent_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCentersWithBlockingStatus"
+ referencedColumns: ["id"]
+ },
]
}
maintenanceDispatchItem: {
@@ -13195,6 +13230,13 @@ export type Database = {
referencedRelation: "tools"
referencedColumns: ["id"]
},
+ {
+ foreignKeyName: "maintenanceDispatchItem_maintenanceDispatchId_fkey"
+ columns: ["maintenanceDispatchId"]
+ isOneToOne: false
+ referencedRelation: "activeMaintenanceDispatchesByLocation"
+ referencedColumns: ["id"]
+ },
{
foreignKeyName: "maintenanceDispatchItem_maintenanceDispatchId_fkey"
columns: ["maintenanceDispatchId"]
@@ -13334,6 +13376,13 @@ export type Database = {
referencedRelation: "userDefaults"
referencedColumns: ["userId"]
},
+ {
+ foreignKeyName: "maintenanceDispatchWorkCenter_maintenanceDispatchId_fkey"
+ columns: ["maintenanceDispatchId"]
+ isOneToOne: false
+ referencedRelation: "activeMaintenanceDispatchesByLocation"
+ referencedColumns: ["id"]
+ },
{
foreignKeyName: "maintenanceDispatchWorkCenter_maintenanceDispatchId_fkey"
columns: ["maintenanceDispatchId"]
@@ -13390,6 +13439,13 @@ export type Database = {
referencedRelation: "workCenters"
referencedColumns: ["id"]
},
+ {
+ foreignKeyName: "maintenanceDispatchWorkCenter_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCentersWithBlockingStatus"
+ referencedColumns: ["id"]
+ },
]
}
maintenanceFailureMode: {
@@ -13686,6 +13742,13 @@ export type Database = {
referencedRelation: "workCenters"
referencedColumns: ["id"]
},
+ {
+ foreignKeyName: "maintenanceSchedule_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCentersWithBlockingStatus"
+ referencedColumns: ["id"]
+ },
]
}
maintenanceScheduleItem: {
@@ -15404,6 +15467,13 @@ export type Database = {
referencedRelation: "workCenters"
referencedColumns: ["id"]
},
+ {
+ foreignKeyName: "methodOperation_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCentersWithBlockingStatus"
+ referencedColumns: ["id"]
+ },
{
foreignKeyName: "quoteOperation_operationSupplierProcessId_fkey"
columns: ["operationSupplierProcessId"]
@@ -21990,6 +22060,13 @@ export type Database = {
referencedRelation: "workCenters"
referencedColumns: ["id"]
},
+ {
+ foreignKeyName: "productionEvent_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCentersWithBlockingStatus"
+ referencedColumns: ["id"]
+ },
]
}
productionQuantity: {
@@ -26757,6 +26834,13 @@ export type Database = {
referencedRelation: "workCenters"
referencedColumns: ["id"]
},
+ {
+ foreignKeyName: "quoteOperation_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCentersWithBlockingStatus"
+ referencedColumns: ["id"]
+ },
]
}
quoteOperationParameter: {
@@ -39671,6 +39755,207 @@ export type Database = {
referencedRelation: "workCenters"
referencedColumns: ["id"]
},
+ {
+ foreignKeyName: "workCenterProcess_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCentersWithBlockingStatus"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ workCenterReplacementPart: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ id: string
+ itemId: string
+ quantity: number
+ unitOfMeasureCode: string
+ updatedAt: string | null
+ updatedBy: string | null
+ workCenterId: string
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ id?: string
+ itemId: string
+ quantity: number
+ unitOfMeasureCode: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ workCenterId: string
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ id?: string
+ itemId?: string
+ quantity?: number
+ unitOfMeasureCode?: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ workCenterId?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "workCenterReplacementPart_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCenter"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCenters"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCentersWithBlockingStatus"
+ referencedColumns: ["id"]
+ },
]
}
}
@@ -40001,6 +40286,251 @@ export type Database = {
},
]
}
+ activeMaintenanceDispatchesByLocation: {
+ Row: {
+ actualEndTime: string | null
+ actualFailureModeId: string | null
+ actualFailureModeName: string | null
+ actualStartTime: string | null
+ assignee: string | null
+ assigneeAvatarUrl: string | null
+ assigneeName: string | null
+ companyId: string | null
+ completedAt: string | null
+ content: Json | null
+ createdAt: string | null
+ createdBy: string | null
+ duration: number | null
+ id: string | null
+ locationId: string | null
+ locationName: string | null
+ maintenanceDispatchId: string | null
+ maintenanceScheduleId: string | null
+ nonConformanceId: string | null
+ oeeImpact: Database["public"]["Enums"]["oeeImpact"] | null
+ plannedEndTime: string | null
+ plannedStartTime: string | null
+ priority:
+ | Database["public"]["Enums"]["maintenanceDispatchPriority"]
+ | null
+ severity: Database["public"]["Enums"]["maintenanceSeverity"] | null
+ source: Database["public"]["Enums"]["maintenanceSource"] | null
+ status:
+ | Database["public"]["Enums"]["maintenanceDispatchStatus"]
+ | null
+ suspectedFailureModeId: string | null
+ suspectedFailureModeName: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ workCenterId: string | null
+ workCenterName: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "maintenanceDispatch_actualFailureModeId_fkey"
+ columns: ["actualFailureModeId"]
+ isOneToOne: false
+ referencedRelation: "maintenanceFailureMode"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_maintenanceScheduleId_fkey"
+ columns: ["maintenanceScheduleId"]
+ isOneToOne: false
+ referencedRelation: "maintenanceSchedule"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_maintenanceScheduleId_fkey"
+ columns: ["maintenanceScheduleId"]
+ isOneToOne: false
+ referencedRelation: "maintenanceSchedules"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_nonConformanceId_fkey"
+ columns: ["nonConformanceId"]
+ isOneToOne: false
+ referencedRelation: "issues"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_nonConformanceId_fkey"
+ columns: ["nonConformanceId"]
+ isOneToOne: false
+ referencedRelation: "nonConformance"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_suspectedFailureModeId_fkey"
+ columns: ["suspectedFailureModeId"]
+ isOneToOne: false
+ referencedRelation: "maintenanceFailureMode"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCenter"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCenters"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCentersWithBlockingStatus"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
activeMakeMethods: {
Row: {
companyId: string | null
@@ -42530,6 +43060,13 @@ export type Database = {
referencedRelation: "workCenters"
referencedColumns: ["id"]
},
+ {
+ foreignKeyName: "jobOperation_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCentersWithBlockingStatus"
+ referencedColumns: ["id"]
+ },
]
}
jobOperationsWithMakeMethods: {
@@ -42794,6 +43331,13 @@ export type Database = {
referencedRelation: "workCenters"
referencedColumns: ["id"]
},
+ {
+ foreignKeyName: "jobOperation_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCentersWithBlockingStatus"
+ referencedColumns: ["id"]
+ },
]
}
jobs: {
@@ -43511,6 +44055,13 @@ export type Database = {
referencedRelation: "workCenters"
referencedColumns: ["id"]
},
+ {
+ foreignKeyName: "maintenanceSchedule_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCentersWithBlockingStatus"
+ referencedColumns: ["id"]
+ },
{
foreignKeyName: "workCenter_locationId_fkey"
columns: ["locationId"]
@@ -47614,6 +48165,13 @@ export type Database = {
referencedRelation: "workCenters"
referencedColumns: ["id"]
},
+ {
+ foreignKeyName: "quoteOperation_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCentersWithBlockingStatus"
+ referencedColumns: ["id"]
+ },
]
}
quotes: {
@@ -48412,14 +48970,14 @@ export type Database = {
Relationships: [
{
foreignKeyName: "address_countryCode_fkey"
- columns: ["customerCountryCode"]
+ columns: ["invoiceCountryCode"]
isOneToOne: false
referencedRelation: "country"
referencedColumns: ["alpha2"]
},
{
foreignKeyName: "address_countryCode_fkey"
- columns: ["invoiceCountryCode"]
+ columns: ["customerCountryCode"]
isOneToOne: false
referencedRelation: "country"
referencedColumns: ["alpha2"]
@@ -51620,6 +52178,145 @@ export type Database = {
},
]
}
+ workCentersWithBlockingStatus: {
+ Row: {
+ active: boolean | null
+ blockingDispatchId: string | null
+ blockingDispatchReadableId: string | null
+ companyId: string | null
+ createdAt: string | null
+ createdBy: string | null
+ customFields: Json | null
+ defaultStandardFactor: Database["public"]["Enums"]["factor"] | null
+ description: string | null
+ id: string | null
+ isBlocked: boolean | null
+ laborRate: number | null
+ locationId: string | null
+ locationName: string | null
+ machineRate: number | null
+ name: string | null
+ overheadRate: number | null
+ requiredAbilityId: string | null
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "workCenter_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "workCenter_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "workCenter_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "workCenter_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_requiredAbilityId_fkey"
+ columns: ["requiredAbilityId"]
+ isOneToOne: false
+ referencedRelation: "ability"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
}
Functions: {
_xid_machine_id: { Args: never; Returns: number }
@@ -53246,7 +53943,7 @@ export type Database = {
| "Annual"
maintenanceSeverity:
| "Preventive"
- | "OPM"
+ | "Operator Performed"
| "Maintenance Required"
| "OEM Required"
maintenanceSource: "Scheduled" | "Reactive" | "Non-Conformance"
@@ -53291,6 +53988,7 @@ export type Database = {
| "In Progress"
| "Completed"
| "Skipped"
+ oeeImpact: "Down" | "Planned" | "Impact" | "No Impact"
operationType: "Inside" | "Outside"
payableLineType:
| "Comment"
@@ -54388,7 +55086,7 @@ export const Constants = {
],
maintenanceSeverity: [
"Preventive",
- "OPM",
+ "Operator Performed",
"Maintenance Required",
"OEM Required",
],
@@ -54437,6 +55135,7 @@ export const Constants = {
"Completed",
"Skipped",
],
+ oeeImpact: ["Down", "Planned", "Impact", "No Impact"],
operationType: ["Inside", "Outside"],
payableLineType: [
"Comment",
diff --git a/packages/database/supabase/functions/lib/types.ts b/packages/database/supabase/functions/lib/types.ts
index 31930e694d..4a4bbb1ca3 100644
--- a/packages/database/supabase/functions/lib/types.ts
+++ b/packages/database/supabase/functions/lib/types.ts
@@ -10902,6 +10902,13 @@ export type Database = {
referencedRelation: "workCenters"
referencedColumns: ["id"]
},
+ {
+ foreignKeyName: "jobOperation_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCentersWithBlockingStatus"
+ referencedColumns: ["id"]
+ },
]
}
jobOperationDependency: {
@@ -12450,10 +12457,10 @@ export type Database = {
createdBy: string
duration: number | null
id: string
- isFailure: boolean
maintenanceDispatchId: string
maintenanceScheduleId: string | null
nonConformanceId: string | null
+ oeeImpact: Database["public"]["Enums"]["oeeImpact"]
plannedEndTime: string | null
plannedStartTime: string | null
priority: Database["public"]["Enums"]["maintenanceDispatchPriority"]
@@ -12477,10 +12484,10 @@ export type Database = {
createdBy: string
duration?: number | null
id?: string
- isFailure?: boolean
maintenanceDispatchId: string
maintenanceScheduleId?: string | null
nonConformanceId?: string | null
+ oeeImpact?: Database["public"]["Enums"]["oeeImpact"]
plannedEndTime?: string | null
plannedStartTime?: string | null
priority?: Database["public"]["Enums"]["maintenanceDispatchPriority"]
@@ -12504,10 +12511,10 @@ export type Database = {
createdBy?: string
duration?: number | null
id?: string
- isFailure?: boolean
maintenanceDispatchId?: string
maintenanceScheduleId?: string | null
nonConformanceId?: string | null
+ oeeImpact?: Database["public"]["Enums"]["oeeImpact"]
plannedEndTime?: string | null
plannedStartTime?: string | null
priority?: Database["public"]["Enums"]["maintenanceDispatchPriority"]
@@ -12709,6 +12716,13 @@ export type Database = {
referencedRelation: "workCenters"
referencedColumns: ["id"]
},
+ {
+ foreignKeyName: "maintenanceDispatch_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCentersWithBlockingStatus"
+ referencedColumns: ["id"]
+ },
]
}
maintenanceDispatchComment: {
@@ -12806,6 +12820,13 @@ export type Database = {
referencedRelation: "userDefaults"
referencedColumns: ["userId"]
},
+ {
+ foreignKeyName: "maintenanceDispatchComment_maintenanceDispatchId_fkey"
+ columns: ["maintenanceDispatchId"]
+ isOneToOne: false
+ referencedRelation: "activeMaintenanceDispatchesByLocation"
+ referencedColumns: ["id"]
+ },
{
foreignKeyName: "maintenanceDispatchComment_maintenanceDispatchId_fkey"
columns: ["maintenanceDispatchId"]
@@ -12995,6 +13016,13 @@ export type Database = {
referencedRelation: "userDefaults"
referencedColumns: ["userId"]
},
+ {
+ foreignKeyName: "maintenanceDispatchEvent_maintenanceDispatchId_fkey"
+ columns: ["maintenanceDispatchId"]
+ isOneToOne: false
+ referencedRelation: "activeMaintenanceDispatchesByLocation"
+ referencedColumns: ["id"]
+ },
{
foreignKeyName: "maintenanceDispatchEvent_maintenanceDispatchId_fkey"
columns: ["maintenanceDispatchId"]
@@ -13051,6 +13079,13 @@ export type Database = {
referencedRelation: "workCenters"
referencedColumns: ["id"]
},
+ {
+ foreignKeyName: "maintenanceDispatchEvent_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCentersWithBlockingStatus"
+ referencedColumns: ["id"]
+ },
]
}
maintenanceDispatchItem: {
@@ -13195,6 +13230,13 @@ export type Database = {
referencedRelation: "tools"
referencedColumns: ["id"]
},
+ {
+ foreignKeyName: "maintenanceDispatchItem_maintenanceDispatchId_fkey"
+ columns: ["maintenanceDispatchId"]
+ isOneToOne: false
+ referencedRelation: "activeMaintenanceDispatchesByLocation"
+ referencedColumns: ["id"]
+ },
{
foreignKeyName: "maintenanceDispatchItem_maintenanceDispatchId_fkey"
columns: ["maintenanceDispatchId"]
@@ -13334,6 +13376,13 @@ export type Database = {
referencedRelation: "userDefaults"
referencedColumns: ["userId"]
},
+ {
+ foreignKeyName: "maintenanceDispatchWorkCenter_maintenanceDispatchId_fkey"
+ columns: ["maintenanceDispatchId"]
+ isOneToOne: false
+ referencedRelation: "activeMaintenanceDispatchesByLocation"
+ referencedColumns: ["id"]
+ },
{
foreignKeyName: "maintenanceDispatchWorkCenter_maintenanceDispatchId_fkey"
columns: ["maintenanceDispatchId"]
@@ -13390,6 +13439,13 @@ export type Database = {
referencedRelation: "workCenters"
referencedColumns: ["id"]
},
+ {
+ foreignKeyName: "maintenanceDispatchWorkCenter_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCentersWithBlockingStatus"
+ referencedColumns: ["id"]
+ },
]
}
maintenanceFailureMode: {
@@ -13686,6 +13742,13 @@ export type Database = {
referencedRelation: "workCenters"
referencedColumns: ["id"]
},
+ {
+ foreignKeyName: "maintenanceSchedule_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCentersWithBlockingStatus"
+ referencedColumns: ["id"]
+ },
]
}
maintenanceScheduleItem: {
@@ -15404,6 +15467,13 @@ export type Database = {
referencedRelation: "workCenters"
referencedColumns: ["id"]
},
+ {
+ foreignKeyName: "methodOperation_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCentersWithBlockingStatus"
+ referencedColumns: ["id"]
+ },
{
foreignKeyName: "quoteOperation_operationSupplierProcessId_fkey"
columns: ["operationSupplierProcessId"]
@@ -21990,6 +22060,13 @@ export type Database = {
referencedRelation: "workCenters"
referencedColumns: ["id"]
},
+ {
+ foreignKeyName: "productionEvent_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCentersWithBlockingStatus"
+ referencedColumns: ["id"]
+ },
]
}
productionQuantity: {
@@ -26757,6 +26834,13 @@ export type Database = {
referencedRelation: "workCenters"
referencedColumns: ["id"]
},
+ {
+ foreignKeyName: "quoteOperation_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCentersWithBlockingStatus"
+ referencedColumns: ["id"]
+ },
]
}
quoteOperationParameter: {
@@ -39671,6 +39755,207 @@ export type Database = {
referencedRelation: "workCenters"
referencedColumns: ["id"]
},
+ {
+ foreignKeyName: "workCenterProcess_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCentersWithBlockingStatus"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
+ workCenterReplacementPart: {
+ Row: {
+ companyId: string
+ createdAt: string
+ createdBy: string
+ id: string
+ itemId: string
+ quantity: number
+ unitOfMeasureCode: string
+ updatedAt: string | null
+ updatedBy: string | null
+ workCenterId: string
+ }
+ Insert: {
+ companyId: string
+ createdAt?: string
+ createdBy: string
+ id?: string
+ itemId: string
+ quantity: number
+ unitOfMeasureCode: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ workCenterId: string
+ }
+ Update: {
+ companyId?: string
+ createdAt?: string
+ createdBy?: string
+ id?: string
+ itemId?: string
+ quantity?: number
+ unitOfMeasureCode?: string
+ updatedAt?: string | null
+ updatedBy?: string | null
+ workCenterId?: string
+ }
+ Relationships: [
+ {
+ foreignKeyName: "workCenterReplacementPart_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "consumables"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "item"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "materials"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "parts"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_itemId_fkey"
+ columns: ["itemId"]
+ isOneToOne: false
+ referencedRelation: "tools"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCenter"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCenters"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenterReplacementPart_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCentersWithBlockingStatus"
+ referencedColumns: ["id"]
+ },
]
}
}
@@ -40001,6 +40286,251 @@ export type Database = {
},
]
}
+ activeMaintenanceDispatchesByLocation: {
+ Row: {
+ actualEndTime: string | null
+ actualFailureModeId: string | null
+ actualFailureModeName: string | null
+ actualStartTime: string | null
+ assignee: string | null
+ assigneeAvatarUrl: string | null
+ assigneeName: string | null
+ companyId: string | null
+ completedAt: string | null
+ content: Json | null
+ createdAt: string | null
+ createdBy: string | null
+ duration: number | null
+ id: string | null
+ locationId: string | null
+ locationName: string | null
+ maintenanceDispatchId: string | null
+ maintenanceScheduleId: string | null
+ nonConformanceId: string | null
+ oeeImpact: Database["public"]["Enums"]["oeeImpact"] | null
+ plannedEndTime: string | null
+ plannedStartTime: string | null
+ priority:
+ | Database["public"]["Enums"]["maintenanceDispatchPriority"]
+ | null
+ severity: Database["public"]["Enums"]["maintenanceSeverity"] | null
+ source: Database["public"]["Enums"]["maintenanceSource"] | null
+ status:
+ | Database["public"]["Enums"]["maintenanceDispatchStatus"]
+ | null
+ suspectedFailureModeId: string | null
+ suspectedFailureModeName: string | null
+ updatedAt: string | null
+ updatedBy: string | null
+ workCenterId: string | null
+ workCenterName: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "maintenanceDispatch_actualFailureModeId_fkey"
+ columns: ["actualFailureModeId"]
+ isOneToOne: false
+ referencedRelation: "maintenanceFailureMode"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_assignee_fkey"
+ columns: ["assignee"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_maintenanceScheduleId_fkey"
+ columns: ["maintenanceScheduleId"]
+ isOneToOne: false
+ referencedRelation: "maintenanceSchedule"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_maintenanceScheduleId_fkey"
+ columns: ["maintenanceScheduleId"]
+ isOneToOne: false
+ referencedRelation: "maintenanceSchedules"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_nonConformanceId_fkey"
+ columns: ["nonConformanceId"]
+ isOneToOne: false
+ referencedRelation: "issues"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_nonConformanceId_fkey"
+ columns: ["nonConformanceId"]
+ isOneToOne: false
+ referencedRelation: "nonConformance"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_suspectedFailureModeId_fkey"
+ columns: ["suspectedFailureModeId"]
+ isOneToOne: false
+ referencedRelation: "maintenanceFailureMode"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCenter"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCenters"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "maintenanceDispatch_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCentersWithBlockingStatus"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
activeMakeMethods: {
Row: {
companyId: string | null
@@ -42530,6 +43060,13 @@ export type Database = {
referencedRelation: "workCenters"
referencedColumns: ["id"]
},
+ {
+ foreignKeyName: "jobOperation_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCentersWithBlockingStatus"
+ referencedColumns: ["id"]
+ },
]
}
jobOperationsWithMakeMethods: {
@@ -42794,6 +43331,13 @@ export type Database = {
referencedRelation: "workCenters"
referencedColumns: ["id"]
},
+ {
+ foreignKeyName: "jobOperation_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCentersWithBlockingStatus"
+ referencedColumns: ["id"]
+ },
]
}
jobs: {
@@ -43511,6 +44055,13 @@ export type Database = {
referencedRelation: "workCenters"
referencedColumns: ["id"]
},
+ {
+ foreignKeyName: "maintenanceSchedule_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCentersWithBlockingStatus"
+ referencedColumns: ["id"]
+ },
{
foreignKeyName: "workCenter_locationId_fkey"
columns: ["locationId"]
@@ -47614,6 +48165,13 @@ export type Database = {
referencedRelation: "workCenters"
referencedColumns: ["id"]
},
+ {
+ foreignKeyName: "quoteOperation_workCenterId_fkey"
+ columns: ["workCenterId"]
+ isOneToOne: false
+ referencedRelation: "workCentersWithBlockingStatus"
+ referencedColumns: ["id"]
+ },
]
}
quotes: {
@@ -48412,14 +48970,14 @@ export type Database = {
Relationships: [
{
foreignKeyName: "address_countryCode_fkey"
- columns: ["customerCountryCode"]
+ columns: ["invoiceCountryCode"]
isOneToOne: false
referencedRelation: "country"
referencedColumns: ["alpha2"]
},
{
foreignKeyName: "address_countryCode_fkey"
- columns: ["invoiceCountryCode"]
+ columns: ["customerCountryCode"]
isOneToOne: false
referencedRelation: "country"
referencedColumns: ["alpha2"]
@@ -51620,6 +52178,145 @@ export type Database = {
},
]
}
+ workCentersWithBlockingStatus: {
+ Row: {
+ active: boolean | null
+ blockingDispatchId: string | null
+ blockingDispatchReadableId: string | null
+ companyId: string | null
+ createdAt: string | null
+ createdBy: string | null
+ customFields: Json | null
+ defaultStandardFactor: Database["public"]["Enums"]["factor"] | null
+ description: string | null
+ id: string | null
+ isBlocked: boolean | null
+ laborRate: number | null
+ locationId: string | null
+ locationName: string | null
+ machineRate: number | null
+ name: string | null
+ overheadRate: number | null
+ requiredAbilityId: string | null
+ tags: string[] | null
+ updatedAt: string | null
+ updatedBy: string | null
+ }
+ Relationships: [
+ {
+ foreignKeyName: "workCenter_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "companies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "company"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "customFieldTables"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "workCenter_companyId_fkey"
+ columns: ["companyId"]
+ isOneToOne: false
+ referencedRelation: "integrations"
+ referencedColumns: ["companyId"]
+ },
+ {
+ foreignKeyName: "workCenter_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_createdBy_fkey"
+ columns: ["createdBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ {
+ foreignKeyName: "workCenter_locationId_fkey"
+ columns: ["locationId"]
+ isOneToOne: false
+ referencedRelation: "location"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_requiredAbilityId_fkey"
+ columns: ["requiredAbilityId"]
+ isOneToOne: false
+ referencedRelation: "ability"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employees"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeesAcrossCompanies"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "employeeSummary"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "user"
+ referencedColumns: ["id"]
+ },
+ {
+ foreignKeyName: "workCenter_updatedBy_fkey"
+ columns: ["updatedBy"]
+ isOneToOne: false
+ referencedRelation: "userDefaults"
+ referencedColumns: ["userId"]
+ },
+ ]
+ }
}
Functions: {
_xid_machine_id: { Args: never; Returns: number }
@@ -53246,7 +53943,7 @@ export type Database = {
| "Annual"
maintenanceSeverity:
| "Preventive"
- | "OPM"
+ | "Operator Performed"
| "Maintenance Required"
| "OEM Required"
maintenanceSource: "Scheduled" | "Reactive" | "Non-Conformance"
@@ -53291,6 +53988,7 @@ export type Database = {
| "In Progress"
| "Completed"
| "Skipped"
+ oeeImpact: "Down" | "Planned" | "Impact" | "No Impact"
operationType: "Inside" | "Outside"
payableLineType:
| "Comment"
@@ -54388,7 +55086,7 @@ export const Constants = {
],
maintenanceSeverity: [
"Preventive",
- "OPM",
+ "Operator Performed",
"Maintenance Required",
"OEM Required",
],
@@ -54437,6 +55135,7 @@ export const Constants = {
"Completed",
"Skipped",
],
+ oeeImpact: ["Down", "Planned", "Impact", "No Impact"],
operationType: ["Inside", "Outside"],
payableLineType: [
"Comment",
diff --git a/packages/database/supabase/migrations/20251216021152_maintenance.sql b/packages/database/supabase/migrations/20251216021152_maintenance.sql
index 72708c74e9..b04cda2f26 100644
--- a/packages/database/supabase/migrations/20251216021152_maintenance.sql
+++ b/packages/database/supabase/migrations/20251216021152_maintenance.sql
@@ -187,7 +187,6 @@ CREATE TABLE "maintenanceDispatch" (
"plannedEndTime" TIMESTAMP WITH TIME ZONE,
"actualStartTime" TIMESTAMP WITH TIME ZONE,
"actualEndTime" TIMESTAMP WITH TIME ZONE,
- "isFailure" BOOLEAN NOT NULL DEFAULT false,
"duration" INTEGER GENERATED ALWAYS AS (
CASE
WHEN "actualEndTime" IS NULL THEN 0
diff --git a/packages/database/supabase/migrations/20251220210000_maintenance_oee_impact.sql b/packages/database/supabase/migrations/20251220210000_maintenance_oee_impact.sql
index b8fc1297a0..2d0e70e6c0 100644
--- a/packages/database/supabase/migrations/20251220210000_maintenance_oee_impact.sql
+++ b/packages/database/supabase/migrations/20251220210000_maintenance_oee_impact.sql
@@ -39,7 +39,6 @@ SELECT
md."plannedEndTime",
md."actualStartTime",
md."actualEndTime",
- md."isFailure",
md.duration,
md."nonConformanceId",
md."completedAt",