use axum::Router;
use std::sync::Arc;
use super::{
picking_batch_handler::create_picking_batch_read_routes,
delivery_note_handler::create_delivery_note_read_routes,
delivery_note_item_handler::create_delivery_note_item_read_routes,
inventory_company_setting_handler::create_inventory_company_setting_routes,
landed_cost_handler::create_landed_cost_read_routes,
landed_cost_line_handler::create_landed_cost_line_read_routes,
landed_cost_adjustment_line_handler::create_landed_cost_adjustment_line_read_routes,
location_handler::create_location_routes,
stock_move_handler::create_stock_move_read_routes,
stock_move_line_handler::create_stock_move_line_read_routes,
operation_type_handler::create_operation_type_routes,
transfer_handler::create_transfer_read_routes,
route_handler::create_route_routes,
route_rule_handler::create_route_rule_routes,
reordering_rule_handler::create_reordering_rule_routes,
purchase_receipt_handler::create_purchase_receipt_read_routes,
purchase_receipt_item_handler::create_purchase_receipt_item_read_routes,
quant_handler::create_quant_read_routes,
scrap_handler::create_scrap_read_routes,
scrap_reason_tag_handler::create_scrap_reason_tag_routes,
stock_entry_handler::create_stock_entry_read_routes,
stock_entry_item_handler::create_stock_entry_item_read_routes,
stock_ledger_entry_handler::create_stock_ledger_entry_read_routes,
bin_handler::create_bin_read_routes,
stock_reconciliation_handler::create_stock_reconciliation_read_routes,
stock_reconciliation_item_handler::create_stock_reconciliation_item_read_routes,
package_type_handler::create_package_type_routes,
storage_category_handler::create_storage_category_routes,
storage_category_capacity_handler::create_storage_category_capacity_routes,
putaway_rule_handler::create_putaway_rule_routes,
lot_handler::create_lot_routes,
package_handler::create_package_routes,
warehouse_handler::create_warehouse_routes,
stock_item_handler::create_stock_item_routes,
};
use crate::application::service::{
PickingBatchService,
DeliveryNoteService,
DeliveryNoteItemService,
InventoryCompanySettingService,
LandedCostService,
LandedCostLineService,
LandedCostAdjustmentLineService,
LocationService,
StockMoveService,
StockMoveLineService,
OperationTypeService,
TransferService,
RouteService,
RouteRuleService,
ReorderingRuleService,
PurchaseReceiptService,
PurchaseReceiptItemService,
QuantService,
ScrapService,
ScrapReasonTagService,
StockEntryService,
StockEntryItemService,
StockLedgerEntryService,
BinService,
StockReconciliationService,
StockReconciliationItemService,
PackageTypeService,
StorageCategoryService,
StorageCategoryCapacityService,
PutawayRuleService,
LotService,
PackageService,
WarehouseService,
StockItemService,
};
pub struct HttpServices {
pub picking_batch: Arc<PickingBatchService>,
pub delivery_note: Arc<DeliveryNoteService>,
pub delivery_note_item: Arc<DeliveryNoteItemService>,
pub inventory_company_setting: Arc<InventoryCompanySettingService>,
pub landed_cost: Arc<LandedCostService>,
pub landed_cost_line: Arc<LandedCostLineService>,
pub landed_cost_adjustment_line: Arc<LandedCostAdjustmentLineService>,
pub location: Arc<LocationService>,
pub stock_move: Arc<StockMoveService>,
pub stock_move_line: Arc<StockMoveLineService>,
pub operation_type: Arc<OperationTypeService>,
pub transfer: Arc<TransferService>,
pub route: Arc<RouteService>,
pub route_rule: Arc<RouteRuleService>,
pub reordering_rule: Arc<ReorderingRuleService>,
pub purchase_receipt: Arc<PurchaseReceiptService>,
pub purchase_receipt_item: Arc<PurchaseReceiptItemService>,
pub quant: Arc<QuantService>,
pub scrap: Arc<ScrapService>,
pub scrap_reason_tag: Arc<ScrapReasonTagService>,
pub stock_entry: Arc<StockEntryService>,
pub stock_entry_item: Arc<StockEntryItemService>,
pub stock_ledger_entry: Arc<StockLedgerEntryService>,
pub bin: Arc<BinService>,
pub stock_reconciliation: Arc<StockReconciliationService>,
pub stock_reconciliation_item: Arc<StockReconciliationItemService>,
pub package_type: Arc<PackageTypeService>,
pub storage_category: Arc<StorageCategoryService>,
pub storage_category_capacity: Arc<StorageCategoryCapacityService>,
pub putaway_rule: Arc<PutawayRuleService>,
pub lot: Arc<LotService>,
pub package: Arc<PackageService>,
pub warehouse: Arc<WarehouseService>,
pub stock_item: Arc<StockItemService>,
}
pub fn configure_routes(services: HttpServices) -> Router {
Router::new()
.merge(create_picking_batch_read_routes(services.picking_batch))
.merge(create_delivery_note_read_routes(services.delivery_note))
.merge(create_delivery_note_item_read_routes(services.delivery_note_item))
.merge(create_inventory_company_setting_routes(services.inventory_company_setting))
.merge(create_landed_cost_read_routes(services.landed_cost))
.merge(create_landed_cost_line_read_routes(services.landed_cost_line))
.merge(create_landed_cost_adjustment_line_read_routes(services.landed_cost_adjustment_line))
.merge(create_location_routes(services.location))
.merge(create_stock_move_read_routes(services.stock_move))
.merge(create_stock_move_line_read_routes(services.stock_move_line))
.merge(create_operation_type_routes(services.operation_type))
.merge(create_transfer_read_routes(services.transfer))
.merge(create_route_routes(services.route))
.merge(create_route_rule_routes(services.route_rule))
.merge(create_reordering_rule_routes(services.reordering_rule))
.merge(create_purchase_receipt_read_routes(services.purchase_receipt))
.merge(create_purchase_receipt_item_read_routes(services.purchase_receipt_item))
.merge(create_quant_read_routes(services.quant))
.merge(create_scrap_read_routes(services.scrap))
.merge(create_scrap_reason_tag_routes(services.scrap_reason_tag))
.merge(create_stock_entry_read_routes(services.stock_entry))
.merge(create_stock_entry_item_read_routes(services.stock_entry_item))
.merge(create_stock_ledger_entry_read_routes(services.stock_ledger_entry))
.merge(create_bin_read_routes(services.bin))
.merge(create_stock_reconciliation_read_routes(services.stock_reconciliation))
.merge(create_stock_reconciliation_item_read_routes(services.stock_reconciliation_item))
.merge(create_package_type_routes(services.package_type))
.merge(create_storage_category_routes(services.storage_category))
.merge(create_storage_category_capacity_routes(services.storage_category_capacity))
.merge(create_putaway_rule_routes(services.putaway_rule))
.merge(create_lot_routes(services.lot))
.merge(create_package_routes(services.package))
.merge(create_warehouse_routes(services.warehouse))
.merge(create_stock_item_routes(services.stock_item))
}
pub mod individual {
use super::*;
pub fn picking_batch_routes(service: Arc<PickingBatchService>) -> Router {
create_picking_batch_read_routes(service)
}
pub fn delivery_note_routes(service: Arc<DeliveryNoteService>) -> Router {
create_delivery_note_read_routes(service)
}
pub fn delivery_note_item_routes(service: Arc<DeliveryNoteItemService>) -> Router {
create_delivery_note_item_read_routes(service)
}
pub fn inventory_company_setting_routes(service: Arc<InventoryCompanySettingService>) -> Router {
create_inventory_company_setting_routes(service)
}
pub fn landed_cost_routes(service: Arc<LandedCostService>) -> Router {
create_landed_cost_read_routes(service)
}
pub fn landed_cost_line_routes(service: Arc<LandedCostLineService>) -> Router {
create_landed_cost_line_read_routes(service)
}
pub fn landed_cost_adjustment_line_routes(service: Arc<LandedCostAdjustmentLineService>) -> Router {
create_landed_cost_adjustment_line_read_routes(service)
}
pub fn location_routes(service: Arc<LocationService>) -> Router {
create_location_routes(service)
}
pub fn stock_move_routes(service: Arc<StockMoveService>) -> Router {
create_stock_move_read_routes(service)
}
pub fn stock_move_line_routes(service: Arc<StockMoveLineService>) -> Router {
create_stock_move_line_read_routes(service)
}
pub fn operation_type_routes(service: Arc<OperationTypeService>) -> Router {
create_operation_type_routes(service)
}
pub fn transfer_routes(service: Arc<TransferService>) -> Router {
create_transfer_read_routes(service)
}
pub fn route_routes(service: Arc<RouteService>) -> Router {
create_route_routes(service)
}
pub fn route_rule_routes(service: Arc<RouteRuleService>) -> Router {
create_route_rule_routes(service)
}
pub fn reordering_rule_routes(service: Arc<ReorderingRuleService>) -> Router {
create_reordering_rule_routes(service)
}
pub fn purchase_receipt_routes(service: Arc<PurchaseReceiptService>) -> Router {
create_purchase_receipt_read_routes(service)
}
pub fn purchase_receipt_item_routes(service: Arc<PurchaseReceiptItemService>) -> Router {
create_purchase_receipt_item_read_routes(service)
}
pub fn quant_routes(service: Arc<QuantService>) -> Router {
create_quant_read_routes(service)
}
pub fn scrap_routes(service: Arc<ScrapService>) -> Router {
create_scrap_read_routes(service)
}
pub fn scrap_reason_tag_routes(service: Arc<ScrapReasonTagService>) -> Router {
create_scrap_reason_tag_routes(service)
}
pub fn stock_entry_routes(service: Arc<StockEntryService>) -> Router {
create_stock_entry_read_routes(service)
}
pub fn stock_entry_item_routes(service: Arc<StockEntryItemService>) -> Router {
create_stock_entry_item_read_routes(service)
}
pub fn stock_ledger_entry_routes(service: Arc<StockLedgerEntryService>) -> Router {
create_stock_ledger_entry_read_routes(service)
}
pub fn bin_routes(service: Arc<BinService>) -> Router {
create_bin_read_routes(service)
}
pub fn stock_reconciliation_routes(service: Arc<StockReconciliationService>) -> Router {
create_stock_reconciliation_read_routes(service)
}
pub fn stock_reconciliation_item_routes(service: Arc<StockReconciliationItemService>) -> Router {
create_stock_reconciliation_item_read_routes(service)
}
pub fn package_type_routes(service: Arc<PackageTypeService>) -> Router {
create_package_type_routes(service)
}
pub fn storage_category_routes(service: Arc<StorageCategoryService>) -> Router {
create_storage_category_routes(service)
}
pub fn storage_category_capacity_routes(service: Arc<StorageCategoryCapacityService>) -> Router {
create_storage_category_capacity_routes(service)
}
pub fn putaway_rule_routes(service: Arc<PutawayRuleService>) -> Router {
create_putaway_rule_routes(service)
}
pub fn lot_routes(service: Arc<LotService>) -> Router {
create_lot_routes(service)
}
pub fn package_routes(service: Arc<PackageService>) -> Router {
create_package_routes(service)
}
pub fn warehouse_routes(service: Arc<WarehouseService>) -> Router {
create_warehouse_routes(service)
}
pub fn stock_item_routes(service: Arc<StockItemService>) -> Router {
create_stock_item_routes(service)
}
}