Add company management module with registration and entity switching

This commit is contained in:
timurgordon
2025-05-05 13:58:51 +03:00
parent 2760f00a30
commit 9468595395
20 changed files with 2538 additions and 76 deletions

View File

@@ -10,6 +10,7 @@ use crate::controllers::contract::ContractController;
use crate::controllers::asset::AssetController;
use crate::controllers::marketplace::MarketplaceController;
use crate::controllers::defi::DefiController;
use crate::controllers::company::CompanyController;
use crate::middleware::JwtAuth;
use crate::SESSION_KEY;
@@ -133,6 +134,14 @@ pub fn configure_routes(cfg: &mut web::ServiceConfig) {
.route("/swap", web::post().to(DefiController::swap_tokens))
.route("/collateral", web::post().to(DefiController::create_collateral))
)
// Company routes
.service(
web::scope("/company")
.route("", web::get().to(CompanyController::index))
.route("/register", web::post().to(CompanyController::register))
.route("/view/{id}", web::get().to(CompanyController::view_company))
.route("/switch/{id}", web::get().to(CompanyController::switch_entity))
)
);
// Keep the /protected scope for any future routes that should be under that path