Stock plan data that may contain deprecated fields
Optionalcontext: stringOptional context for deprecation warnings (e.g., "stockPlan.create")
Object containing normalized stock_class_ids and deprecation usage flag
// Old format (deprecated)
const result = normalizeDeprecatedStockPlanFields({
stock_class_id: 'sc-1',
});
// Returns { stock_class_ids: ['sc-1'], usedDeprecatedField: true }
// New format
const result = normalizeDeprecatedStockPlanFields({
stock_class_ids: ['sc-1', 'sc-2'],
});
// Returns { stock_class_ids: ['sc-1', 'sc-2'], usedDeprecatedField: false }
Normalize deprecated stock plan fields.
Handles the OCF deprecation of
stock_class_id(singular) →stock_class_ids(array).