import type { WorkOrderTablePatch } from "@/domain/work-orders/types/work-order-table-row"; export function serviceIdentityPatch( currentServiceId: string | number | null | undefined, currentName: string, nextName: string, nextServiceId: string | number | null | undefined, ): Pick { const sameIdentity = currentServiceId != null && nextServiceId != null && String(currentServiceId) === String(nextServiceId); if (sameIdentity) return {}; if (nextServiceId != null) return { pm: nextName, serviceId: nextServiceId }; if (currentServiceId != null) return { pm: nextName, serviceId: null }; return nextName === currentName ? {} : { pm: nextName }; }