Add missing trait methods to ServiceProvider traits #26

Closed
opened 2026-02-09 22:53:30 +00:00 by mik-tf · 0 comments
Owner

Problem

Multiple controller handlers bypass ServiceProvider by calling concrete services directly (UserPersistence, UserService, SliceRentalService, etc.) because the required methods do not exist on the corresponding traits.

New methods needed

UserProfile trait (~9 methods)

  • update_notification_settings(user_email, settings)
  • get_compute_resources(user_email)
  • calculate_metrics(user_email)
  • get_active_deployments(user_email)
  • get_applications(user_email)
  • get_purchased_services(user_email)
  • get_purchase_history(user_email)
  • get_or_create_user_data(user_email) (combines load + create_default)
  • save_user_data(user_email, data) (generic persistence)

ResourceProviderManager trait (~10 methods)

  • get_slice_products(user_email)
  • add_slice_product(user_email, product)
  • update_slice_product(user_email, product)
  • delete_slice_product(user_email, product_id)
  • remove_node(user_email, node_id)
  • refresh_slice_calculations(user_email)
  • get_node_slices(user_email, node_id)
  • fetch_and_validate_grid_node(node_id)
  • add_multiple_grid_nodes(user_email, node_ids)
  • sync_nodes_with_grid(user_email)

ServiceProviderManager trait (~4 methods)

  • remove_service_request(user_email, request_id)
  • update_service_request_progress(user_email, request_id, progress, ...)
  • get_sla_by_id(user_email, sla_id)
  • get_user_products(user_email) / add_user_product(user_email, product)

WalletManager trait (~2 methods)

  • configure_auto_topup(user_email, settings)
  • get_auto_topup_settings(user_email)

OrderManager trait (~1 method)

  • transfer_guest_cart(user_email, session)

Implementation

  1. Add method signatures to src/services/traits/mod.rs
  2. Implement in src/services/impl_fixtures/ (delegate to existing concrete services)
  3. Implement in src/services/impl_hero/ (delegate to OsisClient)

This is a prerequisite for fully rewiring all controllers (issues #10-#17).

## Problem Multiple controller handlers bypass ServiceProvider by calling concrete services directly (UserPersistence, UserService, SliceRentalService, etc.) because the required methods do not exist on the corresponding traits. ## New methods needed ### UserProfile trait (~9 methods) - `update_notification_settings(user_email, settings)` - `get_compute_resources(user_email)` - `calculate_metrics(user_email)` - `get_active_deployments(user_email)` - `get_applications(user_email)` - `get_purchased_services(user_email)` - `get_purchase_history(user_email)` - `get_or_create_user_data(user_email)` (combines load + create_default) - `save_user_data(user_email, data)` (generic persistence) ### ResourceProviderManager trait (~10 methods) - `get_slice_products(user_email)` - `add_slice_product(user_email, product)` - `update_slice_product(user_email, product)` - `delete_slice_product(user_email, product_id)` - `remove_node(user_email, node_id)` - `refresh_slice_calculations(user_email)` - `get_node_slices(user_email, node_id)` - `fetch_and_validate_grid_node(node_id)` - `add_multiple_grid_nodes(user_email, node_ids)` - `sync_nodes_with_grid(user_email)` ### ServiceProviderManager trait (~4 methods) - `remove_service_request(user_email, request_id)` - `update_service_request_progress(user_email, request_id, progress, ...)` - `get_sla_by_id(user_email, sla_id)` - `get_user_products(user_email)` / `add_user_product(user_email, product)` ### WalletManager trait (~2 methods) - `configure_auto_topup(user_email, settings)` - `get_auto_topup_settings(user_email)` ### OrderManager trait (~1 method) - `transfer_guest_cart(user_email, session)` ## Implementation 1. Add method signatures to `src/services/traits/mod.rs` 2. Implement in `src/services/impl_fixtures/` (delegate to existing concrete services) 3. Implement in `src/services/impl_hero/` (delegate to OsisClient) This is a prerequisite for fully rewiring all controllers (issues #10-#17).
Commenting is not possible because the repository is archived.
No milestone
No project
No assignees
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
coopcloud_code/projectmycelium_marketplace#26
No description provided.