- Extracted
ProductService,EventService,UserService,ApiKeyService,SyncService, andRecallServicefrom the 1282-line monolithicservices.rsinto individual files underbackend/src/services/ - Fixed a correctness issue: cache helper methods (
invalidate_product_cache,invalidate_global_stats) were incorrectly placed inside traitimplblocks; they are now in inherentimplblocks where they belong - Reduced
services.rsto 40 lines ofpub moddeclarations andpub usere-exports — all existing import paths remain unchanged - Added missing re-exports for
BatchService,BatchRepository,SupplierService,IoTService,QualityService, andRegulatoryService, which were referenced in handlers but not previously re-exported
| File | Lines | Contents |
|---|---|---|
services/product.rs |
266 | ProductService + ProductRepository impl |
services/event.rs |
169 | EventService + EventRepository impl |
services/user.rs |
178 | UserService + UserRepository impl |
services/api_key.rs |
143 | ApiKeyService + ApiKeyRepository impl |
services/sync.rs |
64 | SyncService |
services/recall.rs |
343 | RecallService |
-
cargo checkpasses with no new errors - All handler paths that call into services resolve correctly (no broken imports)
-
crate::services::ApiKeyService::hash_api_key/generate_api_keystill callable as static methods -
crate::services::UserService::hash_passwordstill callable as a static method -
crate::services::BatchRepositorytrait is accessible fromhandlers/batch.rs
Closes #407