diff --git a/src/api/api-paths.ts b/src/api/api-paths.ts index 64405aa6..303d9711 100644 --- a/src/api/api-paths.ts +++ b/src/api/api-paths.ts @@ -31,6 +31,7 @@ export const API_PATHS = { boardSearch: "workorders/board/search", boardPatch: (id: string | number) => `workorders/${id}/board`, boardDetail: (id: string | number) => `workorders/${id}/detail`, + completionTemplates: "workorders/completion-templates", comments: (id: string | number) => `workorders/${id}/comments`, commentItem: (workOrderId: string | number, commentId: string | number) => `workorders/${workOrderId}/comments/${commentId}`, @@ -167,6 +168,8 @@ export const API_PATHS = { }, services: { list: "services", + byId: (id: string | number) => `services/${id}`, + deactivate: (id: string | number) => `services/${id}/deactivate`, }, user: { list: "User", diff --git a/src/app/(protected)/settings/_components/services-registry-components.tsx b/src/app/(protected)/settings/_components/services-registry-components.tsx new file mode 100644 index 00000000..e7145bec --- /dev/null +++ b/src/app/(protected)/settings/_components/services-registry-components.tsx @@ -0,0 +1,379 @@ +import { + Autocomplete, + Box, + Button, + Checkbox, + Chip, + Dialog, + DialogActions, + DialogContent, + DialogContentText, + DialogTitle, + Divider, + Drawer, + FormControl, + FormControlLabel, + FormHelperText, + InputLabel, + MenuItem, + Select, + Stack, + Switch, + TextField, + Typography, +} from "@mui/material"; +import { Droplets, Hammer, Settings2, Wrench, Zap } from "lucide-react"; +import { + SERVICE_WORK_ORDER_TYPES, + type CompletionDocTemplateOption, + type Service, + type ServiceWorkOrderType, +} from "@/domain/services/types/service"; +import type { ServiceForm } from "@/domain/services/use-cases/use-services-registry-controller"; + +const ICONS = [ + { key: "wrench", label: "Wrench", Icon: Wrench }, + { key: "droplets", label: "Droplets", Icon: Droplets }, + { key: "zap", label: "Zap", Icon: Zap }, + { key: "hammer", label: "Hammer", Icon: Hammer }, + { key: "settings", label: "Settings", Icon: Settings2 }, +] as const; + +export function ServiceIcon({ iconKey, size = 18 }: { iconKey: string; size?: number }) { + const icon = ICONS.find((item) => item.key === iconKey) ?? ICONS[0]; + const Icon = icon.Icon; + return