Bug #11774
openAllow Explicit Service Removal in Partial Quotation Updates
0%
Description
In
updateQuotation
, the merge routine was introduced to prevent accidental deletion of services when updating costBreakdowns:
javascript
const mergedServiceIds = Array.from(
new Set([
...extractServiceIds(existingQuotation.services),
...extractServiceIds(existingQuotation.costBreakdowns),
...derivedServiceIds,
...explicitServiceIds,
]),
);
While the frontend UI in
EditQuotations.tsx:L763
always provides services: servicesPayload, if an API caller or background process updates costBreakdowns with a removed service and leaves services undefined, mergedServiceIds unconditionally merges the old services back from existingQuotation.services.
2. Acceptance Criteria
AC 4.1 (Explicit Empty Services): Given an update payload containing costBreakdowns and an explicit services: [] (or fewer services), When updateQuotation is processed, Then mergedServiceIds MUST respect the services present in the incoming costBreakdowns and services payload without forcefully restoring deleted services from existingQuotation.services.
AC 4.2 (Safe Fallback When Services Omitted): If and only if the incoming payload contains neither services nor costBreakdowns, existing services must be preserved.
Subtasks
Related issues
No data to display