Skip to main content

coil_commerce/module/platform/
mod.rs

1use super::core::CommerceModule;
2use coil_core::{PlatformModule, RegistrationError, ServiceRegistry};
3use coil_data::MigrationPlan;
4
5mod manifest;
6mod registration;
7
8use manifest::build_manifest;
9use registration::register_module_services;
10
11impl PlatformModule for CommerceModule {
12    fn manifest(&self) -> coil_core::ModuleManifest {
13        build_manifest(self)
14    }
15
16    fn register(&self, registry: &mut ServiceRegistry) -> Result<(), RegistrationError> {
17        register_module_services(self, registry)
18    }
19
20    fn install_migration_plan(&self) -> Option<MigrationPlan> {
21        Some(
22            CommerceModule::migration_plan(self)
23                .expect("commerce migration plan is constant and valid"),
24        )
25    }
26}