package master

import (
	"gitlab.com/mbugroup/lti-api.git/internal/modules"

	"github.com/go-playground/validator/v10"
	"github.com/gofiber/fiber/v2"
	"gorm.io/gorm"

	areas "gitlab.com/mbugroup/lti-api.git/internal/modules/master/areas"
	banks "gitlab.com/mbugroup/lti-api.git/internal/modules/master/banks"
	configChecklists "gitlab.com/mbugroup/lti-api.git/internal/modules/master/config-checklists"
	customers "gitlab.com/mbugroup/lti-api.git/internal/modules/master/customers"
	employeess "gitlab.com/mbugroup/lti-api.git/internal/modules/master/employees"
	fcrs "gitlab.com/mbugroup/lti-api.git/internal/modules/master/fcrs"
	flocks "gitlab.com/mbugroup/lti-api.git/internal/modules/master/flocks"
	kandanggroups "gitlab.com/mbugroup/lti-api.git/internal/modules/master/kandang-groups"
	kandangs "gitlab.com/mbugroup/lti-api.git/internal/modules/master/kandangs"
	locations "gitlab.com/mbugroup/lti-api.git/internal/modules/master/locations"
	nonstocks "gitlab.com/mbugroup/lti-api.git/internal/modules/master/nonstocks"
	phaseActivitys "gitlab.com/mbugroup/lti-api.git/internal/modules/master/phase-activities"
	phasess "gitlab.com/mbugroup/lti-api.git/internal/modules/master/phasess"
	productcategories "gitlab.com/mbugroup/lti-api.git/internal/modules/master/product-categories"
	productionStandards "gitlab.com/mbugroup/lti-api.git/internal/modules/master/production-standards"
	products "gitlab.com/mbugroup/lti-api.git/internal/modules/master/products"
	suppliers "gitlab.com/mbugroup/lti-api.git/internal/modules/master/suppliers"
	uoms "gitlab.com/mbugroup/lti-api.git/internal/modules/master/uoms"
	warehouses "gitlab.com/mbugroup/lti-api.git/internal/modules/master/warehouses"
	// MODULE IMPORTS
)

func RegisterRoutes(router fiber.Router, db *gorm.DB, validate *validator.Validate) {
	group := router.Group("/master-data")

	allModules := []modules.Module{
		uoms.UomModule{},
		areas.AreaModule{},
		locations.LocationModule{},
		kandanggroups.KandangGroupModule{},
		kandangs.KandangModule{},
		warehouses.WarehouseModule{},
		customers.CustomerModule{},
		suppliers.SupplierModule{},
		fcrs.FcrModule{},
		nonstocks.NonstockModule{},
		productcategories.ProductCategoryModule{},
		products.ProductModule{},
		banks.BankModule{},
		flocks.FlockModule{},
		productionStandards.ProductionStandardModule{},
		employeess.EmployeesModule{},
		phasess.PhasesModule{},
		phaseActivitys.PhaseActivityModule{},
		configChecklists.ConfigChecklistModule{},
		// MODULE REGISTRY
	}

	for _, m := range allModules {
		m.RegisterRoutes(group, db, validate)
	}
}
