Rewire Resource Provider handlers to use ServiceProvider traits #10
Labels
No milestone
No project
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set.
Reference
coopcloud_code/projectmycelium_marketplace#10
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
16 Resource Provider handlers in dashboard bypass the ServiceProvider DI container and directly instantiate fixture-based services. When running with
APP_BACKEND=hero, these handlers return empty data because they read from JSON fixture files instead of hero_osis.Affected Handlers
All handlers in the Resource Provider domain that use patterns like:
Template-Rendering Handlers (return HTML pages)
resource_provider_section— Main RP dashboard pageresource_provider_node_detail— Individual node viewresource_provider_slice_management— Slice/rental managementresource_provider_earnings— Earnings overviewresource_provider_wallet— RP wallet viewresource_provider_statistics— Statistics pageresource_provider_settings— RP settingsAPI Handlers (return JSON)
resource_provider_data_api— ✅ Already fixed (uses ServiceProvider)resource_provider_nodes_api— Returns node listresource_provider_earnings_api— Returns earnings dataresource_provider_statistics_api— Returns statisticsresource_provider_node_action_api— Node enable/disable actionsSolution
For each handler:
services: web::Data<ServiceProvider>parameterResourceProviderService::builder().build()withservices.resource_provider.*callsUserService::builder().build()withservices.users.*callsAcceptance Criteria
ResourceProviderService::builder()calls remain in RP handlersDependencies
Rewired 25 Resource Provider handler calls to ServiceProvider traits (commit
277b958). 11 fixture-only calls remain (no trait equivalents).Reopened — remaining work
Previous commit rewired 25 handlers but 11
ResourceProviderService::builder()+ 11UserPersistencecalls remain.Remaining bypasses:
ResourceProviderService::builder()at lines 667, 702, 1082, 1092, 1369, 2446, 2507, 2569, 2754, 2818, 2862, 2908 — methods: grid sync, slice calculations, format customizationsUserPersistenceat lines 751, 807, 825, 849, 886, 957, 1020, 1168, 1738, 1910, 2195 — methods: slice products, node CRUD, user lockSessionManagerat lines 84, 85 — session infrastructure (keep)Depends on #26 for new trait methods (get_slice_products, remove_node, etc.)