turash/bugulma/backend/internal/localization/register.go

71 lines
1.8 KiB
Go

package localization
import (
"bugulma/backend/internal/localization/handlers"
)
// RegisterAllEntities registers all entity handlers with the registry
// This is called from init() to avoid import cycles
func RegisterAllEntities() {
// Register all entity handlers
RegisterEntity(&EntityDescriptor{
Type: "site",
Fields: []string{"name", "notes", "builder_owner", "architect", "original_purpose", "current_use", "style", "materials"},
Handler: handlers.NewSiteHandler(),
TableName: "sites",
IDField: "id",
})
RegisterEntity(&EntityDescriptor{
Type: "heritage_title",
Fields: []string{"title", "content"},
Handler: handlers.NewHeritageTitleHandler(),
TableName: "heritage_title",
IDField: "id",
})
RegisterEntity(&EntityDescriptor{
Type: "timeline_item",
Fields: []string{"title", "content"},
Handler: handlers.NewTimelineItemHandler(),
TableName: "timeline_items",
IDField: "id",
})
RegisterEntity(&EntityDescriptor{
Type: "heritage_source",
Fields: []string{"title"},
Handler: handlers.NewHeritageSourceHandler(),
TableName: "heritage_sources",
IDField: "id",
})
RegisterEntity(&EntityDescriptor{
Type: "organization",
Fields: []string{"name", "description", "sector", "sub_type"},
Handler: handlers.NewOrganizationHandler(),
TableName: "organizations",
IDField: "id",
})
RegisterEntity(&EntityDescriptor{
Type: "geographical_feature",
Fields: []string{"name", "properties"},
Handler: handlers.NewGeographicalFeatureHandler(),
TableName: "geographical_features",
IDField: "id",
})
RegisterEntity(&EntityDescriptor{
Type: "product",
Fields: []string{"name", "description"},
Handler: handlers.NewProductHandler(),
TableName: "products",
IDField: "id",
})
}
func init() {
RegisterAllEntities()
}