refactor: consolidate lang into constants, rename services to email

- Merge lang package into constants (add IsValidLang, ValidateLang, AllLangs)
- Rename internal/services to internal/email for consistency with pdf package
- Rename types to avoid redundancy: EmailService→Service, EmailConfig→Config
- Update all imports and references across codebase
- Delete internal/lang directory (functions moved to constants)
This commit is contained in:
juanatsap
2025-12-06 17:05:17 +00:00
parent 30ed21ff7a
commit c89b67a06d
28 changed files with 241 additions and 290 deletions
+6 -12
View File
@@ -8,14 +8,10 @@ import (
)
// TestPlainText tests the PlainText handler
// NOTE: This test requires running from project root due to template path resolution
// Run with: go test ./internal/handlers/ -run TestPlainText -v
// Or skip in CI: go test ./internal/handlers/ -run TestPlainText -short
func TestPlainText(t *testing.T) {
// Skip if running in short mode (CI) - requires project root
if testing.Short() {
t.Skip("Skipping PlainText test - requires running from project root")
}
// Change to project root for template path resolution
cleanup := chDirToProjectRoot(t)
defer cleanup()
handler := newTestCVHandler(t, "localhost:8080", nil)
@@ -122,12 +118,10 @@ func TestPlainText(t *testing.T) {
}
// TestPlainTextDownloadFilename tests that download filename is correctly formatted
// NOTE: This test requires running from project root due to template path resolution
func TestPlainTextDownloadFilename(t *testing.T) {
// Skip if running in short mode (CI) - requires project root
if testing.Short() {
t.Skip("Skipping PlainTextDownloadFilename test - requires running from project root")
}
// Change to project root for template path resolution
cleanup := chDirToProjectRoot(t)
defer cleanup()
handler := newTestCVHandler(t, "localhost:8080", nil)