feat: migrate billing plans APIs to Connect RPC #1165
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
✅ COMPLETE: Successfully migrated all 4 billing plan APIs from gRPC to Connect RPC format as part of the IAM API standardization initiative.
Linear Ticket
CLD-2277: Migrate Frontier RPC - Billing Plans
APIs Migrated
Progress: 4/4 APIs Complete (100%) 🎉
Implementation Summary
Files Changed
billing/plan/service.go- Added UpdateByName service methodinternal/api/v1beta1/billing_plan.go- Extended PlanService interfaceinternal/api/v1beta1/mocks/plan_service.go- Updated mock with UpdateByName supportinternal/api/v1beta1connect/billing_plan.go- All 4 Connect RPC implementationsinternal/api/v1beta1connect/billing_plan_test.go- Complete test suite with 16 scenariosinternal/api/v1beta1connect/billing_subscription.go- Extended PlanService interfaceKey Features Implemented
✅ Connect RPC Patterns: All handlers use
connect.Request[T]andconnect.Response[T]✅ Complex Data Handling: Full product/price/feature parsing and transformation
✅ Metadata Support: Proper handling for plan, product, price, and feature metadata
✅ Service Integration: UpsertPlans, GetByID, List, and UpdateByName service methods
✅ Error Handling: Comprehensive Connect error codes with proper error constants
✅ Business Logic: 100% preservation of original gRPC business logic
✅ Comprehensive Testing: 16 test scenarios covering all APIs and edge cases
Test Coverage Details
CreatePlan (5 scenarios)
ListPlans (4 scenarios)
GetPlan (3 scenarios)
UpdatePlan (4 scenarios)
Quality Verification
Migration Achievements
Technical Highlights
Ready for review and merge! 🚀