d8372c6fb8
Replaced the loop over `body.order` which generated an N+1 issue with a single bulk query fetching all relevant `SubscriptionPlan` records via the `.in_()` clause. Added an in-memory dictionary map of `plan_id` to `SubscriptionPlan` objects to allow `O(1)` lookups while updating the order. Benchmark speedup: 14.71x faster on 500 records. Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>