Open Cap Table Protocol Canton SDK - v0.2.224
    Preparing search index...

    Function normalizeDeprecatedStockPlanFields

    • Normalize deprecated stock plan fields.

      Handles the OCF deprecation of stock_class_id (singular) → stock_class_ids (array).

      Parameters

      • data: StockPlanDataWithDeprecatedField

        Stock plan data that may contain deprecated fields

      • Optionalcontext: string

        Optional context for deprecation warnings (e.g., "stockPlan.create")

      Returns NormalizedStockPlanFields

      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 }