refactor(rename): German→English for backend (tables, types, services, handler files)
t-paliad-025 — Phase 1: backend rename.
Migrations 018+019 rewritten from scratch with English table/column
names throughout. Since v2 schema (018/019) has never been applied to
youpc prod DB, this is a clean replacement — not an ALTER RENAME chain.
Pre-existing German tables (parteien, fristen, termine, dokumente,
akten_events, notizen) are renamed inline in 018 via ALTER TABLE … RENAME
TO alongside the akte_id → project_id column rewrite.
Renames applied:
projekte → projects
projekt_teams → project_teams
projekt_events → project_events (via akten_events → project_events)
fristen → deadlines
termine → appointments
parteien → parties
notizen → notes
dezernate → departments
dezernat_mitglieder → department_members
dokumente → documents
can_see_projekt → can_see_project
notiz_is_visible → note_is_visible
akte_id / frist_id / termin_id / akten_event_id → project_id /
deadline_id / appointment_id / project_event_id
termin_type → appointment_type
Go types + services renamed:
Projekt / ProjektService / ProjektEvent / ProjektTeamMember
Frist / FristService / FristWithProjekt
Termin / TerminService / TerminWithProjekt / TerminType
Notiz / NotizService / ChecklistInstanceWithProjekt
Dezernat / DezernatService / DezernatMitglied
Partei / Parteien / ParteienService
Files renamed (git mv):
internal/services/{projekt,frist,termin,notiz,dezernat,parteien}_service.go
→ {project,deadline,appointment,note,department,party}_service.go
internal/handlers/{projekte,fristen,fristen_pages,termine,termine_pages,
notizen,dezernate,akten_pages,gerichte,glossar,checklisten}.go
→ {projects,deadlines,deadlines_pages,appointments,appointments_pages,
notes,departments,projects_pages,courts,glossary,checklists}.go
internal/checklisten/ → internal/checklists/
internal/db/migrations/018_projekte_v2.* → 018_projects_v2.*
internal/db/migrations/019_seed_dezernate_from_user_text.*
→ 019_seed_departments_from_user_text.*
User-facing i18n strings (DE/EN labels) stay untouched. Product names
Fristenrechner / Kostenrechner / Gebührentabellen stay German.
Build + vet + tests clean.
This commit is contained in:
@@ -52,7 +52,7 @@ func main() {
|
||||
|
||||
// DATABASE_URL is optional during the Phase A → Phase D transition. The
|
||||
// existing knowledge-platform features (Kostenrechner, Glossar, etc.) work
|
||||
// without a DB. Akten/Frist endpoints return 503 until DATABASE_URL is set.
|
||||
// without a DB. Akten/Deadline endpoints return 503 until DATABASE_URL is set.
|
||||
dbURL := os.Getenv("DATABASE_URL")
|
||||
var svcBundle *handlers.Services
|
||||
var caldavSvc *services.CalDAVService
|
||||
@@ -70,9 +70,9 @@ func main() {
|
||||
}
|
||||
holidays := services.NewHolidayService(pool)
|
||||
users := services.NewUserService(pool)
|
||||
projektSvc := services.NewProjektService(pool, users)
|
||||
projektSvc := services.NewProjectService(pool, users)
|
||||
teamSvc := services.NewTeamService(pool, projektSvc)
|
||||
dezernatSvc := services.NewDezernatService(pool, users)
|
||||
dezernatSvc := services.NewDepartmentService(pool, users)
|
||||
rules := services.NewDeadlineRuleService(pool)
|
||||
|
||||
// Phase F: optional CalDAV cipher. If CALDAV_ENCRYPTION_KEY is unset
|
||||
@@ -89,7 +89,7 @@ func main() {
|
||||
log.Println("CalDAV encryption configured (AES-256-GCM)")
|
||||
}
|
||||
|
||||
terminSvc := services.NewTerminService(pool, projektSvc)
|
||||
terminSvc := services.NewAppointmentService(pool, projektSvc)
|
||||
caldavSvc = services.NewCalDAVService(pool, cipher, terminSvc)
|
||||
// Wire the push hook so user-driven mutations sync to the external
|
||||
// calendar without waiting for the next 60-second tick.
|
||||
@@ -100,19 +100,19 @@ func main() {
|
||||
reminderSvc := services.NewReminderService(pool, mailSvc, users, baseURL)
|
||||
|
||||
svcBundle = &handlers.Services{
|
||||
Projekt: projektSvc,
|
||||
Project: projektSvc,
|
||||
Team: teamSvc,
|
||||
Dezernat: dezernatSvc,
|
||||
Parteien: services.NewParteienService(pool, projektSvc),
|
||||
Frist: services.NewFristService(pool, projektSvc),
|
||||
Termin: terminSvc,
|
||||
Parties: services.NewPartyService(pool, projektSvc),
|
||||
Deadline: services.NewDeadlineService(pool, projektSvc),
|
||||
Appointment: terminSvc,
|
||||
CalDAV: caldavSvc,
|
||||
Rules: rules,
|
||||
Calculator: services.NewDeadlineCalculator(holidays),
|
||||
Users: users,
|
||||
Fristenrechner: services.NewFristenrechnerService(rules, holidays),
|
||||
Dashboard: services.NewDashboardService(pool, users),
|
||||
Notiz: services.NewNotizService(pool, projektSvc, terminSvc),
|
||||
Note: services.NewNoteService(pool, projektSvc, terminSvc),
|
||||
ChecklistInst: services.NewChecklistInstanceService(pool, projektSvc),
|
||||
Mail: mailSvc,
|
||||
Invite: inviteSvc,
|
||||
@@ -132,7 +132,7 @@ func main() {
|
||||
caldavSvc.Stop()
|
||||
}()
|
||||
} else {
|
||||
log.Println("DATABASE_URL not set — Akten/Frist endpoints will return 503")
|
||||
log.Println("DATABASE_URL not set — Akten/Deadline endpoints will return 503")
|
||||
}
|
||||
|
||||
mux := http.NewServeMux()
|
||||
|
||||
Reference in New Issue
Block a user